From 8fa635773c301f695f13e1248c4aa146d59a1c11 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Fri, 28 Aug 2020 16:11:50 +0200 Subject: [PATCH] Notifications are closable --- bds/static/bds/js/bds.js | 7 +++++++ bds/templates/bds/base.html | 40 ++++++++++++++++++++----------------- 2 files changed, 29 insertions(+), 18 deletions(-) create mode 100644 bds/static/bds/js/bds.js diff --git a/bds/static/bds/js/bds.js b/bds/static/bds/js/bds.js new file mode 100644 index 00000000..3c2fb49b --- /dev/null +++ b/bds/static/bds/js/bds.js @@ -0,0 +1,7 @@ +$(function () { + // Close notifications when delete button is pressed + $(".notification .delete").on("click", function () { + $(this).parent().remove(); + }); + +}); \ No newline at end of file diff --git a/bds/templates/bds/base.html b/bds/templates/bds/base.html index ac2b4875..f456f6dc 100644 --- a/bds/templates/bds/base.html +++ b/bds/templates/bds/base.html @@ -16,31 +16,35 @@ {# Javascript #} + {% block extra_head %}{% endblock extra_head %} {% include "bds/nav.html" %} + {% block layout %} +
+
+
-
-
-
- {% if messages %} - {% for message in messages %} -
- {% if 'safe' in message.tags %} - {{ message|safe }} - {% else %} - {{ message }} - {% endif %} -
- {% endfor %} - {% endif %} + {% if messages %} + {% for message in messages %} +
+ {% if 'safe' in message.tags %} + {{ message|safe }} + {% else %} + {{ message }} + {% endif %} + +
+ {% endfor %} + {% endif %} - {% block content %} - {% endblock content %} -
+ {% block content %} + {% endblock content %} +
- +
+ {% endblock layout %}