From 7ebcdfebdf4e1c8b69026a24cafe500c67dbc384 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 26 Jul 2021 20:52:56 -0700 Subject: web: access_redirect_fallback mechanism This adds a helper code path that "tries harder" to find an access link, by querying the fatcat API directly to look for any file from any release associated with the work. If it finds a match, it does the redirect as usual (but does log the incident). If no match can be found, there is now a more helpful access-specific 404 error page. If the *work* is a 404, the generic error page is shown. --- fatcat_scholar/templates/access_404.html | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 fatcat_scholar/templates/access_404.html (limited to 'fatcat_scholar/templates') diff --git a/fatcat_scholar/templates/access_404.html b/fatcat_scholar/templates/access_404.html new file mode 100644 index 0000000..d058186 --- /dev/null +++ b/fatcat_scholar/templates/access_404.html @@ -0,0 +1,35 @@ +{% extends "base.html" %} + +{% block title %} +404 - {{ super() }} +{% endblock %} + +{% block main %} +
+
+
{% trans %}404: Access Location Not Found{% endtrans %}
+

{% trans %}We could not find a valid redirect for the URL you tried. Sorry about that!{% endtrans %} +

{% trans %}There may be a typo, truncation, or encoding error. Or, the resource may have been removed from our catalog.{% endtrans %} +

{% trans %}Some places you can visit try to hunt down this resource (or a replacement) include:{% endtrans %} +

+
+
+{% endblock %} -- cgit v1.2.3