{% from 'events/display/indico/_common.html' import render_user_data, render_users %} {% macro _render_contribution(item, count) %} {{ item.title }} {% set speakers = item.person_links|selectattr("is_speaker")|list %} {% if speakers %} - {{ render_users(speakers, span_class="compact-speakers", separator=' ', title=false) }} {% endif %} {% endmacro %} {% macro _render_contrib_list(session) %}
{% trans %}Contributions{% endtrans %}
{% endmacro %} {% macro _render_tooltip(entry, timezone) %} {% endmacro %} {% macro _render_entry(entry, start_time, classes, extra_styles, has_multi, slot_entries, loop) %}
{{ start_time|format_time(timezone=timezone) if loop.first else '' }} {% if hide_placeholders and show_end_times %} {{ entry.end_dt | format_time(timezone=timezone) }} {% endif %} {% if entry.type.name == 'CONTRIBUTION' %} {{ _render_contribution(entry.object) }} {% else %} {{ entry.object.title }} {% endif %} {{ _render_tooltip(entry, timezone) }} {% if has_multi and entry.type.name == 'CONTRIBUTION' %} {% set multi_title -%} {%- trans count=(slot_entries|length - 1) -%} There is one more contribution at this time. Click this icon to show it. {%- pluralize -%} There are {{ count }} more contributions at this time. Click this icon to show them. {%- endtrans -%} {%- endset %} {% endif %}
{% endmacro %} {% macro render_placeholder(duration) %} {% set height = ((duration / 5) * px_per_5_minutes) %} {% if to_subtract[-1] %} {% set subtract = to_subtract.pop() %} {% if subtract <= height %} {% set height = height - subtract %} {% else %} {% set __ = to_subtract.append(subtract - height) %} {% set height = 0 %} {% endif %} {% endif %} {% if height > 0 %}
{% endif %} {% endmacro %} {% macro _render_time_slots(start_time, slot_entries, prev_end, hidden_count) %} {% for entry, count in slot_entries %} {% set __ = prev_end.append(entry.end_dt.astimezone(tz_object)) %} {% set session = entry.object.session %} {% set __ = hidden_count.append(count) %} {% set classes = ['row'] %} {% if entry.type.name == 'CONTRIBUTION' %} {% set classes = classes + ['contrib'] %} {% elif entry.type.name == 'BREAK' %} {% set classes = classes + ['break'] %} {% endif %} {% set has_multi = false %} {% if loop.first %} {% set time_parts = (entry.duration.seconds/60) /5 %} {% set height = (time_parts * px_per_5_minutes) %} {% if to_subtract[-1] %} {% if height - to_subtract[-1] >= min_height %} {% set height = height - to_subtract[-1] %} {% set subtract = to_subtract.pop() %} {% endif %} {% endif %} {% if height < min_height %} {% set subtract = 0 %} {% if to_subtract[-1] %} {% set subtract = to_subtract.pop() %} {% endif %} {% set __ = to_subtract.append(subtract + (min_height - height)) %} {% set height = min_height %} {% endif %} {% set extra_styles = ['height: %dpx'|format(height)] %} {% if slot_entries|length > 1 %} {% set has_multi = true %} {% set classes = classes + ['has-multi', has_multi|string] %} {% endif %} {% set entry_colors = timetable_settings.get('colors') %} {% if entry_colors %} {% if entry.type.name == 'CONTRIBUTION' %} {% for keyword in entry.contribution.keywords %} {% for entry_color in entry_colors %} {% if keyword in entry_color.entry %} {% set __ = extra_styles.append('background-color: %s'|format(entry_color.color)) %} {% endif %} {% endfor %} {% endfor %} {% elif entry.type.name == 'BREAK' %} {% set __ = extra_styles.append('background-color: #%s'|format(entry.break_.background_color)) %} {% elif session %} {% set __ = extra_styles.append('background-color: #%s'|format(session.background_color)) %} {% endif %} {% endif %} {% else %} {% set same_time = true %} {% endif %} {% if entry.type.name == 'CONTRIBUTION' or session %} {% if entry.type.name == 'CONTRIBUTION' %} {% set entry_url = url_for('contributions.display_contribution', entry.object) %} {% else %} {% set entry_url = url_for('sessions.display_session', session) %} {% endif %} {% endif %} {{ _render_entry(entry, start_time, classes, extra_styles, has_multi, slot_entries, loop) }} {% if session or entry.type.name == 'CONTRIBUTION' %} {% endif %} {% endfor %} {% endmacro %} {% set px_per_5_minutes = 5 %} {% set min_height = 17 %} {% set to_subtract = [] %} {% for week in week_table %}
{% endfor %}