activity show: concerned parties are clickable links

This commit is contained in:
Mathieu Jaumotte 2021-06-04 10:52:07 +02:00
parent 4ace2fef99
commit c33f577f5a

View File

@ -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 @@
<ul class="list-content">
{% for item in bloc.items %}
<li>
<a href="{{ _self.href(bloc.path, bloc.key, item.id) }}">
<span class="badge badge-primary">
{{ item|chill_entity_render_box({'only_denomination': true}) }}
</span>
</a>
</li>
{% endfor %}
</ul>