From a341a4482f8cc06850565bc922f2b396910739ba Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Tue, 19 Jun 2018 17:07:40 -0300 Subject: [PATCH] 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. --- readthedocs/templates/401.html | 2 ++ readthedocs/templates/404.html | 2 ++ readthedocs/templates/500.html | 14 ++++++++------ readthedocs/templates/base.html | 22 +++++++++++++--------- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/readthedocs/templates/401.html b/readthedocs/templates/401.html index 6df1ba860..d9d818be0 100644 --- a/readthedocs/templates/401.html +++ b/readthedocs/templates/401.html @@ -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 %} diff --git a/readthedocs/templates/404.html b/readthedocs/templates/404.html index 6a14db51b..973307846 100644 --- a/readthedocs/templates/404.html +++ b/readthedocs/templates/404.html @@ -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 %} diff --git a/readthedocs/templates/500.html b/readthedocs/templates/500.html index 8f198a394..70693b5ea 100644 --- a/readthedocs/templates/500.html +++ b/readthedocs/templates/500.html @@ -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 %} diff --git a/readthedocs/templates/base.html b/readthedocs/templates/base.html index dd8b41963..57d80a18f 100644 --- a/readthedocs/templates/base.html +++ b/readthedocs/templates/base.html @@ -84,15 +84,19 @@
- {% if messages %} -
    - {% for message in messages %} -
  • - {{ message }} -
  • - {% endfor %} -
- {% endif %} + + {% block notify %} + {% if messages %} +
    + {% for message in messages %} +
  • + {{ message }} +
  • + {% endfor %} +
+ {% endif %} + {% endblock %} + {% block content-header %} {% endblock %}