Skip to content

Commit

Permalink
Cleanup for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
brylie committed Jun 1, 2024
1 parent dac24e7 commit 20178bd
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
13 changes: 0 additions & 13 deletions contact/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from wagtail.admin.ui.tables import Column
from wagtail.admin.viewsets.base import ViewSetGroup
from wagtail.admin.viewsets.pages import PageListingViewSet
from memorials.views import MemorialViewSet
Expand All @@ -14,18 +13,6 @@ class PersonViewSet(PageListingViewSet):
menu_label = "People"
name = "people"
icon = "user"
columns = [
Column(
"given_name",
label="Given Name",
sort_key="given_name",
),
Column(
"family_name",
label="Family Name",
sort_key="family_name",
),
]
search_fields = ["given_name", "family_name"]
# Tried to add ordering to the columns, but it didn't work.
# https://stackoverflow.com/questions/78563124/how-to-specify-ordering-for-wagtal-pagelistingviewset
Expand Down
15 changes: 12 additions & 3 deletions documents/views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import django_filters
from wagtail.admin.filters import DateRangePickerWidget
from wagtail.admin.ui.tables import Column, TitleColumn
from wagtail.admin.ui.tables import Column
from wagtail.admin.ui.tables.pages import BulkActionsColumn, PageTitleColumn
from wagtail.admin.viewsets.pages import PageListingViewSet

from .models import PublicBoardDocument, MeetingDocument
Expand All @@ -27,10 +28,14 @@ class PublicBoardDocumentViewSet(PageListingViewSet):
icon = "doc-full"
name = "public_board_documents"
columns = [
TitleColumn(
BulkActionsColumn(
"id",
),
PageTitleColumn(
"title",
label="Title",
sort_key="title",
classname="title",
),
Column(
"publication_date",
Expand Down Expand Up @@ -65,10 +70,14 @@ class MeetingDocumentViewSet(PageListingViewSet):
icon = "doc-full"
name = "meeting_documents"
columns = [
Column(
BulkActionsColumn(
"id",
),
PageTitleColumn(
"title",
label="Title",
sort_key="title",
classname="title",
),
Column(
"publication_date",
Expand Down
5 changes: 4 additions & 1 deletion events/views.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import django_filters
from wagtail.admin.filters import DateRangePickerWidget
from wagtail.admin.ui.tables import Column
from wagtail.admin.ui.tables.pages import PageTitleColumn
from wagtail.admin.ui.tables.pages import BulkActionsColumn, PageTitleColumn
from wagtail.admin.viewsets.pages import PageListingViewSet

from .models import Event
Expand All @@ -28,6 +28,9 @@ class EventViewSet(PageListingViewSet):
icon = "date"
name = "events"
columns = [
BulkActionsColumn(
"id",
),
PageTitleColumn(
"title",
label="Title",
Expand Down
5 changes: 4 additions & 1 deletion wf_pages/views.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import django_filters
from wagtail.admin.filters import DateRangePickerWidget
from wagtail.admin.ui.tables import Column
from wagtail.admin.ui.tables.pages import PageTitleColumn
from wagtail.admin.ui.tables.pages import BulkActionsColumn, PageTitleColumn
from wagtail.admin.viewsets.pages import PageListingViewSet


Expand All @@ -28,6 +28,9 @@ class MollyWingateBlogPageViewSet(PageListingViewSet):
icon = "list-ul"
name = "molly_wingate_blog_pages"
columns = [
BulkActionsColumn(
"id",
),
PageTitleColumn(
"title",
label="Title",
Expand Down

0 comments on commit 20178bd

Please sign in to comment.