{% macro href(pathname, key, value) %} {% set parms = { (key): value } %} {{ path(pathname, parms) }} {% endmacro %} {% 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 %} {% macro computeWidth(nbBlocks) %} {{ 'flex-basis: ' ~ (100 / nbBlocks)|round(1) ~ '%;' }} {% endmacro %} {% set blocks = [] %} {% if context == 'calendar_accompanyingCourse' or entity.activityType.personsVisible %} {% if context == 'person' %} {% set blocks = blocks|merge([{ 'title': 'Others persons'|trans, 'items': entity.persons, 'type': 'person', 'path' : 'chill_person_view', 'key' : 'person_id' }]) %} {% else %} {% set blocks = blocks|merge([{ 'title': 'Persons in accompanying course'|trans, 'items': entity.personsAssociated, 'type': 'person', 'path' : 'chill_person_view', 'key' : 'person_id' },{ 'title': 'Third persons'|trans, 'items': entity.personsNotAssociated, 'type': 'person', 'path' : 'chill_person_view', 'key' : 'person_id', }]) %} {% endif %} {% endif %} {% if context == 'calendar_accompanyingCourse' or entity.activityType.thirdPartiesVisible %} {% set blocks = blocks|merge([{ 'title': 'Third parties'|trans, 'items': entity.thirdParties, 'type': 'thirdparty', 'path' : 'chill_crud_3party_3party_view', 'key' : 'id', }]) %} {% endif %} {% if context == 'calendar_accompanyingCourse' or entity.activityType.usersVisible %} {% set blocks = blocks|merge([{ 'title': 'Users concerned'|trans, 'items': entity.users, 'type': 'user', 'key' : 'id', }]) %} {% endif %} {% if (render == 'bloc') %}
{% for bloc in blocks %}

{{ bloc.title }}

    {% for item in bloc.items %}
  • {% if bloc.type == 'user' %} {{ item|chill_entity_render_box({'render': 'raw', 'addAltNames': false }) }} {% else %} {{ _self.insert_onthefly(bloc.type, item) }} {% endif %}
  • {% endfor %}
{% endfor %}
{% endif %} {% if (render == 'row') %}
{% for bloc in blocks %}
{% if bloc.items|length > 0 %}

{{ bloc.title }}

{% endif %}
{% endfor %}
{% endif %} {% if (render == 'wrap-list') %}
{% for bloc in blocks %}
{% if bloc.items|length > 0 %}

{{ bloc.title }}

{% for item in bloc.items %} {% if bloc.type == 'user' %} {{ item|chill_entity_render_box({'render': 'raw', 'addAltNames': false }) }} {% else %} {{ _self.insert_onthefly(bloc.type, item) }} {% endif %} {% endfor %}
{% endif %}
{% endfor %}
{% endif %}