diff options
| author | Dennis Fink | 2026-11-18 21:42:59 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-11-18 21:42:59 +0100 |
| commit | c724c87eb5e23581732a275f1dd808da72932286 (patch) | |
| tree | 47db97175335917c97ec61d403b771dd531786e9 /webmentions_ssg/views | |
| parent | f267db9148e3a390a1a2e50fe71ac4675dceaea1 (diff) | |
| download | webmentions-ssg-c724c87eb5e23581732a275f1dd808da72932286.tar.gz webmentions-ssg-c724c87eb5e23581732a275f1dd808da72932286.zip | |
refactor(core): standardize filter form rendering
Render received and sent list controls through their WTForms instances
and use a shared `filter_form` template variable for consistent filter
handling.
Diffstat (limited to 'webmentions_ssg/views')
| -rw-r--r-- | webmentions_ssg/views/received.py | 4 | ||||
| -rw-r--r-- | webmentions_ssg/views/sources.py | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/webmentions_ssg/views/received.py b/webmentions_ssg/views/received.py index e49ee31..c273618 100644 --- a/webmentions_ssg/views/received.py +++ b/webmentions_ssg/views/received.py @@ -91,7 +91,8 @@ def received_list() -> ResponseReturnValue: :returns: Rendered page containing the paginated received Webmentions. """ - filters = received_filter_args(received_filter_form()) + filter_form = received_filter_form() + filters = received_filter_args(filter_form) query = sa.select(ReceivedWebmention) @@ -175,6 +176,7 @@ def received_list() -> ResponseReturnValue: page_size=page_size, sort_urls=sort_urls, max_received_page_size=current_app.config["RECEIVED_MAX_PAGE_SIZE"], + filter_form=filter_form, action_form=ConfirmActionForm(), ) diff --git a/webmentions_ssg/views/sources.py b/webmentions_ssg/views/sources.py index 84b98fb..a3dbb45 100644 --- a/webmentions_ssg/views/sources.py +++ b/webmentions_ssg/views/sources.py @@ -66,8 +66,8 @@ def source_filter_args(form: SourceFilterForm) -> SourceFilterArgs: @login_required def source_list() -> ResponseReturnValue: """Display source documents with filters for outgoing delivery problems.""" - form = source_filter_form() - filters = source_filter_args(form) + filter_form = source_filter_form() + filters = source_filter_args(filter_form) query = sa.select(SourceDocument).options( selectinload(SourceDocument.sent_webmentions) ) @@ -157,7 +157,6 @@ def source_list() -> ResponseReturnValue: "sent.html", title="Sent Webmentions", sources=sources, - form=form, filters=filters, sort_key=sort_key, sort_order=sort_order, @@ -165,6 +164,7 @@ def source_list() -> ResponseReturnValue: status_choices=SOURCE_STATUS_CHOICES, page_size=page_size, max_source_page_size=current_app.config["SOURCES_MAX_PAGE_SIZE"], + filter_form=filter_form, action_form=ConfirmActionForm(), ) |
