diff --git a/src/reader/_app/v2/__init__.py b/src/reader/_app/v2/__init__.py index 5ed213b7..f63bafcf 100644 --- a/src/reader/_app/v2/__init__.py +++ b/src/reader/_app/v2/__init__.py @@ -73,8 +73,10 @@ def mark_as(): if request.headers.get('hx-request') == 'true': return render_block( - 'v2/entries.html', 'entry_form', entry=reader.get_entry(entry) + 'v2/entries.html', + 'entry_form', + entry=reader.get_entry(entry), + next=request.form['next'], ) - print(request.form['next']) return redirect(request.form['next'], code=303) diff --git a/src/reader/_app/v2/static/style.css b/src/reader/_app/v2/static/style.css index 20285ee7..9b074961 100644 --- a/src/reader/_app/v2/static/style.css +++ b/src/reader/_app/v2/static/style.css @@ -15,3 +15,13 @@ .nav.controls .nav-link.active { color: var(--bs-navbar-active-color); } + +.htmx-indicator { + display: none; +} +.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { + display: inline-block; +} +.htmx-request .label, .htmx-request.label { + display: none; +} diff --git a/src/reader/_app/v2/templates/v2/entries.html b/src/reader/_app/v2/templates/v2/entries.html index 4f254275..73e4510c 100644 --- a/src/reader/_app/v2/templates/v2/entries.html +++ b/src/reader/_app/v2/templates/v2/entries.html @@ -95,48 +95,74 @@

{% endif %} - {% set next = loop.index if not loop.last else loop.index - 1 -%} + {% set next_index = loop.index if not loop.last else loop.index - 1 -%} + {% set next = url_for('.entries', **request.args) + '#entry-' + (next_index|string) %}
{#- TODO: aria stuff #} {% block entry_form scoped %}
@@ -152,11 +178,7 @@

- - {% if next -%} - - {%- endif %} + {% endblock %}