diff sat_templates/templates/bulma/chat/message.html @ 230:0e69b5843c2f

theme: bulma theme first draft: This theme uses the Bulma CSS framework, Brython to handle the menu on touch devices, and Sass to customize Bulma. CSS default fallbacks are disabled as Bulma uses its own naming conventions, and default fallbacks would lead to hard to debug conflicts. `common.js` has been slightly improved to handle custom classed in `tab_select` The theme is not complete yet, but it is functional.
author Goffi <goffi@goffi.org>
date Tue, 19 May 2020 00:02:34 +0200
parents
children f5f428a50c10
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sat_templates/templates/bulma/chat/message.html	Tue May 19 00:02:34 2020 +0200
@@ -0,0 +1,31 @@
+{% import 'components/avatar.html' as avatar with context %}
+
+<div id="{{msg.id}}" class="media is-chat-message msg_{{msg.type}} {{'own_msg' if msg.from_ == own_jid.full()}}">
+    {%- if msg.type != C.MESS_TYPE_INFO %}
+        {%- set author = identities[msg.from_].nicknames[0] | default(msg.from_) -%}
+        <figure class="media-left">
+            {{ avatar.avatar(msg.from_, "is-32x32") }}
+        </figure>
+    {% endif -%}
+    <div class="media-content">
+        <div class="content">
+            {%- if msg.type != C.MESS_TYPE_INFO %}
+                <nav class="level is-mobile is-marginless is-size-7">
+                    <div class="level-left has-text-weight-bold">
+                        <div class="level-item">
+                            <span class="author">{{author}}</span>
+                        </div>
+                    </div>
+                    <div class="level-right is-italic">
+                        <div class="level-item">
+                            <span class="date">{{msg.timestamp|date_fmt('auto_day')}}</span>
+                        </div>
+                    </div>
+                </nav>
+            {% endif -%}
+            <p class="msg_body">
+            {{- msg.html or (msg.text|urlize(nofollow=true, target="_blank")) -}}
+            </p>
+        </div>
+    </div>
+</div>