{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %} {% set activeRouteKey = 'chill_calendar_calendar_list' %} {% block title %}{{ 'Calendar list' |trans }}{% endblock title %} {% set user_id = null %} {% set accompanying_course_id = accompanyingCourse.id %} {% block js %} {{ parent() }} {{ encore_entry_script_tags('mod_answer') }} {% endblock %} {% block css %} {{ parent() }} {{ encore_entry_link_tags('mod_answer') }} {% endblock %} {% block content %}

{{ 'Calendar list' |trans }}

{{ filterOrder|chill_render_filter_order_helper }} {% if calendarItems|length == 0 %}

{{ "There is no calendar items."|trans }}

{% else %}
{% for calendar in calendarItems %}
{% if calendar.endDate.diff(calendar.startDate).days >= 1 %}

{{ calendar.startDate|format_datetime('short', 'short') }} - {{ calendar.endDate|format_datetime('short', 'short') }}

{% else %}

{{ calendar.startDate|format_datetime('short', 'short') }} - {{ calendar.endDate|format_datetime('none', 'short') }}

{% endif %}

{{ calendar.duration|date('%H:%I')}}

    {% if calendar.mainUser is not empty %} {{ calendar.mainUser|chill_entity_render_box }} {% endif %}
{% if calendar.comment.comment is not empty or calendar.users|length > 0 or calendar.thirdParties|length > 0 or calendar.users|length > 0 %}
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with { 'context': 'calendar_accompanyingCourse', 'render': 'wrap-list', 'entity': calendar } %}
{% if calendar.comment.comment is not empty %}
{{ calendar.comment|chill_entity_render_box( { 'limit_lines': 3, 'metadata': false } ) }}
{% endif %}
{% endif %} {% if calendar.location is not empty %}
{% if calendar.location.address is not same as(null) and calendar.location.name is not empty %}{% endif %} {% if calendar.location.name is not empty %}{{ calendar.location.name }}{% endif %} {% if calendar.location.address is not same as(null) %}{{ calendar.location.address|chill_entity_render_box({'multiline': false, 'with_picto': (calendar.location.name is empty)}) }}{% else %}{% endif %} {% if calendar.location.phonenumber1 is not empty %} {{ calendar.location.phonenumber1|chill_format_phonenumber }}{% endif %} {% if calendar.location.phonenumber2 is not empty %} {{ calendar.location.phonenumber2|chill_format_phonenumber }}{% endif %}
{% endif %}
    {% if (calendar.isInvited(app.user)) %} {% set invite = calendar.inviteForUser(app.user) %}
  • {% endif %}
  • {# TOOD {% if is_granted('CHILL_ACTIVITY_UPDATE', calendar) %} #}
  • {# TOOD {% endif %} {% if is_granted('CHILL_ACTIVITY_DELETE', calendar) %} #}
  • {# {% endif %} #}
{% endfor %} {% if calendarItems|length < paginator.getTotalItems %} {{ chill_pagination(paginator) }} {% endif %}
{% endif %} {% endblock %}