2
0
Fork 0

add error pages

This commit is contained in:
Andreas (@xAndy) Zimmermann 2022-05-10 18:06:50 +02:00
parent ea4ad94780
commit 737958a7ab
4 changed files with 39 additions and 0 deletions

1
templates/400.html Normal file
View File

@ -0,0 +1 @@
{% extends "error_base.html" %}

3
templates/404.html Normal file
View File

@ -0,0 +1,3 @@
{% extends "error_base.html" %}
<h3 class="title">{% block error_message%}Seite nicht gefunden{% endblock %}</h3>
{% block error_text%}{% endblock %}

3
templates/500.html Normal file
View File

@ -0,0 +1,3 @@
{% extends "error_base.html" %}
<h3 class="title">{% block error_message%}Es ist ein Fehler aufgetreten{% endblock %}</h3>
{% block error_text%}Wir arbeiten dran. Bei dringenden Problemen kannst du dich an den Infopoint wenden.{% endblock %}

32
templates/error_base.html Normal file
View File

@ -0,0 +1,32 @@
{% extends "base.html" %}
{% block title %}Fehler{% endblock %}
{% block navbar %}
<div class="navbar-start">
{% if not helper%}
<a class="navbar-item" href="{% url 'register' %}">Anmelden</a>
{% else %}
{% if not helper.number_validated %}
<p class="navbar-item has-text-danger">Bestätige deine Telefonnummer über den Link in der SMS</p>
{% endif %}
{% if helper.important_shift %}
<a class="navbar-item" href="{% url 'shift' helper.important_shift.pk %}">{%if helper.important_shift.is_running%}Laufende{% else %}Nächste{% endif %} Schicht ({{ helper.important_shift.start_at|date:"H:i" }})</a>
{% endif %}
{% endif %}
</div>
<div class="navbar-end"></div>
{% endblock %}
{% block body %}
<section class="section">
<div class="container">
<h3 class="title">{% block error_message%}Fehler{% endblock %}</h3>
{% block error_text%}<pre>¯\_(ツ)_/¯</pre>{% endblock %}<br>
<a href="{% url 'index' %}" class="button">Zurück zur Schichtübersicht</a>
{% if user.is_authenticated %}
<a href="{% url 'team:index' %}" class="button">Zurück zur Teamansicht</a>
{% endif %}
</div>
</section>
{% endblock %}