diff --git a/konova/urls.py b/konova/urls.py index 1954d298..f4de5eca 100644 --- a/konova/urls.py +++ b/konova/urls.py @@ -57,4 +57,7 @@ urlpatterns = [ if DEBUG: urlpatterns += [ path('__debug__/', include(debug_toolbar.urls)), - ] \ No newline at end of file + ] + +handler404 = "konova.views.get_404_view" +handler500 = "konova.views.get_500_view" \ No newline at end of file diff --git a/konova/views.py b/konova/views.py index c7888aee..1f16b9ea 100644 --- a/konova/views.py +++ b/konova/views.py @@ -113,4 +113,31 @@ def remove_deadline_view(request: HttpRequest, id:str): return form.process_request( request, msg_success=_("Deadline removed") - ) \ No newline at end of file + ) + + +def get_404_view(request: HttpRequest, exception=None): + """ Returns a 404 handling view + + Args: + request (): + exception (): + + Returns: + + """ + context = BaseContext.context + return render(request, "404.html", context, status=404) + + +def get_500_view(request: HttpRequest): + """ Returns a 404 handling view + + Args: + request (): + + Returns: + + """ + context = BaseContext.context + return render(request, "500.html", context, status=500) diff --git a/locale/de/LC_MESSAGES/django.mo b/locale/de/LC_MESSAGES/django.mo index 2790b18b..4985688a 100644 Binary files a/locale/de/LC_MESSAGES/django.mo and b/locale/de/LC_MESSAGES/django.mo differ diff --git a/locale/de/LC_MESSAGES/django.po b/locale/de/LC_MESSAGES/django.po index 54fd22a7..12a577fb 100644 --- a/locale/de/LC_MESSAGES/django.po +++ b/locale/de/LC_MESSAGES/django.po @@ -26,7 +26,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-01-12 15:43+0100\n" +"POT-Creation-Date: 2022-01-12 16:43+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1064,7 +1064,7 @@ msgid "Compensation {} edited" msgstr "Kompensation {} bearbeitet" #: compensation/views/compensation.py:230 compensation/views/eco_account.py:309 -#: ema/views.py:183 intervention/views.py:477 +#: ema/views.py:183 intervention/views.py:478 msgid "Log" msgstr "Log" @@ -1119,36 +1119,36 @@ msgid "Deduction removed" msgstr "Abbuchung entfernt" #: compensation/views/eco_account.py:330 ema/views.py:263 -#: intervention/views.py:519 +#: intervention/views.py:520 msgid "{} unrecorded" msgstr "{} entzeichnet" #: compensation/views/eco_account.py:330 ema/views.py:263 -#: intervention/views.py:519 +#: intervention/views.py:520 msgid "{} recorded" msgstr "{} verzeichnet" -#: compensation/views/eco_account.py:531 intervention/views.py:500 +#: compensation/views/eco_account.py:531 intervention/views.py:501 msgid "Deduction added" msgstr "Abbuchung hinzugefügt" #: compensation/views/eco_account.py:616 ema/views.py:520 -#: intervention/views.py:375 +#: intervention/views.py:376 msgid "{} has already been shared with you" msgstr "{} wurde bereits für Sie freigegeben" #: compensation/views/eco_account.py:621 ema/views.py:525 -#: intervention/views.py:380 +#: intervention/views.py:381 msgid "{} has been shared with you" msgstr "{} ist nun für Sie freigegeben" #: compensation/views/eco_account.py:628 ema/views.py:532 -#: intervention/views.py:387 +#: intervention/views.py:388 msgid "Share link invalid" msgstr "Freigabelink ungültig" #: compensation/views/eco_account.py:651 ema/views.py:555 -#: intervention/views.py:410 +#: intervention/views.py:411 msgid "Share settings updated" msgstr "Freigabe Einstellungen aktualisiert" @@ -1463,31 +1463,31 @@ msgstr "" msgid "Intervention {} added" msgstr "Eingriff {} hinzugefügt" -#: intervention/views.py:245 +#: intervention/views.py:246 msgid "This intervention has {} revocations" msgstr "Dem Eingriff liegen {} Widersprüche vor" -#: intervention/views.py:293 +#: intervention/views.py:294 msgid "Intervention {} edited" msgstr "Eingriff {} bearbeitet" -#: intervention/views.py:328 +#: intervention/views.py:329 msgid "{} removed" msgstr "{} entfernt" -#: intervention/views.py:349 +#: intervention/views.py:350 msgid "Revocation removed" msgstr "Widerspruch entfernt" -#: intervention/views.py:431 +#: intervention/views.py:432 msgid "Check performed" msgstr "Prüfung durchgeführt" -#: intervention/views.py:453 +#: intervention/views.py:454 msgid "Revocation added" msgstr "Widerspruch hinzugefügt" -#: intervention/views.py:524 +#: intervention/views.py:525 msgid "There are errors on this intervention:" msgstr "Es liegen Fehler in diesem Eingriff vor:" @@ -1891,6 +1891,22 @@ msgstr "Alle" msgid "News" msgstr "Neuigkeiten" +#: templates/404.html:7 +msgid "Not found" +msgstr "Nicht gefunden" + +#: templates/404.html:10 +msgid "The requested data does not exist." +msgstr "Die angeforderten Daten existieren nicht." + +#: templates/500.html:7 +msgid "Server Error" +msgstr "" + +#: templates/500.html:10 +msgid "Something happened. We are working on it!" +msgstr "Irgendetwas ist passiert. Wir arbeiten daran!" + #: templates/email/checking/shared_data_checked.html:4 msgid "Shared data checked" msgstr "Freigegebene Daten geprüft" @@ -1913,8 +1929,8 @@ msgid "" "This means, the responsible registration office just confirmed the " "correctness of this dataset." msgstr "" -"Das bedeutet, dass die zuständige Zulassungsbehörde die Korrektheit des Datensatzes " -"soeben bestätigt hat." +"Das bedeutet, dass die zuständige Zulassungsbehörde die Korrektheit des " +"Datensatzes soeben bestätigt hat." #: templates/email/checking/shared_data_checked.html:17 #: templates/email/deleting/shared_data_deleted.html:17 diff --git a/templates/404.html b/templates/404.html new file mode 100644 index 00000000..6f5d57fb --- /dev/null +++ b/templates/404.html @@ -0,0 +1,13 @@ +{% extends 'public_base.html' %} +{% load i18n fontawesome_5 %} + +{% block body %} +
+

{% fa5_icon 'question-circle' %} 404

+

{% trans 'Not found' %}

+
+

+ {% trans 'The requested data does not exist.' %} +

+
+{% endblock %} \ No newline at end of file diff --git a/templates/500.html b/templates/500.html new file mode 100644 index 00000000..5299a693 --- /dev/null +++ b/templates/500.html @@ -0,0 +1,13 @@ +{% extends 'public_base.html' %} +{% load i18n fontawesome_5 %} + +{% block body %} +
+

{% fa5_icon 'fire-extinguisher' %} {% fa5_icon 'fire-alt' %} 500

+

{% trans 'Server Error' %}

+
+

+ {% trans 'Something happened. We are working on it!' %} +

+
+{% endblock %} \ No newline at end of file