From 87f40d0f8d15f16020964773e75d35ea22da049f Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 2 Apr 2020 17:37:35 -0700 Subject: basic fulltext search highlighting --- fatcat_covid19/templates/entity_macros.html | 34 +++++++++++++++++++---------- 1 file changed, 22 insertions(+), 12 deletions(-) (limited to 'fatcat_covid19/templates/entity_macros.html') diff --git a/fatcat_covid19/templates/entity_macros.html b/fatcat_covid19/templates/entity_macros.html index 66f0eb2..cc3a8a6 100644 --- a/fatcat_covid19/templates/entity_macros.html +++ b/fatcat_covid19/templates/entity_macros.html @@ -1,16 +1,7 @@ {% macro fulltext_search_result_row(paper) -%}
-
- {% if paper.fulltext.t_thumbnail_url %} - - - - {% else %} - No Fulltext - {% endif %} -
-
+
{# ### TITLE ROW #}

@@ -41,14 +32,18 @@ [{{ paper.release_type }}] {% endif %}

+ + {#
  json
+ {% if paper.best_pdf_url %}
  fulltext
{% endif %} + #} {# ### AUTHOR ROW #} @@ -87,8 +82,14 @@ {% endif %} {# ### ABSTRACT / QUERY HIGHLIGHT #} - {% if paper.abstract %} -
+ {% if paper._highlights %} +
+ {% for highlight in paper._highlights %} + {{ highlight|safe }} ... + {% endfor %} +
+ {% elif paper.abstract %} +
{% if paper.abstract[0]|length > 500 %} {{ paper.abstract[0][:500] }}... {% else %} @@ -115,6 +116,15 @@ and 5 other versions of the same work! {% endif %}
+
+ {% if paper.fulltext.thumbnail_url %} + + + + {% else %} + {# No Fulltext #} + {% endif %} +
{% endmacro %} -- cgit v1.2.3