diff options
author | Bryan Newbold <bnewbold@archive.org> | 2021-07-26 20:52:56 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2021-07-26 20:52:58 -0700 |
commit | 7ebcdfebdf4e1c8b69026a24cafe500c67dbc384 (patch) | |
tree | ab580d4307acc5d10b5a8669d28ac6a6ec6e81e5 /fatcat_scholar/templates | |
parent | eeb456c16d016d8523023f787597efae7a6317b9 (diff) | |
download | fatcat-scholar-7ebcdfebdf4e1c8b69026a24cafe500c67dbc384.tar.gz fatcat-scholar-7ebcdfebdf4e1c8b69026a24cafe500c67dbc384.zip |
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.
Diffstat (limited to 'fatcat_scholar/templates')
-rw-r--r-- | fatcat_scholar/templates/access_404.html | 35 |
1 files changed, 35 insertions, 0 deletions
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 %} +<div class="ui icon error message"> + <div class="content"> + <div class="header">{% trans %}404: Access Location Not Found{% endtrans %}</div> + <p>{% trans %}We could not find a valid redirect for the URL you tried. Sorry about that!{% endtrans %} + <p>{% trans %}There may be a typo, truncation, or encoding error. Or, the resource may have been removed from our catalog.{% endtrans %} + <p>{% trans %}Some places you can visit try to hunt down this resource (or a replacement) include:{% endtrans %} + <ul> + {% if original_url %} + <li>{% trans %}Original web url:{% endtrans %} + <br> + <code style="word-break: break-all;"><a href="{{ original_url }}">{{ original_url }}</a></code> + </li> + <li><a href="https://web.archive.org/web/*/{{ original_url }}">{% trans %}Wayback Machine calendar page (all captures){% endtrans %}</a> + {% endif %} + {% if archiveorg_path %} + <li>{% trans %}archive.org download link for the item:{% endtrans %} + {% set archiveorg_url="https://archive.org/download" + archiveorg_path %} + <br> + <code style="word-break: break-all;"><a href="{{ archiveorg_url }}">{{ archiveorg_url }}</a></code> + {% endif %} + {% if work_ident %} + <li><a href="/work/{{ work_ident }}">{% trans %}Scholar landing page{% endtrans %}</a> + <li><a href="https://fatcat.wiki/work/{{ work_ident }}">{% trans %}Fatcat catalog page{% endtrans %}</a> + {% endif %} + </ul> + </div> +</div> +{% endblock %} |