dynamic back message in return values

This commit is contained in:
Tchama 2019-01-21 16:43:02 +01:00
parent 3c434852d5
commit 835ead6ccd
3 changed files with 7 additions and 4 deletions

View File

@ -18,7 +18,7 @@ Moderator: Animateur
Details of an event: Détails d'un événement
New event: Nouvel événement
Back to the most recent events: Retour aux derniers événements
Back to the person events: Retour aux événements de la personne
'Back to %person% events': Retour aux événements de %person%
Event creation: Création d'un événement
Add an event: Ajouter un événement
Event edit: Modifier un événement

View File

@ -17,6 +17,7 @@
{% extends "ChillPersonBundle::layout.html.twig" %}
{% set activeRouteKey = 'chill_event__list_by_person' %}
{% set currentPerson = person.firstName ~ ' ' ~ person.lastName %}
{% block title %}{{ 'Events participation' |trans }}{% endblock title %}
@ -46,7 +47,7 @@
<ul class="record_actions">
<li>
{% set currentPath = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %}
{% set returnLabel = 'Back to the person events'|trans %}
{% set returnLabel = 'Back to %person% events'|trans({ '%person%' : currentPerson } ) %}
{# temporaire --
TODO corriger EventVoter.php pour régler les autorisations sur les boutons, puis remplacer ci-dessous par le code commenté #}
@ -145,7 +146,7 @@
{% endif %}
{#
#}
{{ dump() }}
#}
{% endblock %}

View File

@ -34,8 +34,10 @@
</table>
<ul class="record_actions">
{% set returnPath = app.request.get('return_path') %}
{% set returnLabel = app.request.get('return_label') %}
{% if returnPath and returnLabel %}
<li class="cancel">
<a href="{{ returnPath }}" class="sc-button bt-cancel">{{ returnLabel }}</a>