From fae6b8c0f4214603664f4206f27947202f7e480b Mon Sep 17 00:00:00 2001 From: lemon24 Date: Sun, 19 Jan 2025 11:24:58 +0200 Subject: [PATCH] v2: don't hide search/tags if active; presets should preserve search/tags. #318 --- src/reader/_app/v2/__init__.py | 1 - src/reader/_app/v2/templates/v2/entries.html | 18 +++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/reader/_app/v2/__init__.py b/src/reader/_app/v2/__init__.py index 49d2c51f..1b407991 100644 --- a/src/reader/_app/v2/__init__.py +++ b/src/reader/_app/v2/__init__.py @@ -23,7 +23,6 @@ def entries(): reader = get_reader() # TODO: search - # TODO: if search/tags is active, search/tags box should not be hidden # TODO: highlight active filter preset + uncollapse more # TODO: paqgination # TODO: read time diff --git a/src/reader/_app/v2/templates/v2/entries.html b/src/reader/_app/v2/templates/v2/entries.html index fcc8a3f2..337a633d 100644 --- a/src/reader/_app/v2/templates/v2/entries.html +++ b/src/reader/_app/v2/templates/v2/entries.html @@ -35,8 +35,18 @@ --> {% for name, preset in presets.items() %} + {%- set args = preset.copy() -%} - {%- if feed %}{% set _ = args.update(feed=feed.url) %}{% endif %} + {%- if form.feed.data %} + {% set _ = args.setdefault(form.feed.name, form.feed.raw_data) %} + {% endif %} + {%- if form.search.data %} + {% set _ = args.setdefault(form.search.name, form.search.raw_data) %} + {% endif %} + {%- if form.feed_tags.data %} + {% set _ = args.setdefault(form.feed_tags.name, form.feed_tags.raw_data) %} + {% endif %} +