changeset 295:1de599c5a68f

bulma (base): loading screen: when the `loading_screen` variable is set before extending `base/base.html`, a loading modal is shown (and must be removed via JavaScript). This avoids the user to try to use an interface which is not reactive or working normally because JS is not fully loaded yet.
author Goffi <goffi@goffi.org>
date Fri, 27 Nov 2020 12:24:03 +0100
parents a587d664f62c
children fbea1b9a558f
files sat_templates/templates/bulma/base/base.html sat_templates/templates/bulma/photo/album.html sat_templates/templates/bulma/static/styles_noscript.css
diffstat 3 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/sat_templates/templates/bulma/base/base.html	Fri Nov 27 12:15:39 2020 +0100
+++ b/sat_templates/templates/bulma/base/base.html	Fri Nov 27 12:24:03 2020 +0100
@@ -76,6 +76,19 @@
     {% if atom_url is defined %}
         {{ icon_defs('feed') }}
     {% endif %}
+    {% if loading_screen %}
+        <div id="loading_screen" class="modal is-active">
+            <div class="modal-background"></div>
+            <div class="modal-content">
+                <div class="notification has-text-centered">
+                    <span class="icon is-large">
+                        <i class="icon-loading icon_animate_spin"></i>
+                    </span>
+                    {% trans %}page is loading, please wait…{% endtrans %}
+                </div>
+            </div>
+        </div>
+    {% endif %}
     {% if main_menu %}
         {% block main_menu %}
             {{ component.menu(main_menu, class="main_menu") }}
--- a/sat_templates/templates/bulma/photo/album.html	Fri Nov 27 12:15:39 2020 +0100
+++ b/sat_templates/templates/bulma/photo/album.html	Fri Nov 27 12:24:03 2020 +0100
@@ -1,5 +1,6 @@
 {# FIXME: Q&D way to add a CSS from node_modules, it should be imported directly with the python module #}
 {{ css_files.append(build_path+"node_modules/swiper/swiper-bundle.min.css") or "" }}
+{% set loading_screen = true %}
 {% extends 'base/base.html' %}
 {% import 'components/avatar.html' as avatar with context %}
 {% import 'input/textbox.html' as textbox with context %}
--- a/sat_templates/templates/bulma/static/styles_noscript.css	Fri Nov 27 12:15:39 2020 +0100
+++ b/sat_templates/templates/bulma/static/styles_noscript.css	Fri Nov 27 12:24:03 2020 +0100
@@ -1,3 +1,9 @@
+
+#loading_screen {
+    /* Loading screen doesn't make sense without JS, and must never be displayed */
+    display: none;
+}
+
 /**********
  * Panels *
  **********/