Mercurial > libervia-templates
annotate sat_templates/templates/bulma/chat/message.html @ 405:5016fb0ff62f default tip
Blog redesign: work in progress redesign of the blog.
Some templates have been moved from chat to components to be re-used in other features,
like blog here.
Blog follows same global design as chat with a left panel to search/open blogs.
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 21 May 2025 15:41:00 +0200 |
parents | 66f98ee041d8 |
children |
rev | line source |
---|---|
230 | 1 {% import 'components/avatar.html' as avatar with context %} |
2 | |
386
e63fb06052ae
bulma: message edition + extra menu + improvments:
Goffi <goffi@goffi.org>
parents:
385
diff
changeset
|
3 {% if chat_type == "group" %} |
389
2eaea9a9c234
bulma (chat/message): fix setting of `own_mess` class.
Goffi <goffi@goffi.org>
parents:
387
diff
changeset
|
4 {% set own_msg = msg.from_==own_local_jid %} |
386
e63fb06052ae
bulma: message edition + extra menu + improvments:
Goffi <goffi@goffi.org>
parents:
385
diff
changeset
|
5 {% else %} |
389
2eaea9a9c234
bulma (chat/message): fix setting of `own_mess` class.
Goffi <goffi@goffi.org>
parents:
387
diff
changeset
|
6 {% set own_msg = msg.from_|bare_jid==own_local_jid|bare_jid %} |
386
e63fb06052ae
bulma: message edition + extra menu + improvments:
Goffi <goffi@goffi.org>
parents:
385
diff
changeset
|
7 {% endif %} |
e63fb06052ae
bulma: message edition + extra menu + improvments:
Goffi <goffi@goffi.org>
parents:
385
diff
changeset
|
8 |
e63fb06052ae
bulma: message edition + extra menu + improvments:
Goffi <goffi@goffi.org>
parents:
385
diff
changeset
|
9 <div |
e63fb06052ae
bulma: message edition + extra menu + improvments:
Goffi <goffi@goffi.org>
parents:
385
diff
changeset
|
10 id="{{msg.id}}" |
403 | 11 class="media chat-message msg_{{msg.type}} {{'own_msg' if own_msg}} {{ 'is-retracted' if msg.extra.retracted }}" |
387
8b990c78d4b5
(bulma/chat): add menu + style for message retraction
Goffi <goffi@goffi.org>
parents:
386
diff
changeset
|
12 aria-label="{{ 'Retracted Message' if msg.extra.retracted else 'Chat Message' }}" |
404 | 13 data-from='{{msg.from_}}' |
386
e63fb06052ae
bulma: message edition + extra menu + improvments:
Goffi <goffi@goffi.org>
parents:
385
diff
changeset
|
14 {% if msg.extra.editions %}data-editions='{{msg.extra.editions|tojson}}'{% endif %} |
404 | 15 {% if msg.extra.thread %}data-thread='{{msg.extra.thread}}'{% endif %} |
386
e63fb06052ae
bulma: message edition + extra menu + improvments:
Goffi <goffi@goffi.org>
parents:
385
diff
changeset
|
16 > |
385
941e4006ab6e
bulma (message): reactions + fixes:
Goffi <goffi@goffi.org>
parents:
371
diff
changeset
|
17 {%- if msg.type != "info" %} |
230 | 18 {%- set author = identities[msg.from_].nicknames[0] | default(msg.from_) -%} |
403 | 19 <figure class="media-left"> |
20 {{ avatar.avatar(msg.from_) }} | |
230 | 21 </figure> |
22 {% endif -%} | |
362
b2b859a62e70
bulma (chat): new templates and CSS for chat page.
Goffi <goffi@goffi.org>
parents:
235
diff
changeset
|
23 <div class="media-content is-relative"> |
385
941e4006ab6e
bulma (message): reactions + fixes:
Goffi <goffi@goffi.org>
parents:
371
diff
changeset
|
24 {%- if msg.type != "info" %} |
403 | 25 |
26 <div> | |
27 | |
28 <span class="author" id="msg_author_{{msg.id}}">{{author}}</span> | |
29 <span class="date" id="msg_date_{{msg.id}}">{{(msg.extra.updated or msg.timestamp)|date_fmt('short', tz_name=tz_name)}}</span> | |
30 <span id="status_icons_{{msg.id}}" class="status-icons level-item has-padding-left"> | |
404 | 31 {% if msg.reply_to or msg.extra.thread %} |
32 {{ icon('comment-dots', cls='icon is-small message-thread') }} | |
33 {% endif %} | |
403 | 34 {% if msg.extra.editions %} |
35 {{ icon('pencil', cls='icon is-small message-editions') }} | |
36 {% endif %} | |
37 {% if msg.encrypted %} | |
38 {{ icon('lock-filled', cls='icon is-small has-text-success') }} | |
39 {% else %} | |
40 {{ icon('lock-open', cls='icon is-small has-text-danger') }} | |
41 {% endif %} | |
42 {% if msg.received %} | |
43 {{ icon('ok', cls='icon is-small has-text-link') }} | |
44 {% endif %} | |
45 {% if msg.edited %} | |
46 {{ icon('pencil', cls='icon is-small has-text-info') }} | |
47 {% endif %} | |
48 </span> | |
49 </div> | |
50 | |
51 {% endif -%} | |
52 <div class="message-core"> | |
53 <p class="message-body {{ "has-text-info" if msg.type=="info" or msg.extra.retracted }} m-0" id="message-body_{{msg.id}}"> | |
54 {%- if msg.extra.retracted %} | |
55 {% trans %}This message has been retracted.{% endtrans %} | |
56 {% else %} | |
57 {{- msg.html or (msg.text|e|urlize|safe) -}} | |
58 {% endif -%} | |
59 </p> | |
60 | |
61 <div class="url-previews is-hidden"> | |
62 <div class="icon-container"></div> | |
63 </div> | |
64 | |
65 <div | |
66 id="actions_{{msg.id}}" | |
67 class="level message-actions mb-0 mt-1 {{ "is-hidden" if msg.extra.retracted }}" | |
68 > | |
69 <div class="level-left"></div> | |
70 <div class="level-right"> | |
71 {# {{ icon('share-nodes', cls='icon is-small action-button', id='msg_share_' + msg.id) }} #} | |
404 | 72 {{ icon('reply', cls='icon is-small action-button reply-button')}} |
73 {{ icon('regular face-smile', cls='icon is-small action-button reaction-button') }} | |
74 {{ icon('ellipsis', cls='icon is-small action-button extra-button') }} | |
230 | 75 </div> |
403 | 76 </div> |
364
095bd5b34080
chat: add templates for URL previews
Goffi <goffi@goffi.org>
parents:
363
diff
changeset
|
77 |
403 | 78 <div id="msg_reactions_{{msg.id}}"> |
79 {% if msg.extra.reactions is defined %} | |
80 {% set reactions = msg.extra.get("reactions") %} | |
405
5016fb0ff62f
Blog redesign: work in progress redesign of the blog.
Goffi <goffi@goffi.org>
parents:
404
diff
changeset
|
81 {% include 'components/reactions.html' %} |
403 | 82 {% endif %} |
83 </div> | |
362
b2b859a62e70
bulma (chat): new templates and CSS for chat page.
Goffi <goffi@goffi.org>
parents:
235
diff
changeset
|
84 </div> |
b2b859a62e70
bulma (chat): new templates and CSS for chat page.
Goffi <goffi@goffi.org>
parents:
235
diff
changeset
|
85 {% if msg.attachments %} |
b2b859a62e70
bulma (chat): new templates and CSS for chat page.
Goffi <goffi@goffi.org>
parents:
235
diff
changeset
|
86 <div class="message-attachments pt-2"> |
b2b859a62e70
bulma (chat): new templates and CSS for chat page.
Goffi <goffi@goffi.org>
parents:
235
diff
changeset
|
87 {%- for attachment in msg.attachments %} |
b2b859a62e70
bulma (chat): new templates and CSS for chat page.
Goffi <goffi@goffi.org>
parents:
235
diff
changeset
|
88 <figure class="image message-attachment"> |
385
941e4006ab6e
bulma (message): reactions + fixes:
Goffi <goffi@goffi.org>
parents:
371
diff
changeset
|
89 {%- if not attachment.url -%} |
941e4006ab6e
bulma (message): reactions + fixes:
Goffi <goffi@goffi.org>
parents:
371
diff
changeset
|
90 <div class="notification is-warning"> |
941e4006ab6e
bulma (message): reactions + fixes:
Goffi <goffi@goffi.org>
parents:
371
diff
changeset
|
91 <div class="is-size-6 has-text-weight-semibold mb-1"> |
941e4006ab6e
bulma (message): reactions + fixes:
Goffi <goffi@goffi.org>
parents:
371
diff
changeset
|
92 {% trans name=attachment.name %}Attachment: {{name}}{% endtrans %} |
941e4006ab6e
bulma (message): reactions + fixes:
Goffi <goffi@goffi.org>
parents:
371
diff
changeset
|
93 </div> |
941e4006ab6e
bulma (message): reactions + fixes:
Goffi <goffi@goffi.org>
parents:
371
diff
changeset
|
94 |
941e4006ab6e
bulma (message): reactions + fixes:
Goffi <goffi@goffi.org>
parents:
371
diff
changeset
|
95 <div class="is-size-7 mb-1"> |
941e4006ab6e
bulma (message): reactions + fixes:
Goffi <goffi@goffi.org>
parents:
371
diff
changeset
|
96 {% trans %}Cannot be opened as there are no sources available.{% endtrans %} |
941e4006ab6e
bulma (message): reactions + fixes:
Goffi <goffi@goffi.org>
parents:
371
diff
changeset
|
97 </div> |
941e4006ab6e
bulma (message): reactions + fixes:
Goffi <goffi@goffi.org>
parents:
371
diff
changeset
|
98 |
941e4006ab6e
bulma (message): reactions + fixes:
Goffi <goffi@goffi.org>
parents:
371
diff
changeset
|
99 </div> |
941e4006ab6e
bulma (message): reactions + fixes:
Goffi <goffi@goffi.org>
parents:
371
diff
changeset
|
100 {%- else -%} |
941e4006ab6e
bulma (message): reactions + fixes:
Goffi <goffi@goffi.org>
parents:
371
diff
changeset
|
101 {%- if attachment.media_type|media_type_main == 'image' %} |
941e4006ab6e
bulma (message): reactions + fixes:
Goffi <goffi@goffi.org>
parents:
371
diff
changeset
|
102 <img src="{{attachment.url}}" alt="{{attachment.name}}"> |
941e4006ab6e
bulma (message): reactions + fixes:
Goffi <goffi@goffi.org>
parents:
371
diff
changeset
|
103 {%- else %} |
941e4006ab6e
bulma (message): reactions + fixes:
Goffi <goffi@goffi.org>
parents:
371
diff
changeset
|
104 {{ icon('doc', cls='icon') }} |
941e4006ab6e
bulma (message): reactions + fixes:
Goffi <goffi@goffi.org>
parents:
371
diff
changeset
|
105 {%- endif %} |
941e4006ab6e
bulma (message): reactions + fixes:
Goffi <goffi@goffi.org>
parents:
371
diff
changeset
|
106 <figcaption class="has-text-centered is-size-7"> |
941e4006ab6e
bulma (message): reactions + fixes:
Goffi <goffi@goffi.org>
parents:
371
diff
changeset
|
107 <a href="{{attachment.url}}" target="_blank" class="has-text-grey">{{attachment.name}}</a> |
941e4006ab6e
bulma (message): reactions + fixes:
Goffi <goffi@goffi.org>
parents:
371
diff
changeset
|
108 </figcaption> |
941e4006ab6e
bulma (message): reactions + fixes:
Goffi <goffi@goffi.org>
parents:
371
diff
changeset
|
109 {%- endif -%} |
362
b2b859a62e70
bulma (chat): new templates and CSS for chat page.
Goffi <goffi@goffi.org>
parents:
235
diff
changeset
|
110 </figure> |
b2b859a62e70
bulma (chat): new templates and CSS for chat page.
Goffi <goffi@goffi.org>
parents:
235
diff
changeset
|
111 {%- endfor %} |
b2b859a62e70
bulma (chat): new templates and CSS for chat page.
Goffi <goffi@goffi.org>
parents:
235
diff
changeset
|
112 </div> |
b2b859a62e70
bulma (chat): new templates and CSS for chat page.
Goffi <goffi@goffi.org>
parents:
235
diff
changeset
|
113 {% endif %} |
230 | 114 </div> |
115 </div> |