mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Refactor breadcrumb macro parameters in Workflow templates
Updated the breadcrumb macro's parameters to accept `entity_workflow` directly instead of a context object. This change affects the index, list, and macro_breadcrumb templates, ensuring consistent parameter usage and improving readability. This avoid exploiting a bug which was solved in twig 3.15.0
This commit is contained in:
parent
3a1947df9e
commit
6ca4b91e1e
@ -37,7 +37,7 @@
|
|||||||
<div class="mb-5">
|
<div class="mb-5">
|
||||||
<h2>{{ handler.entityTitle(entity_workflow) }}</h2>
|
<h2>{{ handler.entityTitle(entity_workflow) }}</h2>
|
||||||
|
|
||||||
{{ macro.breadcrumb({'entity_workflow': entity_workflow}) }}
|
{{ macro.breadcrumb(entity_workflow) }}
|
||||||
{% if entity_workflow.isOnHoldAtCurrentStep %}
|
{% if entity_workflow.isOnHoldAtCurrentStep %}
|
||||||
<span class="badge bg-success rounded-pill" title="{{ 'workflow.On hold'|trans|escape('html_attr') }}">{{ 'workflow.On hold'|trans }}</span>
|
<span class="badge bg-success rounded-pill" title="{{ 'workflow.On hold'|trans|escape('html_attr') }}">{{ 'workflow.On hold'|trans }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -68,7 +68,7 @@
|
|||||||
|
|
||||||
</button>
|
</button>
|
||||||
<div>
|
<div>
|
||||||
{{ macro.breadcrumb(l) }}
|
{{ macro.breadcrumb(l.entity_workflow) }}
|
||||||
{% if l.entity_workflow.isOnHoldAtCurrentStep %}
|
{% if l.entity_workflow.isOnHoldAtCurrentStep %}
|
||||||
<span class="badge bg-success rounded-pill" title="{{ 'workflow.On hold'|trans|escape('html_attr') }}">{{ 'workflow.On hold'|trans }}</span>
|
<span class="badge bg-success rounded-pill" title="{{ 'workflow.On hold'|trans|escape('html_attr') }}">{{ 'workflow.On hold'|trans }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -52,10 +52,10 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro breadcrumb(_ctx) %}
|
{% macro breadcrumb(entity_workflow) %}
|
||||||
<div class="breadcrumb">
|
<div class="breadcrumb">
|
||||||
{% for step in _ctx.entity_workflow.stepsChained %}
|
{% for step in entity_workflow.stepsChained %}
|
||||||
{% set labels = workflow_metadata(_ctx.entity_workflow, 'label', step.currentStep, _ctx.entity_workflow.workflowName) %}
|
{% set labels = workflow_metadata(entity_workflow, 'label', step.currentStep, entity_workflow.workflowName) %}
|
||||||
{% set label = labels is null ? step.currentStep : labels|localize_translatable_string %}
|
{% set label = labels is null ? step.currentStep : labels|localize_translatable_string %}
|
||||||
{% set popTitle = _self.popoverTitle(step) %}
|
{% set popTitle = _self.popoverTitle(step) %}
|
||||||
{% set popContent = _self.popoverContent(step) %}
|
{% set popContent = _self.popoverContent(step) %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user