add return path for page show and edit for single task

This commit is contained in:
Julien Fastré 2019-04-29 12:05:28 +02:00
parent c6a4e615dd
commit c52cf14459
3 changed files with 16 additions and 9 deletions

View File

@ -30,3 +30,7 @@ Version 1.5.7
- fix error when showing task list without person in context (issue #3) ;
Version 1.5.8
=============
- add returnPath to page Show and List for Single tasks ;

View File

@ -36,13 +36,12 @@
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a class="sc-button bt-cancel" href="{{ path('chill_task_singletask_list', { 'person_id': person.id } ) }}">
{{ 'Back to the list'|trans }}
</a>
</li>
<li class="cancel">
<a href="{{ path('chill_task_single_task_show', { 'id': task.id, 'list_params': app.request.query.get('list_params', { } )} ) }}" class="sc-button">
{{ 'Cancel'|trans }}
<a class="sc-button bt-cancel" href="{% if app.request.query.has('returnPath') %}
{{ app.request.query.get('returnPath')|escape('html_attr') }}
{% else %}
{{ path('chill_task_single_task_show', { 'id': task.id, 'list_params': app.request.query.get('list_params', { } )} ) }}" class="sc-button">
{% endif %}
{{ app.request.query.get('returnLabel')|default('Cancel'|trans) }}
</a>
</li>
<li>

View File

@ -85,8 +85,12 @@
<ul class="record_actions">
<li class="cancel">
<a class="sc-button bt-cancel" href="{{ path('chill_task_singletask_list', app.request.query.get('list_params', {}) ) }}">
{{ 'Back to the list'|trans }}
<a class="sc-button bt-cancel" href="{%- if app.request.query.has('returnPath') -%}
{{ app.request.query.get('returnPath')|escape('html_attr') }}
{%- else -%}
{{ path('chill_task_singletask_list', app.request.query.get('list_params', {}) ) }}
{%- endif -%}">
{{ app.request.query.get('returnLabel')|default('Back to the list'|trans) }}
</a>
</li>
{% if workflow_transitions(task)|length > 0 %}