forked from DGNum/gestioCOF
Notifications are closable
This commit is contained in:
parent
1ac3e0f976
commit
8fa635773c
2 changed files with 29 additions and 18 deletions
7
bds/static/bds/js/bds.js
Normal file
7
bds/static/bds/js/bds.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
$(function () {
|
||||
// Close notifications when delete button is pressed
|
||||
$(".notification .delete").on("click", function () {
|
||||
$(this).parent().remove();
|
||||
});
|
||||
|
||||
});
|
|
@ -16,31 +16,35 @@
|
|||
{# Javascript #}
|
||||
<script src="{% static 'vendor/jquery/jquery-3.3.1.min.js' %}"></script>
|
||||
<script src="{% static "vendor/jquery/jquery.autocomplete-light.min.js" %}"></script>
|
||||
<script src="{% static 'bds/js/bds.js' %}"></script>
|
||||
|
||||
{% block extra_head %}{% endblock extra_head %}
|
||||
</head>
|
||||
<body>
|
||||
{% include "bds/nav.html" %}
|
||||
{% block layout %}
|
||||
<div class="columns">
|
||||
<div class="column is-two-thirds is-offset-2">
|
||||
<section class="section">
|
||||
|
||||
<section class="section">
|
||||
<div class="columns">
|
||||
<div class="column is-two-thirds is-offset-2">
|
||||
{% if messages %}
|
||||
{% for message in messages %}
|
||||
<div class="notification is-{{ message.level_tag|bulma_message_tag }}">
|
||||
{% if 'safe' in message.tags %}
|
||||
{{ message|safe }}
|
||||
{% else %}
|
||||
{{ message }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if messages %}
|
||||
{% for message in messages %}
|
||||
<div class="notification is-{{ message.level_tag|bulma_message_tag }}">
|
||||
{% if 'safe' in message.tags %}
|
||||
{{ message|safe }}
|
||||
{% else %}
|
||||
{{ message }}
|
||||
{% endif %}
|
||||
<button class="delete"></button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% block content %}
|
||||
{% endblock content %}
|
||||
</div>
|
||||
{% block content %}
|
||||
{% endblock content %}
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
{% endblock layout %}
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue