changeset 407:f45c311710b1 default tip

chat (message): Add origin of the message: A tag is used to show origin of the message below header. A "bot" tag is also added is the sender identifies itself as a bot. rel 459
author Goffi <goffi@goffi.org>
date Sun, 08 Jun 2025 17:31:38 +0200
parents 049a0638f6fa
children
files sat_templates/templates/bulma/chat/message.html
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/sat_templates/templates/bulma/chat/message.html	Fri Jun 06 10:50:35 2025 +0200
+++ b/sat_templates/templates/bulma/chat/message.html	Sun Jun 08 17:31:38 2025 +0200
@@ -48,6 +48,20 @@
                     </span>
                 </div>
 
+               {% if msg.extra.origin or msg.extra.get("is-bot") %}
+                   <div class="tags mb-0 pb-1">
+                       {% if msg.extra.origin == "smtp" %}
+
+                           <span data-type="{{msg.extra.origin}}" class="message-origin tag is-hoverable is-light">🖂 {% trans %}email{% endtrans %}</span>
+                       {% else %}
+                           <span class="message-origin tag is-hoverable is-light">{{msg.extra.origin}}</span>
+                       {% endif %}
+                       {% if msg.extra.get("is-bot") %}
+                           <span data-type="{{msg.extra.origin}}" class="tag is-light">🤖 bot</span>
+                       {% endif %}
+                   </div>
+               {% endif %}
+
             {% endif -%}
             <div class="message-core">
                 <p class="message-body {{ "has-text-info" if msg.type=="info" or msg.extra.retracted }} m-0" id="message-body_{{msg.id}}">