Changeset - 8838b9b47d79
[Not reviewed]
0 6 0
Joel Addison - 3 years ago 2021-01-23 04:20:43
joel@addison.net.au
Highlight current talks on schedule
6 files changed with 33 insertions and 4 deletions:
0 comments (0 inline, 0 general)
pinaxcon/templates/symposion/schedule/_grid.html
Show inline comments
...
 
@@ -30,3 +30,3 @@
 
      {% for slot in row.slots %}
 
      <td class="slot slot-{{ slot.kind.label }}" colspan="{{ slot.colspan }}" rowspan="{{ slot.rowspan }}" data-startdatetime="{{ slot.start_datetime }}" data-enddatetime="{{ slot.end_datetime }}">
 
      <td class="slot slot-{{ slot.kind.label }}" colspan="{{ slot.colspan }}" rowspan="{{ slot.rowspan }}" data-starttime="{{ slot.start_datetime|date:'c' }}" data-endtime="{{ slot.end_datetime|date:'c' }}">
 
        {% with slot.kind.label.lower as label %}
pinaxcon/templates/symposion/schedule/schedule_conference.html
Show inline comments
...
 
@@ -48,3 +48,3 @@
 
          </h2>
 
          <p class="timezone-info small">Conference times are in {{ settings.LCA_START|date:'T' }} (UTC{{ settings.LCA_START|date:'O' }}).</p>
 
          <p class="timezone-info small">Conference times are in {{ settings.LCA_START|date:'T' }} (UTC{{ settings.LCA_START|date:'O' }}). Current talks will be highlighted.</p>
 
          <div class="table-responsive d-none d-md-block">
pinaxcon/templates/symposion/schedule/schedule_detail.html
Show inline comments
...
 
@@ -18,3 +18,3 @@
 
        </h2>
 
        <p class="timezone-info small">Conference times are in {{ settings.LCA_START|date:'T' }} (UTC{{ settings.LCA_START|date:'O' }}).</p>
 
        <p class="timezone-info small">Conference times are in {{ settings.LCA_START|date:'T' }} (UTC{{ settings.LCA_START|date:'O' }}). Current talks will be highlighted.</p>
 
        <div class="table-responsive d-none d-md-block">
pinaxcon/templates/symposion/schedule/schedule_edit.html
Show inline comments
...
 
@@ -26,3 +26,3 @@
 
      </h2>
 
      <p class="timezone-info small">Conference times are in {{ settings.LCA_START|date:'T' }} (UTC{{ settings.LCA_START|date:'O' }}).</p>
 
      <p class="timezone-info small">Conference times are in {{ settings.LCA_START|date:'T' }} (UTC{{ settings.LCA_START|date:'O' }}). Current talks will be highlighted.</p>
 
      <div class="table-responsive d-none d-md-block">
static/src/js/schedule.js
Show inline comments
 
$(function() {
 
    var SLOT_REFRESH_INTERVAL = 60 * 1000;
 

	
 
    /* Schedule display localisation */
...
 
@@ -105,2 +107,21 @@ $(function() {
 

	
 
    var highlightCurrentSlots = function() {
 
        var now = luxon.DateTime.local();
 

	
 
        var slots = $('td.slot');
 
        for (var i = 0; i < slots.length; ++i) {
 
            var slot = $(slots[i]);
 
            var startTime = slot.data('starttime');
 
            var endTime = slot.data('endtime');
 
            var confStartTime = luxon.DateTime.fromISO(startTime, { zone: CONF_TZ });
 
            var confEndTime = luxon.DateTime.fromISO(endTime, { zone: CONF_TZ });
 

	
 
            if (confStartTime <= now && confEndTime > now) {
 
                slot.addClass("slot-active");
 
            } else {
 
                slot.removeClass("slot-active");
 
            }
 
        }
 
    }
 

	
 
    var embeddedView = function() {
...
 
@@ -117,2 +138,4 @@ $(function() {
 
                    anchor.attr('href', path + separator + 'embed')
 
                } else if (path.startsWith('http')) {
 
                    anchor.attr('target', '_blank');
 
                }
...
 
@@ -146,2 +169,4 @@ $(function() {
 
    updatePresentationTimes();
 
    highlightCurrentSlots();
 
    var slotRefresh = setInterval(highlightCurrentSlots, SLOT_REFRESH_INTERVAL);
 
});
static/src/scss/app.scss
Show inline comments
...
 
@@ -86,2 +86,6 @@ h3, .h3 {
 

	
 
.slot-active {
 
    background-color: $blaze;
 
}
 

	
 
/* END LCA BRAND */
0 comments (0 inline, 0 general)