Move notifications into container

pull/1/head
Luca 3 years ago
parent 4e035fb888
commit 472bd6f629

@ -9,17 +9,12 @@
{% endblock %}
{% block body %}
{% if helper %}
<section class="hero">
<div class="container">
<div class="hero-body">
<h1 class="title">Hallo {{ helper.name }}!</h1>
</div>
</div>
</section>
{% endif %}
<section class="section">
<div class="container">
{% include 'notifications.html' %}
{% if helper %}
<h1 class="title">Hallo {{ helper.name }}!</h1>
{% endif %}
{% block content %}{% endblock %}
</div>
</section>

@ -10,6 +10,7 @@
{% block body %}
<section class="section">
<div class="container">
{% include 'notifications.html' %}
{% block content %}{% endblock %}
</div>
</section>

@ -18,13 +18,9 @@
</div>
</div>
</nav>
{% for message in messages %}
<div class="notification{% for tag in message.tags.split %} is-{{ tag }}{% endfor %}">
<button class="delete"></button>
{{ message }}
</div>
{% endfor %}
{% block body %}
{% include 'notifications.html' %}
{% endblock %}
<script>document.querySelectorAll('.delete').forEach(btn => btn.addEventListener('click', event => event.target.parentElement.remove()));</script>
</body>
</html>

@ -0,0 +1,6 @@
{% for message in messages %}
<div class="notification{% for tag in message.tags.split %} is-{{ tag }}{% endfor %}">
<button class="delete"></button>
{{ message }}
</div>
{% endfor %}
Loading…
Cancel
Save