{% 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 content %}

{{ 'Calendar list' |trans }}

{% if calendarItems|length == 0 %}

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

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

{{ "From the day"|trans }} {{ calendar.startDate|format_datetime('medium', 'short') }}

{{ "to the day"|trans }} {{ calendar.endDate|format_datetime('medium', 'short') }}

{% else %}

{{ calendar.startDate|format_date('full') }}

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

{{ calendar.endDate.diff(calendar.startDate)|date("%H:%M")}}

{% endif %} {% endif %}
    {% if calendar.user %}
  • {{ 'by'|trans }}{{ calendar.user.usernameCanonical }}
  • {% endif %} {% if calendar.mainUser is not empty %}
  • {{ 'main user concerned'|trans }}: {{ calendar.mainUser.usernameCanonical }}
  • {% endif %}
  • {# TOOD {% if is_granted('CHILL_ACTIVITY_UPDATE', calendar) %} #}
  • {# TOOD {% endif %} {% if is_granted('CHILL_ACTIVITY_DELETE', calendar) %} #}
  • {# {% 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': accompanyingCourse, 'with_display': 'row', 'entity': calendar } %}
{% if calendar.comment.comment is not empty %}
{{ calendar.comment|chill_entity_render_box( { 'limit_lines': 3, 'metadata': false } ) }}
{% endif %}
{% endif %}
{% endfor %} {% if calendarItems|length < paginator.getTotalItems %} {{ chill_pagination(paginator) }} {% endif %}
{% endif %} {% endblock %}