Mercurial > libervia-templates
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 |
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 | 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 | 5 @variable comments_service(unicode): service for adding comments |
6 @variable comments_node(unicode): node for adding comments | |
7 #} | |
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 | 11 ] %} |
12 {% if not embedded %}{% extends 'base/base.html' %}{% endif %} | |
13 {% import 'input/xmlui.html' as xmlui with context %} | |
14 {% import 'components/avatar.html' as avatar with context %} | |
15 {% import 'blog/macros.html' as blog with context %} | |
16 {% import 'input/textbox.html' as textbox with context %} | |
17 | |
18 {% block title %}{{item|adv_format('#{value.widget_value.id} {value.widget_value.title}') }}{% endblock %} | |
19 | |
20 {% block confirm_message %} | |
21 {% trans %}Your comment has been sent{% endtrans %} | |
22 {% endblock confirm_message %} | |
23 | |
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 | 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 | 29 {% if identities is defined %} |
30 {% if avatar is defined %} | |
31 <figure class="media-left"> | |
32 {{ avatar.avatar(item.widget_value['publisher'].bare) }} | |
33 </figure> | |
34 {% endif %} | |
35 {% endif %} | |
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 | 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 | 40 |
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 | 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 | 53 {% endif %} |
54 {% if comments_node is defined %} | |
55 <div class="comment_post"> | |
56 {{- textbox.comment_or_login(service=comments_service, node=comments_node) -}} | |
57 </div> | |
58 {% endif %} | |
59 </div> | |
303
877f01720036
bulma (lists): creation, invitations, item deletion:
Goffi <goffi@goffi.org>
parents:
298
diff
changeset
|
60 {% if can_modify %} |
230 | 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 | 63 {{ icon('pencil', cls='icon is-64x64') }} |
64 </a> | |
65 </div> | |
66 {% endif %} | |
67 </div> | |
68 </div> | |
69 <div class="column is-one-quarter has-background-light"> | |
70 {{ | |
71 xmlui.generate( | |
72 item, | |
73 form=false, | |
74 filters={ | |
75 'created': { | |
76 'filters': ['date_fmt'], | |
77 'filters_args':[{'fmt': 'short'}] | |
78 }, | |
79 'updated': { | |
80 'filters': ['date_fmt'], | |
81 'filters_args':[{'fmt': 'short'}] | |
82 }, | |
83 }, | |
84 ignore=['publisher', 'title', 'body', 'comments_uri'], | |
85 ) | |
86 }} | |
87 </div> | |
88 </div> | |
89 {% endblock body %} |