Skip to content

Commit

Permalink
v2: pass macros to render_block. #318
Browse files Browse the repository at this point in the history
  • Loading branch information
lemon24 committed Jan 10, 2025
1 parent 7b6bdab commit 84eedab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/reader/_app/v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from flask import abort
from flask import Blueprint
from flask import current_app
from flask import redirect
from flask import request
from jinja2_fragments.flask import render_block
Expand All @@ -27,7 +28,6 @@ def entries():
# TODO: feed filter
# TODO: paqgination
# TODO: read time
# TODO: htmx mark as ...

form = EntryFilter(request.args)
kwargs = dict(form.data)
Expand Down Expand Up @@ -77,6 +77,8 @@ def mark_as():
'entry_form',
entry=reader.get_entry(entry),
next=request.form['next'],
# equivalent to {% import "v2/macros.html" as macros %}
macros=current_app.jinja_env.get_template('v2/macros.html').module,
)

return redirect(request.form['next'], code=303)

0 comments on commit 84eedab

Please sign in to comment.