Skip to content
Snippets Groups Projects
Commit 2e20b144 authored by Alexa Valentová's avatar Alexa Valentová
Browse files

update 404 page

parent c838bc46
Branches test
No related tags found
1 merge request!8update 404 page
Pipeline #21541 passed
...@@ -2,24 +2,14 @@ ...@@ -2,24 +2,14 @@
{% block content %} {% block content %}
<h1 class="font-alt text-6xl mb-6 md:mb-10"> <h1 class="font-alt text-6xl mb-6 md:mb-10">
Přesun do nového Registru Smlouva nenalezena
</h1> </h1>
<div class="prose max-w-none"> <div class="prose max-w-none">
<p> <p>
{% if archive_page_exists %}
Tato smlouva bohužel zatím nebyla zadána do nedávno nasazené nové verze Registru
smluv.<br>
<strong>
Je však stále dostupná v archivu na adrese:
<a href="{{ archive_url }}">{{ archive_url }}</a>.
</strong>
{% else %}
Tato smlouva byla možná v určitou dobu dostupná ve staré verzi Registru smluv, Tato smlouva byla možná v určitou dobu dostupná ve staré verzi Registru smluv,
ale aktuálně není dostupná v ani jedné ze dvou verzí. Pokud víš jistě, že ji ale aktuálně není nahraná nikde. Pokud víš jistě, že odkaz je správný,
dokážeš najít, archiv najdeš na napiš <a href="https://zulip.pirati.cz/#narrow/stream/34-Technick.C3.BD-odbor/topic/Registr.20smluv">sem</a>.
<a href="https://smlouvy-archiv.pirati.cz">smlouvy-archiv.pirati.cz</a>.
{% endif %}
</p> </p>
<p> <p>
Více informací o novém Registru se můžeš dozvědět Více informací o novém Registru se můžeš dozvědět
......
...@@ -546,11 +546,6 @@ def get_ares_info(request, ico: int): ...@@ -546,11 +546,6 @@ def get_ares_info(request, ico: int):
def handle_404(request, exception): def handle_404(request, exception):
path = os.path.normpath(request.get_full_path()) path = os.path.normpath(request.get_full_path())
archive_url = f"https://smlouvy-archiv.pirati.cz{path}"
archive_response = requests.get(archive_url)
# Quick dirty check for whether the page found is an actual contract
was_found = archive_response.ok and "Datum podpisu" in str(archive_response.content)
return render( return render(
request, request,
...@@ -559,7 +554,5 @@ def handle_404(request, exception): ...@@ -559,7 +554,5 @@ def handle_404(request, exception):
**get_base_context(request), **get_base_context(request),
"title": "Stránka nenalezena", "title": "Stránka nenalezena",
"description": "", "description": "",
"archive_page_exists": was_found,
"archive_url": archive_url,
}, },
) )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment