add updates plugin
This commit is contained in:
parent
ca79e88c16
commit
03342fde2d
6 changed files with 162 additions and 40 deletions
|
|
@ -8,6 +8,7 @@ from .models import (
|
|||
GovernmentPlansCMSPlugin,
|
||||
GovernmentPlanSection,
|
||||
GovernmentPlanSectionsCMSPlugin,
|
||||
GovernmentPlanUpdatesCMSPlugin,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -51,3 +52,18 @@ class GovernmentPlanSectionsPlugin(CMSPluginBase):
|
|||
context["sections"] = sections
|
||||
|
||||
return context
|
||||
|
||||
|
||||
@plugin_pool.register_plugin
|
||||
class GovernmentPlanUpdatesPlugin(CMSPluginBase):
|
||||
name = _("Government plan updates")
|
||||
model = GovernmentPlanUpdatesCMSPlugin
|
||||
render_template = "froide_govplan/plugins/updates.html"
|
||||
|
||||
def render(self, context, instance, placeholder):
|
||||
context = super().render(context, instance, placeholder)
|
||||
context["updates"] = instance.get_updates(
|
||||
context["request"], published_only=False
|
||||
)
|
||||
context["show_context"] = True
|
||||
return context
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue