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' %} {% if context == 'person' %}
{% set blocs = [ {% set blocs = [
{ 'title': 'Others persons'|trans, 'items': entity.persons }, { 'title': 'Others persons'|trans,
{ 'title': 'Third parties'|trans, 'items': entity.thirdParties }, 'items': entity.persons,
{ 'title': 'Users concerned'|trans, 'items': entity.users }, '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 %} {% else %}
{% set blocs = [ {% set blocs = [
{ 'title': 'Persons in accompanying course'|trans, 'items': entity.personsAssociated }, { 'title': 'Persons in accompanying course'|trans,
{ 'title': 'Third persons'|trans, 'items': entity.personsNotAssociated }, 'items': entity.personsAssociated,
{ 'title': 'ThirdParties'|trans, 'items': entity.thirdParties }, 'path' : 'chill_person_view',
{ 'title': 'Users concerned'|trans, 'items': entity.users }, '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 %} {% endif %}
@ -24,9 +57,11 @@
<ul class="list-content"> <ul class="list-content">
{% for item in bloc.items %} {% for item in bloc.items %}
<li> <li>
<span class="badge badge-primary"> <a href="{{ _self.href(bloc.path, bloc.key, item.id) }}">
{{ item|chill_entity_render_box({'only_denomination': true}) }} <span class="badge badge-primary">
</span> {{ item|chill_entity_render_box({'only_denomination': true}) }}
</span>
</a>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>