Wrap notifications HTML code into a block

This block is override in error pages to be none and do not show
notifications on these pages.
humitos/mkdocs/theme-config
Manuel Kaufmann 2018-06-19 17:07:40 -03:00
parent 017f5817e1
commit a341a4482f
4 changed files with 25 additions and 15 deletions

View File

@ -10,6 +10,8 @@
{% include "error_header.html" %}
{% endblock %}
{% block notify %}{% endblock %}
{# Hide the language select form so we don't set a CSRF cookie #}
{% block language-select-form %}{% endblock %}

View File

@ -10,6 +10,8 @@
{% include "error_header.html" %}
{% endblock %}
{% block notify %}{% endblock %}
{# Hide the language select form so we don't set a CSRF cookie #}
{% block language-select-form %}{% endblock %}

View File

@ -1,13 +1,15 @@
{% extends "base.html" %}
{% load i18n %}
{% block title %}
{% trans "Server Error" %}
{% endblock %}
{% block title %}
{% trans "Server Error" %}
{% endblock %}
{% block header-wrapper %}
{% include "error_header.html" %}
{% endblock %}
{% block header-wrapper %}
{% include "error_header.html" %}
{% endblock %}
{% block notify %}{% endblock %}
{# Hide the language select form so we don't set a CSRF cookie #}
{% block language-select-form %}{% endblock %}

View File

@ -84,15 +84,19 @@
<div id="content">
<div class="wrapper">
{% if messages %}
<ul class="notifications">
{% for message in messages %}
<li class="notification notification-{{ message.level }}" {% if message.pk %}data-dismiss-url="{% url 'message_mark_read' message.pk %}{% endif %}">
{{ message }}
</li>
{% endfor %}
</ul>
{% endif %}
<!-- BEGIN notify -->
{% block notify %}
{% if messages %}
<ul class="notifications">
{% for message in messages %}
<li class="notification notification-{{ message.level }}" {% if message.pk %}data-dismiss-url="{% url 'message_mark_read' message.pk %}{% endif %}">
{{ message }}
</li>
{% endfor %}
</ul>
{% endif %}
{% endblock %}
<!-- END notify -->
{% block content-header %}
{% endblock %}