aboutsummaryrefslogtreecommitdiffstats
path: root/fatcat_scholar/templates/search_macros.html
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-08-06 20:21:33 -0700
committerBryan Newbold <bnewbold@archive.org>2020-08-06 20:21:33 -0700
commitb7a3739239df2fb1573a8677eaef9b7104c4ad0a (patch)
tree2998374d44d2d9bdb0c3aac39b23bc24f190fa84 /fatcat_scholar/templates/search_macros.html
parent65b96de965cf3633a216d6740791376d00a11564 (diff)
downloadfatcat-scholar-b7a3739239df2fb1573a8677eaef9b7104c4ad0a.tar.gz
fatcat-scholar-b7a3739239df2fb1573a8677eaef9b7104c4ad0a.zip
add debug mode flag (to control json tag/link)
Diffstat (limited to 'fatcat_scholar/templates/search_macros.html')
-rw-r--r--fatcat_scholar/templates/search_macros.html10
1 files changed, 6 insertions, 4 deletions
diff --git a/fatcat_scholar/templates/search_macros.html b/fatcat_scholar/templates/search_macros.html
index 1f5f8f3..05fbbdc 100644
--- a/fatcat_scholar/templates/search_macros.html
+++ b/fatcat_scholar/templates/search_macros.html
@@ -24,7 +24,7 @@
{% endif %}
{% endmacro %}
-{% macro fulltext_search_result_row(paper, locale=None) -%}
+{% macro fulltext_search_result_row(paper, locale=None, debug_mode=False) -%}
<div class="ui grid">
<div class="thirteen wide column serp-hit-box">
{# ### TITLE ROW #}
@@ -149,9 +149,11 @@
{# colors to use: olive, brown, grey, pink, red, etc #}
{# TODO: remove doc for ES 7.x-style lack of type #}
{# TODO: only show 'json' link if from cluster? #}
- <a target="_blank" href="{{ settings.ELASTICSEARCH_BACKEND }}/{{ settings.ELASTICSEARCH_FULLTEXT_INDEX }}/_doc/{{ paper.key }}">
- <span class="ui label small" title="search document JSON debug link">json</span>
- </a>
+ {% if debug_mode %}
+ <a target="_blank" href="{{ settings.ELASTICSEARCH_BACKEND }}/{{ settings.ELASTICSEARCH_FULLTEXT_INDEX }}/_doc/{{ paper.key }}">
+ <span class="ui label small" title="search document JSON debug link">json</span>
+ </a>
+ {% endif %}
{% for tag in paper.tags|sort %}
{{ tag_label(tag) }}