summaryrefslogtreecommitdiffstats
path: root/fatcat_scholar/templates/base.html
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2022-04-06 17:40:30 -0700
committerBryan Newbold <bnewbold@archive.org>2022-04-06 17:40:30 -0700
commitddf54c9670c6d4adb500e08342d831cf1214d641 (patch)
tree5f4533779c6a85e8dda318f5def1619d73d5adce /fatcat_scholar/templates/base.html
parentc06508bb7b2c28360c74ac5a98cad0b1ee9f77c7 (diff)
downloadfatcat-scholar-ddf54c9670c6d4adb500e08342d831cf1214d641.tar.gz
fatcat-scholar-ddf54c9670c6d4adb500e08342d831cf1214d641.zip
polish RSS feed generation, and add basic test coverage
Diffstat (limited to 'fatcat_scholar/templates/base.html')
-rw-r--r--fatcat_scholar/templates/base.html20
1 files changed, 7 insertions, 13 deletions
diff --git a/fatcat_scholar/templates/base.html b/fatcat_scholar/templates/base.html
index ce74f26..1abc216 100644
--- a/fatcat_scholar/templates/base.html
+++ b/fatcat_scholar/templates/base.html
@@ -136,19 +136,13 @@
<div style="display: flex; width: 100%; justify-content: space-between; padding-top: 0.5em;">
<div></div>
<div>
- {% if query %}
- <form class="" id="rss_feed_form" name="rss_feed_form" action="{{ lang_prefix }}/feed/rss" method="get">
- <input form="rss_feed_form" type="hidden" name="q" value="{{ query.q }}">
- {% if query.filter_type %}
- <input form="rss_feed_form" type="hidden" name="filter_type" value="{{ query.filter_type }}">
- {% endif %}
- {% if query.filter_availability %}
- <input form="rss_feed_form" type="hidden" name="filter_availability" value="{{ query.filter_availability }}">
- {% endif %}
- <button class="text-button" form="rss_feed_form" type="submit">
- {% trans %}RSS Feed{% endtrans %}
- </button>
- </form>
+ {% if query and query.q %}
+ {% set rss_params = dict(q=query.q) %}
+ {% if query.filter_type %}{% do rss_params.update(dict(filter_type= query.filter_type)) %}{% endif %}
+ {% if query.filter_availability %}{% do rss_params.update(dict(filter_availabilty=query.filter_availability)) %}{% endif %}
+ <a href="{{ lang_prefix }}/feed/rss?{{ rss_params | urlencode }}" rel="nofollow">
+ {% trans %}RSS Feed{% endtrans %}
+ </a>
&nbsp;
{% endif %}
<a rel="help" href="{{ lang_prefix }}/help" style="order: -1;">{{ _("User Guide") }}</a>