Mercurial > libervia-templates
annotate sat_templates/templates/bulma/base/base.html @ 404:66f98ee041d8 default tip
chat: add UI for replies/threads:
rel 457
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 06 May 2025 00:37:41 +0200 |
parents | 65c53ec5e777 |
children |
rev | line source |
---|---|
312
6411615771b6
bulma (base): menu can now be fixed on top with `menu_fixed_top` bool variable
Goffi <goffi@goffi.org>
parents:
311
diff
changeset
|
1 {# base template managing common layout, blocks, links or scripts |
6411615771b6
bulma (base): menu can now be fixed on top with `menu_fixed_top` bool variable
Goffi <goffi@goffi.org>
parents:
311
diff
changeset
|
2 |
6411615771b6
bulma (base): menu can now be fixed on top with `menu_fixed_top` bool variable
Goffi <goffi@goffi.org>
parents:
311
diff
changeset
|
3 except for special pages, this template should always be extended. |
6411615771b6
bulma (base): menu can now be fixed on top with `menu_fixed_top` bool variable
Goffi <goffi@goffi.org>
parents:
311
diff
changeset
|
4 |
6411615771b6
bulma (base): menu can now be fixed on top with `menu_fixed_top` bool variable
Goffi <goffi@goffi.org>
parents:
311
diff
changeset
|
5 @variable menu_fixed_top(bool): if true, the menu will always stay on top, and padding will be added to body accordingly. |
6411615771b6
bulma (base): menu can now be fixed on top with `menu_fixed_top` bool variable
Goffi <goffi@goffi.org>
parents:
311
diff
changeset
|
6 #} |
6411615771b6
bulma (base): menu can now be fixed on top with `menu_fixed_top` bool variable
Goffi <goffi@goffi.org>
parents:
311
diff
changeset
|
7 |
6411615771b6
bulma (base): menu can now be fixed on top with `menu_fixed_top` bool variable
Goffi <goffi@goffi.org>
parents:
311
diff
changeset
|
8 |
6411615771b6
bulma (base): menu can now be fixed on top with `menu_fixed_top` bool variable
Goffi <goffi@goffi.org>
parents:
311
diff
changeset
|
9 {# embedded is set to avoid including base.html several times if a generic page is included (e.g. blog/articles.html) #} |
230 | 10 {% set embedded = True %} |
11 {% import 'components/common.html' as component with context %} | |
12 {{ script.include('common', '') }} {# common.js is, as its name states, a common script, so it's useful to import it here #} | |
13 <!DOCTYPE html> | |
14 <html> | |
15 <head> | |
16 <meta charset="utf-8"> | |
17 <meta name="viewport" content="width=device-width, initial-scale=1"> | |
18 {# using SVG directly doesn't always play well with Bulma, so we also use the icon font #} | |
402
2bbcb7da56bc
bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents:
401
diff
changeset
|
19 <link rel='stylesheet' type="text/css" href='{{build_path}}node_modules/@fortawesome/fontawesome-free/css/all.min.css'> |
2bbcb7da56bc
bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents:
401
diff
changeset
|
20 <link rel='stylesheet' type="text/css" href='{{build_path}}node_modules/bulma/css/bulma.min.css'> |
230 | 21 |
22 {% if norobots %} | |
23 <meta name="robots" content="noindex, nofollow"> | |
24 {% endif %} | |
25 | |
26 <title>{% block title %}{{C.APP_NAME}}{% endblock %}</title> | |
27 | |
28 {% if css_content is defined %} | |
29 <style type="text/css"> | |
30 {{css_content}} | |
31 </style> | |
32 {% if css_content_noscript is defined %} | |
33 <noscript> | |
34 <style type="text/css"> | |
35 {{css_content_noscript}} | |
36 </style> | |
37 </noscript> | |
38 {% endif %} | |
39 {% else %} | |
40 {% for css_file in css_files %} | |
41 <link rel='stylesheet' type="text/css" href='{{css_file}}'> | |
42 {% endfor %} | |
43 {% if css_files_noscript %} | |
44 <noscript> | |
45 {% for css_file in css_files_noscript %} | |
46 <link rel='stylesheet' type="text/css" href='{{css_file}}'> | |
47 {% endfor %} | |
48 </noscript> | |
49 {% endif %} | |
50 {% endif %} | |
51 | |
52 {% if links is defined %} | |
53 {% for link_data in links %} | |
54 <link{{link_data|xmlattr}}> | |
55 {% endfor %} | |
56 {% endif %} | |
57 | |
58 {% if xmpp_uri is defined %} | |
59 <link rel="alternate" type="application/atom+xml" href="{{xmpp_uri}}" > | |
60 {% endif %} | |
61 | |
62 {% if dynamic_style is defined %} | |
63 {# be extra careful about dynamic style, insure escaping if you use untrusted values ! #} | |
64 <style type="text/css"> | |
65 {{dynamic_style}} | |
66 </style> | |
67 {% endif %} | |
68 | |
237
caa3767707fb
base/base.html: expose CSRF token to script + fixed script content
Goffi <goffi@goffi.org>
parents:
230
diff
changeset
|
69 {% if csrf_token is defined %} |
267
5a1d7c2d965a
bulma (base/base.html): expose `session_uuid` to scripts
Goffi <goffi@goffi.org>
parents:
244
diff
changeset
|
70 <script>var csrf_token = "{{csrf_token}}"; var session_uuid="{{session_uuid}}";</script> |
237
caa3767707fb
base/base.html: expose CSRF token to script + fixed script content
Goffi <goffi@goffi.org>
parents:
230
diff
changeset
|
71 {% endif %} |
caa3767707fb
base/base.html: expose CSRF token to script + fixed script content
Goffi <goffi@goffi.org>
parents:
230
diff
changeset
|
72 |
329 | 73 {% if websocket is defined %} |
355 | 74 <script>var ws_url = "{{websocket.url}}"; var ws_token="{{websocket.token}}"; var ws_debug={{websocket.debug}};</script> |
329 | 75 {% endif %} |
76 | |
230 | 77 {{ script.generate_scripts() }} |
78 | |
79 {% for script in scripts %} | |
237
caa3767707fb
base/base.html: expose CSRF token to script + fixed script content
Goffi <goffi@goffi.org>
parents:
230
diff
changeset
|
80 <script{{ {'src': script.src, 'type': script.type} | xmlattr }}>{{script.content|safe}}</script> |
230 | 81 {% endfor %} |
82 | |
83 {% block favicon %} | |
84 <link rel="icon" href="{{media_path}}icons/apps/64/sat.png"> | |
85 {% endblock favicon %} | |
86 </head> | |
312
6411615771b6
bulma (base): menu can now be fixed on top with `menu_fixed_top` bool variable
Goffi <goffi@goffi.org>
parents:
311
diff
changeset
|
87 <body{{ {'onload': body_onload} | xmlattr }} class="{{' body--fullscreen' if full_screen_body}}{{' has-navbar-fixed-top' if menu_fixed_top}}"> |
230 | 88 {% if atom_url is defined %} |
89 {{ icon_defs('feed') }} | |
90 {% endif %} | |
295 | 91 {% if loading_screen %} |
92 <div id="loading_screen" class="modal is-active"> | |
93 <div class="modal-background"></div> | |
94 <div class="modal-content"> | |
95 <div class="notification has-text-centered"> | |
403 | 96 <div class="is-flex is-align-items-center is-justify-content-center"> |
97 <span class="icon is-large"> | |
98 <i class="fa-solid fa-spinner fa-spin fa-xl"></i> | |
99 </span> | |
100 <span class=""> | |
101 {% trans %}page is loading, please wait…{% endtrans %} | |
102 </span> | |
103 </div> | |
295 | 104 </div> |
105 </div> | |
106 </div> | |
107 {% endif %} | |
230 | 108 {% if main_menu %} |
109 {% block main_menu %} | |
312
6411615771b6
bulma (base): menu can now be fixed on top with `menu_fixed_top` bool variable
Goffi <goffi@goffi.org>
parents:
311
diff
changeset
|
110 {{ component.menu(main_menu) }} |
230 | 111 {% endblock main_menu %} |
112 {% endif %} | |
289
f1a39607d6a5
bulma (base/base.html): `full_screen_body` parameter + body_wrapper:
Goffi <goffi@goffi.org>
parents:
280
diff
changeset
|
113 {% block body_wrapper %} |
403 | 114 <div id="body"> |
323 | 115 {% if breadcrumbs and not no_breadcrumps and breadcrumbs|length > 1 %} |
116 <nav class="breadcrumb is-medium" aria-label="breadcrumbs"> | |
117 <ul> | |
118 {% for crumb in breadcrumbs %} | |
119 <li {% if loop.last %}class="is-active"{% endif %}> | |
120 <a href="{{crumb.url or '#'}}"> | |
121 {% if crumb.icon %} | |
122 <span class="icon is-medium"> | |
123 <i class="icon-{{crumb.icon}}"></i> | |
124 </span> | |
125 {% endif %} | |
126 <span>{{crumb.label}}</span> | |
127 </a> | |
128 </li> | |
129 {% endfor %} | |
130 </ul> | |
131 </nav> | |
132 {% endif %} | |
279
a35ddf972ad2
bulma (base/base.html): display backend confirmation and notifications
Goffi <goffi@goffi.org>
parents:
267
diff
changeset
|
133 {% if confirm %} |
a35ddf972ad2
bulma (base/base.html): display backend confirmation and notifications
Goffi <goffi@goffi.org>
parents:
267
diff
changeset
|
134 <article class="message is-success mt-4"> |
280
cf3fcbc797bc
bulma (base/base.html): remove backend notification/confirm message on delete button click
Goffi <goffi@goffi.org>
parents:
279
diff
changeset
|
135 <div class="message-header"> |
cf3fcbc797bc
bulma (base/base.html): remove backend notification/confirm message on delete button click
Goffi <goffi@goffi.org>
parents:
279
diff
changeset
|
136 {% trans %}Success{% endtrans %} |
cf3fcbc797bc
bulma (base/base.html): remove backend notification/confirm message on delete button click
Goffi <goffi@goffi.org>
parents:
279
diff
changeset
|
137 <button class="delete" aria-label="delete" onclick="this.parentElement.parentElement.remove()"></button> |
cf3fcbc797bc
bulma (base/base.html): remove backend notification/confirm message on delete button click
Goffi <goffi@goffi.org>
parents:
279
diff
changeset
|
138 </div> |
279
a35ddf972ad2
bulma (base/base.html): display backend confirmation and notifications
Goffi <goffi@goffi.org>
parents:
267
diff
changeset
|
139 <div class="message-body"> |
a35ddf972ad2
bulma (base/base.html): display backend confirmation and notifications
Goffi <goffi@goffi.org>
parents:
267
diff
changeset
|
140 {% trans %}Your data has been sent correctly.{% endtrans %} |
a35ddf972ad2
bulma (base/base.html): display backend confirmation and notifications
Goffi <goffi@goffi.org>
parents:
267
diff
changeset
|
141 </div> |
a35ddf972ad2
bulma (base/base.html): display backend confirmation and notifications
Goffi <goffi@goffi.org>
parents:
267
diff
changeset
|
142 </article> |
a35ddf972ad2
bulma (base/base.html): display backend confirmation and notifications
Goffi <goffi@goffi.org>
parents:
267
diff
changeset
|
143 {% endif %} |
a35ddf972ad2
bulma (base/base.html): display backend confirmation and notifications
Goffi <goffi@goffi.org>
parents:
267
diff
changeset
|
144 {% if notifications %} |
a35ddf972ad2
bulma (base/base.html): display backend confirmation and notifications
Goffi <goffi@goffi.org>
parents:
267
diff
changeset
|
145 {% for notification in notifications %} |
a35ddf972ad2
bulma (base/base.html): display backend confirmation and notifications
Goffi <goffi@goffi.org>
parents:
267
diff
changeset
|
146 <article class="message {{ {C.LVL_WARNING: "is-warning"}.get(notification.level, "is-info") }} mt-4"> |
280
cf3fcbc797bc
bulma (base/base.html): remove backend notification/confirm message on delete button click
Goffi <goffi@goffi.org>
parents:
279
diff
changeset
|
147 <div class="message-header"> |
cf3fcbc797bc
bulma (base/base.html): remove backend notification/confirm message on delete button click
Goffi <goffi@goffi.org>
parents:
279
diff
changeset
|
148 {% trans %}Notification{% endtrans %} |
cf3fcbc797bc
bulma (base/base.html): remove backend notification/confirm message on delete button click
Goffi <goffi@goffi.org>
parents:
279
diff
changeset
|
149 <button class="delete" aria-label="delete" onclick="this.parentElement.parentElement.remove()"></button> |
cf3fcbc797bc
bulma (base/base.html): remove backend notification/confirm message on delete button click
Goffi <goffi@goffi.org>
parents:
279
diff
changeset
|
150 </div> |
279
a35ddf972ad2
bulma (base/base.html): display backend confirmation and notifications
Goffi <goffi@goffi.org>
parents:
267
diff
changeset
|
151 <div class="message-body"> |
a35ddf972ad2
bulma (base/base.html): display backend confirmation and notifications
Goffi <goffi@goffi.org>
parents:
267
diff
changeset
|
152 {{ notification.message }} |
a35ddf972ad2
bulma (base/base.html): display backend confirmation and notifications
Goffi <goffi@goffi.org>
parents:
267
diff
changeset
|
153 </div> |
a35ddf972ad2
bulma (base/base.html): display backend confirmation and notifications
Goffi <goffi@goffi.org>
parents:
267
diff
changeset
|
154 </article> |
a35ddf972ad2
bulma (base/base.html): display backend confirmation and notifications
Goffi <goffi@goffi.org>
parents:
267
diff
changeset
|
155 {% endfor %} |
a35ddf972ad2
bulma (base/base.html): display backend confirmation and notifications
Goffi <goffi@goffi.org>
parents:
267
diff
changeset
|
156 {% endif %} |
244
a62822c6a114
bulma: added a notification area + first dialog template for confirmation request
Goffi <goffi@goffi.org>
parents:
237
diff
changeset
|
157 <div id="notifs_area"></div> |
230 | 158 {% block body %} |
159 {% endblock body %} | |
160 </div> | |
289
f1a39607d6a5
bulma (base/base.html): `full_screen_body` parameter + body_wrapper:
Goffi <goffi@goffi.org>
parents:
280
diff
changeset
|
161 {% endblock body_wrapper%} |
311 | 162 {% block footer %} |
163 {% endblock footer %} | |
230 | 164 </body> |
165 </html> |