Skip to content

Commit

Permalink
Overflow the full block choice
Browse files Browse the repository at this point in the history
Co-Authored-By: Andy Chosak <[email protected]>
  • Loading branch information
willbarton and chosak committed Sep 23, 2024
1 parent 5ffdd15 commit 9e23409
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion wagtailinventory/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from django.forms.widgets import SelectMultiple

from wagtail.admin.auth import permission_denied
from wagtail.admin.filters import ContentTypeFilter, WagtailFilterSet
from wagtail.admin.views.reports import PageReportView
Expand All @@ -10,7 +12,7 @@

def get_block_choices():
return [
(page_block, page_block.rsplit(".", 1)[1])
(page_block, page_block)
for page_block in PageBlock.objects.distinct()
.order_by("block")
.values_list("block", flat=True)
Expand All @@ -23,13 +25,15 @@ class BlockInventoryFilterSet(WagtailFilterSet):
label="Include Blocks",
distinct=True,
choices=get_block_choices,
widget=SelectMultiple(attrs={"style": "overflow: auto"}),
)
exclude_page_blocks = django_filters.MultipleChoiceFilter(
field_name="page_blocks__block",
label="Exclude Blocks",
distinct=True,
exclude=True,
choices=get_block_choices,
widget=SelectMultiple(attrs={"style": "overflow: auto"}),
)
content_type = ContentTypeFilter(
label="Page Type",
Expand Down

0 comments on commit 9e23409

Please sign in to comment.