From 01ae25c1bf24c8d9f7721f49122a15bf522bdbb4 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 21 May 2020 14:23:31 -0700 Subject: search query improvements - wire up most of the filters and sort order - query sticks around in search box - crude error message (needs work) --- fatcat_scholar/templates/search.html | 70 +++++++++++------------------------- 1 file changed, 21 insertions(+), 49 deletions(-) (limited to 'fatcat_scholar/templates/search.html') diff --git a/fatcat_scholar/templates/search.html b/fatcat_scholar/templates/search.html index c2cd3ea..6d9fec2 100644 --- a/fatcat_scholar/templates/search.html +++ b/fatcat_scholar/templates/search.html @@ -5,68 +5,40 @@
- {% if found %} -
-
- {{ "{:,}".format(found.count_found) }} -
-
- Hits -
+ {% if hits %} +
+ {#

{{ "{:,}".format(hits.count_found) }}

#} +

{{ "{:,}".format(hits.count_found) }}

+ Hits +
+
+ in {{ "{:0.2}".format(hits.query_time_ms/1000.0) }}sec
- {% else %} - Maybe some filters, facets, counts over here? {% endif %}
- Release Date - - -
- Resource Type - - -
- Availability - - -
- Sort Order - + {{ search_macros.query_option(query.time_options, query.filter_time) }} + {{ search_macros.query_option(query.type_options, query.filter_type) }} + {{ search_macros.query_option(query.availability_options, query.filter_availability) }} + {{ search_macros.query_option(query.sort_options, query.sort_order) }}
- {% if found %} - {% if found.results %} - {% for paper in found.results %} + {% if search_error %} +
+
Query Error
+

{{ search_error }}

+
+ {% elif hits %} + {% if hits.results %} + {% for paper in hits.results %} {{ search_macros.fulltext_search_result_row(paper) }} {% endfor %} {% endif %} {% else %} - Some other message here when there is no search? Like a bunch of examples? - Or does that ever happen... we can just run query on "*". + No search submitted? Some message should go here. {% endif %}
-- cgit v1.2.3