{% set user_id = null %} {% if user %} {% set user_id = user.id %} {% endif %} {% set accompanying_course_id = null %} {% if accompanyingCourse %} {% set accompanying_course_id = accompanyingCourse.id %} {% endif %}

{{ 'Calendar list' |trans }}

{% if calendarItems|length == 0 %}

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

{% else %}
{% for calendar in calendarItems %} {% set t = calendar.type %}
{% if calendar.date %}

{{ calendar.date|format_date('long') }}

{% endif %}
{% if t.durationTimeVisible > 0 %}

{{ calendar.durationTime|date('H:i') }}

{% endif %} {% if calendar.travelTime and t.travelTimeVisible %}

{{ calendar.travelTime|date('H:i') }}

{% endif %}
{% if context == 'user' and calendar.accompanyingPeriod is not empty %} {% endif %}
    {% if calendar.user and t.userVisible %}
  • {{ 'by'|trans }}{{ calendar.user.usernameCanonical }}
  • {% endif %}
  • {{ calendar.type.name | localize_translatable_string }} {% if calendar.attendee is not null and t.attendeeVisible %} {% if calendar.attendee %} {{ '→ ' ~ 'present'|trans|capitalize }} {% else %} {{ '→ ' ~ 'not present'|trans|capitalize }} {% endif %} {% endif %}
  • {{ 'location'|trans ~ ': ' }} Domicile de l'usager {# {% if calendar.location %}{{ calendar.location }}{% endif %} #}
  • {%- if t.reasonsVisible -%}
  • {%- if calendar.reasons is empty -%} {{ 'No reason associated'|trans }} {%- else -%} {% for r in calendar.reasons %} {{ r|chill_entity_render_box }} {% endfor %} {%- endif -%}
  • {% endif %} {%- if t.socialIssuesVisible %} {% endif %} {%- if t.socialActionsVisible -%} {% 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 'ChillCalendarBundle:Calendar:concernedGroups.html.twig' with {'context': context, '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 %}
{% endif %} {% if context != 'user' %} {# TODO set this condition in configuration #} {% endif %}