Skip to content
Snippets Groups Projects
Commit bdf7ecf5 authored by Todd Dembrey's avatar Todd Dembrey
Browse files

Make the categories collapsible

parent 6de2b1be
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@ from modelcluster.fields import ParentalKey
from wagtail.wagtailadmin.edit_handlers import (
FieldPanel,
InlinePanel,
MultiFieldPanel,
PageChooserPanel,
StreamFieldPanel,
)
......@@ -124,7 +125,11 @@ class ProjectPage(FundingMixin, BasePage):
InlinePanel('contact_details', label="Contact Details"),
InlinePanel('related_pages', label="Related Projects"),
] + FundingMixin.content_panels + [
FieldPanel('categories', widget=CategoriesWidget),
MultiFieldPanel(
[FieldPanel('categories', widget=CategoriesWidget)],
heading="Categories",
classname="collapsible collapsed",
),
]
def category_options(self):
......
<li>
<h2>{{ widget.attrs.label_tag }}</h2>
<h1>{{ widget.attrs.label_tag }}</h1>
<fieldset>
{% with id=widget.attrs.id %}
<ul{% if id %} id="{{ id }}"{% endif %}class="fields {% if widget.attrs.class %}{{ widget.attrs.class }}{% endif %}">{% for group, options, index in widget.optgroups %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment