From d2f418cd11356b8b655c754f91fc79f14bd7af61 Mon Sep 17 00:00:00 2001 From: Jorran de Wit <jorrandewit@outlook.com> Date: Thu, 25 May 2017 22:11:39 +0200 Subject: [PATCH] Improve error pages --- SciPost_v1/settings/local_jorran.py | 2 +- templates/403.html | 29 ++++++++++++++++------------- templates/404.html | 26 +++++++++++++------------- templates/500.html | 21 ++++++++++----------- 4 files changed, 40 insertions(+), 38 deletions(-) diff --git a/SciPost_v1/settings/local_jorran.py b/SciPost_v1/settings/local_jorran.py index 1d47922ef..a599c9c41 100644 --- a/SciPost_v1/settings/local_jorran.py +++ b/SciPost_v1/settings/local_jorran.py @@ -1,7 +1,7 @@ from .base import * # THE MAIN THING HERE -DEBUG = True +DEBUG = False # Debug toolbar settings INSTALLED_APPS += ( diff --git a/templates/403.html b/templates/403.html index 126e12579..7275c7806 100644 --- a/templates/403.html +++ b/templates/403.html @@ -2,18 +2,21 @@ {% block pagetitle %}: 403{% endblock pagetitle %} -{% block headsup %} +{% block content %} -{% endblock headsup %} +<div class="row"> + <div class="col-12"> + <div style="text-align: center;"> + <img src="//scipost.org/static/scipost/images/logo_scipost_RGB_HTML_groot.png" alt="SciPost logo" width="240" style="margin-top: 20px; margin-bottom: 20px" /> + <h1>You are not authorized to view the requested page.</h1> + <h2>403</h2> + {% if request.user.is_anonymous %} + <p style="margin-top: 20px;">Please <a href="{% url 'scipost:login' %}">login</a> first, and try again.</p> + {% else %} + <p style="margin-top: 20px;">Continue to your <a href="{% url 'scipost:personal_page' %}">personal page</a>.</p> + {% endif %} + </div> + </div> +</div> -{% block bodysup %} - - -<section> - <h1>You are not authorized to view the requested page.</h1> - {% if exception %} - <p>Exception: {{ exception }}</p> - {% endif %} -</section> - -{% endblock bodysup %} +{% endblock %} diff --git a/templates/404.html b/templates/404.html index 3402bd83c..aa58a2b18 100644 --- a/templates/404.html +++ b/templates/404.html @@ -1,19 +1,19 @@ {% extends 'scipost/base.html' %} -{% block pagetitle %}: 403{% endblock pagetitle %} +{% block pagetitle %}: 404{% endblock pagetitle %} -{% block headsup %} -{% endblock headsup %} +{% block content %} -{% block bodysup %} +<div class="row"> + <div class="col-12"> + <div style="text-align: center;"> + <img src="//scipost.org/static/scipost/images/logo_scipost_RGB_HTML_groot.png" alt="SciPost logo" width="240" style="margin-top: 20px; margin-bottom: 20px" /> + <h1>The page you requested could not be found.</h1> + <h2>404</h2> + <p style="margin-top: 20px;">Continue to the <a href="{% url 'submissions:submissions' %}">submissions</a>, <a href="{% url 'commentaries:commentaries' %}">commentaries</a> or <a href="{% url 'theses:theses' %}">theses</a> page.</p> + </div> + </div> +</div> - -<section> - <h1>The page you requested could not be found.</h1> - {% if exception %} - <p>Exception: {{ exception }}</p> - {% endif %} -</section> - -{% endblock bodysup %} +{% endblock %} diff --git a/templates/500.html b/templates/500.html index 4ab810c9d..91403510f 100644 --- a/templates/500.html +++ b/templates/500.html @@ -1,16 +1,15 @@ {% extends 'scipost/base.html' %} -{% block pagetitle %}: 403{% endblock pagetitle %} +{% block pagetitle %}: 500{% endblock pagetitle %} -{% block headsup %} +{% block content %} -{% endblock headsup %} +<div style="text-align: center;"> + <img src="//scipost.org/static/scipost/images/logo_scipost_RGB_HTML_groot.png" alt="SciPost logo" width="240" style="margin-top: 20px; margin-bottom: 20px" /> + <h1>The server responded with an error.</h1> + <h2>500</h2> + <h3>We are sorry, something went wrong. The SciPost administrators have been informed.</h3> + <p style="margin-top: 20px;">Go back to <a href="//scipost.org">the homepage</a>.</p> +</div> -{% block bodysup %} - - -<section> - <h1>The server responded with an error.</h1> -</section> - -{% endblock bodysup %} +{% endblock %} -- GitLab