{% macro with_default(content='') %} {% set content = (caller() if caller is defined else content) | trim %} {%- if content -%} {{ content }} {%- else -%} {% trans %}None{% endtrans %} {%- endif -%} {% endmacro %} {% macro section_id(name) -%} event-settings-{{ name|replace('_', '-') }} {%- endmacro %} {% macro render_section(event, name, icon, edit_endpoint, edit_title, with_container=true) %} {% set id = section_id(name) %} {% if with_container %}
{% endif %}
{{ caller() }}
{% if with_container %}
{% endif %} {% endmacro %} {% macro render_section_data(event, with_container=true) %} {% call render_section(event, 'data', 'icon-home', '.edit_data', _('Edit basic event data'), with_container=with_container) %}
{% trans %}Title{% endtrans %}
{{ event.title }}
{% trans %}Description{% endtrans %}
{{ with_default(event.description|striptags)|truncate(200) }}
{% trans %}Short URL{% endtrans %}
{% call with_default() %} {% if event.url_shortcut %} {{ event.short_external_url }} {% endif %} {% endcall %}
{% endcall %} {% endmacro %} {% macro render_section_dates(event, with_container=true) %} {% call render_section(event, 'dates', 'icon-calendar', '.edit_dates', _('Edit event dates'), with_container=with_container) %} {% set tz = event.tzinfo %}
{% trans %}Date{% endtrans %}
{% if event.start_dt.astimezone(tz).date() == event.end_dt.astimezone(tz).date() %} {{ event.start_dt|format_date('long', timezone=tz) }} {% else %} {{ event.start_dt|format_date(timezone=tz) }} - {{ event.end_dt|format_date(timezone=tz) }} {% endif %}
{% trans %}Time{% endtrans %}
{{ event.start_dt|format_time(timezone=tz) }} - {{ event.end_dt|format_time(timezone=tz) }}
{% trans %}Timezone{% endtrans %}
{{ event.timezone }}
{% if event.type == 'conference' %}
{% trans %}Screen dates{% endtrans %}
{% if event.start_dt_override or event.end_dt_override %} {{ event.start_dt_display | format_datetime(timezone=tz) }} - {{ event.end_dt_display | format_datetime(timezone=tz) }} {% else %} {{ with_default() }} {% endif %}
{% endif %} {% endcall %} {% endmacro %} {% macro render_section_location(event, with_container=true) %} {% call render_section(event, 'location', 'icon-location', '.edit_location', _('Edit event location'), with_container=with_container) %}
{% trans %}Room{% endtrans %}
{{ with_default(event.room_name) }}
{% trans %}Venue{% endtrans %}
{{ with_default(event.venue_name) }}
{% trans %}Address{% endtrans %}
{{ with_default(event.address|replace('\n', '
'|safe)) }}
{% endcall %} {% endmacro %} {% macro render_section_persons(event, with_container=true) %} {% set edit_persons_title = _('Edit speakers') if event.type == 'lecture' else _('Edit chairpersons') %} {% call render_section(event, 'persons', 'icon-user-chairperson', '.edit_persons', edit_persons_title, with_container=with_container) %}
{%- if event.type == 'lecture' -%} {% trans %}Speakers{% endtrans %} {%- else -%} {% trans %}Chairpersons{% endtrans %} {%- endif -%}
{% call with_default() %} {% for event_person_link in event.person_links | sort(attribute='display_order_key') %}
{{ event_person_link.display_full_name }} {% if event_person_link.is_submitter %} {% trans %}Submitter{% endtrans %} {% endif %}
{% endfor %} {% endcall %}
{% endcall %} {% endmacro %} {% macro render_section_contact_info(event, with_container=true) %} {% call render_section(event, 'contact_info', 'icon-info', '.edit_contact_info', _('Edit contact info'), with_container=with_container) %}
{% if event.type == 'lecture' %}
{% trans %}Organizer{% endtrans %}
{{ with_default(event.organizer_info|truncate(200)) }}
{% endif %} {% if event.type == 'conference' %}
{% trans %}Additional info{% endtrans %}
{{ with_default(event.additional_info|striptags|truncate(200)) }}
{% endif %}
{% trans %}Contact title{% endtrans %}
{{ with_default(event.contact_title) }}
{% trans %}Email{% endtrans %}
{{ with_default(event.contact_emails|join(', ')) }}
{% trans %}Phone{% endtrans %}
{{ with_default(event.contact_phones|join(', ')) }}
{% endcall %} {% endmacro %} {% macro render_section_classification(event, with_container=true) %} {% set edit_cls_title = _('Edit keywords / references') if event.type == 'meeting' else _('Edit keywords') %} {% call render_section(event, 'classification', 'icon-tag', '.edit_classification', edit_cls_title, with_container=with_container) %}
{% trans %}Keywords{% endtrans %}
{% call with_default() %} {% for keyword in event.keywords %} {{ keyword }} {% endfor %} {% endcall %}
{% if event.type == 'meeting' %}
{% trans %}External IDs{% endtrans %}
{% call with_default() %} {% set references = event.references|sort(attribute='value')|sort(attribute='reference_type.name') %} {% if references %} {% for reference in references -%} {{ reference.value }} ({{ reference.reference_type.name }}) {% if not loop.last %}
{% endif %} {% endfor %} {% endif %} {% endcall %}
{% endif %}
{% endcall %} {% endmacro %} {% macro render_event_settings(event, section=none, with_container=true) %} {% if section is none or section == 'data' %} {{ render_section_data(event, with_container=with_container) }} {% endif %} {% if section is none or section == 'dates' %} {{ render_section_dates(event, with_container=with_container) }} {% endif %} {% if section is none or section == 'location' %} {{ render_section_location(event, with_container=with_container) }} {% endif %} {% if section is none or section == 'persons' %} {{ render_section_persons(event, with_container=with_container) }} {% endif %} {% if section is none or section == 'contact_info' %} {{ render_section_contact_info(event, with_container=with_container) }} {% endif %} {% if section is none or section == 'classification' %} {{ render_section_classification(event, with_container=with_container) }} {% endif %} {% endmacro %}