aboutsummaryrefslogtreecommitdiffstats
path: root/fatcat_scholar/templates
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2021-01-22 11:17:42 -0800
committerBryan Newbold <bnewbold@archive.org>2021-01-22 11:17:42 -0800
commit60b031925e86ff0a408b683e91ade54156cad64f (patch)
tree40322796e46fe4a1f6c68c9aed0659ab8c1da961 /fatcat_scholar/templates
parenta38b226a03010e055d7d1d6c5928827adefc5a04 (diff)
downloadfatcat-scholar-60b031925e86ff0a408b683e91ade54156cad64f.tar.gz
fatcat-scholar-60b031925e86ff0a408b683e91ade54156cad64f.zip
for lookup (direct) and permalink queries, auto-expand result
Diffstat (limited to 'fatcat_scholar/templates')
-rw-r--r--fatcat_scholar/templates/search.html3
-rw-r--r--fatcat_scholar/templates/search_macros.html4
2 files changed, 4 insertions, 3 deletions
diff --git a/fatcat_scholar/templates/search.html b/fatcat_scholar/templates/search.html
index e7ccc1b..a4a5ba4 100644
--- a/fatcat_scholar/templates/search.html
+++ b/fatcat_scholar/templates/search.html
@@ -126,8 +126,9 @@
{% endif %}
{# search results (rendered via macro) #}
+ {% set expand_result = hits.query_type == 'lookup' %}
{% for paper in hits.results %}
- {{ search_macros.fulltext_search_result_row(paper, locale=locale, debug_mode=query.debug) }}
+ {{ search_macros.fulltext_search_result_row(paper, locale=locale, debug_mode=query.debug, expand=expand_result) }}
{% endfor %}
{% if hits.count_found > hits.limit %}
diff --git a/fatcat_scholar/templates/search_macros.html b/fatcat_scholar/templates/search_macros.html
index fb7068e..1fbfde6 100644
--- a/fatcat_scholar/templates/search_macros.html
+++ b/fatcat_scholar/templates/search_macros.html
@@ -169,11 +169,11 @@
{% endif %}
{% endmacro %}
-{% macro fulltext_search_result_row(paper, locale=None, debug_mode=False) -%}
+{% macro fulltext_search_result_row(paper, locale=None, debug_mode=False, expand=False) -%}
<div class="ui stackable doubling grid">
<div class="thirteen wide column biblio-record">
-<details class="access-options">
+<details class="access-options" {% if expand %}open{% endif %}>
<summary>
{# ### TITLE ROW #}
<h3 class="biblio-title">