From fc7cac3184686b293d43ce103f8c7160ecafc955 Mon Sep 17 00:00:00 2001 From: Stefan Wehrmeyer Date: Fri, 18 Mar 2022 14:25:41 +0100 Subject: [PATCH] Add status filter into search --- froide_govplan/cms_plugins.py | 2 ++ .../templates/froide_govplan/plugins/search.html | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/froide_govplan/cms_plugins.py b/froide_govplan/cms_plugins.py index 04652a8..9b73155 100644 --- a/froide_govplan/cms_plugins.py +++ b/froide_govplan/cms_plugins.py @@ -9,6 +9,7 @@ from .models import ( GovernmentPlanSection, GovernmentPlanSectionsCMSPlugin, GovernmentPlanUpdatesCMSPlugin, + PlanStatus, ) @@ -25,6 +26,7 @@ class GovernmentPlansPlugin(CMSPluginBase): def render(self, context, instance, placeholder): context = super().render(context, instance, placeholder) context["plugin"] = instance + context["status_list"] = PlanStatus.choices context["object_list"] = instance.get_plans( context["request"], published_only=False ) diff --git a/froide_govplan/templates/froide_govplan/plugins/search.html b/froide_govplan/templates/froide_govplan/plugins/search.html index c27ca85..773c997 100644 --- a/froide_govplan/templates/froide_govplan/plugins/search.html +++ b/froide_govplan/templates/froide_govplan/plugins/search.html @@ -1,7 +1,13 @@ {% load i18n %}
-
- +
+ +