render_box person and thirdparty: fix bug customOptions with 'replace'

This commit is contained in:
Mathieu Jaumotte 2021-08-19 09:59:27 +02:00
parent 801e897a38
commit 7ffdf4cb1f
2 changed files with 4 additions and 4 deletions

View File

@ -137,13 +137,14 @@
{{ options['customButtons']['before'] }}
{% endif %}
{%- if options['customButtons']['replace'] is not defined and is_granted('CHILL_PERSON_SEE', person) -%}
{%- if options['customButtons']['replace'] is defined -%}
{{ options['customButtons']['replace'] }}
{%- elseif is_granted('CHILL_PERSON_SEE', person) -%}
<li>
<a class="btn btn-sm 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']['after'] is defined %}

View File

@ -94,13 +94,12 @@
{% if options['customButtons']['replace'] is defined %}
{{ options['customButtons']['replace'] }}
{% elseif is_granted('CHILL_3PARTY_3PARTY_SHOW', thirdparty) %}
{% elseif is_granted('CHILL_3PARTY_3PARTY_SHOW', thirdparty) %}
<li>
<a class="btn btn-sm btn-show" target="_blank" title="{{ 'Show thirdparty'|trans }}"
href="{{ path('chill_3party_3party_show', { thirdparty_id: thirdparty.id }) }}"></a>
</li>
{% else %}
{# rien faire ? j'ai eu un bug car options['customButtons'] était vide (marc) #}
{% endif %}
{% if options['customButtons']['after'] is defined %}