{% extends '@ChillPerson/AccompanyingCourse/layout.html.twig' %} {% block title %} {{ 'Resume Accompanying Course'|trans }} {% endblock %} {% macro insert_onthefly(type, entity, parent = null) %} {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { action: 'show', displayBadge: true, targetEntity: { name: type, id: entity.id }, buttonText: entity|chill_entity_render_string, isDead: entity.deathdate is defined and entity.deathdate is not null, parent: parent } %} {% endmacro %} {% block js %} {{ parent() }} {{ encore_entry_script_tags('page_accompanying_course_index_person_locate') }} {{ encore_entry_script_tags('page_accompanying_course_index_masonry') }} {{ encore_entry_script_tags('mod_notification_toggle_read_status') }} {% endblock %} {% block css %} {{ parent() }} {{ encore_entry_link_tags('mod_notification_toggle_read_status') }} {% endblock %} {% block content %}
{% if 'CLOSED' == accompanyingCourse.step %}

{{ 'This course is closed'|trans }}

{% if accompanyingCourse.closingMotive is not same as null %}

{{ 'Closing motive'|trans }} : {{ accompanyingCourse.closingMotive.name|localize_translatable_string }}

{% endif %}
{% endif %} {% if 'DRAFT' == accompanyingCourse.step %}
{% include '@ChillPerson/AccompanyingCourse/_still_draft.html.twig' %}
{% endif %} {% if 'DRAFT' != accompanyingCourse.step %} {% if withoutHousehold|length > 0 %}
{% include '@ChillPerson/AccompanyingCourse/_join_household.html.twig' %}
{% endif %} {% endif %} {% if accompanyingCourse.locationStatus == 'address' or accompanyingCourse.locationStatus == 'none' %}
{% include '@ChillPerson/AccompanyingCourse/_warning_address.html.twig' %}
{% endif %} {% if accompanyingCourse.locationStatus != 'none' %}
{% if accompanyingCourse.locationStatus == 'person' %}

{{ 'This course is located by'|trans }}

{{ accompanyingCourse.personLocation|chill_entity_render_string }}

{% elseif accompanyingCourse.locationStatus == 'address' %}

{{ 'This course has a temporarily location'|trans }}

{% endif %} {{ accompanyingCourse.location|chill_entity_render_box }}
{% endif %} {% if accompanyingCourse.pinnedComment is not empty %}

{{ 'Pinned comment'|trans }}

{{ accompanyingCourse.pinnedComment.content|u.truncate(250, '…', false)|chill_markdown_to_html }} {% if accompanyingCourse.pinnedComment.content|length > 250 %} {{ 'Read more'|trans }} {% endif %}
{% endif %} {% if accompanyingCourse.getCurrentParticipations is not empty %}

{{ 'Persons associated'|trans }}

{% for r in accompanyingCourse.getCurrentParticipations %} {{ _self.insert_onthefly('person', r.person) }} {% endfor %}
{% endif %} {% if accompanyingCourse.resources is not empty %}

{{ 'Resources'|trans }}

{% for r in accompanyingCourse.resources %} {% set parent = { 'type': 'accompanying_period_resource', 'id': r.id, 'comment': r.comment, 'parent': { 'type': 'accompanying_period', 'id': accompanyingCourse.id } } %} {% if r.person is not null %} {{ _self.insert_onthefly('person', r.person, parent) }} {% elseif r.thirdParty is not null %} {{ _self.insert_onthefly('thirdparty', r.thirdParty, parent) }} {% endif %} {% endfor %}
{% endif %} {% if accompanyingCourse.scopes is not empty %}

{{ 'Concerned scopes'|trans }}

{% for s in accompanyingCourse.scopes %} {{ s.name|localize_translatable_string|upper }}{% if not loop.last %}, {% endif %} {% endfor %}
{% endif %} {% if accompanyingCourse.requestorPerson is not null or accompanyingCourse.requestorThirdParty is not null %}
{% if accompanyingCourse.requestorPerson is not null %}

{{ 'Requestor'|trans }}

{% if accompanyingCourse.requestorAnonymous %}

{{ _self.insert_onthefly('person', accompanyingCourse.requestorPerson) }}

{% else %} {{ _self.insert_onthefly('person', accompanyingCourse.requestorPerson) }} {% endif %} {% elseif accompanyingCourse.requestorThirdParty is not null %}

{{ 'Requestor'|trans }}

{% if accompanyingCourse.requestorAnonymous %}

{{ _self.insert_onthefly('thirdparty', accompanyingCourse.requestorThirdParty) }}

{% else %} {{ _self.insert_onthefly('thirdparty', accompanyingCourse.requestorThirdParty) }} {% endif %} {% endif %}
{% endif %} {% if accompanyingCourse.origin is not empty %}

{{ 'Origin'|trans }}

{{ accompanyingCourse.origin.label|localize_translatable_string|capitalize }}
{% endif %} {% if accompanyingCourse.administrativeLocation is not null %}

{{ 'accompanying_course.administrative_location'|trans }}

{{ accompanyingCourse.administrativeLocation.name }} ({{ accompanyingCourse.administrativeLocation.locationType.title|localize_translatable_string }})
{% endif %} {% if accompanyingCourse.step != 'DRAFT' %}

{{ 'notification.Notifications'|trans }}

{% set notif_counter = chill_count_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', accompanyingCourse.id) %} {% if notif_counter.total > 0 %} {% endif %}
{% if accompanyingCourse.hasUser and accompanyingCourse.user is not same as(app.user) %} {% else %} {{ 'notification.Notify'|trans }} {% endif %}
{% endif %} {% if counters.activities > 0 %}
{{ counters.activities }}
{% if counters.activities == 1 %} {{ 'Activity'|trans }} {% else %} {{ 'Activities'|trans }} {% endif %}
{% endif %} {% if counters.works > 0 %}
{{ counters.openWorks }} / {{ counters.works }}
{{ 'accompanying_course_work.On-going works over total'|trans }}
{% endif %}

{{ 'Last social actions'|trans }}

{% include '@ChillPerson/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig' with {'buttonText': false } %}
{% block contentActivity %}
{% set person = null %} {% 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 %}

{{ 'Last activities' |trans }}

{% include '@ChillActivity/Activity/list_recent.html.twig' with { 'context': 'accompanyingCourse', 'no_action': true } %}
{% endblock %}
{% set notifications = chill_list_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', accompanyingCourse.id) %} {% if notifications is not empty %} {{ notifications|raw }} {% endif %}
{% endblock %} {% block block_post_menu %}
{% endblock %}