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

Revert "Revert "Heading levels"" #1843

Closed
wants to merge 12 commits into from
24 changes: 24 additions & 0 deletions collection/migrations/0007_alter_collection_body.py

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions collection/migrations/0008_specify_heading_levels_in_labels.py

Large diffs are not rendered by default.

246 changes: 138 additions & 108 deletions conference/models.py
Original file line number Diff line number Diff line change
@@ -1,200 +1,230 @@
from django.db import models
from django.template.response import TemplateResponse
from django.utils import timezone
from django.utils.timezone import localtime, now
from modelcluster.fields import ParentalKey

from wagtail.fields import StreamField, RichTextField
from wagtail.admin.panels import FieldPanel, MultiFieldPanel, InlinePanel, FieldRowPanel
from wagtail.models import Page, Orderable
from wagtail.embeds.blocks import EmbedBlock
from wagtail.admin.panels import (
FieldPanel,
FieldRowPanel,
MultiFieldPanel,
TitleFieldPanel,
)
from wagtail.fields import RichTextField, StreamField
from wagtail.models import Page
from wagtail.search import index

from .blocks import VenueBlock, DirectionsBlock, PartnersBlock
from newamericadotorg.blocks import IntegerBlock, PeopleBlock, SessionsBlock
from newamericadotorg.blocks import PeopleBlock, SessionsBlock

from .blocks import DirectionsBlock, PartnersBlock, VenueBlock


class AllConferencesHomePage(Page):
parent_page_types = ['home.HomePage']
subpage_types = ['Conference']
parent_page_types = ["home.HomePage"]
subpage_types = ["Conference"]

class Meta:
verbose_name = "Conferences Homepage"


class Conference(Page):
"""
"""
parent_page_types = ['AllConferencesHomePage']
""" """

parent_page_types = ["AllConferencesHomePage"]
subpage_types = []

description = RichTextField(help_text="This will be the ABOUT text")
subheading = models.TextField(blank=True, null=True)
story_excerpt = models.CharField("excerpt", blank=True, null=True, max_length=140)

story_image = models.ForeignKey(
'home.CustomImage',
"home.CustomImage",
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name='+',
verbose_name="Cover Image"
related_name="+",
verbose_name="Cover Image",
)
story_image_alt = models.TextField(
default='',
default="",
blank=True,
verbose_name='Cover image alternative text',
help_text='A concise description of the image for users of assistive technology.',
verbose_name="Cover image alternative text",
help_text="A concise description of the image for users of assistive technology.",
)

about_image = models.ForeignKey(
'home.CustomImage',
"home.CustomImage",
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name='+',
verbose_name="About Image"
related_name="+",
verbose_name="About Image",
)
about_image_alt = models.TextField(
default='',
default="",
blank=True,
verbose_name='About image alternative text',
help_text='A concise description of the image for users of assistive technology.',
verbose_name="About image alternative text",
help_text="A concise description of the image for users of assistive technology.",
)

alternate_logo = models.ForeignKey(
'home.CustomImage',
"home.CustomImage",
help_text="This will replace the New America logo at the top of the introduction / cover image",
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name='+',
verbose_name="Alternate Logo"
related_name="+",
verbose_name="Alternate Logo",
)
alternate_logo_alt = models.TextField(
default='',
default="",
blank=True,
verbose_name='Alternate logo alternative text',
help_text='A concise description of the image for users of assistive technology.',
verbose_name="Alternate logo alternative text",
help_text="A concise description of the image for users of assistive technology.",
)

host_organization = models.TextField(
default='New America',
blank=True,
null=True
)
host_organization = models.TextField(default="New America", blank=True, null=True)

live_stream = models.URLField(blank=True, null=True)
rsvp_link = models.URLField(blank=True, null=True)
invitation_only = models.BooleanField(default=False, help_text="This will override the RSVP link and replace it with an request for invitation")
publish_speakers = models.BooleanField(default=False, help_text="Speakers list will not show up until this is checked.")
publish_sessions = models.BooleanField(default=False, help_text="Sessions list will not show up until this is checked.")
invitation_only = models.BooleanField(
default=False,
help_text="This will override the RSVP link and replace it with an request for invitation",
)
publish_speakers = models.BooleanField(
default=False, help_text="Speakers list will not show up until this is checked."
)
publish_sessions = models.BooleanField(
default=False, help_text="Sessions list will not show up until this is checked."
)

date = models.DateField("Start Date", default=timezone.now)
end_date = models.DateField(blank=True, null=True)

location_name = models.TextField(help_text='Name of building (e.g. the Kennedy Center)', blank=True, null=True)
street = models.TextField(default='740 15th St NW #900', blank=True, null=True)
city = models.TextField(default='Washington', blank=True, null=True)
state = models.TextField(default='D.C.', blank=True, null=True)
zipcode = models.TextField(default='20005', blank=True, null=True)
location_name = models.TextField(
help_text="Name of building (e.g. the Kennedy Center)", blank=True, null=True
)
street = models.TextField(default="740 15th St NW #900", blank=True, null=True)
city = models.TextField(default="Washington", blank=True, null=True)
state = models.TextField(default="D.C.", blank=True, null=True)
zipcode = models.TextField(default="20005", blank=True, null=True)
venue_details = RichTextField(null=True, blank=True)

partner_heading = models.TextField(default='Sponsors & Partners')
partner_heading = models.TextField(default="Sponsors & Partners")

search_fields = Page.search_fields + [
index.FilterField('date'),
index.FilterField("date"),
]

about = MultiFieldPanel(
[
FieldPanel('title'),
FieldPanel('subheading'),
FieldPanel('host_organization'),
FieldPanel('alternate_logo'),
FieldPanel('alternate_logo_alt'),
FieldRowPanel([
FieldPanel('date', classname="col6"),
FieldPanel('end_date', classname="col6")
]),
FieldPanel('story_image'),
FieldPanel('story_image_alt'),
FieldPanel('about_image'),
FieldPanel('about_image_alt'),
FieldPanel('live_stream'),
FieldPanel('description')
TitleFieldPanel("title"),
FieldPanel("subheading"),
FieldPanel("host_organization"),
FieldPanel("alternate_logo"),
FieldPanel("alternate_logo_alt"),
FieldRowPanel(
[
FieldPanel("date", classname="col6"),
FieldPanel("end_date", classname="col6"),
]
),
FieldPanel("story_image"),
FieldPanel("story_image_alt"),
FieldPanel("about_image"),
FieldPanel("about_image_alt"),
FieldPanel("live_stream"),
FieldPanel("description"),
],
heading="About"
heading="About",
)

setup = MultiFieldPanel([
FieldRowPanel([
FieldPanel('rsvp_link', classname="col6"),
FieldPanel('invitation_only', classname="col6"),
]),
FieldRowPanel([
FieldPanel('publish_speakers', classname="col6"),
FieldPanel('publish_sessions', classname="col6")
])
], heading="Setup")
setup = MultiFieldPanel(
[
FieldRowPanel(
[
FieldPanel("rsvp_link", classname="col6"),
FieldPanel("invitation_only", classname="col6"),
]
),
FieldRowPanel(
[
FieldPanel("publish_speakers", classname="col6"),
FieldPanel("publish_sessions", classname="col6"),
]
),
],
heading="Setup",
)

address = MultiFieldPanel(
[
FieldPanel('location_name'),
FieldPanel('street'),
FieldPanel('city'),
FieldRowPanel([
FieldPanel('state', classname="col6"),
FieldPanel('zipcode', classname="col6")
]),
FieldPanel('venue_details'),
FieldPanel("location_name"),
FieldPanel("street"),
FieldPanel("city"),
FieldRowPanel(
[
FieldPanel("state", classname="col6"),
FieldPanel("zipcode", classname="col6"),
]
),
FieldPanel("venue_details"),
],
heading="Conference Location"
heading="Conference Location",
)

hotel_location_name = models.TextField(help_text='Name of building (e.g. the Kennedy Center)', blank=True, null=True)
hotel_street = models.TextField(default='740 15th St NW #900', blank=True, null=True)
hotel_city = models.TextField(default='Washington', blank=True, null=True)
hotel_state = models.TextField(default='D.C.', blank=True, null=True)
hotel_zipcode = models.TextField(default='20005', blank=True, null=True)
hotel_details = RichTextField(null=True, blank=True, help_text='must be filled for header and section to appear')
hotel_location_name = models.TextField(
help_text="Name of building (e.g. the Kennedy Center)", blank=True, null=True
)
hotel_street = models.TextField(
default="740 15th St NW #900", blank=True, null=True
)
hotel_city = models.TextField(default="Washington", blank=True, null=True)
hotel_state = models.TextField(default="D.C.", blank=True, null=True)
hotel_zipcode = models.TextField(default="20005", blank=True, null=True)
hotel_details = RichTextField(
null=True,
blank=True,
help_text="must be filled for header and section to appear",
)

hotel_address = MultiFieldPanel(
[
FieldPanel('hotel_location_name'),
FieldPanel('hotel_street'),
FieldPanel('hotel_city'),
FieldRowPanel([
FieldPanel('hotel_state', classname="col6"),
FieldPanel('hotel_zipcode', classname="col6")
]),
FieldPanel('hotel_details')
FieldPanel("hotel_location_name"),
FieldPanel("hotel_street"),
FieldPanel("hotel_city"),
FieldRowPanel(
[
FieldPanel("hotel_state", classname="col6"),
FieldPanel("hotel_zipcode", classname="col6"),
]
),
FieldPanel("hotel_details"),
],
heading="Hotel Location"
heading="Hotel Location",
)

# to be deleted after transfer
venue = StreamField(VenueBlock(), null=True, blank=True, use_json_field=True)
directions = StreamField(DirectionsBlock(), null=True, blank=True, use_json_field=True)
directions = StreamField(
DirectionsBlock(), null=True, blank=True, use_json_field=True
)
speakers = StreamField(PeopleBlock(), null=True, blank=True, use_json_field=True)
partners = StreamField(PartnersBlock(), null=True, blank=True, use_json_field=True)
sessions = StreamField(SessionsBlock(), null=True, blank=True, use_json_field=True)

partners_and_sponsors = MultiFieldPanel([
FieldPanel('partner_heading'),
FieldPanel('partners')
]);
partners_and_sponsors = MultiFieldPanel(
[FieldPanel("partner_heading"), FieldPanel("partners")]
)

content_panels = [
about,
setup,
address,
hotel_address,
FieldPanel('directions'),
FieldPanel('speakers'),
FieldPanel('sessions'),
partners_and_sponsors
FieldPanel("directions"),
FieldPanel("speakers"),
FieldPanel("sessions"),
partners_and_sponsors,
]

promote_panels = Page.promote_panels

class Meta:
verbose_name = 'Conference'
verbose_name = "Conference"
45 changes: 45 additions & 0 deletions home/migrations/0063_auto_20240308_1840.py

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions home/migrations/0064_specify_heading_levels_in_labels.py

Large diffs are not rendered by default.

Loading
Loading