{% set person_id = null %} {% if person %} {% set person_id = person.id %} {% endif %} {% set accompanying_course_id = null %} {% if accompanyingCourse %} {% set accompanying_course_id = accompanyingCourse.id %} {% endif %}

{{ 'Activity list' |trans }}

{% if activities|length == 0 %}

{{ "There isn't any activities."|trans }}

{% else %}
{% for activity in activities %} {% set t = activity.type %}
{% if activity.date %}

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

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

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

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

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

{% endif %}
    {% if activity.user and t.userVisible %}
  • {{ 'by'|trans }}{{ activity.user.usernameCanonical }}
  • {% endif %}
  • {{ activity.type.name | localize_translatable_string }} {% if activity.attendee is not null and t.attendeeVisible %} {% if activity.attendee %} {{ '→ ' ~ 'present'|trans|capitalize }} {% else %} {{ '→ ' ~ 'not present'|trans|capitalize }} {% endif %} {% endif %}
  • {{ 'location'|trans ~ ': ' }} Domicile de l'usager {# {% if activity.location %}{{ activity.location }}{% endif %} #}
  • {%- if t.reasonsVisible -%}
  • {%- if activity.reasons is empty -%} {{ 'No reason associated'|trans }} {%- else -%} {% for r in activity.reasons %} {{ r|chill_entity_render_box }} {% endfor %} {%- endif -%}
  • {% endif %} {%- if t.socialIssuesVisible %} {% endif %} {%- if t.socialActionsVisible -%} {% endif %}
  • {# TOOD {% if is_granted('CHILL_ACTIVITY_UPDATE', activity) %} #}
  • {# TOOD {% endif %} {% if is_granted('CHILL_ACTIVITY_DELETE', activity) %} #}
  • {# {% endif %} #}
{% if activity.comment.comment is not empty or activity.persons|length > 0 or activity.thirdParties|length > 0 or activity.users|length > 0 %}
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {'context': context, 'with_display': 'row', 'entity': activity } %}
{% if activity.comment.comment is not empty %}
{{ activity.comment|chill_entity_render_box( { 'limit_lines': 3, 'metadata': false } ) }}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}