diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig index 39c993dd3..f6b052265 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig @@ -3,89 +3,93 @@ {{ path(pathname, parms) }} {% endmacro %} -{% if context == 'person' %} - {% set blocs = [ - { 'title': 'Others persons'|trans, +{% macro computeWidth(nbBlocks) %} + {{ 'flex-basis: ' ~ (100 / nbBlocks)|round(1) ~ '%;' }} +{% endmacro %} + +{% set blocks = [] %} +{% if entity.activityType.personsVisible %} + {% if context == 'person' %} + {% set blocks = blocks|merge([{ + 'title': 'Others persons'|trans, 'items': entity.persons, 'path' : 'chill_person_view', 'key' : 'person_id' - }, - { 'title': 'Third parties'|trans, - 'items': entity.thirdParties, - 'path' : 'chill_crud_3party_3party_view', - 'key' : 'id' - }, - { 'title': 'Users concerned'|trans, - 'items': entity.users, - 'key' : 'id' - }, - ] %} -{% else %} - {% set blocs = [ - { 'title': 'Persons in accompanying course'|trans, + }]) %} + {% else %} + {% set blocks = blocks|merge([{ + 'title': 'Persons in accompanying course'|trans, 'items': entity.personsAssociated, 'path' : 'chill_person_view', 'key' : 'person_id' - }, - { 'title': 'Third persons'|trans, + },{ + 'title': 'Third persons'|trans, 'items': entity.personsNotAssociated, 'path' : 'chill_person_view', - 'key' : 'person_id' - }, - { 'title': 'Third parties'|trans, - 'items': entity.thirdParties, - 'path' : 'chill_crud_3party_3party_view', - 'key' : 'id' - }, - { 'title': 'Users concerned'|trans, - 'items': entity.users, - 'key' : 'id' - }, - ] %} + 'key' : 'person_id', + }]) %} + {% endif %} +{% endif %} +{% if entity.activityType.thirdPartiesVisible %} + {% set blocks = blocks|merge([{ + 'title': 'Third parties'|trans, + 'items': entity.thirdParties, + 'path' : 'chill_crud_3party_3party_view', + 'key' : 'id', + }]) %} +{% endif %} +{% if entity.activityType.usersVisible %} + {% set blocks = blocks|merge([{ + 'title': 'Users concerned'|trans, + 'items': entity.users, + 'key' : 'id', + }]) %} {% endif %} {% if (with_display == 'bloc') %}