Mercurial > libervia-templates
comparison sat_templates/templates/bulma/chat/message.html @ 386:e63fb06052ae
bulma: message edition + extra menu + improvments:
- add an extra menu template with `Edit` and `Quote`
- add a template for previous editions popup
- fix `own_msg` class application
- add CSS for edit mode
- cosmetic changes
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 28 Nov 2023 17:48:00 +0100 |
parents | 941e4006ab6e |
children | 8b990c78d4b5 |
comparison
equal
deleted
inserted
replaced
385:941e4006ab6e | 386:e63fb06052ae |
---|---|
1 {% import 'components/avatar.html' as avatar with context %} | 1 {% import 'components/avatar.html' as avatar with context %} |
2 | 2 |
3 <div id="{{msg.id}}" class="media is-chat-message msg_{{msg.type}} {{'own_msg' if msg.from_ == own_jid}}" style="padding: 0.5em;" role="listitem" aria-label="Chat Message"> | 3 {% if chat_type == "group" %} |
4 {% set own_msg = msg.from_==own_jid %} | |
5 {% else %} | |
6 {% set own_msg = msg.from_|bare_jid==own_jid|bare_jid %} | |
7 {% endif %} | |
8 | |
9 <div | |
10 id="{{msg.id}}" | |
11 class="media is-chat-message msg_{{msg.type}} {{'own_msg' if own_msg}}" | |
12 style="padding: 0.5em;" | |
13 role="listitem" | |
14 aria-label="Chat Message" | |
15 {% if msg.extra.editions %}data-editions='{{msg.extra.editions|tojson}}'{% endif %} | |
16 > | |
4 {%- if msg.type != "info" %} | 17 {%- if msg.type != "info" %} |
5 {%- set author = identities[msg.from_].nicknames[0] | default(msg.from_) -%} | 18 {%- set author = identities[msg.from_].nicknames[0] | default(msg.from_) -%} |
6 <figure class="media-left pt-1"> | 19 <figure class="media-left pt-1"> |
7 {{ avatar.avatar(msg.from_, "is-32x32") }} | 20 {{ avatar.avatar(msg.from_, "is-32x32") }} |
8 </figure> | 21 </figure> |
9 {% endif -%} | 22 {% endif -%} |
10 <div class="media-content is-relative"> | 23 <div class="media-content is-relative"> |
11 <div class="content"> | 24 <div class="content"> |
12 {%- if msg.type != "info" %} | 25 {%- if msg.type != "info" %} |
13 <nav class="level is-mobile is-marginless is-size-7"> | 26 <nav class="level is-mobile is-marginless is-size-7 is-not-selectable"> |
14 <div class="level-left has-text-weight-bold"> | 27 <div class="level-left has-text-weight-bold"> |
15 <div class="level-item"> | 28 <div class="level-item"> |
16 <span class="author" id="msg_author_{{msg.id}}">{{author}}</span> | 29 <span class="author" id="msg_author_{{msg.id}}">{{author}}</span> |
17 </div> | 30 </div> |
18 </div> | 31 </div> |
19 <div class="level-right is-italic"> | 32 <div class="level-right is-italic"> |
20 <div class="level-item"> | 33 <div class="level-item"> |
21 <span class="date" id="msg_date_{{msg.id}}">{{msg.timestamp|date_fmt('auto_day')}}</span> | 34 <span class="date" id="msg_date_{{msg.id}}">{{(msg.extra.updated or msg.timestamp)|date_fmt('short', tz_name=tz_name)}}</span> |
22 <div id="status_icons_{{msg.id}}" class="status-icons level-item has-padding-left"> | 35 <div id="status_icons_{{msg.id}}" class="status-icons level-item has-padding-left"> |
36 {% if msg.extra.editions %} | |
37 {{ icon('pencil', cls='icon is-small message-editions') }} | |
38 {% endif %} | |
23 {% if msg.encrypted %} | 39 {% if msg.encrypted %} |
24 {{ icon('lock-filled', cls='icon is-small has-text-success') }} | 40 {{ icon('lock-filled', cls='icon is-small has-text-success') }} |
25 {% else %} | 41 {% else %} |
26 {{ icon('lock-open', cls='icon is-small has-text-danger') }} | 42 {{ icon('lock-open', cls='icon is-small has-text-danger') }} |
27 {% endif %} | 43 {% endif %} |