mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-19 05:04:59 +00:00
Code updates have been made in multiple files to ensure that when entities are rendered, it includes the appropriate context relating to the date. This adjustment has been primarily made in template files where the `chill_entity_render_box` function is used. These changes help to provide users with more accurate information regarding the state of an entity at a specific time.
79 lines
3.6 KiB
Twig
79 lines
3.6 KiB
Twig
{% macro popoverContent(step) %}
|
|
<ul class="small_in_title">
|
|
{% if step.previous is not null %}
|
|
<li>
|
|
<span class="item-key">{{ 'By'|trans ~ ' : ' }}</span>
|
|
<b>{{ step.previous.transitionBy|chill_entity_render_box({'at_date': step.previous.transitionAt }) }}</b>
|
|
</li>
|
|
<li>
|
|
<span class="item-key">{{ 'Le'|trans ~ ' : ' }}</span>
|
|
<b>{{ step.previous.transitionAt|format_datetime('short', 'short') }}</b>
|
|
</li>
|
|
<li>
|
|
<span class="item-key">{{ 'workflow.For'|trans ~ ' : ' }}</span>
|
|
<b>
|
|
{% for d in step.destUser %}{{ d|chill_entity_render_string({'at_date': step.previous.transitionAt}) }}{% if not loop.last %}, {% endif %}{% endfor %}
|
|
</b>
|
|
</li>
|
|
<li>
|
|
<span class="item-key">{{ 'workflow.Cc'|trans ~ ' : ' }}</span>
|
|
<b>
|
|
{% for u in step.ccUser %}{{ u|chill_entity_render_string({'at_date': step.previous.transitionAt }) }}{% if not loop.last %}, {% endif %}{% endfor %}
|
|
</b>
|
|
</li>
|
|
{% else %}
|
|
<li>
|
|
<span class="item-key">{{ 'workflow.Created by'|trans ~ ' : ' }}</span>
|
|
<b>{{ step.entityWorkflow.createdBy|chill_entity_render_box({'at_date': step.entityWorkflow.createdAt }) }}</b>
|
|
</li>
|
|
<li>
|
|
<span class="item-key">{{ 'Le'|trans ~ ' : ' }}</span>
|
|
<b>{{ step.entityWorkflow.createdAt|format_datetime('short', 'short') }}</b>
|
|
</li>
|
|
{% endif %}
|
|
</ul>
|
|
{% endmacro %}
|
|
|
|
{% macro popoverTitle(step) %}
|
|
{% if step.previous is not null and step.previous.freezeAfter == true %}
|
|
<i class="fa fa-snowflake-o fa-sm me-1" title="{{ 'workflow.Freezed'|trans }}"></i>
|
|
{% endif %}
|
|
{% if step.previous is not null %}
|
|
{% set transition = chill_workflow_transition_by_string(step.entityWorkflow, step.previous.transitionAfter) %}
|
|
{% set labels = workflow_metadata(step.entityWorkflow, 'label', transition) %}
|
|
{% set label = labels is null ? step.previous.transitionAfter : labels|localize_translatable_string %}
|
|
{{ label }}
|
|
{% endif %}
|
|
{% endmacro %}
|
|
|
|
{% macro breadcrumb(_ctx) %}
|
|
<div class="breadcrumb">
|
|
{% for step in _ctx.entity_workflow.stepsChained %}
|
|
{% set labels = workflow_metadata(_ctx.entity_workflow, 'label', step.currentStep) %}
|
|
{% set label = labels is null ? step.currentStep : labels|localize_translatable_string %}
|
|
{% set popTitle = _self.popoverTitle(step) %}
|
|
{% set popContent = _self.popoverContent(step) %}
|
|
<span class="mx-2"
|
|
tabindex="0"
|
|
data-bs-trigger="focus hover"
|
|
data-bs-toggle="popover"
|
|
data-bs-placement="bottom"
|
|
data-bs-custom-class="workflow-transition"
|
|
title="{{ popTitle|e('html_attr') }}"
|
|
data-bs-content="{{ popContent|e('html_attr') }}"
|
|
>
|
|
{% if step.currentStep == 'initial' %}
|
|
<i class="fa fa-circle me-1 text-chill-yellow"></i>
|
|
{% endif %}
|
|
{% if step.previous is not null and step.previous.freezeAfter == true %}
|
|
<i class="fa fa-snowflake-o fa-sm me-1" title="{{ 'workflow.Freezed'|trans }}"></i>
|
|
{% endif %}
|
|
{{ label }}
|
|
</span>
|
|
{% if not loop.last %}
|
|
→
|
|
{% endif %}
|
|
{% endfor %}
|
|
</div>
|
|
{% endmacro %}
|