Update error pages

This commit is contained in:
Jannis Portmann 2023-05-18 14:03:35 +02:00
parent fb6e703b67
commit 15897d0370
7 changed files with 62 additions and 29 deletions

View file

@ -0,0 +1,18 @@
{% extends 'base.html' %}
{% load i18n %}
{% block title %}
{% trans "Not found" %}
{% endblock title %}
{% block content %}
<div>
<h1 class="mb-5">
<span class="badge bg-danger">Error 403</span> {% trans "Forbidden" %}
</h1>
<p class="mb-5 blockquote w-75 m-auto">
{% blocktrans %}Halt! You've reached a forbidden enclave. Access to this hidden sanctuary is restricted, and its secrets are reserved for chosen ones. We apologize for any inconvenience caused by this unattainable allure.Please explore the accessible realms of our botanical wonders while the forbidden gates remain sealed. If you think your worthy, please let your message reach us.{% endblocktrans %}
</p>
<h2>{% trans "What now?" %}</h2>
<a href="{% url 'index' %}" class="btn btn-pfl">{% trans "Go home" %}</a>
<a href="mailto:contact@pflaenz.li" class="btn btn-secondary">{% trans "Report error" %}</a>
</div>
{% endblock content %}

View file

@ -0,0 +1,18 @@
{% extends 'base.html' %}
{% load i18n %}
{% block title %}
{% trans "Not found" %}
{% endblock title %}
{% block content %}
<div>
<h1 class="mb-5">
<span class="badge bg-danger">Error 403</span> {% trans "Forbidden" %} ({% trans "CSRF verification failed" %})
</h1>
<p class="mb-5 blockquote w-75 m-auto">
{% blocktrans %}Halt! Only bearers of the CSRF token are allowed past this point. This protective enchantment prevents unauthorized actions and ensures security. Please ensure the validity of your session and attempt again. Should you seek further guidance, our plant mystics stands ready to lend their wisdom and support on your journey.{% endblocktrans %}
</p>
<h2>{% trans "What now?" %}</h2>
<a href="{% url 'index' %}" class="btn btn-pfl">{% trans "Go home" %}</a>
<a href="mailto:contact@pflaenz.li" class="btn btn-secondary">{% trans "Report error" %}</a>
</div>
{% endblock content %}

View file

@ -9,10 +9,7 @@
<span class="badge bg-danger">Error 404</span> {% trans "Page not found" %}
</h1>
<p class="mb-5 blockquote w-75 m-auto">
{% blocktrans %}
Alas! Your path has led you astray in the depths of the enchanted forest. The elusive plant you seek has hidden
itself amidst the mystical foliage. If you have a map, please share it with us!
{% endblocktrans %}
{% blocktrans %}Alas! Your path has led you astray in the depths of the enchanted forest. The elusive plant you seek has hidden itself amidst the mystical foliage. If you have a map, please share it with us!{% endblocktrans %}
</p>
<h2>{% trans "What now?" %}</h2>
<a href="{% url 'index' %}" class="btn btn-pfl">{% trans "Go home" %}</a>

View file

@ -0,0 +1,18 @@
{% extends 'base.html' %}
{% load i18n %}
{% block title %}
{% trans "Not found" %}
{% endblock title %}
{% block content %}
<div>
<h1 class="mb-5">
<span class="badge bg-danger">Error 500</span> {% trans "Forbidden" %}
</h1>
<p class="mb-5 blockquote w-75 m-auto">
{% blocktrans %}Uh-oh! The delicate balance of the botanical realms has been disrupted. The forces of nature are in disarray, and our plant guardians are diligently working to restore harmony. We apologize for any inconvenience caused during this mystical turbulence. Please bear with us as we channel our magic to mend the rupture. Please contact us, if you have any information that could help to dispel the dark magic!{% endblocktrans %}
</p>
<h2>{% trans "What now?" %}</h2>
<a href="{% url 'index' %}" class="btn btn-pfl">{% trans "Go home" %}</a>
<a href="mailto:contact@pflaenz.li" class="btn btn-secondary">{% trans "Report error" %}</a>
</div>
{% endblock content %}

View file

@ -1,23 +0,0 @@
{% extends 'base.html' %}
{% load i18n %}
{% block title %}
{% trans "Not found" %}
{% endblock title %}
{% block content %}
<div>
<h1 class="mb-3">
<span class="badge bg-danger">Error 500</span> {% trans "Page not found" %}
</h1>
<p class="mb-5 blockquote w-75">
{% blocktrans %}
Uh-oh! The delicate balance of the botanical realms has been disrupted. The forces of nature are in disarray,
and our plant guardians are diligently working to restore harmony. We apologize for any inconvenience caused
during this mystical turbulence. Please bear with us as we channel our magic to mend the rupture. Please
contact us, if you have any information that could help to disspell the dark magic!
{% endblocktrans %}
</p>
<h2>{% trans "What now?" %}</h2>
<a href="{% url 'index' %}" class="btn btn-pfl">{% trans "Go home" %}</a>
<a href="mailto:contact@pflaenz.li" class="btn btn-secondary">{% trans "Report error" %}</a>
</div>
{% endblock content %}

View file

@ -185,11 +185,15 @@ def register_user(request):
def error_404(request, exception):
return render(request, 'error/404.html')
return render(request, '404.html')
def error_403(request, exception):
return render(request, '403.html')
def error_500(request):
return render(request, 'error/500.html')
return render(request, '500.html')
def filter_offers(offers, form):

View file

@ -28,4 +28,5 @@ urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
handler404 = 'pflaenzli.views.error_404'
handler403 = 'pflaenzli.views.error_403'
handler500 = 'pflaenzli.views.error_500'