reuse notification item in show template

This commit is contained in:
Mathieu Jaumotte 2022-01-06 19:42:45 +01:00
parent 7d4ca8d149
commit 18959f60e2
3 changed files with 90 additions and 73 deletions

View File

@ -2,7 +2,8 @@
* Notifications List * Notifications List
*/ */
div.notification-list { div.notification-list,
div.notification-show {
div.item-bloc { div.item-bloc {
div.item-row.header { div.item-row.header {

View File

@ -10,7 +10,7 @@
<div class="item-col"> <div class="item-col">
<ul class="small_in_title"> <ul class="small_in_title">
{% if step == 'inbox' %} {% if step is not defined or step == 'inbox' %}
<li class="notification-from"> <li class="notification-from">
<span class="item-key"> <span class="item-key">
<abbr title="{{ 'notification.received_from'|trans }}"> <abbr title="{{ 'notification.received_from'|trans }}">
@ -60,6 +60,7 @@
</blockquote> </blockquote>
</div> </div>
</div> </div>
{% if action_button is not defined or action_button != 'false' %}
<div class="item-row separator"> <div class="item-row separator">
<ul class="record_actions"> <ul class="record_actions">
<li> <li>
@ -83,4 +84,5 @@
{% endif %} {% endif %}
</ul> </ul>
</div> </div>
{% endif %}
</div> </div>

View File

@ -13,19 +13,32 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="col-10"> <div class="col-10 notification notification-show">
<h1>{{ notification.title }}</h1> <h1 class="visually-hidden">{{ notification.title }}</h1>
<div class="flex-table">
{% include 'ChillMainBundle:Notification:_list_item.html.twig' with {
'data': {
'template': handler.getTemplate(notification),
'template_data': handler.getTemplateData(notification)
},
'action_button': 'false'
} %}
</div>
{#
{{ dump() }}
<div> <div>
{% include handler.getTemplate(notification) with handler.getTemplateData(notification) %} {% include handler.getTemplate(notification) with handler.getTemplateData(notification) %}
</div> </div>
<div> <div>
{# à remplacer par un commentEmbeddable #} à remplacer par un commentEmbeddable
{{ notification.message|chill_markdown_to_html }} {{ notification.message|chill_markdown_to_html }}
</div> </div>
#}
<div class="comments thread m-5">
{% if notification.comments|length > 0 %} {% if notification.comments|length > 0 %}
{% for comment in notification.comments %} {% for comment in notification.comments %}
{% if editedCommentForm is null or editedCommentId != comment.id %} {% if editedCommentForm is null or editedCommentId != comment.id %}
@ -80,6 +93,7 @@
{{ form_end(appendCommentForm) }} {{ form_end(appendCommentForm) }}
</div> </div>
{% endif %} {% endif %}
</div>
<ul class="record_actions sticky-form-buttons"> <ul class="record_actions sticky-form-buttons">
<li class="cancel"> <li class="cancel">