Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7884] remove unnecessary admin fields from mozfest homepage #8130

Merged
merged 6 commits into from
Jan 26, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions network-api/networkapi/mozfest/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.db import models
from wagtail.admin.edit_handlers import FieldPanel, StreamFieldPanel
from wagtail.admin.edit_handlers import FieldPanel, MultiFieldPanel, StreamFieldPanel
from wagtail.core.fields import StreamField, RichTextField
from wagtail.core.models import Page
from wagtail.images.edit_handlers import ImageChooserPanel
Expand Down Expand Up @@ -208,21 +208,18 @@ class MozfestHomepage(MozfestPrimaryPage):
'MozfestHomepage',
]

# Put everything above the body
parent_panels = MozfestPrimaryPage.content_panels
panel_count = len(parent_panels)
n = panel_count - 1

content_panels = parent_panels[:n] + [
FieldPanel('cta_button_label'),
FieldPanel('cta_button_destination'),
content_panels = Page.content_panels + [
Pomax marked this conversation as resolved.
Show resolved Hide resolved
SnippetChooserPanel('signup'),
MultiFieldPanel([
FieldPanel('cta_button_label', heading='Label'),
FieldPanel('cta_button_destination', heading='Destination'),
], heading='CTA Button'),
FieldPanel('banner_heading'),
FieldPanel('banner_cta_label'),
StreamFieldPanel('banner_carousel'),
FieldPanel('banner_guide_text'),
FieldPanel('banner_video_url'),
StreamFieldPanel('banner_video'),
] + parent_panels[n:]
StreamFieldPanel('body'),
]

# Because we inherit from PrimaryPage, but the "use_wide_template" property does nothing
# we should hide it and make sure we use the right template
Expand Down