Skip to content

Commit

Permalink
Create 404 page (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherSpelt authored Sep 25, 2024
2 parents 2891351 + 53db4d3 commit cc56eff
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 15 deletions.
12 changes: 10 additions & 2 deletions amt/locale/base.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-09-18 11:47+0200\n"
"POT-Creation-Date: 2024-09-24 16:54+0200\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 Down Expand Up @@ -53,6 +53,14 @@ msgstr ""
msgid "Details"
msgstr ""

#: amt/site/templates/errors/_HTTPException404.html.j2:1
msgid "Page not found"
msgstr ""

#: amt/site/templates/errors/_HTTPException404.html.j2:3
msgid "The page or file you requested is not found. Please check the URL."
msgstr ""

#: amt/site/templates/errors/_RequestValidation.html.j2:1
msgid "Request Validation Error"
msgstr ""
Expand All @@ -61,7 +69,7 @@ msgstr ""
msgid "An error occurred"
msgstr ""

#: amt/site/templates/layouts/base.html.j2:1
#: amt/site/templates/layouts/base.html.j2:11
msgid "Algorithmic Management Toolkit (AMT)"
msgstr ""

Expand Down
Binary file modified amt/locale/en_US/LC_MESSAGES/messages.mo
Binary file not shown.
12 changes: 10 additions & 2 deletions amt/locale/en_US/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-09-18 11:47+0200\n"
"POT-Creation-Date: 2024-09-24 16:54+0200\n"
"PO-Revision-Date: 2024-07-25 21:01+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: en_US\n"
Expand Down Expand Up @@ -54,6 +54,14 @@ msgstr ""
msgid "Details"
msgstr ""

#: amt/site/templates/errors/_HTTPException404.html.j2:1
msgid "Page not found"
msgstr ""

#: amt/site/templates/errors/_HTTPException404.html.j2:3
msgid "The page or file you requested is not found. Please check the URL."
msgstr ""

#: amt/site/templates/errors/_RequestValidation.html.j2:1
msgid "Request Validation Error"
msgstr ""
Expand All @@ -62,7 +70,7 @@ msgstr ""
msgid "An error occurred"
msgstr ""

#: amt/site/templates/layouts/base.html.j2:1
#: amt/site/templates/layouts/base.html.j2:11
msgid "Algorithmic Management Toolkit (AMT)"
msgstr ""

Expand Down
Binary file modified amt/locale/nl_FY/LC_MESSAGES/messages.mo
Binary file not shown.
12 changes: 10 additions & 2 deletions amt/locale/nl_FY/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-09-18 11:47+0200\n"
"POT-Creation-Date: 2024-09-24 16:54+0200\n"
"PO-Revision-Date: 2024-07-25 21:01+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: nl_FY\n"
Expand Down Expand Up @@ -54,6 +54,14 @@ msgstr ""
msgid "Details"
msgstr ""

#: amt/site/templates/errors/_HTTPException404.html.j2:1
msgid "Page not found"
msgstr ""

#: amt/site/templates/errors/_HTTPException404.html.j2:3
msgid "The page or file you requested is not found. Please check the URL."
msgstr ""

#: amt/site/templates/errors/_RequestValidation.html.j2:1
msgid "Request Validation Error"
msgstr ""
Expand All @@ -62,7 +70,7 @@ msgstr ""
msgid "An error occurred"
msgstr ""

#: amt/site/templates/layouts/base.html.j2:1
#: amt/site/templates/layouts/base.html.j2:11
msgid "Algorithmic Management Toolkit (AMT)"
msgstr ""

Expand Down
Binary file modified amt/locale/nl_NL/LC_MESSAGES/messages.mo
Binary file not shown.
12 changes: 10 additions & 2 deletions amt/locale/nl_NL/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-09-18 11:47+0200\n"
"POT-Creation-Date: 2024-09-24 16:54+0200\n"
"PO-Revision-Date: 2024-07-25 21:01+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: nl_NL\n"
Expand Down Expand Up @@ -54,6 +54,14 @@ msgstr ""
msgid "Details"
msgstr ""

#: amt/site/templates/errors/_HTTPException404.html.j2:1
msgid "Page not found"
msgstr "Pagina niet gevonden"

#: amt/site/templates/errors/_HTTPException404.html.j2:3
msgid "The page or file you requested is not found. Please check the URL."
msgstr "De pagina die u wilde zien of het bestand dat u wilde bekijken is niet gevonden. Controleer de URL."

#: amt/site/templates/errors/_RequestValidation.html.j2:1
msgid "Request Validation Error"
msgstr "Aanvraag Validatie Fout"
Expand All @@ -62,7 +70,7 @@ msgstr "Aanvraag Validatie Fout"
msgid "An error occurred"
msgstr "Er is is een fout opgetreden"

#: amt/site/templates/layouts/base.html.j2:1
#: amt/site/templates/layouts/base.html.j2:11
msgid "Algorithmic Management Toolkit (AMT)"
msgstr "Algoritme Management Toolkit (AMT)"

Expand Down
9 changes: 8 additions & 1 deletion amt/site/templates/errors/HTTPException.html.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{% extends 'layouts/base.html.j2' %}

{% block content %}
{% include 'errors/_HTTPException.html.j2' %}
<div class="rvo-max-width-layout rvo-max-width-layout--md rvo-max-width-layout-inline-padding--none margin-bottom-large">

{% if status_code == 404 %}
{% include 'errors/_HTTPException404.html.j2' %}
{% else %}
{% include 'errors/_HTTPException.html.j2' %}
{% endif %}
</div>
{% endblock %}
4 changes: 4 additions & 0 deletions amt/site/templates/errors/_HTTPException404.html.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<h1 class="utrecht-heading-1">{% trans %}Page not found{% endtrans %}</h1>
<p class="rvo-text">
{% trans %}The page or file you requested is not found. Please check the URL.{% endtrans %}
</p>
12 changes: 6 additions & 6 deletions tests/api/routes/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_get_unknown_project(client: TestClient) -> None:
# then
assert response.status_code == 404
assert response.headers["content-type"] == "text/html; charset=utf-8"
assert b"NotFound: Not found" in response.content
assert b"Page not found" in response.content


def test_get_project_tasks(client: TestClient, db: DatabaseTestUtils) -> None:
Expand Down Expand Up @@ -66,7 +66,7 @@ def test_get_system_card_unknown_project(client: TestClient) -> None:
# then
assert response.status_code == 404
assert response.headers["content-type"] == "text/html; charset=utf-8"
assert b"NotFound: Not found" in response.content
assert b"Page not found" in response.content


# TODO: Test are now have hard coded URL paths because the system card
Expand Down Expand Up @@ -95,7 +95,7 @@ def test_get_assessment_card_unknown_project(client: TestClient) -> None:
# then
assert response.status_code == 404
assert response.headers["content-type"] == "text/html; charset=utf-8"
assert b"NotFound: Not found" in response.content
assert b"Page not found" in response.content


# TODO: Test are now have hard coded URL paths because the system card
Expand All @@ -111,7 +111,7 @@ def test_get_assessment_card_unknown_assessment(client: TestClient, db: Database
# then
assert response.status_code == 404
assert response.headers["content-type"] == "text/html; charset=utf-8"
assert b"NotFound: Not found" in response.content
assert b"Page not found" in response.content


# TODO: Test are now have hard coded URL paths because the system card
Expand Down Expand Up @@ -140,7 +140,7 @@ def test_get_model_card_unknown_project(client: TestClient) -> None:
# then
assert response.status_code == 404
assert response.headers["content-type"] == "text/html; charset=utf-8"
assert b"NotFound: Not found" in response.content
assert b"Page not found" in response.content


# TODO: Test are now have hard coded URL paths because the system card
Expand All @@ -156,4 +156,4 @@ def test_get_assessment_card_unknown_model_card(client: TestClient, db: Database
# then
assert response.status_code == 404
assert response.headers["content-type"] == "text/html; charset=utf-8"
assert b"NotFound: Not found" in response.content
assert b"Page not found" in response.content

0 comments on commit cc56eff

Please sign in to comment.