From 19143a7860a7572b428bbf3c3b7c7bfec3c6465a Mon Sep 17 00:00:00 2001 From: Christoph Ladurner Date: Fri, 2 Feb 2024 10:10:23 +0100 Subject: [PATCH] ui: add 423 error page --- invenio_theme_tugraz/ext.py | 7 +++++-- .../templates/invenio_theme_tugraz/423.html | 14 ++++++++++++++ .../translations/de/LC_MESSAGES/messages.po | 16 ++++++++++++---- .../translations/en/LC_MESSAGES/messages.po | 16 ++++++++++++---- invenio_theme_tugraz/translations/messages.pot | 14 +++++++++++--- invenio_theme_tugraz/views.py | 5 +++++ 6 files changed, 59 insertions(+), 13 deletions(-) create mode 100644 invenio_theme_tugraz/templates/invenio_theme_tugraz/423.html diff --git a/invenio_theme_tugraz/ext.py b/invenio_theme_tugraz/ext.py index 7db9382..74b1296 100644 --- a/invenio_theme_tugraz/ext.py +++ b/invenio_theme_tugraz/ext.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2020-2021 Graz University of Technology. +# Copyright (C) 2020-2024 Graz University of Technology. # # invenio-theme-tugraz is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see LICENSE file for more @@ -9,7 +9,7 @@ """invenio module for TUGRAZ theme.""" from . import config -from .views import index +from .views import index, locked class InvenioThemeTugraz(object): @@ -26,6 +26,9 @@ class InvenioThemeTugraz(object): # https://flask.palletsprojects.com/en/1.1.x/api/#flask.Flask.add_url_rule app.add_url_rule("/", "index", index) self.init_config(app) + + app.register_error_handler(423, locked) + app.extensions["invenio-theme-tugraz"] = self def init_config(self, app): diff --git a/invenio_theme_tugraz/templates/invenio_theme_tugraz/423.html b/invenio_theme_tugraz/templates/invenio_theme_tugraz/423.html new file mode 100644 index 0000000..88ec245 --- /dev/null +++ b/invenio_theme_tugraz/templates/invenio_theme_tugraz/423.html @@ -0,0 +1,14 @@ +{# + Copyright (C) 2024 Graz University of Technology. + + invenio-theme-tugraz is free software; you can redistribute it and/or + modify it under the terms of the MIT License; see LICENSE file for more + details. +#} + +{% extends config.THEME_ERROR_TEMPLATE %} + +{% block message %} +

{{_("Locked")}}

+

{{_("The resource that is being accessed is locked.")}}

+{% endblock message %} diff --git a/invenio_theme_tugraz/translations/de/LC_MESSAGES/messages.po b/invenio_theme_tugraz/translations/de/LC_MESSAGES/messages.po index f7ae1c0..3c2ca91 100644 --- a/invenio_theme_tugraz/translations/de/LC_MESSAGES/messages.po +++ b/invenio_theme_tugraz/translations/de/LC_MESSAGES/messages.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: invenio-theme-tugraz 1.0.4\n" "Report-Msgid-Bugs-To: mojib.wali@tugraz.at\n" -"POT-Creation-Date: 2024-01-31 09:23+0100\n" -"PO-Revision-Date: 2024-01-31 10:03+0100\n" +"POT-Creation-Date: 2024-02-02 10:08+0100\n" +"PO-Revision-Date: 2024-02-02 10:09+0100\n" "Last-Translator: \n" "Language-Team: de \n" "Language: de\n" @@ -38,6 +38,14 @@ msgstr "Übersicht" msgid "My dashboard" msgstr "Meine Übersicht" +#: invenio_theme_tugraz/templates/invenio_theme_tugraz/423.html:12 +msgid "Locked" +msgstr "Locked" + +#: invenio_theme_tugraz/templates/invenio_theme_tugraz/423.html:13 +msgid "The resource that is being accessed is locked." +msgstr "Die angeforderte Ressource ist zurzeit gesperrt." + #: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/accounts_base.html:26 #: invenio_theme_tugraz/templates/invenio_theme_tugraz/base.html:34 msgid "Invenio" @@ -118,7 +126,7 @@ msgid "All uploads display standards compliant usage statistics. " msgstr "Alle Uploads zeigen standardkonforme Nutzungsstatistiken an." #: invenio_theme_tugraz/templates/invenio_theme_tugraz/benefits.html:19 -#: invenio_theme_tugraz/templates/invenio_theme_tugraz/recent_uploads.html:86 +#: invenio_theme_tugraz/templates/invenio_theme_tugraz/recent_uploads.html:88 msgid "More" msgstr "Mehr" @@ -397,7 +405,7 @@ msgstr "Es sind keine öffentlich zugänglichen Datensätze vorhanden." msgid "Publication date" msgstr "Datum der Veröffentlichung" -#: invenio_theme_tugraz/templates/invenio_theme_tugraz/recent_uploads.html:33 +#: invenio_theme_tugraz/templates/invenio_theme_tugraz/recent_uploads.html:34 msgid "Resource type" msgstr "Art der Veröffentlichung" diff --git a/invenio_theme_tugraz/translations/en/LC_MESSAGES/messages.po b/invenio_theme_tugraz/translations/en/LC_MESSAGES/messages.po index 74b647b..f368246 100644 --- a/invenio_theme_tugraz/translations/en/LC_MESSAGES/messages.po +++ b/invenio_theme_tugraz/translations/en/LC_MESSAGES/messages.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: invenio-theme-tugraz 4.12.0\n" "Report-Msgid-Bugs-To: mojib.wali@tugraz.at\n" -"POT-Creation-Date: 2024-01-31 09:23+0100\n" -"PO-Revision-Date: 2024-01-31 10:00+0100\n" +"POT-Creation-Date: 2024-02-02 10:08+0100\n" +"PO-Revision-Date: 2024-02-02 10:09+0100\n" "Last-Translator: \n" "Language-Team: en \n" "Language: en\n" @@ -38,6 +38,14 @@ msgstr "" msgid "My dashboard" msgstr "" +#: invenio_theme_tugraz/templates/invenio_theme_tugraz/423.html:12 +msgid "Locked" +msgstr "" + +#: invenio_theme_tugraz/templates/invenio_theme_tugraz/423.html:13 +msgid "The resource that is being accessed is locked." +msgstr "" + #: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/accounts_base.html:26 #: invenio_theme_tugraz/templates/invenio_theme_tugraz/base.html:34 msgid "Invenio" @@ -108,7 +116,7 @@ msgid "All uploads display standards compliant usage statistics. " msgstr "" #: invenio_theme_tugraz/templates/invenio_theme_tugraz/benefits.html:19 -#: invenio_theme_tugraz/templates/invenio_theme_tugraz/recent_uploads.html:86 +#: invenio_theme_tugraz/templates/invenio_theme_tugraz/recent_uploads.html:88 msgid "More" msgstr "" @@ -380,7 +388,7 @@ msgstr "" msgid "Publication date" msgstr "" -#: invenio_theme_tugraz/templates/invenio_theme_tugraz/recent_uploads.html:33 +#: invenio_theme_tugraz/templates/invenio_theme_tugraz/recent_uploads.html:34 msgid "Resource type" msgstr "" diff --git a/invenio_theme_tugraz/translations/messages.pot b/invenio_theme_tugraz/translations/messages.pot index 1ce738b..5a22d9c 100644 --- a/invenio_theme_tugraz/translations/messages.pot +++ b/invenio_theme_tugraz/translations/messages.pot @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: invenio-theme-tugraz 4.12.3\n" "Report-Msgid-Bugs-To: mojib.wali@tugraz.at\n" -"POT-Creation-Date: 2024-01-31 09:23+0100\n" +"POT-Creation-Date: 2024-02-02 10:08+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -36,6 +36,14 @@ msgstr "" msgid "My dashboard" msgstr "" +#: invenio_theme_tugraz/templates/invenio_theme_tugraz/423.html:12 +msgid "Locked" +msgstr "" + +#: invenio_theme_tugraz/templates/invenio_theme_tugraz/423.html:13 +msgid "The resource that is being accessed is locked." +msgstr "" + #: invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/accounts_base.html:26 #: invenio_theme_tugraz/templates/invenio_theme_tugraz/base.html:34 msgid "Invenio" @@ -106,7 +114,7 @@ msgid "All uploads display standards compliant usage statistics. " msgstr "" #: invenio_theme_tugraz/templates/invenio_theme_tugraz/benefits.html:19 -#: invenio_theme_tugraz/templates/invenio_theme_tugraz/recent_uploads.html:86 +#: invenio_theme_tugraz/templates/invenio_theme_tugraz/recent_uploads.html:88 msgid "More" msgstr "" @@ -351,7 +359,7 @@ msgstr "" msgid "Publication date" msgstr "" -#: invenio_theme_tugraz/templates/invenio_theme_tugraz/recent_uploads.html:33 +#: invenio_theme_tugraz/templates/invenio_theme_tugraz/recent_uploads.html:34 msgid "Resource type" msgstr "" diff --git a/invenio_theme_tugraz/views.py b/invenio_theme_tugraz/views.py index 7efb700..8b3201f 100644 --- a/invenio_theme_tugraz/views.py +++ b/invenio_theme_tugraz/views.py @@ -100,3 +100,8 @@ def index(): return render_template( "invenio_theme_tugraz/index.html", records=records_serializer(records) ) + + +def locked(): + """Error page for status locked.""" + return render_template("invenio_theme_tugraz/423.html")