fix macro metadata + fix merge conflicts from branch ux_corrections

This commit is contained in:
Mathieu Jaumotte 2022-03-01 11:33:33 +01:00
parent b146f17d2f
commit 0d38cae217
2 changed files with 67 additions and 59 deletions

View File

@ -1,8 +1,10 @@
{% import "@ChillDocStore/Macro/macro.html.twig" as m %} {% import "@ChillDocStore/Macro/macro.html.twig" as m %}
{% import "@ChillDocStore/Macro/macro_mimeicon.html.twig" as mm %} {% import "@ChillDocStore/Macro/macro_mimeicon.html.twig" as mm %}
{% import '@ChillPerson/Macro/updatedBy.html.twig' as mmm %}
<div class="item-bloc"> <div class="item-bloc">
<div class="item-row"> <div class="item-row">
<div class="item-col"> <div class="item-col" style="width: unset">
<div class="denomination h2"> <div class="denomination h2">
{{ document.title }} {{ document.title }}
</div> </div>
@ -30,27 +32,19 @@
</div> </div>
</div> </div>
{% if document.description is not empty %} {% if document.description is not empty %}
<div class="item-row separator"> <div class="item-row">
<blockquote class="chill-user-quote"> <blockquote class="chill-user-quote col">
{{ document.description|chill_markdown_to_html }} {{ document.description|chill_markdown_to_html }}
</blockquote> </blockquote>
</div> </div>
{% endif %} {% endif %}
<div class="item-row separator"> <div class="item-row separator">
<div class="item-col item-meta"> <div class="item-col item-meta">
<div class="updatedBy"> {{ mmm.createdBy(document) }}
{{ 'Created by'|trans }}:
<span class="user">{{ document.createdBy|chill_entity_render_string }}</span>
<span class="date">le {{ document.createdAt|format_date('long') }}</span>
</div> </div>
</div> <div class="item-col">
</div>
<div>
{% if document.course is defined %}
<ul class="record_actions"> <ul class="record_actions">
<li> {% if document.course is defined %}
{{ chill_entity_workflow_list('Chill\\DocStoreBundle\\Entity\\AccompanyingCourseDocument', document.id) }}
</li>
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE_DETAILS', document) %} {% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE_DETAILS', document) %}
<li> <li>
{{ m.download_button(document.object, document.title) }} {{ m.download_button(document.object, document.title) }}
@ -64,9 +58,10 @@
<a href="{{ path('accompanying_course_document_edit', {'course': accompanyingCourse.id, 'id': document.id }) }}" class="btn btn-update"></a> <a href="{{ path('accompanying_course_document_edit', {'course': accompanyingCourse.id, 'id': document.id }) }}" class="btn btn-update"></a>
</li> </li>
{% endif %} {% endif %}
</ul> <li>
{{ chill_entity_workflow_list('Chill\\DocStoreBundle\\Entity\\AccompanyingCourseDocument', document.id) }}
</li>
{% else %} {% else %}
<ul class="record_actions">
{% if is_granted('CHILL_PERSON_DOCUMENT_SEE_DETAILS', document) %} {% if is_granted('CHILL_PERSON_DOCUMENT_SEE_DETAILS', document) %}
<li> <li>
{{ m.download_button(document.object, document.title) }} {{ m.download_button(document.object, document.title) }}
@ -80,7 +75,8 @@
<a href="{{ path('person_document_edit', {'person': person.id, 'id': document.id}) }}" class="btn btn-update"></a> <a href="{{ path('person_document_edit', {'person': person.id, 'id': document.id}) }}" class="btn btn-update"></a>
</li> </li>
{% endif %} {% endif %}
</ul>
{% endif %} {% endif %}
</ul>
</div>
</div> </div>
</div> </div>

View File

@ -1,11 +1,17 @@
{% macro updatedBy(entity) %} {% macro updatedBy(entity) %}
<div class="updatedBy"> <div class="updatedBy">
{% if entity.updatedAt != null %}
{{ 'Last updated on'|trans }} {{ 'Last updated on'|trans }}
<span class="date"> <span class="date">
{{ entity.updatedAt|format_datetime('medium', 'short') }} {{ entity.updatedAt|format_datetime('medium', 'short') }}
</span> </span>
{% if entity.updatedBy %} {% endif %}
{% if entity.updatedBy != null %}
{% if entity.updatedAt != null %}
{{ ', ' ~ 'by_user'|trans }} {{ ', ' ~ 'by_user'|trans }}
{% else %}
{{ 'Last updated by'|trans }}
{% endif %}
<span class="user"> <span class="user">
{{ entity.updatedBy|chill_entity_render_box }} {{ entity.updatedBy|chill_entity_render_box }}
</span> </span>
@ -14,13 +20,19 @@
{% endmacro %} {% endmacro %}
{% macro createdBy(entity) %} {% macro createdBy(entity) %}
<div class="updatedBy"> <div class="createdBy">
{% if entity.createdAt != null %}
{{ 'Created on'|trans }} {{ 'Created on'|trans }}
<span class="date"> <span class="date">
{{ entity.createdAt|format_datetime('medium', 'short') }} {{ entity.createdAt|format_datetime('medium', 'short') }}
</span> </span>
{% if entity.createdBy %} {% endif %}
{% if entity.createdBy != null %}
{% if entity.createdAt != null %}
{{ ', ' ~ 'by_user'|trans }} {{ ', ' ~ 'by_user'|trans }}
{% else %}
{{ 'Created by'|trans }}
{% endif %}
<span class="user"> <span class="user">
{{ entity.createdBy|chill_entity_render_string }} {{ entity.createdBy|chill_entity_render_string }}
</span> </span>