From 1aba786da46208d783c29557f440ea1db1634660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20H=C3=A1la?= Date: Sun, 7 Apr 2024 18:52:55 +0200 Subject: [PATCH] Update error pages - Add base error template for errors that cannot use frame - Update messages --- backend/locale/cs/LC_MESSAGES/django.po | 26 +++++------ category/locale/cs/LC_MESSAGES/django.po | 12 ++--- frontend/locale/cs/LC_MESSAGES/django.po | 51 ++++++++------------- frontend/templates/400.html | 2 +- frontend/templates/403.html | 4 +- frontend/templates/404.html | 58 +++++------------------- frontend/templates/base/error.html | 30 ++++++++++++ 7 files changed, 81 insertions(+), 102 deletions(-) create mode 100644 frontend/templates/base/error.html diff --git a/backend/locale/cs/LC_MESSAGES/django.po b/backend/locale/cs/LC_MESSAGES/django.po index 3e786b4..8daa4dc 100644 --- a/backend/locale/cs/LC_MESSAGES/django.po +++ b/backend/locale/cs/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-26 14:31+0000\n" +"POT-Creation-Date: 2024-04-07 16:49+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -104,53 +104,53 @@ msgstr "Jste si jisti že chcete smazat písničku" msgid "Confirm" msgstr "Potvrdit" -#: backend/templates/songs/index.html:25 +#: backend/templates/songs/index.html:27 msgid "Hide chords" msgstr "Skrýt akordy" -#: backend/templates/songs/index.html:31 +#: backend/templates/songs/index.html:33 msgid "Prevent sleep" msgstr "Zabránit uspání" -#: backend/templates/songs/index.html:37 +#: backend/templates/songs/index.html:39 msgid "Single page" msgstr "Bez stránek" -#: backend/templates/songs/index.html:62 +#: backend/templates/songs/index.html:64 msgid "Actions" msgstr "Akce" -#: backend/templates/songs/index.html:67 +#: backend/templates/songs/index.html:69 msgid "Edit" msgstr "Editor" -#: backend/templates/songs/index.html:70 +#: backend/templates/songs/index.html:72 msgid "Delete" msgstr "Smazat" -#: backend/templates/songs/index.html:84 +#: backend/templates/songs/index.html:86 msgid "Transpose" msgstr "Transponovat" -#: backend/templates/songs/index.html:103 +#: backend/templates/songs/index.html:105 msgid "Search" msgstr "Vyhledávání" -#: backend/templates/songs/index.html:105 +#: backend/templates/songs/index.html:107 msgid "Number, text or author" msgstr "Číslo, text nebo autor" -#: backend/views.py:92 +#: backend/views.py:101 #, python-format msgid "Song %(name)s was successfully created" msgstr "Písnička %(name)s byla úspěšně přidána" -#: backend/views.py:115 +#: backend/views.py:124 #, python-format msgid "Song %(name)s was successfully updated" msgstr "Písnička %(name)s byla úspěšně upravena" -#: backend/views.py:131 +#: backend/views.py:140 #, python-format msgid "Song %s was successfully deleted" msgstr "Písnička %s byla úspěšně odstraněna" diff --git a/category/locale/cs/LC_MESSAGES/django.po b/category/locale/cs/LC_MESSAGES/django.po index 751ca52..8454bd4 100644 --- a/category/locale/cs/LC_MESSAGES/django.po +++ b/category/locale/cs/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-26 14:31+0000\n" +"POT-Creation-Date: 2024-04-07 16:49+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -119,27 +119,27 @@ msgstr "Smazat" msgid "Add Category" msgstr "Přidat Kategorii" -#: category/views.py:36 +#: category/views.py:40 #, python-format msgid "Category with url /%(slug)s does not exist" msgstr "Kategorie s url /%(slug)s neexistuje" -#: category/views.py:65 +#: category/views.py:73 #, python-format msgid "Category %(name)s was successfully created" msgstr "Kategorie %(name)s byla úspěšně vytvořena" -#: category/views.py:82 +#: category/views.py:90 #, python-format msgid "Category %(name)s was successfully updated" msgstr "Kategorie %(name)s byla úspěšně upravena" -#: category/views.py:103 +#: category/views.py:111 #, python-format msgid "Category %s was successfully staged for PDF generation" msgstr "PDF pro Kategorii %s bylo přidáno do fronty" -#: category/views.py:114 +#: category/views.py:122 #, python-format msgid "Category %(name)s was successfully deleted" msgstr "Kategorie %(name)s byla úspěšně smazána" diff --git a/frontend/locale/cs/LC_MESSAGES/django.po b/frontend/locale/cs/LC_MESSAGES/django.po index 82a7397..7707b6c 100644 --- a/frontend/locale/cs/LC_MESSAGES/django.po +++ b/frontend/locale/cs/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-26 14:35+0000\n" +"POT-Creation-Date: 2024-04-07 16:50+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -24,55 +24,40 @@ msgid "Bad Request" msgstr "Špatný dotaz" #: frontend/templates/400.html:9 -msgid "" -"There is something wrong there, I don't think this is the way to do it? " -"Aren't some of the data missing? Or in the wrong format?" -msgstr "" -"Něco tu nesedí. Nemyslím že tohle je ten správný způsob jak tohle udělat. " -"Nechybí ti nějaká data? A neposlals je ve špatném formátu?" +#| msgid "Bad Request" +msgid "Invalid request" +msgstr "Špatný požadavek" #: frontend/templates/403.html:4 frontend/templates/403.html:5 msgid "Permission denied" msgstr "Přístup zamítnut" #: frontend/templates/403.html:9 -msgid "" -"Didn't your Mom tell you to not enter websites you don't have permissions " -"for? Get out of here!" -msgstr "" -"Maminka ti neříkala že nemáš lozit na zakázané stránky? Vypadni! Tohle je " -"jen pro přihlášené!" +msgid "Insufficient permissions" +msgstr "Nedostatečné oprávnění" -#: frontend/templates/404.html:13 frontend/templates/404.html:30 -msgid "Not found" +#: frontend/templates/404.html:4 +msgid "Not Found" msgstr "Nenalezeno" -#: frontend/templates/404.html:34 -#, python-format -msgid "" -"Welp, nothing is at %(request)s. Like, literally nothing. Not even " -"cockroaches or russians. How did you get here? Are you sure this is the " -"right URL?" -msgstr "" -"No, na adrese %(request)s není lautr nic. Jakože, doslova nic. Nežijí tu " -"švábi a rusáci. Jak ses sem sakra dostal? Jsi si jistý že je tohle správná " -"adresa?" +#: frontend/templates/404.html:4 +msgid "Back to homepage" +msgstr "Zpátky domů" -#: frontend/templates/404.html:38 +#: frontend/templates/404.html:7 #, python-format -msgid "" -"It seems you turned wrong somewhere, there is nothing here but small midget " -"wizard with long beard telling you reason what you did wrong:
" -"%(exception)s" -msgstr "" -"Vypadá to že si někde špatně uhl, není tu nic vyjma trpasličího čaroděje s " -"dlouhými vousy který se ti snaží říct co pokazilo:
%(exception)s" +msgid "URL %(request_path)s does not exist." +msgstr "URL %(request_path)s neexistuje." #: frontend/templates/admin/base/migrate.html:29 #: frontend/templates/base/form.html:9 msgid "Submit" msgstr "Odeslat" +#: frontend/templates/base/error.html:8 +msgid "Not found" +msgstr "Nenalezeno" + #: frontend/templates/base/index.html:35 msgid "Logo" msgstr "" diff --git a/frontend/templates/400.html b/frontend/templates/400.html index 2959128..5d677ec 100644 --- a/frontend/templates/400.html +++ b/frontend/templates/400.html @@ -6,6 +6,6 @@ {% block framed_body %}

- {% trans "There is something wrong there, I don't think this is the way to do it? Aren't some of the data missing? Or in the wrong format?" %} + {% trans "Invalid request" %}

{% endblock %} \ No newline at end of file diff --git a/frontend/templates/403.html b/frontend/templates/403.html index d0da5bc..5aa70b6 100644 --- a/frontend/templates/403.html +++ b/frontend/templates/403.html @@ -6,6 +6,6 @@ {% block framed_body %}

- {% trans "Didn't your Mom tell you to not enter websites you don't have permissions for? Get out of here!" %} + {% trans "Insufficient permissions" %}: {{ exception }}

-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/frontend/templates/404.html b/frontend/templates/404.html index f7583a4..ff44ddb 100644 --- a/frontend/templates/404.html +++ b/frontend/templates/404.html @@ -1,49 +1,13 @@ -{% load static %} -{% load sass_tags %} +{% extends "base/error.html" %} {% load i18n %} -{% get_current_language as LANGUAGE_CODE %} -{% get_available_languages as LANGUAGES %} -{% get_language_info_list for LANGUAGES as languages %} - - - - - {% trans "Not found" %} - - - - - - - - - {% block extra_head %} {% endblock %} - - -
-
-

{% trans "Not found" %} (404){% trans "Back to homepage" %}

-
-

- {% if exception == "Resolver404" %} - {% blocktranslate with request=request_path trimmed %} - Unable to find {{ request }}. - {% endblocktranslate %} - {% else %} - {{ exception }} - {% endif %} -

-
-
- - - \ No newline at end of file +{% block header %} {% trans "Not Found" %} (404){% trans "Back to homepage" %}{% endblock %} +{% block body %} + {% if exception == "Resolver404" %} + {% blocktranslate with request=request_path trimmed %} +URL {{ request_path }} does not exist. + {% endblocktranslate %} + {% else %} + {{ exception }} + {% endif %} +{% endblock %} \ No newline at end of file diff --git a/frontend/templates/base/error.html b/frontend/templates/base/error.html new file mode 100644 index 0000000..0da6c67 --- /dev/null +++ b/frontend/templates/base/error.html @@ -0,0 +1,30 @@ +{% load static %} +{% load sass_tags %} +{% load i18n %} + + + + + {% trans "Not found" %} + + + + + + + + + {% block extra_head %} {% endblock %} + + +
+

{% block header %}{% endblock %}

+
+

+ {% block body %}{% endblock %} +

+
+ + \ No newline at end of file