changeset 390:38635d393089

bulma (chat/reactions): use a special style for reactions made by the user.
author Goffi <goffi@goffi.org>
date Wed, 13 Dec 2023 22:01:46 +0100 (12 months ago)
parents 2eaea9a9c234
children cb3e75c7c999
files sat_templates/templates/bulma/chat/reactions.html sat_templates/templates/bulma/static/styles.css
diffstat 2 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/sat_templates/templates/bulma/chat/reactions.html	Wed Dec 13 22:01:20 2023 +0100
+++ b/sat_templates/templates/bulma/chat/reactions.html	Wed Dec 13 22:01:46 2023 +0100
@@ -1,7 +1,15 @@
 <div class="reactions-container is-flex-wrap-wrap">
+
+    {% if chat_type == "group" %}
+        {% set local_jid = own_local_jid %}
+    {% else %}
+        {% set local_jid = own_local_jid|bare_jid %}
+    {% endif %}
+
     {% for emoji, jids in reactions.items() %}
+        {% set own_reaction = local_jid in jids %}
         <div
-                class="reaction box is-shadowless is-inline-flex is-align-items-center my-1 ml-0 mr-2 px-2 py-1 is-size-6 has-background-light has-border is-not-selectable"
+                class="reaction box is-shadowless is-inline-flex is-align-items-center my-1 ml-0 mr-2 px-2 py-1 is-size-6 has-background-light has-border is-not-selectable {{ 'own-reaction' if own_reaction }}"
                 data-jids='{{jids|tojson}}'
                 >
             <span class="emoji has-text-weight-semibold">{{ emoji }}</span>
--- a/sat_templates/templates/bulma/static/styles.css	Wed Dec 13 22:01:20 2023 +0100
+++ b/sat_templates/templates/bulma/static/styles.css	Wed Dec 13 22:01:46 2023 +0100
@@ -642,6 +642,10 @@
     margin-right: .5rem; /* Space between emoji and counter using rem unit */
 }
 
+.own-reaction {
+    border-color: #3273dc;
+}
+
 /**************
  * animations *
  *************/