From dc184762d63347ffaef9ea2a092fc00fb54f8682 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 28 Jan 2022 23:54:01 +0100 Subject: [PATCH] workflow history --- .../views/Workflow/_history.html.twig | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/views/Workflow/_history.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Workflow/_history.html.twig index 7fea14f21..cee9d219c 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Workflow/_history.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Workflow/_history.html.twig @@ -2,15 +2,18 @@
{% for step in entity_workflow.stepsChained %} + {% set place_labels = workflow_metadata(entity_workflow, 'label', step.currentStep) %} + {% set place_label = place_labels is null ? step.currentStep : place_labels|localize_translatable_string %} +
- + {% if loop.first and step.next is null %}
{{ 'workflow.No transitions'|trans }}
{% else %} - +
{% if step.previous is not null and step.previous.freezeAfter == true %} @@ -18,10 +21,7 @@
- {% if not loop.first %} - - {% endif %} - {{ step.currentStep }} + {{ place_label }}
{#
@@ -31,9 +31,13 @@ #}
{% endif %} - +
{% if step.next is not null %} + {% set transition = chill_workflow_transition_by_string(step.entityWorkflow, step.transitionAfter) %} + {% set transition_labels = workflow_metadata(step.entityWorkflow, 'label', transition) %} + {% set transition_label = transition_labels is null ? step.transitionAfter : transition_labels|localize_translatable_string %} + {% set forward = workflow_metadata(step.entityWorkflow, 'isForward', transition) %}
{% if step.transitionBy is not null %} @@ -48,7 +52,12 @@
- {{ step.next.currentStep }} + {% if forward %} + + {% else %} + + {% endif %} + {{ transition_label }}