Error pages

This commit is contained in:
Raphael Michel
2018-07-08 18:15:14 +02:00
parent 32f401e423
commit 50aa186197
6 changed files with 95 additions and 60 deletions

View File

@@ -2,12 +2,14 @@
{% load i18n %} {% load i18n %}
{% block title %}{% trans "Bad Request" %}{% endblock %} {% block title %}{% trans "Bad Request" %}{% endblock %}
{% block content %} {% block content %}
<i class="fa fa-frown-o big-icon"></i> <i class="fa fa-frown-o fa-fw big-icon"></i>
<h1>{% trans "Bad Request" %}</h1> <div class="error-details">
<p>{% trans "We were unable to parse your request." %}</p> <h1>{% trans "Bad Request" %}</h1>
<p>{{ exception }}</p> <p>{% trans "We were unable to parse your request." %}</p>
<p class="links"> <p>{{ exception }}</p>
<a id='goback' href='#'>{% trans "Take a step back" %}</a> <p class="links">
&middot; <a id='reload' href='#'>{% trans "Try again" %}</a> <a id='goback' href='#'>{% trans "Take a step back" %}</a>
</p> &middot; <a id='reload' href='#'>{% trans "Try again" %}</a>
</p>
</div>
{% endblock %} {% endblock %}

View File

@@ -2,12 +2,14 @@
{% load i18n %} {% load i18n %}
{% block title %}{% trans "Permission denied" %}{% endblock %} {% block title %}{% trans "Permission denied" %}{% endblock %}
{% block content %} {% block content %}
<i class="fa fa-lock big-icon"></i> <i class="fa fa-fw fa-lock big-icon"></i>
<h1>{% trans "Permission denied" %}</h1> <div class="error-details">
<p>{% trans "You do not have access to this page." %}</p> <h1>{% trans "Permission denied" %}</h1>
<p>{{ exception }}</p> <p>{% trans "You do not have access to this page." %}</p>
<p class="links"> <p>{{ exception }}</p>
<a id='goback' href='#'>{% trans "Take a step back" %}</a> <p class="links">
&middot; <a id='reload' href='#'>{% trans "Try again" %}</a> <a id='goback' href='#'>{% trans "Take a step back" %}</a>
</p> &middot; <a id='reload' href='#'>{% trans "Try again" %}</a>
</p>
</div>
{% endblock %} {% endblock %}

View File

@@ -2,11 +2,13 @@
{% load i18n %} {% load i18n %}
{% block title %}{% trans "Not found" %}{% endblock %} {% block title %}{% trans "Not found" %}{% endblock %}
{% block content %} {% block content %}
<i class="fa fa-meh-o big-icon"></i> <i class="fa fa-meh-o fa-fw big-icon"></i>
<h1>{% trans "Not found" %}</h1> <div class="error-details">
<p>{% trans "I'm afraid we could not find the the resource you requested." %}</p> <h1>{% trans "Not found" %}</h1>
<p>{{ exception }}</p> <p>{% trans "I'm afraid we could not find the the resource you requested." %}</p>
<p class="links"> <p>{{ exception }}</p>
<a id='goback' href='#'>{% trans "Take a step back" %}</a> <p class="links">
</p> <a id='goback' href='#'>{% trans "Take a step back" %}</a>
</p>
</div>
{% endblock %} {% endblock %}

View File

@@ -2,22 +2,24 @@
{% load i18n %} {% load i18n %}
{% block title %}{% trans "Internal Server Error" %}{% endblock %} {% block title %}{% trans "Internal Server Error" %}{% endblock %}
{% block content %} {% block content %}
<i class="fa fa-bolt big-icon"></i> <i class="fa fa-bolt big-icon fa-fw"></i>
<h1>{% trans "Internal Server Error" %}</h1> <div class="error-details">
<p>{% trans "We had trouble processing your request." %}</p> <h1>{% trans "Internal Server Error" %}</h1>
<p>{% trans "If this problem persists, please contact us." %}</p> <p>{% trans "We had trouble processing your request." %}</p>
{% if request.sentry.id %} <p>{% trans "If this problem persists, please contact us." %}</p>
<p> {% if request.sentry.id %}
{% blocktrans trimmed %} <p>
If you contact us, please send us the following code: {% blocktrans trimmed %}
{% endblocktrans %} If you contact us, please send us the following code:
<br> {% endblocktrans %}
{{ request.sentry.id }} <br>
{{ request.sentry.id }}
</p>
{% endif %}
<p>{{ exception }}</p>
<p class="links">
<a id='goback' href='#'>{% trans "Take a step back" %}</a>
&middot; <a id='reload' href='#'>{% trans "Try again" %}</a>
</p> </p>
{% endif %} </div>
<p>{{ exception }}</p>
<p class="links">
<a id='goback' href='#'>{% trans "Take a step back" %}</a>
&middot; <a id='reload' href='#'>{% trans "Try again" %}</a>
</p>
{% endblock %} {% endblock %}

View File

@@ -2,23 +2,27 @@
{% load i18n %} {% load i18n %}
{% block title %}{% trans "Verification failed" %}{% endblock %} {% block title %}{% trans "Verification failed" %}{% endblock %}
{% block content %} {% block content %}
<i class="fa fa-frown-o big-icon"></i> <i class="fa fa-frown-o big-icon fa-fw"></i>
<h1>{% trans "Verification failed" %}</h1> <div class="error-details">
<p>{% blocktrans trimmed %} <h1>{% trans "Verification failed" %}</h1>
We could not verify that this request really was sent from you. For security reasons, we therefore cannot process it.
{% endblocktrans %}</p>
{% if no_referer %}
<p>{{ no_referer1 }}</p>
<p>{{ no_referer2 }}</p>
{% elif no_cookie %}
<p>{{ no_cookie1 }}</p>
<p>{{ no_cookie2 }}</p>
{% else %}
<p>{% blocktrans trimmed %} <p>{% blocktrans trimmed %}
Please go back to the last page, refresh this page and then try again. If the problem persists, please get in touch with us. We could not verify that this request really was sent from you. For security reasons, we therefore cannot
process it.
{% endblocktrans %}</p> {% endblocktrans %}</p>
{% endif %} {% if no_referer %}
<p class="links"> <p>{{ no_referer1 }}</p>
<a id='goback' href='#'>{% trans "Take a step back" %}</a> <p>{{ no_referer2 }}</p>
</p> {% elif no_cookie %}
<p>{{ no_cookie1 }}</p>
<p>{{ no_cookie2 }}</p>
{% else %}
<p>{% blocktrans trimmed %}
Please go back to the last page, refresh this page and then try again. If the problem persists, please
get in touch with us.
{% endblocktrans %}</p>
{% endif %}
<p class="links">
<a id='goback' href='#'>{% trans "Take a step back" %}</a>
</p>
</div>
{% endblock %} {% endblock %}

View File

@@ -5,12 +5,35 @@
body { body {
background: #ececec; background: #fbf7fc;
text-align: center;
padding: 50px 0; padding: 50px 0;
} }
.big-icon { .big-icon {
font-size: 200px; font-size: 200px;
color: $brand-primary; color: $navbar-inverse-bg;
display: block;
float: left;
}
.error-details {
margin-left: 260px;
}
.container {
width: 90%;
max-width: 800px;
}
@media(max-width: 600px) {
body {
text-align: center;
}
.big-icon {
margin: auto;
float: none;
}
.error-details {
margin-left: 0;
}
} }