diff options
author | Bryan Newbold <bnewbold@archive.org> | 2020-04-09 17:49:49 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2020-04-09 17:49:49 -0700 |
commit | ee7d9a60092ebd7ede167bcc4ec1aa1477a714c2 (patch) | |
tree | 96e4c4e6e03e4828e1c0755886506271b9c4355e /fatcat_covid19 | |
parent | 8b3b3e5892a10bf6748c7824549641d20e2447d7 (diff) | |
download | fatcat-covid19-ee7d9a60092ebd7ede167bcc4ec1aa1477a714c2.tar.gz fatcat-covid19-ee7d9a60092ebd7ede167bcc4ec1aa1477a714c2.zip |
fix webface bugs with default filter values
Diffstat (limited to 'fatcat_covid19')
-rw-r--r-- | fatcat_covid19/templates/fulltext_search.html | 4 | ||||
-rw-r--r-- | fatcat_covid19/webface.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/fatcat_covid19/templates/fulltext_search.html b/fatcat_covid19/templates/fulltext_search.html index 55b25cc..f668b19 100644 --- a/fatcat_covid19/templates/fulltext_search.html +++ b/fatcat_covid19/templates/fulltext_search.html @@ -43,7 +43,7 @@ {{ _("from") }} <div class="ui inline dropdown"> - <input type="hidden" name="filter_time" value="{{ filter_time or 'all' }}"> + <input type="hidden" name="filter_time" value="{{ filter_time or 'all_time' }}"> <div class="text">{{ (filter_time and filter_time.replace("_", " ")) or "all time" }}</div> <i class="dropdown icon"></i> <div class="menu"> @@ -52,7 +52,7 @@ {{ _("Time Period") }} </div> <div class="divider"></div> - <div class="{% if filter_type == 'all' %}active{% endif %} item" data-value="all" >{{ _("all time") }}</div> + <div class="{% if filter_type == 'all_time' %}active{% endif %} item" data-value="all_time" >{{ _("all time") }}</div> <div class="{% if filter_type == 'past_week' %}active{% endif %} item" data-value="past_week" >{{ _("past week") }}</div> <div class="{% if filter_type == 'this_year' %}active{% endif %} item" data-value="this_year" >{{ _("this year") }}</div> <div class="{% if filter_type == 'since_2000' %}active{% endif %} item" data-value="since_2000" >{{ _("since 2000") }}</div> diff --git a/fatcat_covid19/webface.py b/fatcat_covid19/webface.py index aa604df..8db807b 100644 --- a/fatcat_covid19/webface.py +++ b/fatcat_covid19/webface.py @@ -83,8 +83,8 @@ def page_home(): def fulltext_search(): query = request.args.get('q') - filter_type = request.args.get('filter_type') or None - filter_time = request.args.get('filter_time') or None + filter_type = request.args.get('filter_type') or 'papers' + filter_time = request.args.get('filter_time') or 'all_time' offset = request.args.get('offset', '0') offset = max(0, int(offset)) if offset.isnumeric() else 0 |