From 39fc53dd8de38f5b6a666e6eb9e0b9a0e210946c Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 21 Jan 2021 22:25:21 -0800 Subject: doi domain display: handle /help page --- fatcat_scholar/templates/help.html | 4 ++-- fatcat_scholar/templates/search_macros.html | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'fatcat_scholar/templates') diff --git a/fatcat_scholar/templates/help.html b/fatcat_scholar/templates/help.html index df514e3..5b8ddc2 100644 --- a/fatcat_scholar/templates/help.html +++ b/fatcat_scholar/templates/help.html @@ -128,11 +128,11 @@ apply range queries like year:>1989 year:<2000.{% endtrans %} {% trans %}Digitized copies of works on microfilm may be linked to experimentally. Access may be limited to controlled lending{% endtrans %} - {{ search_macros.doi_access_button({'doi': '#'}, is_oa=False) }} + {{ search_macros.doi_access_button({'biblio': {'doi': '#'}}, is_oa=False) }} {% trans %}A publisher landing page is the authoriative source for the "version of record" of a research publication, but content is not always accessible to the general public{% endtrans %} - {{ search_macros.doi_access_button({'doi': '#'}, is_oa=True) }} + {{ search_macros.doi_access_button({'biblio': {'doi': '#'}}, is_oa=True) }} {% trans %}When the work is from an Open Access publication (sometimes known as "Gold" or "Diamond" OA), and the publisher is expected to provide access to all readers, the button has an orange "unlocked" icon{% endtrans %} diff --git a/fatcat_scholar/templates/search_macros.html b/fatcat_scholar/templates/search_macros.html index 25ba7f5..2f8ddc7 100644 --- a/fatcat_scholar/templates/search_macros.html +++ b/fatcat_scholar/templates/search_macros.html @@ -108,7 +108,12 @@ {% else %} {% endif %} - {{ paper._obj.biblio.doi_link_domain("Publisher / doi.org") }} + {% set default_domain = "Publisher / doi.org" %} + {% if paper._obj and paper._obj.biblio %} + {{ paper._obj.biblio.doi_link_domain(default_domain) }} + {% else %} + {{ default_domain }} + {% endif %} {% endif %} -- cgit v1.2.3