From 34cc010136244e6c4afc62c3c5c46e6d101d95af Mon Sep 17 00:00:00 2001 From: Eliseu Amaro Date: Thu, 30 Dec 2021 17:33:51 +0000 Subject: [PATCH] [CARDS][Note] Separating complementary info as its own block --- templates/cards/note/view.html.twig | 95 +++++++++++++++++------------ 1 file changed, 55 insertions(+), 40 deletions(-) diff --git a/templates/cards/note/view.html.twig b/templates/cards/note/view.html.twig index 899c5d5b8e..ab81d93c0a 100644 --- a/templates/cards/note/view.html.twig +++ b/templates/cards/note/view.html.twig @@ -23,7 +23,8 @@ {% for current_action in get_note_actions(note) %}
  • -
  • {% endfor %} @@ -34,7 +35,8 @@ {% block note_replies %} {% if replies is defined and replies is not empty %} -
    +
    {{ 'Replies to ' | trans }}{{ nickname }} {% for conversation in replies %} {{ _self.macro_note(conversation['note'], conversation['replies']) }} @@ -47,9 +49,10 @@ {% block note_attachments %} {% if hide_attachments is not defined %} {% if note.getAttachments() is not empty %} -
    +
    {% for attachment in note.getAttachments() %} - {% include '/cards/attachments/view.html.twig' with {'attachment': attachment, 'note': note, 'title': attachment.getBestTitle(note)} only%} + {% include '/cards/attachments/view.html.twig' with {'attachment': attachment, 'note': note, 'title': attachment.getBestTitle(note)} only %} {% endfor %}
    {% endif %} @@ -69,7 +72,8 @@ {% endblock note_links %} {% block note_text %} -
    +
    {{ note.getRendered() | raw }}
    {% endblock note_text %} @@ -77,24 +81,29 @@ {% block note_author %} {# Microformat's h-card properties indicates a face icon is a "u-logo" #} -
    - {% if fullname is not null %} - {{ fullname }} - {% else %} - {{ nickname }} - {% endif %} -
    +
    + {% if fullname is not null %} + {{ fullname }} + {% else %} + {{ nickname }} + {% endif %} +
    - {{ mention }} + {{ mention }} {% endblock note_author %} {% block note_sidebar %} {% endblock note_sidebar %} @@ -103,8 +112,10 @@ @@ -112,6 +123,33 @@
    {% endblock note_info %} +{% block note_complementary_info %} + {% for complementary_info in handle_event('AppendCardNote', {'note': note }) %} + + {% endfor %} +{% endblock note_complementary_info %} + {% macro macro_note(note, replies) %} {% set actor = note.getActor() %} {% set nickname = actor.getNickname() %} @@ -133,30 +171,7 @@
    {{ block('note_replies') }} - - {% for complementary_info in handle_event('AppendCardNote', {'note': note }) %} - - {% endfor %} + {{ block('note_complementary_info') }}