Skip to content

Commit

Permalink
Merge pull request #4273 from rtfd/humitos/notifications/error-pages
Browse files Browse the repository at this point in the history
Wrap notifications HTML code into a block
  • Loading branch information
ericholscher committed Jun 21, 2018
2 parents 303d3a4 + a341a44 commit ae9d47c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 15 deletions.
2 changes: 2 additions & 0 deletions readthedocs/templates/401.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

Expand Down
2 changes: 2 additions & 0 deletions readthedocs/templates/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

Expand Down
14 changes: 8 additions & 6 deletions readthedocs/templates/500.html
Original file line number Diff line number Diff line change
@@ -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 %}
Expand Down
22 changes: 13 additions & 9 deletions readthedocs/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down

0 comments on commit ae9d47c

Please sign in to comment.