{% from 'events/display/indico/_common.html' import render_location %} {% macro render_event(event, timezone, detail, accessible_categories=()) %} {% set category = event.category %} {% if event.ongoing %} {% set ongoing_message %} {% trans start=event.first_occurence_start_dt|format_datetime(timezone=timezone), end=event.end_dt|format_datetime(timezone=timezone) -%} Ongoing from {{ start }} until {{ end }}. {%- endtrans %} {% endset %} ongoing {% else %} {{ event.start_dt|format_time(format='HH:mm', timezone=timezone) }} {% endif %} {{ event.title }} {% if show_chairpersons and event.person_links %} ({{ event.person_links|map(attribute='full_name')|sort|join('; ') }}) {% endif %} {% if event.effective_protection_mode.name == 'protected' %} {% endif %} {% if category.has_effective_icon %} {% endif %} {% if event.has_location_info %} {{ render_location(event, class='right') }} {% endif %} {% if (detail in ('session', 'contribution') and event.timetable_objects and ((not event.is_self_protected and event.category_id in accessible_categories) or event.effective_protection_mode.name == 'public' or event.can_access(session.user))) %} {% if detail == 'session' %} {{ _render_timetable(event, timezone, show_session=true) }} {% elif detail == 'contribution' %} {{ _render_timetable(event, timezone, show_session=true, show_contribution=true, show_break=true) }} {% endif %} {% endif %} {% endmacro %} {% macro _render_timetable(event, timezone, show_session=true, show_contribution=false, show_break=false) %} {% for object in event.timetable_objects %} {% if show_session and object.timetable_entry.type.name == 'SESSION_BLOCK' %} {{ _session_info(object, timezone) }} {% elif show_contribution and object.timetable_entry.type.name == 'CONTRIBUTION' %} {{ _contribution_info(object, timezone) }} {% elif show_break and object.timetable_entry.type.name == 'BREAK' %} {{ _break_info(object, timezone) }} {% endif %} {% endfor %}
{% endmacro %} {% macro _session_info(session_block, timezone) %} {% set session = session_block.session %} {% set title %} {% if session_block.title %} {{ session_block.title }} ({{ session.title }}) {% else %} {{ session.title }} {% endif %} {% endset %} {{ _render_block('session', session_block.timetable_entry.start_dt, timezone, title, location=session, persons=session.conveners) }} {% endmacro %} {% macro _contribution_info(contribution, timezone) %} {{ _render_block('contribution', contribution.timetable_entry.start_dt, timezone, contribution.title, location=contribution, persons=contribution.speakers ) }} {% endmacro %} {% macro _break_info(break, timezone) %} {{ _render_block('break', break.timetable_entry.start_dt, timezone, break.title, location=break) }} {% endmacro %} {% macro _render_block(class, time, timezone, title, location=none, persons=[]) %} {{ time|format_time(format='HH:mm', timezone=timezone) }} {{ title }} {% if persons %} ({{ persons|map(attribute='full_name')|join('; ') }}) {% endif %} {% if location and location.has_location_info %} {{ render_location(location) }} {% endif %} {% endmacro %}