mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
render box, mechanism to pass custom buttons
This commit is contained in:
parent
4e9916534f
commit
ad3fe7cf91
@ -6,6 +6,19 @@
|
||||
{{ 'Resume Accompanying Course'|trans }}
|
||||
{% endblock %}
|
||||
|
||||
{% macro button_person(person) %}
|
||||
{% if person.isSharingHousehold %}
|
||||
<li>
|
||||
<a href="{{ chill_path_add_return_path('chill_person_household_summary', { 'household_id': person.getCurrentHousehold.id }) }}"
|
||||
class="btn btn-misc">
|
||||
<i class="fa fa-home"></i>
|
||||
n°
|
||||
{{ person.getCurrentHousehold.id }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% block content %}
|
||||
<div class="accompanyingcourse-resume">
|
||||
|
||||
@ -27,25 +40,11 @@
|
||||
{% if participation.enddate is null %}
|
||||
<div class="item-bloc">
|
||||
{{ participation.person|chill_entity_render_box({
|
||||
'render': 'bloc', 'addLink': false, 'addInfo': true
|
||||
'render': 'bloc', 'addLink': false, 'addInfo': true, 'customButtons': _self.button_person(participation.person)
|
||||
}) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{# AJOUTER ACTIONS
|
||||
<ul class="record_actions">
|
||||
{% if p.person.isSharingHousehold %}
|
||||
<li>
|
||||
<a href="{{ chill_path_add_return_path('chill_person_household_summary', { 'household_id': p.person.getCurrentHousehold.id }) }}"
|
||||
class="btn btn-misc">
|
||||
<i class="fa fa-home"></i>
|
||||
n°
|
||||
{{ p.person.getCurrentHousehold.id }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
#}
|
||||
</div>
|
||||
{% if withoutHousehold|length > 0 %}
|
||||
{% include '@ChillPerson/AccompanyingCourse/_join_household.html.twig' with {} %}
|
||||
|
@ -7,6 +7,7 @@
|
||||
* addEntity bool
|
||||
* addInfo bool
|
||||
* hLevel integer
|
||||
* customButtons Twig\Markup (html)
|
||||
#}
|
||||
|
||||
{% macro raw(person, options) %}
|
||||
@ -92,13 +93,17 @@
|
||||
{%- endif -%}
|
||||
</li>
|
||||
</ul>
|
||||
{%- if is_granted('CHILL_PERSON_SEE', person) -%}
|
||||
<ul class="record_actions">
|
||||
<li><a class="btn btn-show" target="_blank" title="{{ 'Show'|trans }}"
|
||||
href="{{ path('chill_person_view', { person_id: person.id }) }}"></a>
|
||||
</li>
|
||||
{%- if is_granted('CHILL_PERSON_SEE', person) -%}
|
||||
<li>
|
||||
<a class="btn btn-show" target="_blank" title="{{ 'Show'|trans }}"
|
||||
href="{{ path('chill_person_view', { person_id: person.id }) }}"></a>
|
||||
</li>
|
||||
{%- endif -%}
|
||||
{% if options['customButtons'] %}
|
||||
{{ options['customButtons'] }}
|
||||
{% endif %}
|
||||
</ul>
|
||||
{%- endif -%}
|
||||
</div>
|
||||
</div>
|
||||
{%- endif -%}
|
||||
|
@ -58,6 +58,7 @@ class PersonRender extends AbstractChillEntityRender
|
||||
'addEntity' => $options['addEntity'] ?? false,
|
||||
'addInfo' => $options['addInfo'] ?? false,
|
||||
'hLevel' => $options['hLevel'] ?? 3,
|
||||
'customButtons' => $options['customButtons'] ?? null,
|
||||
];
|
||||
|
||||
return
|
||||
|
@ -8,6 +8,7 @@
|
||||
* addEntity bool
|
||||
* addInfo bool
|
||||
* hLevel integer
|
||||
* customButtons Twig\Markup (html)
|
||||
#}
|
||||
|
||||
{% macro raw(thirdparty, options) %}
|
||||
@ -77,9 +78,15 @@
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ path('chill_3party_3party_show', { thirdparty_id: thirdparty.id }) }}" class="btn btn-show" target="_blank" title="Voir"></a>
|
||||
</li>
|
||||
{%- if is_granted('CHILL_3PARTY_3PARTY_SHOW', thirdparty) -%}
|
||||
<li>
|
||||
<a class="btn btn-show" target="_blank" title="{{ 'Show'|trans }}"
|
||||
href="{{ path('chill_3party_3party_show', { thirdparty_id: thirdparty.id }) }}"></a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if options['customButtons'] %}
|
||||
{{ options['customButtons'] }}
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -52,6 +52,7 @@ class ThirdPartyRender extends AbstractChillEntityRender
|
||||
'addEntity' => $options['addEntity'] ?? false,
|
||||
'addInfo' => $options['addInfo'] ?? false,
|
||||
'hLevel' => $options['hLevel'] ?? 3,
|
||||
'customButtons' => $options['customButtons'] ?? null,
|
||||
];
|
||||
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user