mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
render box, custom buttons before, after or remplacing default
This commit is contained in:
@@ -10,10 +10,8 @@
|
||||
{% if person.isSharingHousehold %}
|
||||
<li>
|
||||
<a href="{{ chill_path_add_return_path('chill_person_household_summary', { 'household_id': person.getCurrentHousehold.id }) }}"
|
||||
class="btn btn-misc">
|
||||
class="btn btn-chill-pink" title="{{ 'Show household'|trans ~ ' n° ' ~ person.getCurrentHousehold.id }}">
|
||||
<i class="fa fa-home"></i>
|
||||
n°
|
||||
{{ person.getCurrentHousehold.id }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
@@ -40,7 +38,8 @@
|
||||
{% if participation.enddate is null %}
|
||||
<div class="item-bloc">
|
||||
{{ participation.person|chill_entity_render_box({
|
||||
'render': 'bloc', 'addLink': false, 'addInfo': true, 'customButtons': _self.button_person(participation.person)
|
||||
'render': 'bloc', 'addLink': false, 'addInfo': true,
|
||||
'customButtons': { 'before': _self.button_person(participation.person) }
|
||||
}) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@@ -1,13 +1,17 @@
|
||||
{#
|
||||
Template to render a person
|
||||
* render [raw|label|bloc]
|
||||
* render string ['raw'|'label'|'bloc']
|
||||
OPTIONS
|
||||
* addAltNames bool
|
||||
* addLink bool
|
||||
* addEntity bool
|
||||
* addInfo bool
|
||||
* hLevel integer
|
||||
* customButtons Twig\Markup (html)
|
||||
* addAltNames bool
|
||||
* addLink bool
|
||||
* addEntity bool
|
||||
* addInfo bool
|
||||
* hLevel integer
|
||||
* customButtons [
|
||||
'before' Twig\Markup, (injected with macro)
|
||||
'replace' Twig\Markup,
|
||||
'after' Twig\Markup
|
||||
]
|
||||
#}
|
||||
|
||||
{% macro raw(person, options) %}
|
||||
@@ -94,14 +98,21 @@
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="record_actions">
|
||||
{%- if is_granted('CHILL_PERSON_SEE', person) -%}
|
||||
{% if options['customButtons']['before'] is defined %}
|
||||
{{ options['customButtons']['before'] }}
|
||||
{% endif %}
|
||||
|
||||
{%- if options['customButtons']['replace'] is not defined and is_granted('CHILL_PERSON_SEE', person) -%}
|
||||
<li>
|
||||
<a class="btn btn-show" target="_blank" title="{{ 'Show'|trans }}"
|
||||
<a class="btn btn-show" target="_blank" title="{{ 'Show person'|trans }}"
|
||||
href="{{ path('chill_person_view', { person_id: person.id }) }}"></a>
|
||||
</li>
|
||||
{%- else -%}
|
||||
{{ options['customButtons']['replace'] }}
|
||||
{%- endif -%}
|
||||
{% if options['customButtons'] %}
|
||||
{{ options['customButtons'] }}
|
||||
|
||||
{% if options['customButtons']['after'] is defined %}
|
||||
{{ options['customButtons']['after'] }}
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user