From c33f577f5ad63eedd685e524664969d4c4031d5d Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Fri, 4 Jun 2021 10:52:07 +0200 Subject: [PATCH] activity show: concerned parties are clickable links --- .../views/Activity/concernedGroups.html.twig | 55 +++++++++++++++---- 1 file changed, 45 insertions(+), 10 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig index 6181784da..f39eafd08 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig @@ -1,15 +1,48 @@ +{% macro href(pathname, key, value) %} + {% set parms = { (key): value } %} + {{ path(pathname, parms) }} +{% endmacro %} + {% if context == 'person' %} {% set blocs = [ - { 'title': 'Others persons'|trans, 'items': entity.persons }, - { 'title': 'Third parties'|trans, 'items': entity.thirdParties }, - { 'title': 'Users concerned'|trans, 'items': entity.users }, + { 'title': 'Others persons'|trans, + 'items': entity.persons, + 'path' : 'chill_person_view', + 'key' : 'person_id' + }, + { 'title': 'Third parties'|trans, + 'items': entity.thirdParties, + 'path' : 'chill_3party_3party_show', + 'key' : 'thirdparty_id' + }, + { 'title': 'Users concerned'|trans, + 'items': entity.users, + 'path' : 'admin_user_show', + 'key' : 'id' + }, ] %} {% else %} {% set blocs = [ - { 'title': 'Persons in accompanying course'|trans, 'items': entity.personsAssociated }, - { 'title': 'Third persons'|trans, 'items': entity.personsNotAssociated }, - { 'title': 'ThirdParties'|trans, 'items': entity.thirdParties }, - { 'title': 'Users concerned'|trans, 'items': entity.users }, + { 'title': 'Persons in accompanying course'|trans, + 'items': entity.personsAssociated, + 'path' : 'chill_person_view', + 'key' : 'person_id' + }, + { 'title': 'Third persons'|trans, + 'items': entity.personsNotAssociated, + 'path' : 'chill_person_view', + 'key' : 'person_id' + }, + { 'title': 'Third parties'|trans, + 'items': entity.thirdParties, + 'path' : 'chill_3party_3party_show', + 'key' : 'thirdparty_id' + }, + { 'title': 'Users concerned'|trans, + 'items': entity.users, + 'path' : 'admin_user_show', + 'key' : 'id' + }, ] %} {% endif %} @@ -24,9 +57,11 @@