From 7b0667109dfe1579e37fda76e13784de95d0a915 Mon Sep 17 00:00:00 2001 From: Eliseu Amaro Date: Tue, 8 Feb 2022 01:26:25 +0000 Subject: [PATCH] [CARDS][Note] Note actions are now displayed at the end Due to space constraint on mobile screens, prior actions placement proved to be a problem. Additionally, note replies are now separated from their parent, allowing more horizontal space to be used if necessary/more reply depth to be presented in a reasonable fashion. --- .../templates/collection/notes.html.twig | 2 +- .../assets/default_theme/css/pages/feeds.css | 43 +++++++++---------- templates/cards/blocks/note.html.twig | 21 ++++----- templates/cards/macros/note.html.twig | 7 +-- 4 files changed, 37 insertions(+), 36 deletions(-) diff --git a/components/Collection/templates/collection/notes.html.twig b/components/Collection/templates/collection/notes.html.twig index c08e98ac5a..24d143ad85 100644 --- a/components/Collection/templates/collection/notes.html.twig +++ b/components/Collection/templates/collection/notes.html.twig @@ -51,7 +51,7 @@ {% else %} {{ noteView.note_vanilla(conversation) }} {% endif %} -
+
{% endblock current_note %} {% endfor %} diff --git a/public/assets/default_theme/css/pages/feeds.css b/public/assets/default_theme/css/pages/feeds.css index 0ef2b7f691..fd20f32dcf 100644 --- a/public/assets/default_theme/css/pages/feeds.css +++ b/public/assets/default_theme/css/pages/feeds.css @@ -149,10 +149,13 @@ padding: unset; } -.h-entry .replies { - border-left: 1px solid var(--border); +.note-replies { + margin-left: var(--xl); +} + +.note-replies-start { + margin-top: var(--s); margin-bottom: var(--s); - padding: 0 var(--s); } .h-entry a:focus { @@ -228,7 +231,6 @@ embed header { flex-wrap: wrap; justify-content: space-between; align-items: center; - background: var(--gradient-backwards); } .note-info-start { flex: 1; @@ -253,14 +255,16 @@ embed header { font-style: italic; } .note-actions { - display: block; + display: flex; + flex-direction: initial; + justify-content: flex-end; + padding: 4px 8px; + background: var(--gradient-backwards); + border-radius: 0 0 var(--s) 0; } .note-actions > li { display: inline-block; - margin-left: 4px; -} -.note-actions-extra-details { - margin-right: 4px; + margin-left: 8px; } .note-actions-extra-details ul { display: flex; @@ -278,13 +282,7 @@ embed header { font-size: 0.937rem; line-height: 2; } -.note-actions-separator { - background: var(--foreground); - display: inline-block; - height: 1em; - opacity: 0.33; - width: 1px; -} + .note-actions-set { opacity: 1 !important; } @@ -310,7 +308,7 @@ embed header { .note-content { border-radius: 0 0 var(--s) var(--s); display: block; - padding: 0 4px 4px 0; + padding: 0 4px 8px 0; } .note-replies-start { @@ -319,8 +317,13 @@ embed header { opacity: .5; } +.hr-replies-end { + margin-bottom: var(--xl); +} + .note-sidebar { display: flex; + flex-direction: column; padding: var(--s); } @@ -370,11 +373,7 @@ embed header { @media only screen and (max-width: 1280px) { .note-sidebar { - padding: 8px 2px 0; + padding: 4px 6px; } - .note-sidebar > * { - max-height: 2rem; - max-width: 2rem; - } } diff --git a/templates/cards/blocks/note.html.twig b/templates/cards/blocks/note.html.twig index ffa9dbdc09..67ba7b7687 100644 --- a/templates/cards/blocks/note.html.twig +++ b/templates/cards/blocks/note.html.twig @@ -1,6 +1,6 @@ {% block note_actions %} {% if app.user or note_actions_hide is defined %} - +
  • @@ -15,7 +15,6 @@
  • - {% for current_action in get_note_actions(note) %}
  • {% endfor %} @@ -27,14 +26,16 @@ {% import '/cards/macros/note.html.twig' as noteView %} {% if replies is defined and replies is not empty %} -
    - {{ 'Replies to ' | trans }}{{ nickname }}{{ '\'s note' | trans }} - {% for conversation in replies %} - {{ noteView.note_vanilla(conversation['note'], conversation['replies']) }} -
    - {% endfor %} -
    +
    +
    {{ 'Replies to ' | trans }}{{ nickname }}{{ '\'s note' | trans }}
    +
    + {% for conversation in replies %} + {{ noteView.note_vanilla(conversation['note'], conversation['replies']) }} +
    + {% endfor %} +
    +
    {% endif %} {% endblock note_replies %} diff --git a/templates/cards/macros/note.html.twig b/templates/cards/macros/note.html.twig index 3d85597570..65491f925d 100644 --- a/templates/cards/macros/note.html.twig +++ b/templates/cards/macros/note.html.twig @@ -10,10 +10,10 @@
    {{ block('note_sidebar', 'cards/blocks/note.html.twig') }} +
    {{ block('note_info', 'cards/blocks/note.html.twig') }} - {{ block('note_actions', 'cards/blocks/note.html.twig') }}
    - - {{ block('note_replies', 'cards/blocks/note.html.twig') }} {{ block('note_complementary_info', 'cards/blocks/note.html.twig') }} + {{ block('note_actions', 'cards/blocks/note.html.twig') }}
    + + {{ block('note_replies', 'cards/blocks/note.html.twig') }} {% endmacro note_vanilla %} {% macro note_compact(note) %}