From ab23290599c79c78798f88ac8dde488b1b254d87 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Sun, 23 Jan 2022 17:07:08 +0100 Subject: [PATCH] refund extension_list_notification template: change place and content --- .../Resources/views/Activity/show.html.twig | 26 ++++++++++++++----- .../Activity/showAccompanyingCourse.html.twig | 16 +----------- .../views/Notification/_list_item.html.twig | 18 ++++++++++--- ...extension_list_notifications_for.html.twig | 21 +++++++++++++-- .../views/Notification/show.html.twig | 3 ++- 5 files changed, 56 insertions(+), 28 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig index 546ba99ce..aca133d46 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig @@ -181,6 +181,14 @@ +
+ {% set notifications = chill_list_notifications('Chill\\ActivityBundle\\Entity\\Activity', entity.id) %} + {% if notifications is not empty %} + {{ notifications|raw }} + {% endif %} +
+ + {% set person_id = null %} {% if person %} {% set person_id = person.id %} @@ -197,18 +205,22 @@ {{ 'Back to the list'|trans }} - {% if is_granted('CHILL_ACTIVITY_UPDATE', entity) %} -
  • - - {{ 'Edit'|trans }} +
  • + + + {{ 'notification.Notify'|trans }}
  • + {% if is_granted('CHILL_ACTIVITY_UPDATE', entity) %} +
  • + +
  • {% endif %} {% if is_granted('CHILL_ACTIVITY_DELETE', entity) %}
  • - - {{ 'Delete'|trans }} - +
  • {% endif %} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/showAccompanyingCourse.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/showAccompanyingCourse.html.twig index e8d84fc51..fbd7b20b4 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/showAccompanyingCourse.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/showAccompanyingCourse.html.twig @@ -25,19 +25,5 @@ {% endblock content %} {% block block_post_menu %} -
    - - - - {% set notifications = chill_list_notifications('Chill\\ActivityBundle\\Entity\\Activity', entity.id) %} - {% if notifications is not empty %} - {{ notifications|raw }} - {% endif %} - -
    +
    {% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Notification/_list_item.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Notification/_list_item.html.twig index 5750a3a2c..41f04f369 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Notification/_list_item.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Notification/_list_item.html.twig @@ -52,9 +52,11 @@ {% macro content(c) %}
    -
    - {% include c.data.template with c.data.template_data %} -
    + {% if c.data is defined %} +
    + {% include c.data.template with c.data.template_data %} +
    + {% endif %}
    @@ -107,15 +109,25 @@ {{ _self.header(_context) }} +
    + {{ _self.content(_context) }} + + {% if with_folded_comments is defined and with_folded_comments != false %} +
    {# close previous flex-table and reopen it after #} + {% include 'ChillMainBundle:Notification:_item_comments.html.twig' %} +
    + {% endif %} +
    {% else %} {{ _self.title(_context) }} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Notification/extension_list_notifications_for.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Notification/extension_list_notifications_for.html.twig index ac1daad6f..a7156c5dd 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Notification/extension_list_notifications_for.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Notification/extension_list_notifications_for.html.twig @@ -1,8 +1,24 @@ +

    {{ 'notification.Notification'|trans }}

    + +
    + {% for notification in notifications %} + {% include 'ChillMainBundle:Notification:_list_item.html.twig' with { + 'action_button': false, + 'full_content': true, + 'fold_item': true, + } %}{# + DISABLED + 'with_folded_comments': true + #} + {% endfor %} +
    + +{#

    {{ 'notification.Sent'|trans }}

    - {# TODO pagination or limit #} + {% for notification in notifications %}
    @@ -13,7 +29,7 @@ {{ notification.date|format_datetime('short','short') }} - {# Vue component #} + {% endfor %}
    +#} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Notification/show.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Notification/show.html.twig index c8834c07c..cce7ebd64 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Notification/show.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Notification/show.html.twig @@ -26,7 +26,8 @@ 'template_data': handler.getTemplateData(notification) }, 'action_button': false, - 'full_content': true + 'full_content': true, + 'fold_item': false } %}