changeset 202:a1fa6744c78e

base: handle notifications through "notifications" variable
author Goffi <goffi@goffi.org>
date Sun, 26 May 2019 22:05:06 +0200
parents d5f4f29b1c5d
children bdc578994b97
files sat_templates/templates/default/base/base.html sat_templates/templates/default/static/styles.css
diffstat 2 files changed, 24 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/sat_templates/templates/default/base/base.html	Sun May 05 20:36:00 2019 +0200
+++ b/sat_templates/templates/default/base/base.html	Sun May 26 22:05:06 2019 +0200
@@ -104,6 +104,15 @@
                     </div>
                 {% endblock confirm %}
             {% endif %}
+            {% if notifications %}
+                {% block notifications %}
+                    {% for notification in notifications %}
+                        <div class="box notification notification--{{notification.level}}">
+                            {{ notification.message }}
+                        </div>
+                    {% endfor %}
+                {% endblock notifications %}
+            {% endif %}
 
         </header>
 
--- a/sat_templates/templates/default/static/styles.css	Sun May 05 20:36:00 2019 +0200
+++ b/sat_templates/templates/default/static/styles.css	Sun May 26 22:05:06 2019 +0200
@@ -1196,7 +1196,22 @@
  * Notifications *
  *****************/
 
+
+.notification {
+    text-align: center;
+    padding: 1em;
+    font-size: 1.2em;
+    font-weight: bold;
+    width: 60%;
+    margin: 1.5em auto;
+}
+
+.notification--warning {
+    background-color: red;
+}
+
 .notification.retry {
+    /* FIXME: inconcistent naming */
     position: fixed;
     top: 1rem;
     margin: auto;