From 35e907f7b267aba93ccadacf29c4f5f17f783db6 Mon Sep 17 00:00:00 2001 From: Eliseu Amaro Date: Wed, 9 Feb 2022 18:49:34 +0000 Subject: [PATCH] [CARDS][Note] Note's 'in reply to' information added, overall polish of feeds templates and proper titles added for every single section that makes up a note --- .../templates/collection/notes.html.twig | 16 +++--- public/assets/default_theme/pages/feeds.css | 40 +++++++-------- templates/base.html.twig | 10 ++-- templates/cards/blocks/note.html.twig | 51 ++++++++++--------- templates/cards/macros/note.html.twig | 26 +++++++--- 5 files changed, 78 insertions(+), 65 deletions(-) diff --git a/components/Collection/templates/collection/notes.html.twig b/components/Collection/templates/collection/notes.html.twig index c8033aeeb3..1df64928d3 100644 --- a/components/Collection/templates/collection/notes.html.twig +++ b/components/Collection/templates/collection/notes.html.twig @@ -14,11 +14,11 @@ {% endfor %} {% if notes is defined %} -
+
{% set current_path = app.request.get('_route') %} {% if page_title is defined %} {% if current_path starts with 'feed_' or 'conversation' in current_path %} -

{{ page_title | trans }}

+

{{ page_title | trans }}

{% endif %} {% else %} {% if current_path starts with 'search' %} @@ -27,12 +27,12 @@

{{ 'Notes' | trans }}

{% endif %} {% endif %} -
{% endblock header %} -
- -
+ +
+
+
diff --git a/templates/cards/blocks/note.html.twig b/templates/cards/blocks/note.html.twig index 1fc77b1356..18bf758fb3 100644 --- a/templates/cards/blocks/note.html.twig +++ b/templates/cards/blocks/note.html.twig @@ -26,13 +26,18 @@ {% import '/cards/macros/note.html.twig' as noteView %} {% if replies is defined and replies is not empty %} -
-
+
+
{% for conversation in replies %} -
- - {{ noteView.note_vanilla(conversation['note'], conversation['replies']) }} + {% if extra.depth is defined %} + {% set depth_increment = {'depth': extra.depth + 1} %} + {% set parent = {'parent': block('note_author')} %} + {% set extra = extra|merge(depth_increment) %} + {% set extra = extra|merge(parent) %} + {% endif %} + + {{ noteView.note_vanilla(conversation['note'], conversation['replies'], extra) }} {% endfor %}
@@ -43,7 +48,7 @@ {% if hide_attachments is not defined %} {% if note.getAttachments() is not empty %}
+ title="{{ 'Attachments for this note' | trans }}"> {% for attachment in note.getAttachments() %} {% include 'cards/blocks/attachment.html.twig' with {'attachment': attachment, 'note': note, 'title': attachment.getBestTitle(note)} only %} {% endfor %} @@ -66,7 +71,7 @@ {% block note_text %}
+ title="{{ 'Main note content' | trans }}"> {% set paragraph_array = note.getRenderedSplit() %} {% if 'conversation' not in app.request.get('_route') and paragraph_array | length > 3 %}

{{ paragraph_array[0] | raw }}

@@ -88,23 +93,18 @@ {% 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 %} -