allow to display pinned comment in item of accompanying course list

This commit is contained in:
Julien Fastré 2022-04-07 22:40:20 +02:00
parent fc55567a64
commit 0f926e9dfe
2 changed files with 34 additions and 7 deletions

View File

@ -24,6 +24,7 @@ and this project adheres to
* allow every person which has part for a workflow to see the workflow page
* able to see the workflow if the evaluation document has been deleted
* hardcode the list of supported mime types for edition with collabora
* list of accompanying course: allow to see the pinned comment in list_item
### 2021-04-06

View File

@ -116,14 +116,40 @@
</div>
</div>
{% endif %}
<div class="item-row separator">
{% set notif_counter = chill_count_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', period.id) %}
{% if notif_counter.total > 0 %}
<div class="item-col item-meta">
{{ chill_counter_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', period.id) }}
{% if show_pinned_comment|default(false) and period.pinnedComment is not empty%}
<div class="item-row separator comment">
<div style="width: 100%">
<h4 class="item-key visually-hidden">{{ 'Pinned comment'|trans }}</h4>
<blockquote class="chill-user-quote">
{{ period.pinnedComment.content|u.truncate(750, '…', false)|chill_markdown_to_html }}
{% if period.pinnedComment.content|length > 750 %}
<a href="{{ chill_path_add_return_path('chill_person_accompanying_period_comment_list', {'accompanying_period_id': period.id}) }}">{{ 'Read more'|trans }}</a>
{% endif %}
<div class="metadata">
{{ 'Last updated by'| trans }}
<span class="user">
{{ period.pinnedComment.updatedBy|chill_entity_render_box }}
</span>
{{ 'on'|trans ~ ' ' }}
<span class="date">
{{ period.pinnedComment.updatedAt|format_datetime("medium", "short") }}
</span>
</div>
</blockquote>
</div>
{% endif %}
{% if itemMeta is defined %}
</div>
{% endif %}
<div class="item-row separator">
{% if itemMeta is not defined %}
{% set notif_counter = chill_count_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', period.id) %}
{% if notif_counter.total > 0 %}
<div class="item-col item-meta">
{{ chill_counter_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', period.id) }}
</div>
{% endif %}
{% else %}
{{ itemMeta }}
{% endif %}
<div class="item-col">