Skip to content

Commit

Permalink
ui: add 423 error page
Browse files Browse the repository at this point in the history
  • Loading branch information
utnapischtim committed Feb 2, 2024
1 parent 2d47e30 commit 19143a7
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 13 deletions.
7 changes: 5 additions & 2 deletions invenio_theme_tugraz/ext.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,7 +9,7 @@
"""invenio module for TUGRAZ theme."""

from . import config
from .views import index
from .views import index, locked


class InvenioThemeTugraz(object):
Expand All @@ -26,6 +26,9 @@ def init_app(self, app):
# 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):
Expand Down
14 changes: 14 additions & 0 deletions invenio_theme_tugraz/templates/invenio_theme_tugraz/423.html
Original file line number Diff line number Diff line change
@@ -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 %}
<h1><i class="bolt icon"></i> {{_("Locked")}}</h1>
<p>{{_("The resource that is being accessed is locked.")}}</p>
{% endblock message %}
16 changes: 12 additions & 4 deletions invenio_theme_tugraz/translations/de/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ msgid ""
msgstr ""
"Project-Id-Version: invenio-theme-tugraz 1.0.4\n"
"Report-Msgid-Bugs-To: [email protected]\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 <[email protected]>\n"
"Language: de\n"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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"

Expand Down
16 changes: 12 additions & 4 deletions invenio_theme_tugraz/translations/en/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ msgid ""
msgstr ""
"Project-Id-Version: invenio-theme-tugraz 4.12.0\n"
"Report-Msgid-Bugs-To: [email protected]\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 <[email protected]>\n"
"Language: en\n"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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 ""

Expand Down Expand Up @@ -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 ""

Expand Down
14 changes: 11 additions & 3 deletions invenio_theme_tugraz/translations/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: invenio-theme-tugraz 4.12.3\n"
"Report-Msgid-Bugs-To: [email protected]\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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand All @@ -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"
Expand Down Expand Up @@ -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 ""

Expand Down Expand Up @@ -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 ""

Expand Down
5 changes: 5 additions & 0 deletions invenio_theme_tugraz/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

0 comments on commit 19143a7

Please sign in to comment.