annotate sat_templates/templates/bulma/list/item.html @ 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
parents c5609be6c34e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
298
1c330913ff13 bulma (tickets): renamed "tickets" to "lists"
Goffi <goffi@goffi.org>
parents: 247
diff changeset
1 {# display a single list item
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
2
298
1c330913ff13 bulma (tickets): renamed "tickets" to "lists"
Goffi <goffi@goffi.org>
parents: 247
diff changeset
3 @variable item(xmlui_item): list item to display
1c330913ff13 bulma (tickets): renamed "tickets" to "lists"
Goffi <goffi@goffi.org>
parents: 247
diff changeset
4 @variable comments(data_object.BlogItems): comments of the list item
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
5 @variable comments_service(unicode): service for adding comments
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
6 @variable comments_node(unicode): node for adding comments
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
7 #}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
8
298
1c330913ff13 bulma (tickets): renamed "tickets" to "lists"
Goffi <goffi@goffi.org>
parents: 247
diff changeset
9 {% set category_menu = [('list', url_list_items),
1c330913ff13 bulma (tickets): renamed "tickets" to "lists"
Goffi <goffi@goffi.org>
parents: 247
diff changeset
10 ('list_item_new', url_list_new),
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
11 ] %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
12 {% if not embedded %}{% extends 'base/base.html' %}{% endif %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
13 {% import 'input/xmlui.html' as xmlui with context %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
14 {% import 'components/avatar.html' as avatar with context %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
15 {% import 'blog/macros.html' as blog with context %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
16 {% import 'input/textbox.html' as textbox with context %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
17
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
18 {% block title %}{{item|adv_format('#{value.widget_value.id} {value.widget_value.title}') }}{% endblock %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
19
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
20 {% block confirm_message %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
21 {% trans %}Your comment has been sent{% endtrans %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
22 {% endblock confirm_message %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
23
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
24 {% block body %}
303
877f01720036 bulma (lists): creation, invitations, item deletion:
Goffi <goffi@goffi.org>
parents: 298
diff changeset
25 {{ icon_defs('pencil', 'trash-empty') }}
246
1928ba66c194 bulma: replaced custom styles by new spacing helpers
Goffi <goffi@goffi.org>
parents: 230
diff changeset
26 <div class="columns mt-4">
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
27 <div class="column has-background-white">
246
1928ba66c194 bulma: replaced custom styles by new spacing helpers
Goffi <goffi@goffi.org>
parents: 230
diff changeset
28 <div id="{{ item.widget_value['id'] }}" class="media px-1 py-1">
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
29 {% if identities is defined %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
30 {% if avatar is defined %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
31 <figure class="media-left">
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
32 {{ avatar.avatar(item.widget_value['publisher'].bare) }}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
33 </figure>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
34 {% endif %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
35 {% endif %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
36 <div class="media-content">
340
0e388a8288ae (bulma) list/item: set XMLUI classes on content
Goffi <goffi@goffi.org>
parents: 303
diff changeset
37 <div class="content {{item|xmlui_class(["status", "priority", "severity"])}}">
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
38 <h4 class="title is-4">{{item.widget_value['title']}}</h1>
373
c5609be6c34e bulma (list/item): add `safe` to "body" which is a cleaned xhtml value
Goffi <goffi@goffi.org>
parents: 340
diff changeset
39 {{ item.widget_value['body']|safe }}
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
40
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
41 </div>
303
877f01720036 bulma (lists): creation, invitations, item deletion:
Goffi <goffi@goffi.org>
parents: 298
diff changeset
42 <nav class="level">
877f01720036 bulma (lists): creation, invitations, item deletion:
Goffi <goffi@goffi.org>
parents: 298
diff changeset
43 <div class="level-left">
877f01720036 bulma (lists): creation, invitations, item deletion:
Goffi <goffi@goffi.org>
parents: 298
diff changeset
44 {% if can_modify %}
877f01720036 bulma (lists): creation, invitations, item deletion:
Goffi <goffi@goffi.org>
parents: 298
diff changeset
45 <div class="level-item is-size-7 x-is-hoverable-primary action_delete">
877f01720036 bulma (lists): creation, invitations, item deletion:
Goffi <goffi@goffi.org>
parents: 298
diff changeset
46 {{ icon('trash-empty', cls='icon is-small') }}
877f01720036 bulma (lists): creation, invitations, item deletion:
Goffi <goffi@goffi.org>
parents: 298
diff changeset
47 </div>
877f01720036 bulma (lists): creation, invitations, item deletion:
Goffi <goffi@goffi.org>
parents: 298
diff changeset
48 {% endif %}
877f01720036 bulma (lists): creation, invitations, item deletion:
Goffi <goffi@goffi.org>
parents: 298
diff changeset
49 </div>
877f01720036 bulma (lists): creation, invitations, item deletion:
Goffi <goffi@goffi.org>
parents: 298
diff changeset
50 </nav>
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
51 {% if comments is defined %}
247
40fccd3b7cf0 updated code to handle blog items following data structure change in backend/Libervia
Goffi <goffi@goffi.org>
parents: 246
diff changeset
52 {{ blog.show_items(comments['items']|reverse, expanded=true) }}
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
53 {% endif %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
54 {% if comments_node is defined %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
55 <div class="comment_post">
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
56 {{- textbox.comment_or_login(service=comments_service, node=comments_node) -}}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
57 </div>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
58 {% endif %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
59 </div>
303
877f01720036 bulma (lists): creation, invitations, item deletion:
Goffi <goffi@goffi.org>
parents: 298
diff changeset
60 {% if can_modify %}
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
61 <div class="media-right">
298
1c330913ff13 bulma (tickets): renamed "tickets" to "lists"
Goffi <goffi@goffi.org>
parents: 247
diff changeset
62 <a href="{{url_list_item_edit}}">
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
63 {{ icon('pencil', cls='icon is-64x64') }}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
64 </a>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
65 </div>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
66 {% endif %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
67 </div>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
68 </div>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
69 <div class="column is-one-quarter has-background-light">
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
70 {{
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
71 xmlui.generate(
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
72 item,
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
73 form=false,
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
74 filters={
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
75 'created': {
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
76 'filters': ['date_fmt'],
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
77 'filters_args':[{'fmt': 'short'}]
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
78 },
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
79 'updated': {
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
80 'filters': ['date_fmt'],
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
81 'filters_args':[{'fmt': 'short'}]
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
82 },
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
83 },
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
84 ignore=['publisher', 'title', 'body', 'comments_uri'],
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
85 )
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
86 }}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
87 </div>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
88 </div>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
89 {% endblock body %}