Skip to content

Commit

Permalink
v2: don't hide search/tags if active; presets should preserve search/…
Browse files Browse the repository at this point in the history
…tags. #318
  • Loading branch information
lemon24 committed Jan 19, 2025
1 parent ab76bcf commit fae6b8c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/reader/_app/v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 15 additions & 3 deletions src/reader/_app/v2/templates/v2/entries.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,18 @@
</li>
-->
{% 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 %}

<li class="nav-item">
<a class="nav-link" href="{{ url_for('.entries', **args) }}">
{{ name }}
Expand All @@ -53,9 +63,11 @@


<form>
{% if form.search.data %}{{ macros.input(form.search, 'search') }}{% endif %}
{% if form.feed_tags.data %}{{ macros.input(form.feed_tags, 'tag') }}{% endif %}
<div class="collapse mb-3" id="nav-more">
{% if form.search.data %}{{ macros.input(form.search, 'search') }}{% endif %}
{% if form.feed_tags.data %}{{ macros.input(form.feed_tags, 'tag') }}{% endif %}
{% if not form.search.data %}{{ macros.input(form.search, 'search') }}{% endif %}
{% if not form.feed_tags.data %}{{ macros.input(form.feed_tags, 'tag') }}{% endif %}
<div class="mb-3">
{{ macros.radio(form.read) }}
{{ macros.radio(form.important) }}
Expand Down

0 comments on commit fae6b8c

Please sign in to comment.