Esempio n. 1
0
class HomePage(Page):
    body = fields.StreamField([
        ('paragraph', blocks.RichTextBlock()),
        ('call_to_action', cms_blocks.CallToActionBlock()),
        ('image_call_to_action', cms_blocks.ImageCallToActionBlock()),
        ('columns_text', cms_blocks.ColumnsBlock()),
        ('accordion', cms_blocks.DocsBlock())
    ])

    subtitle = models.CharField(max_length=120, blank=True)

    header_image = models.ForeignKey('wagtailimages.Image',
                                     null=True,
                                     blank=True,
                                     on_delete=models.SET_NULL,
                                     related_name='+')

    content_panels = [
        edit_handlers.FieldPanel('title'),
        edit_handlers.FieldPanel('subtitle'),
        ImageChooserPanel('header_image'),
        edit_handlers.StreamFieldPanel('body')
    ]

    subpage_types = ['cms_home.SimplePage']
Esempio n. 2
0
class HomePage(Page):
    body = fields.StreamField([
        ('paragraph',
         blocks.RichTextBlock(
             template='meinberlin_cms/blocks/richtext_block.html')),
        ('call_to_action', cms_blocks.CallToActionBlock()),
        ('image_call_to_action', cms_blocks.ImageCallToActionBlock()),
        ('columns_text', cms_blocks.ColumnsBlock()),
        ('projects', cms_blocks.ProjectsWrapperBlock()),
        ('activities', actions_blocks.PlatformActivityBlock()),
        ('accordion', cms_blocks.DocsBlock()),
        ('infographic', cms_blocks.InfographicBlock()),
        ('map_teaser', cms_blocks.MapTeaserBlock())
    ])

    subtitle = models.CharField(max_length=120)

    header_image = models.ForeignKey('meinberlin_cms.CustomImage',
                                     null=True,
                                     blank=True,
                                     on_delete=models.SET_NULL,
                                     related_name='+')
    storefront = models.ForeignKey('meinberlin_cms.Storefront',
                                   on_delete=models.SET_NULL,
                                   null=True,
                                   related_name='+')

    content_panels = Page.content_panels + [
        edit_handlers.FieldPanel('subtitle'),
        ImageChooserPanel('header_image'),
        edit_handlers.StreamFieldPanel('body'),
        SnippetChooserPanel('storefront')
    ]
Esempio n. 3
0
class FeaturedBlogsMixin(models.Model):
    class Meta:
        abstract = True

    featured_posts = fields.StreamField(blog_link_blocks, blank=True)

    panels = [StreamFieldPanel('featured_posts')]
Esempio n. 4
0
class ArchivePage(Page):
    body = fields.StreamField([
        ('archive_list', ArchiveListBlock()),
    ])

    description = models.CharField(max_length=200)
    image = models.ForeignKey(
        'images.CustomImage',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+'
    )

    content_panels = Page.content_panels + [
        edit_handlers.FieldPanel('description'),
        image_handlers.ImageChooserPanel('image'),
        edit_handlers.StreamFieldPanel('body'),
    ]

    class Meta:
        verbose_name = _('Archive')

    parent_page_types = [
        'home.HomePage'
    ]
    subpage_types = []
Esempio n. 5
0
class Migration(migrations.Migration):

    dependencies = [
        ('v1', '0205_bureau_structure_multiple_leads'),
    ]

    operations = [
        migrations.CreateModel(
            name='EnforcementActionPage',
            fields=[
                ('abstractfilterpage_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='v1.AbstractFilterPage')),
                ('sidebar_header', models.CharField(default='Action details', max_length=100)),
                ('court', models.CharField(blank=True, default='', max_length=150)),
                ('institution_type', models.CharField(choices=[('Nonbank', 'Nonbank'), ('Bank', 'Bank')], max_length=50)),
                ('docket_number', models.CharField(max_length=100)),
                ('content', core_fields.StreamField((('full_width_text', core_blocks.StreamBlock((('content', core_blocks.RichTextBlock(icon='edit')), ('content_with_anchor', core_blocks.StructBlock((('content_block', core_blocks.RichTextBlock()), ('anchor_link', core_blocks.StructBlock((('link_id', core_blocks.CharBlock(help_text='\n            ID will be auto-generated on save.\n            However, you may enter some human-friendly text that\n            will be incorporated to make it easier to read.\n        ', label='ID for this content block', required=False)),)))))), ('heading', core_blocks.StructBlock((('text', v1.blocks.HeadingTextBlock(required=False)), ('level', core_blocks.ChoiceBlock(choices=[('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')])), ('icon', v1.blocks.HeadingIconBlock(help_text='Input the name of an icon to appear to the left of the heading. E.g., approved, help-round, etc. <a href="https://cfpb.github.io/capital-framework/components/cf-icons/#the-icons">See full list of icons</a>', required=False))), required=False)), ('image', core_blocks.StructBlock((('image', core_blocks.StructBlock((('upload', images_blocks.ImageChooserBlock(required=False)), ('alt', core_blocks.CharBlock(help_text="If the image is decorative (i.e., if a screenreader wouldn't have anything useful to say about it), leave the Alt field blank.", required=False))))), ('image_width', core_blocks.ChoiceBlock(choices=[('full', 'full'), (470, '470px'), (270, '270px'), (170, '170px')])), ('image_position', core_blocks.ChoiceBlock(choices=[('right', 'right'), ('left', 'left')], help_text='Does not apply if the image is full-width')), ('text', core_blocks.RichTextBlock(label='Caption', required=False)), ('is_bottom_rule', core_blocks.BooleanBlock(default=True, help_text='Check to add a horizontal rule line to bottom of inset.', label='Has bottom rule line', required=False))))), ('table_block', v1.atomic_elements.organisms.AtomicTableBlock(table_options={'renderer': 'html'})), ('quote', core_blocks.StructBlock((('body', core_blocks.TextBlock()), ('citation', core_blocks.TextBlock(required=False)), ('is_large', core_blocks.BooleanBlock(required=False))))), ('cta', core_blocks.StructBlock((('slug_text', core_blocks.CharBlock(required=False)), ('paragraph_text', core_blocks.RichTextBlock(required=False)), ('button', core_blocks.StructBlock((('text', core_blocks.CharBlock(required=False)), ('url', core_blocks.CharBlock(default='/', required=False)), ('size', core_blocks.ChoiceBlock(choices=[('regular', 'Regular'), ('large', 'Large Primary')])))))))), ('related_links', core_blocks.StructBlock((('heading', core_blocks.CharBlock(required=False)), ('paragraph', core_blocks.RichTextBlock(required=False)), ('links', core_blocks.ListBlock(core_blocks.StructBlock((('text', core_blocks.CharBlock(required=False)), ('url', core_blocks.CharBlock(default='/', required=False))))))))), ('reusable_text', v1.blocks.ReusableTextChooserBlock('v1.ReusableText')), ('email_signup', core_blocks.StructBlock((('heading', core_blocks.CharBlock(default='Stay informed', required=False)), ('default_heading', core_blocks.BooleanBlock(default=True, help_text='If selected, heading will be styled as an H5 with green top rule. Deselect to style header as H3.', label='Default heading style', required=False)), ('text', core_blocks.CharBlock(help_text='Write a sentence or two about what kinds of emails the user is signing up for, how frequently they will be sent, etc.', required=False)), ('gd_code', core_blocks.CharBlock(help_text='Code for the topic (i.e., mailing list) you want people who submit this form to subscribe to. Format: USCFPB_###', label='GovDelivery code', required=False)), ('disclaimer_page', core_blocks.PageChooserBlock(help_text='Choose the page that the "See Privacy Act statement" link should go to. If in doubt, use "Generic Email Sign-Up Privacy Act Statement".', label='Privacy Act statement', required=False))))), ('well', core_blocks.StructBlock((('content', core_blocks.RichTextBlock(label='Well', required=False)),))), ('well_with_ask_search', core_blocks.StructBlock((('content', core_blocks.RichTextBlock(label='Well', required=False)), ('ask_search', core_blocks.StructBlock((('show_label', core_blocks.BooleanBlock(default=True, help_text='Whether to show form label.', required=False)), ('placeholder', core_blocks.TextBlock(help_text='Text to show for the input placeholder text.', required=False))))))))))), ('expandable', core_blocks.StructBlock((('label', core_blocks.CharBlock(required=False)), ('is_bordered', core_blocks.BooleanBlock(required=False)), ('is_midtone', core_blocks.BooleanBlock(required=False)), ('is_expanded', core_blocks.BooleanBlock(required=False)), ('content', core_blocks.StreamBlock((('paragraph', core_blocks.RichTextBlock(required=False)), ('well', core_blocks.StructBlock((('content', core_blocks.RichTextBlock(label='Well', required=False)),))), ('links', core_blocks.StructBlock((('text', core_blocks.CharBlock(required=False)), ('url', core_blocks.CharBlock(default='/', required=False))))), ('email', core_blocks.StructBlock((('emails', core_blocks.ListBlock(core_blocks.StructBlock((('url', core_blocks.EmailBlock(label='Email address')), ('text', core_blocks.CharBlock(label='Link text (optional)', required=False)))))),))), ('phone', core_blocks.StructBlock((('fax', core_blocks.BooleanBlock(default=False, label='Is this number a fax?', required=False)), ('phones', core_blocks.ListBlock(core_blocks.StructBlock((('number', core_blocks.CharBlock(help_text='Do not include spaces or dashes. Ex. 8554112372', max_length=15, validators=[django.core.validators.RegexValidator(message='Enter a numeric phone number, without punctuation.', regex='^\\d*$')])), ('extension', core_blocks.CharBlock(max_length=4, required=False)), ('vanity', core_blocks.CharBlock(help_text='A phoneword version of the above number. Include any formatting. Ex. (555) 222-CFPB', max_length=15, required=False)), ('tty', core_blocks.CharBlock(help_text='Do not include spaces or dashes. Ex. 8554112372', label='TTY', max_length=15, required=False, validators=[django.core.validators.RegexValidator(message='Enter a numeric phone number, without punctuation.', regex='^\\d*$')])), ('tty_ext', core_blocks.CharBlock(label='TTY Extension', max_length=4, required=False))))))))), ('address', core_blocks.StructBlock((('label', core_blocks.CharBlock(required=False)), ('title', core_blocks.CharBlock(required=False)), ('street', core_blocks.CharBlock(required=False)), ('city', core_blocks.CharBlock(max_length=50, required=False)), ('state', core_blocks.CharBlock(max_length=25, required=False)), ('zip_code', core_blocks.CharBlock(max_length=15, required=False)))))), blank=True))))), ('expandable_group', core_blocks.StructBlock((('heading', core_blocks.CharBlock(help_text='Added as an <code>&lt;h3&gt;</code> at the top of this block. Also adds a wrapping <code>&lt;div&gt;</code> whose <code>id</code> attribute comes from a slugified version of this heading, creating an anchor that can be used when linking to this part of the page.', required=False)), ('body', core_blocks.RichTextBlock(required=False)), ('is_accordion', core_blocks.BooleanBlock(required=False)), ('has_top_rule_line', core_blocks.BooleanBlock(default=False, help_text='Check this to add a horizontal rule line to top of expandable group.', required=False)), ('expandables', core_blocks.ListBlock(core_blocks.StructBlock((('label', core_blocks.CharBlock(required=False)), ('is_bordered', core_blocks.BooleanBlock(required=False)), ('is_midtone', core_blocks.BooleanBlock(required=False)), ('is_expanded', core_blocks.BooleanBlock(required=False)), ('content', core_blocks.StreamBlock((('paragraph', core_blocks.RichTextBlock(required=False)), ('well', core_blocks.StructBlock((('content', core_blocks.RichTextBlock(label='Well', required=False)),))), ('links', core_blocks.StructBlock((('text', core_blocks.CharBlock(required=False)), ('url', core_blocks.CharBlock(default='/', required=False))))), ('email', core_blocks.StructBlock((('emails', core_blocks.ListBlock(core_blocks.StructBlock((('url', core_blocks.EmailBlock(label='Email address')), ('text', core_blocks.CharBlock(label='Link text (optional)', required=False)))))),))), ('phone', core_blocks.StructBlock((('fax', core_blocks.BooleanBlock(default=False, label='Is this number a fax?', required=False)), ('phones', core_blocks.ListBlock(core_blocks.StructBlock((('number', core_blocks.CharBlock(help_text='Do not include spaces or dashes. Ex. 8554112372', max_length=15, validators=[django.core.validators.RegexValidator(message='Enter a numeric phone number, without punctuation.', regex='^\\d*$')])), ('extension', core_blocks.CharBlock(max_length=4, required=False)), ('vanity', core_blocks.CharBlock(help_text='A phoneword version of the above number. Include any formatting. Ex. (555) 222-CFPB', max_length=15, required=False)), ('tty', core_blocks.CharBlock(help_text='Do not include spaces or dashes. Ex. 8554112372', label='TTY', max_length=15, required=False, validators=[django.core.validators.RegexValidator(message='Enter a numeric phone number, without punctuation.', regex='^\\d*$')])), ('tty_ext', core_blocks.CharBlock(label='TTY Extension', max_length=4, required=False))))))))), ('address', core_blocks.StructBlock((('label', core_blocks.CharBlock(required=False)), ('title', core_blocks.CharBlock(required=False)), ('street', core_blocks.CharBlock(required=False)), ('city', core_blocks.CharBlock(max_length=50, required=False)), ('state', core_blocks.CharBlock(max_length=25, required=False)), ('zip_code', core_blocks.CharBlock(max_length=15, required=False)))))), blank=True))))))))), ('notification', core_blocks.StructBlock((('message', core_blocks.CharBlock(help_text='The main notification message to display.', required=True)), ('explanation', core_blocks.TextBlock(help_text='Explanation text appears below the message in smaller type.', required=False)), ('links', core_blocks.ListBlock(core_blocks.StructBlock((('text', core_blocks.CharBlock(required=False)), ('url', core_blocks.CharBlock(default='/', required=False)))), help_text='Links appear on their own lines below the explanation.', required=False))))), ('table_block', v1.atomic_elements.organisms.AtomicTableBlock(table_options={'renderer': 'html'})), ('feedback', core_blocks.StructBlock((('was_it_helpful_text', core_blocks.CharBlock(default='Was this page helpful to you?', help_text='Use this field only for feedback forms that use "Was this helpful?" radio buttons.', required=False)), ('intro_text', core_blocks.CharBlock(help_text='Optional feedback intro', required=False)), ('question_text', core_blocks.CharBlock(help_text='Optional expansion on intro', required=False)), ('radio_intro', core_blocks.CharBlock(help_text='Leave blank unless you are building a feedback form with extra radio-button prompts, as in /owning-a-home/help-us-improve/.', required=False)), ('radio_text', core_blocks.CharBlock(default='This information helps us understand your question better.', required=False)), ('radio_question_1', core_blocks.CharBlock(default='How soon do you expect to buy a home?', required=False)), ('radio_question_2', core_blocks.CharBlock(default='Do you currently own a home?', required=False)), ('button_text', core_blocks.CharBlock(default='Submit')), ('contact_advisory', core_blocks.RichTextBlock(help_text='Use only for feedback forms that ask for a contact email', required=False)))))), blank=True)),
            ],
            options={
                'abstract': False,
            },
            bases=('v1.abstractfilterpage',),
        ),
        migrations.CreateModel(
            name='EnforcementActionStatus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('institution', models.CharField(blank=True, max_length=200)),
                ('status', models.CharField(choices=[('Post Order/Post Judgment', 'Post Order/Post Judgment'), ('Expired/Terminated/Dismissed', 'Expired/Terminated/Dismissed'), ('Pending Litigation', 'Pending Litigation')], max_length=50)),
                ('action', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='statuses', to='v1.EnforcementActionPage')),
            ],
        ),
    ]
Esempio n. 6
0
class SectionPage(BasePage, InlineHeroMixin, SubNavMixin):

    """SectionPage is a top level page for containing grouped articles.

    """

    parent_page_types: list = [
        "home.HomePage",
        "core.SectionPage",
        "ai_lab.AiLabHomePage",
    ]
    subpage_types: list = [
        "core.ArticlePage",
        "core.SectionPage",
        "core.CookieFormPage",
        "people.PeopleListingPage",
        "meeting_minutes.MeetingMinutesListingPage",
        "ig_guidance.GuidanceListingPage",
        "case_studies.CaseStudyPage",
    ]

    subnav_panels: list = SubNavMixin.panels

    search_fields = BasePage.search_fields + InlineHeroMixin.extra_search_fields

    body = fields.StreamField(
        section_page_blocks, blank=True, verbose_name="Body blocks"
    )
    page_width = models.CharField(
        choices=[("two-thirds", "Two Thirds"), ("full", "Full")],
        max_length=20,
        default="two-thirds",
    )

    @cached_classmethod
    def get_admin_tabs(cls):
        tabs = super().get_admin_tabs()
        tabs.insert(2, (cls.subnav_panels, "Subnavigation"))
        return tabs

    def subnav_items_per_row(self):
        if len(self.subnav_pages) % 3 == 0:
            return 3
        else:
            return 2

    def subnav_column_class(self):
        if len(self.subnav_pages) % 3 == 0:
            return "one-third"
        else:
            return "one-half"

    content_panels = [
        *Page.content_panels,
        FieldPanel("sub_head"),
        ImageChooserPanel("image"),
        StreamFieldPanel("body"),
    ]

    settings_panels = [*Page.settings_panels, FieldPanel("page_width")]
Esempio n. 7
0
class AiLabHomePage(SectionPage):
    subpage_types = [
        "AiLabResourceIndexPage",
        "core.ArticlePage",
        "core.SectionPage",
        "publications.PublicationPage",
    ]
    max_count = 1
    homepage_body = fields.StreamField(ai_lab_home_page_blocks,
                                       blank=True,
                                       verbose_name="Body blocks")

    content_panels = [
        *Page.content_panels,
        FieldPanel("sub_head"),
        ImageChooserPanel("image"),
        StreamFieldPanel("homepage_body"),
    ]

    def get_context(self, request):
        context = super().get_context(request)
        blog_posts = (BlogPost.objects.filter(
            tags__slug="ai-lab").distinct().order_by("-first_published_at")[:3]
                      )
        context.update({"blog_posts": blog_posts})
        return context

    class Meta:
        verbose_name = "AI Lab Homepage"
class Migration(migrations.Migration):

    dependencies = [
        ('testapp', '0002_nested_stream_block_page'),
    ]

    operations = [
        migrations.AlterField(
            model_name='singlestreamfieldpage',
            name='content',
            field=core_fields.StreamField(
                [('atom',
                  core_blocks.StructBlock([('title', core_blocks.CharBlock())
                                           ])),
                 ('molecule',
                  core_blocks.StructBlock(
                      [('title', core_blocks.CharBlock()),
                       ('atoms',
                        core_blocks.ListBlock(
                            core_blocks.StructBlock(
                                [('title', core_blocks.CharBlock())])))])),
                 ('organism',
                  core_blocks.StructBlock(
                      [('molecules',
                        core_blocks.ListBlock(
                            core_blocks.StructBlock(
                                [('title', core_blocks.CharBlock()),
                                 ('atoms',
                                  core_blocks.ListBlock(
                                      core_blocks.StructBlock([
                                          ('title', core_blocks.CharBlock())
                                      ])))])))]))],
                blank=True),
        ),
    ]
Esempio n. 9
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('wagtailcore', '0028_merge'),
    ]

    operations = [
        migrations.CreateModel(
            name='TestPage',
            fields=[
                ('page_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='wagtailcore.Page')),
                ('body',
                 fields.StreamField(
                     (('heading', blocks.CharBlock(classname='full title')),
                      ('paragraph', blocks.RichTextBlock()),
                      ('imagemap', wagtail_svgmap.blocks.ImageMapBlock())))),
            ],
            options={
                'abstract': False,
            },
            bases=('wagtailcore.page', ),
        ),
    ]
Esempio n. 10
0
class StandardPage(wagtail_models.Page):
    """
    A standard content page.
    """

    description = models.TextField(blank=True)
    excerpt = wagtail_fields.RichTextField(blank=True)
    authors = modelcluster_fields.ParentalManyToManyField("users.User")
    date = models.DateTimeField()
    featured_image = models.ForeignKey(
        "wagtailimages.Image",
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name="+",
    )
    body = wagtail_fields.StreamField([
        ("heading", wagtail_blocks.CharBlock()),
        ("paragraph", wagtail_blocks.RichTextBlock()),
        ("section", SectionBlock()),
    ])

    content_panels = wagtail_models.Page.content_panels + [
        wagtail_panels.FieldPanel("description"),
        wagtail_panels.FieldPanel("excerpt"),
        wagtail_panels.FieldPanel("authors"),
        wagtail_panels.FieldPanel("date"),
        wagtail_image_panels.ImageChooserPanel("featured_image"),
        wagtail_panels.StreamFieldPanel("body"),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('oc_core', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Navigation',
            fields=[
                ('id',
                 models.AutoField(verbose_name='ID',
                                  serialize=False,
                                  auto_created=True,
                                  primary_key=True)),
                ('title', models.CharField(max_length=255)),
                ('slug', models.SlugField(max_length=255)),
                ('navigation',
                 fields.StreamField(
                     [(b'menu_block',
                       blocks.StructBlock(
                           [(b'title', blocks.CharBlock()),
                            (b'menu_items',
                             blocks.ListBlock(
                                 blocks.StreamBlock([
                                     (b'link_external',
                                      blocks.StructBlock(
                                          [(b'caption', blocks.CharBlock()),
                                           (b'url', blocks.CharBlock())])),
                                     (b'link_page', blocks.PageChooserBlock())
                                 ])))]))],
                     blank=True)),
            ],
        ),
    ]
Esempio n. 12
0
class DocsPage(Page):

    image = models.ForeignKey(
        'images.CustomImage',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+'
    )

    body = fields.StreamField([
        ('documents_list', DocsBlock()),
        ('Text', RichTextBlock())
    ])

    description = models.CharField(max_length=200)

    content_panels = Page.content_panels + [
        ImageChooserPanel('image'),
        edit_handlers.FieldPanel('description'),
        edit_handlers.StreamFieldPanel('body'),
    ]

    class Meta:
        verbose_name = _('Documents')

    parent_page_types = [
        'home.HomePage'
    ]
    subpage_types = []
Esempio n. 13
0
class FeaturedNewsMixin(models.Model):
    class Meta:
        abstract = True

    featured_posts = fields.StreamField(news_link_blocks, blank=True)

    panels = [StreamFieldPanel("featured_posts")]
Esempio n. 14
0
class BasePage(Page, SocialMetaMixin):

    """Make sure any new pages you create extend this one, so that there is a
    centralised place where we can add functionality to all page types.
    """

    class Meta:
        abstract = True

    promote_panels = SocialMetaMixin.promote_panels
    settings_panels = Page.settings_panels

    body = fields.StreamField(nhsx_blocks, blank=True, verbose_name="Body blocks")

    content_panels = Page.content_panels + [
        StreamFieldPanel("body"),
    ]

    search_fields = Page.search_fields + [
        index.SearchField("search_description", boost=10),
        index.SearchField("title", boost=5),
        index.SearchField("body"),
    ]

    @cached_classmethod
    def get_admin_tabs(cls) -> List[tuple]:
        """Extend the admin tabs in your subclass page by calling this and then
        editing the returned list. Alternatively, leave all of this out of your subclass
        to get the BasePage tabs.

        Example:
            @cached_classmethod
            def get_admin_tabs(cls):
                tabs = super().get_admin_tabs()
                tabs.insert(3, (cls.taxonomy_panels, 'Taxonomy'))
                return tabs

        Returns:
            list: List of tuples
        """
        tabs = [
            (cls.content_panels, "Content"),
            (cls.promote_panels, "Promote"),
            (cls.settings_panels, "Settings"),
        ]
        return tabs

    @cached_classmethod
    def get_edit_handler(cls) -> TabbedInterface:  # NOQA
        """
        """
        tabs = cls.get_admin_tabs()
        edit_handler = TabbedInterface(
            [
                ObjectList(tab[0], heading=tab[1], classname=slugify(tab[1]))
                for tab in tabs
            ]
        )
        return edit_handler.bind_to(model=cls)
Esempio n. 15
0
class EventPage(EntryPage):
    details = fields.StreamField([
        ('details', EventDetailBlock()),
    ])

    content_panels = [
        StreamFieldPanel('details'),
    ] + EntryPage.content_panels
Esempio n. 16
0
class HomePage(Page):
    body = fields.RichTextField(blank=True)
    site_areas = fields.StreamField([('site_area', SiteAreaBlock())],
                                    blank=True)

    content_panels = Page.content_panels + [
        FieldPanel('body'),
        StreamFieldPanel('site_areas'),
    ]
Esempio n. 17
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('wagtailcore', '0032_add_bulk_delete_page_permission'),
    ]

    operations = [
        migrations.CreateModel(
            name='MultipleStreamFieldsPage',
            fields=[
                ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
                ('first', core_fields.StreamField([('atom', core_blocks.StructBlock([('title', core_blocks.CharBlock())])), ('molecule', core_blocks.StructBlock([('title', core_blocks.CharBlock()), ('atoms', core_blocks.ListBlock(core_blocks.StructBlock([('title', core_blocks.CharBlock())])))])), ('organism', core_blocks.StructBlock([('molecules', core_blocks.ListBlock(core_blocks.StructBlock([('title', core_blocks.CharBlock()), ('atoms', core_blocks.ListBlock(core_blocks.StructBlock([('title', core_blocks.CharBlock())])))])))]))])),
                ('second', core_fields.StreamField([('atom', core_blocks.StructBlock([('title', core_blocks.CharBlock())])), ('molecule', core_blocks.StructBlock([('title', core_blocks.CharBlock()), ('atoms', core_blocks.ListBlock(core_blocks.StructBlock([('title', core_blocks.CharBlock())])))])), ('organism', core_blocks.StructBlock([('molecules', core_blocks.ListBlock(core_blocks.StructBlock([('title', core_blocks.CharBlock()), ('atoms', core_blocks.ListBlock(core_blocks.StructBlock([('title', core_blocks.CharBlock())])))])))]))])),
            ],
            options={
                'abstract': False,
            },
            bases=('wagtailcore.page',),
        ),
        migrations.CreateModel(
            name='NoStreamFieldsPage',
            fields=[
                ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
                ('content', models.TextField()),
            ],
            options={
                'abstract': False,
            },
            bases=('wagtailcore.page',),
        ),
        migrations.CreateModel(
            name='SingleStreamFieldPage',
            fields=[
                ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
                ('content', core_fields.StreamField([('text', core_blocks.CharBlock()), ('atom', core_blocks.StructBlock([('title', core_blocks.CharBlock())])), ('molecule', core_blocks.StructBlock([('title', core_blocks.CharBlock()), ('atoms', core_blocks.ListBlock(core_blocks.StructBlock([('title', core_blocks.CharBlock())])))])), ('organism', core_blocks.StructBlock([('molecules', core_blocks.ListBlock(core_blocks.StructBlock([('title', core_blocks.CharBlock()), ('atoms', core_blocks.ListBlock(core_blocks.StructBlock([('title', core_blocks.CharBlock())])))])))]))])),
            ],
            options={
                'abstract': False,
            },
            bases=('wagtailcore.page',),
        ),
    ]
Esempio n. 18
0
class StreamfieldSimplePage(Page):
    body = fields.StreamField([('paragraph', blocks.RichTextBlock()),
                               ('html', blocks.RawHTMLBlock())],
                              blank=True)

    content_panels = [
        edit_handlers.FieldPanel('title'),
        edit_handlers.StreamFieldPanel('body'),
    ]

    subpage_types = []
Esempio n. 19
0
class InternalGuidance(IGGuidance):
    introduction = fields.StreamField(nhsx_blocks,
                                      blank=True,
                                      verbose_name="Introduction")
    service_user_body = fields.StreamField(nhsx_blocks,
                                           blank=True,
                                           verbose_name="Service User content")
    healthcare_worker_body = fields.StreamField(
        nhsx_blocks, blank=True, verbose_name="Healthcare worker content")
    ig_professional_body = fields.StreamField(
        nhsx_blocks, blank=True, verbose_name="IG professional content")

    content_panels = IGGuidance.content_panels + [
        StreamFieldPanel("introduction"),
        StreamFieldPanel("service_user_body"),
        StreamFieldPanel("healthcare_worker_body"),
        StreamFieldPanel("ig_professional_body"),
    ]

    class Meta:
        verbose_name = "Panel Guidance"
Esempio n. 20
0
class Migration(migrations.Migration):

    dependencies = [
        ('teachers_digital_platform',
         '0019_activitybuildingblock_svg_icon_labels'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='activityindexpage',
            name='intro',
        ),
        migrations.AddField(
            model_name='activityindexpage',
            name='header',
            field=core_fields.StreamField([(
                'text_introduction',
                core_blocks.StructBlock([(
                    'eyebrow',
                    core_blocks.CharBlock(
                        help_text=
                        'Optional: Adds an H5 eyebrow above H1 heading text. Only use in conjunction with heading.',
                        label='Pre-heading',
                        required=False)),
                                         ('heading',
                                          core_blocks.CharBlock(
                                              required=False)),
                                         ('intro',
                                          core_blocks.RichTextBlock(
                                              required=False)),
                                         ('body',
                                          core_blocks.RichTextBlock(
                                              required=False)),
                                         ('links',
                                          core_blocks.ListBlock(
                                              core_blocks.StructBlock(
                                                  [('text',
                                                    core_blocks.CharBlock(
                                                        required=False)),
                                                   ('url',
                                                    core_blocks.CharBlock(
                                                        default='/',
                                                        required=False))]),
                                              required=False)),
                                         ('has_rule',
                                          core_blocks.BooleanBlock(
                                              help_text=
                                              'Check this to add a horizontal rule line to bottom of text introduction.',
                                              label='Has bottom rule',
                                              required=False))]))],
                                          blank=True),
        ),
    ]
Esempio n. 21
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('v1', '0203_deprecate_spanish_home_page'),
    ]

    operations = [
        migrations.CreateModel(
            name='FormExplainerPage',
            fields=[
                ('cfgovpage_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='v1.CFGOVPage')),
                ('header', core_fields.StreamField((('hero', core_blocks.StructBlock((('heading', core_blocks.CharBlock(help_text='For complete guidelines on creating heroes, visit our <a href="https://cfpb.github.io/design-manual/global-elements/heroes.html">Design Manual</a>.<ul class="help">Character counts (including spaces) at largest breakpoint:<li>&bull; 41 characters max (one-line heading)</li><li>&bull; 82 characters max (two-line heading)</li></ul>', required=False)), ('body', core_blocks.RichTextBlock(help_text='<ul class="help">Character counts (including spaces) at largest breakpoint:<li>&bull; 165-186 characters (after a one-line heading)</li><li>&bull; 108-124 characters (after a two-line heading)</li></ul>', label='Sub-heading', required=False)), ('image', images_blocks.ImageChooserBlock(help_text='When saving illustrations, use a transparent background. <a href="https://cfpb.github.io/design-manual/global-elements/heroes.html#style">See image dimension guidelines.</a>', label='Large image', required=False)), ('small_image', images_blocks.ImageChooserBlock(help_text='<b>Optional.</b> Provides an alternate image for small displays when using a photo or bleeding hero. Not required for the standard illustration. <a href="https://cfpb.github.io/design-manual/global-elements/heroes.html#style">See image dimension guidelines.</a>', required=False)), ('background_color', core_blocks.CharBlock(help_text='Specify a hex value (with the # sign) from our <a href="https://cfpb.github.io/design-manual/brand-guidelines/color-principles.html">official color palette</a>.', required=False)), ('is_overlay', core_blocks.BooleanBlock(help_text='<b>Optional.</b> Uses the large image as a background under the entire hero, creating the "Photo" style of hero (see <a href="https://cfpb.github.io/design-manual/global-elements/heroes.html">Design Manual</a> for details). When using this option, make sure to specify a background color (above) for the left/right margins that appear when screens are wider than 1200px and for the text section when the photo and text stack at mobile sizes.', label='Photo', required=False)), ('is_white_text', core_blocks.BooleanBlock(help_text='<b>Optional.</b> Turns the hero text white. Useful if using a dark background color or background image.', label='White text', required=False)), ('is_bleeding', core_blocks.BooleanBlock(help_text='<b>Optional.</b> Select if you want the illustration to bleed vertically off the top and bottom of the hero space.', label='Bleed', required=False))))), ('text_introduction', core_blocks.StructBlock((('eyebrow', core_blocks.CharBlock(help_text='Optional: Adds an H5 eyebrow above H1 heading text. Only use in conjunction with heading.', label='Pre-heading', required=False)), ('heading', core_blocks.CharBlock(required=False)), ('intro', core_blocks.RichTextBlock(required=False)), ('body', core_blocks.RichTextBlock(required=False)), ('links', core_blocks.ListBlock(core_blocks.StructBlock((('text', core_blocks.CharBlock(required=False)), ('url', core_blocks.CharBlock(default='/', required=False)))), required=False)), ('has_rule', core_blocks.BooleanBlock(help_text='Check this to add a horizontal rule line to bottom of text introduction.', label='Has bottom rule', required=False)))))), blank=True)),
                ('content', core_fields.StreamField((('explainer', core_blocks.StructBlock((('pages', core_blocks.ListBlock(core_blocks.StructBlock((('image', images_blocks.ImageChooserBlock(icon='image', required=True)), ('categories', core_blocks.ListBlock(core_blocks.StructBlock((('title', core_blocks.CharBlock(help_text='Optional. Leave blank if there is only one type of note for this image.', label='Category title', required=False)), ('notes', core_blocks.ListBlock(core_blocks.StructBlock((('coordinates', core_blocks.StructBlock((('left', core_blocks.FloatBlock(max_value=100, min_value=0, required=True)), ('top', core_blocks.FloatBlock(max_value=100, min_value=0, required=True)), ('width', core_blocks.FloatBlock(max_value=100, min_value=0, required=True)), ('height', core_blocks.FloatBlock(max_value=100, min_value=0, required=True))), form_classname='coordinates', help_text='Enter percentage values to define the area that will be highlighted on the image for this note.', label='Note image map coordinates')), ('heading', core_blocks.CharBlock(label='Note heading', required=True)), ('body', core_blocks.RichTextBlock(features=['bold', 'italic', 'link', 'document-link'], label='Note text', required=True))), form_classname='explainer_notes', required=False), default=[]))), required=False)))), required=False))),))), ('well', core_blocks.StructBlock((('content', core_blocks.RichTextBlock(label='Well', required=False)),))), ('info_unit_group', core_blocks.StructBlock((('format', core_blocks.ChoiceBlock(choices=[('50-50', '50/50'), ('33-33-33', '33/33/33'), ('25-75', '25/75')], help_text='Choose the number and width of info unit columns.', label='Format')), ('heading', core_blocks.StructBlock((('text', v1.blocks.HeadingTextBlock(required=False)), ('level', core_blocks.ChoiceBlock(choices=[('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')])), ('icon', v1.blocks.HeadingIconBlock(help_text='Input the name of an icon to appear to the left of the heading. E.g., approved, help-round, etc. <a href="https://cfpb.github.io/capital-framework/components/cf-icons/#the-icons">See full list of icons</a>', required=False))), required=False)), ('intro', core_blocks.RichTextBlock(help_text='If this field is not empty, the Heading field must also be set.', required=False)), ('link_image_and_heading', core_blocks.BooleanBlock(default=True, help_text="Check this to link all images and headings to the URL of the first link in their unit's list, if there is a link.", required=False)), ('has_top_rule_line', core_blocks.BooleanBlock(default=False, help_text='Check this to add a horizontal rule line to top of info unit group.', required=False)), ('lines_between_items', core_blocks.BooleanBlock(default=False, help_text='Check this to show horizontal rule lines between info units.', label='Show rule lines between items', required=False)), ('info_units', core_blocks.ListBlock(core_blocks.StructBlock((('image', core_blocks.StructBlock((('upload', images_blocks.ImageChooserBlock(required=False)), ('alt', core_blocks.CharBlock(help_text="If the image is decorative (i.e., if a screenreader wouldn't have anything useful to say about it), leave the Alt field blank.", required=False))))), ('heading', core_blocks.StructBlock((('text', v1.blocks.HeadingTextBlock(required=False)), ('level', core_blocks.ChoiceBlock(choices=[('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')])), ('icon', v1.blocks.HeadingIconBlock(help_text='Input the name of an icon to appear to the left of the heading. E.g., approved, help-round, etc. <a href="https://cfpb.github.io/capital-framework/components/cf-icons/#the-icons">See full list of icons</a>', required=False))), default={'level': 'h3'}, required=False)), ('body', core_blocks.RichTextBlock(blank=True, required=False)), ('links', core_blocks.ListBlock(core_blocks.StructBlock((('text', core_blocks.CharBlock(required=False)), ('url', core_blocks.CharBlock(default='/', required=False)))), required=False)))))), ('sharing', core_blocks.StructBlock((('shareable', core_blocks.BooleanBlock(help_text='If checked, share links will be included below the items.', label='Include sharing links?', required=False)), ('share_blurb', core_blocks.CharBlock(help_text='Sets the tweet text, email subject line, and LinkedIn post text.', required=False)))))))), ('feedback', core_blocks.StructBlock((('was_it_helpful_text', core_blocks.CharBlock(default='Was this page helpful to you?', help_text='Use this field only for feedback forms that use "Was this helpful?" radio buttons.', required=False)), ('intro_text', core_blocks.CharBlock(help_text='Optional feedback intro', required=False)), ('question_text', core_blocks.CharBlock(help_text='Optional expansion on intro', required=False)), ('radio_intro', core_blocks.CharBlock(help_text='Leave blank unless you are building a feedback form with extra radio-button prompts, as in /owning-a-home/help-us-improve/.', required=False)), ('radio_text', core_blocks.CharBlock(default='This information helps us understand your question better.', required=False)), ('radio_question_1', core_blocks.CharBlock(default='How soon do you expect to buy a home?', required=False)), ('radio_question_2', core_blocks.CharBlock(default='Do you currently own a home?', required=False)), ('button_text', core_blocks.CharBlock(default='Submit')), ('contact_advisory', core_blocks.RichTextBlock(help_text='Use only for feedback forms that ask for a contact email', required=False)))))))),
            ],
            options={
                'abstract': False,
            },
            bases=('v1.cfgovpage',),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('mega_menu', '0001_initial'),
    ]

    operations = [
        migrations.AlterField(
            model_name='menu',
            name='submenus',
            field=core_fields.StreamField((('submenu', core_blocks.StructBlock((('title', core_blocks.CharBlock()), ('overview_page', core_blocks.PageChooserBlock(required=False)), ('featured_links', core_blocks.ListBlock(core_blocks.StructBlock((('page', core_blocks.PageChooserBlock(required=False)), ('text', core_blocks.CharBlock(required=False)), ('url', core_blocks.CharBlock(required=False)))), default=[])), ('other_links', core_blocks.ListBlock(core_blocks.StructBlock((('page', core_blocks.PageChooserBlock(required=False)), ('text', core_blocks.CharBlock(required=False)), ('url', core_blocks.CharBlock(required=False)), ('icon', core_blocks.CharBlock()))), default=[])), ('columns', core_blocks.ListBlock(core_blocks.StructBlock((('heading', core_blocks.CharBlock(required=False)), ('links', core_blocks.ListBlock(core_blocks.StructBlock((('page', core_blocks.PageChooserBlock(required=False)), ('text', core_blocks.CharBlock(required=False)), ('url', core_blocks.CharBlock(required=False)))), default=[])))), default=[]))))),)),
        ),
    ]
Esempio n. 23
0
class SimplePage(Page):
    body_streamfield_de = fields.StreamField([
        ('html', blocks.RawHTMLBlock()), ('richtext', blocks.RichTextBlock()),
        ('image', ImageChooserBlock()),
        ('faq', cms_blocks.AccordeonListBlock()),
        ('image_cta', cms_blocks.ImageCTABlock()),
        ('col_list_image_cta_block', cms_blocks.ColumnsImageCTABlock()),
        ('columns_cta', cms_blocks.ColumnsCTABlock()),
        ('downloads', cms_blocks.DownloadListBlock()),
        ('quote', cms_blocks.QuoteBlock())
    ])
    body_streamfield_en = fields.StreamField(
        [('html', blocks.RawHTMLBlock()), ('richtext', blocks.RichTextBlock()),
         ('image', ImageChooserBlock()),
         ('faq', cms_blocks.AccordeonListBlock()),
         ('image_cta', cms_blocks.ImageCTABlock()),
         ('col_list_image_cta_block', cms_blocks.ColumnsImageCTABlock()),
         ('columns_cta', cms_blocks.ColumnsCTABlock()),
         ('downloads', cms_blocks.DownloadListBlock()),
         ('quote', cms_blocks.QuoteBlock())],
        blank=True)

    body_streamfield = TranslatedField('body_streamfield_de',
                                       'body_streamfield_en')

    en_content_panels = [StreamFieldPanel('body_streamfield_en')]

    de_content_panels = [StreamFieldPanel('body_streamfield_de')]

    common_panels = [FieldPanel('title'), FieldPanel('slug')]

    edit_handler = TabbedInterface([
        ObjectList(common_panels, heading='Common'),
        ObjectList(en_content_panels, heading='English'),
        ObjectList(de_content_panels, heading='German')
    ])

    subpage_types = ['a4_candy_cms_pages.SimplePage']
Esempio n. 24
0
class MeetingMinutes(Page):
    meeting_date = models.DateField(auto_now_add=False, auto_now=False)
    start_time = models.TimeField(auto_now_add=False, auto_now=False)
    end_time = models.TimeField(auto_now_add=False, auto_now=False)
    venue = models.CharField(max_length=255)
    attendees = fields.StreamField(people_blocks)
    apologies = fields.StreamField(people_blocks)
    items = fields.StreamField([("rich_text",
                                 blocks.RichTextBlock(group=" Content"))])

    content_panels = [
        FieldPanel("meeting_date"),
        FieldPanel("start_time"),
        FieldPanel("end_time"),
        FieldPanel("venue"),
        StreamFieldPanel("attendees"),
        StreamFieldPanel("apologies"),
        StreamFieldPanel("items"),
    ]

    def save(self, *args, **kwargs):
        self.title = self.meeting_date.strftime("%A %e %B %Y")
        return super().save(*args, **kwargs)
class Migration(migrations.Migration):

    dependencies = [
        ('paying_for_college', '0008_recreated2'),
    ]

    operations = [
        migrations.AlterField(
            model_name='collegecostspage',
            name='content',
            field=core_fields.StreamField((('full_width_text', core_blocks.StreamBlock((('content', core_blocks.RichTextBlock(icon='edit')), ('content_with_anchor', core_blocks.StructBlock((('content_block', core_blocks.RichTextBlock()), ('anchor_link', core_blocks.StructBlock((('link_id', core_blocks.CharBlock(help_text='\n            ID will be auto-generated on save.\n            However, you may enter some human-friendly text that\n            will be incorporated to make it easier to read.\n        ', label='ID for this content block', required=False)),)))))), ('heading', core_blocks.StructBlock((('text', v1.blocks.HeadingTextBlock(required=False)), ('level', core_blocks.ChoiceBlock(choices=[('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')])), ('icon', v1.blocks.HeadingIconBlock(help_text='Input the name of an icon to appear to the left of the heading. E.g., approved, help-round, etc. <a href="https://cfpb.github.io/capital-framework/components/cf-icons/#the-icons">See full list of icons</a>', required=False))), required=False)), ('image', core_blocks.StructBlock((('image', core_blocks.StructBlock((('upload', images_blocks.ImageChooserBlock(required=False)), ('alt', core_blocks.CharBlock(help_text="If the image is decorative (i.e., if a screenreader wouldn't have anything useful to say about it), leave the Alt field blank.", required=False))))), ('image_width', core_blocks.ChoiceBlock(choices=[('full', 'full'), (470, '470px'), (270, '270px'), (170, '170px')])), ('image_position', core_blocks.ChoiceBlock(choices=[('right', 'right'), ('left', 'left')], help_text='Does not apply if the image is full-width')), ('text', core_blocks.RichTextBlock(label='Caption', required=False)), ('is_bottom_rule', core_blocks.BooleanBlock(default=True, help_text='Check to add a horizontal rule line to bottom of inset.', label='Has bottom rule line', required=False))))), ('table_block', v1.atomic_elements.organisms.AtomicTableBlock(table_options={'renderer': 'html'})), ('quote', core_blocks.StructBlock((('body', core_blocks.TextBlock()), ('citation', core_blocks.TextBlock(required=False)), ('is_large', core_blocks.BooleanBlock(required=False))))), ('cta', core_blocks.StructBlock((('slug_text', core_blocks.CharBlock(required=False)), ('paragraph_text', core_blocks.RichTextBlock(required=False)), ('button', core_blocks.StructBlock((('text', core_blocks.CharBlock(required=False)), ('url', core_blocks.CharBlock(default='/', required=False)), ('size', core_blocks.ChoiceBlock(choices=[('regular', 'Regular'), ('large', 'Large Primary')])))))))), ('related_links', core_blocks.StructBlock((('heading', core_blocks.CharBlock(required=False)), ('paragraph', core_blocks.RichTextBlock(required=False)), ('links', core_blocks.ListBlock(core_blocks.StructBlock((('text', core_blocks.CharBlock(required=False)), ('url', core_blocks.CharBlock(default='/', required=False))))))))), ('reusable_text', v1.blocks.ReusableTextChooserBlock('v1.ReusableText')), ('email_signup', core_blocks.StructBlock((('heading', core_blocks.CharBlock(default='Stay informed', required=False)), ('default_heading', core_blocks.BooleanBlock(default=True, help_text='If selected, heading will be styled as an H5 with green top rule. Deselect to style header as H3.', label='Default heading style', required=False)), ('text', core_blocks.CharBlock(help_text='Write a sentence or two about what kinds of emails the user is signing up for, how frequently they will be sent, etc.', required=False)), ('gd_code', core_blocks.CharBlock(help_text='Code for the topic (i.e., mailing list) you want people who submit this form to subscribe to. Format: USCFPB_###', label='GovDelivery code', required=False)), ('disclaimer_page', core_blocks.PageChooserBlock(help_text='Choose the page that the "See Privacy Act statement" link should go to. If in doubt, use "Generic Email Sign-Up Privacy Act Statement".', label='Privacy Act statement', required=False))))), ('well', core_blocks.StructBlock((('content', core_blocks.RichTextBlock(label='Well', required=False)),))), ('well_with_ask_search', core_blocks.StructBlock((('content', core_blocks.RichTextBlock(label='Well', required=False)), ('ask_search', core_blocks.StructBlock((('show_label', core_blocks.BooleanBlock(default=True, help_text='Whether to show form label.', required=False)), ('placeholder', core_blocks.TextBlock(help_text='Text to show for the input placeholder text.', required=False))))))))))), ('info_unit_group', core_blocks.StructBlock((('format', core_blocks.ChoiceBlock(choices=[('50-50', '50/50'), ('33-33-33', '33/33/33'), ('25-75', '25/75')], help_text='Choose the number and width of info unit columns.', label='Format')), ('heading', core_blocks.StructBlock((('text', v1.blocks.HeadingTextBlock(required=False)), ('level', core_blocks.ChoiceBlock(choices=[('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')])), ('icon', v1.blocks.HeadingIconBlock(help_text='Input the name of an icon to appear to the left of the heading. E.g., approved, help-round, etc. <a href="https://cfpb.github.io/capital-framework/components/cf-icons/#the-icons">See full list of icons</a>', required=False))), required=False)), ('intro', core_blocks.RichTextBlock(help_text='If this field is not empty, the Heading field must also be set.', required=False)), ('link_image_and_heading', core_blocks.BooleanBlock(default=True, help_text="Check this to link all images and headings to the URL of the first link in their unit's list, if there is a link.", required=False)), ('has_top_rule_line', core_blocks.BooleanBlock(default=False, help_text='Check this to add a horizontal rule line to top of info unit group.', required=False)), ('lines_between_items', core_blocks.BooleanBlock(default=False, help_text='Check this to show horizontal rule lines between info units.', label='Show rule lines between items', required=False)), ('info_units', core_blocks.ListBlock(core_blocks.StructBlock((('image', core_blocks.StructBlock((('upload', images_blocks.ImageChooserBlock(required=False)), ('alt', core_blocks.CharBlock(help_text="If the image is decorative (i.e., if a screenreader wouldn't have anything useful to say about it), leave the Alt field blank.", required=False))))), ('heading', core_blocks.StructBlock((('text', v1.blocks.HeadingTextBlock(required=False)), ('level', core_blocks.ChoiceBlock(choices=[('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')])), ('icon', v1.blocks.HeadingIconBlock(help_text='Input the name of an icon to appear to the left of the heading. E.g., approved, help-round, etc. <a href="https://cfpb.github.io/capital-framework/components/cf-icons/#the-icons">See full list of icons</a>', required=False))), default={'level': 'h3'}, required=False)), ('body', core_blocks.RichTextBlock(blank=True, required=False)), ('links', core_blocks.ListBlock(core_blocks.StructBlock((('text', core_blocks.CharBlock(required=False)), ('url', core_blocks.CharBlock(default='/', required=False)))), required=False)))))), ('sharing', core_blocks.StructBlock((('shareable', core_blocks.BooleanBlock(help_text='If checked, share links will be included below the items.', label='Include sharing links?', required=False)), ('share_blurb', core_blocks.CharBlock(help_text='Sets the tweet text, email subject line, and LinkedIn post text.', required=False)))))))), ('expandable_group', core_blocks.StructBlock((('heading', core_blocks.CharBlock(help_text='Added as an <code>&lt;h3&gt;</code> at the top of this block. Also adds a wrapping <code>&lt;div&gt;</code> whose <code>id</code> attribute comes from a slugified version of this heading, creating an anchor that can be used when linking to this part of the page.', required=False)), ('body', core_blocks.RichTextBlock(required=False)), ('is_accordion', core_blocks.BooleanBlock(required=False)), ('has_top_rule_line', core_blocks.BooleanBlock(default=False, help_text='Check this to add a horizontal rule line to top of expandable group.', required=False)), ('expandables', core_blocks.ListBlock(core_blocks.StructBlock((('label', core_blocks.CharBlock(required=False)), ('is_bordered', core_blocks.BooleanBlock(required=False)), ('is_midtone', core_blocks.BooleanBlock(required=False)), ('is_expanded', core_blocks.BooleanBlock(required=False)), ('content', core_blocks.StreamBlock((('paragraph', core_blocks.RichTextBlock(required=False)), ('well', core_blocks.StructBlock((('content', core_blocks.RichTextBlock(label='Well', required=False)),))), ('links', core_blocks.StructBlock((('text', core_blocks.CharBlock(required=False)), ('url', core_blocks.CharBlock(default='/', required=False))))), ('email', core_blocks.StructBlock((('emails', core_blocks.ListBlock(core_blocks.StructBlock((('url', core_blocks.EmailBlock(label='Email address')), ('text', core_blocks.CharBlock(label='Link text (optional)', required=False)))))),))), ('phone', core_blocks.StructBlock((('fax', core_blocks.BooleanBlock(default=False, label='Is this number a fax?', required=False)), ('phones', core_blocks.ListBlock(core_blocks.StructBlock((('number', core_blocks.CharBlock(help_text='Do not include spaces or dashes. Ex. 8554112372', max_length=15, validators=[django.core.validators.RegexValidator(message='Enter a numeric phone number, without punctuation.', regex='^\\d*$')])), ('extension', core_blocks.CharBlock(max_length=4, required=False)), ('vanity', core_blocks.CharBlock(help_text='A phoneword version of the above number. Include any formatting. Ex. (555) 222-CFPB', max_length=15, required=False)), ('tty', core_blocks.CharBlock(help_text='Do not include spaces or dashes. Ex. 8554112372', label='TTY', max_length=15, required=False, validators=[django.core.validators.RegexValidator(message='Enter a numeric phone number, without punctuation.', regex='^\\d*$')])), ('tty_ext', core_blocks.CharBlock(label='TTY Extension', max_length=4, required=False))))))))), ('address', core_blocks.StructBlock((('label', core_blocks.CharBlock(required=False)), ('title', core_blocks.CharBlock(required=False)), ('street', core_blocks.CharBlock(required=False)), ('city', core_blocks.CharBlock(max_length=50, required=False)), ('state', core_blocks.CharBlock(max_length=25, required=False)), ('zip_code', core_blocks.CharBlock(max_length=15, required=False)))))), blank=True))))))))), ('expandable', core_blocks.StructBlock((('label', core_blocks.CharBlock(required=False)), ('is_bordered', core_blocks.BooleanBlock(required=False)), ('is_midtone', core_blocks.BooleanBlock(required=False)), ('is_expanded', core_blocks.BooleanBlock(required=False)), ('content', core_blocks.StreamBlock((('paragraph', core_blocks.RichTextBlock(required=False)), ('well', core_blocks.StructBlock((('content', core_blocks.RichTextBlock(label='Well', required=False)),))), ('links', core_blocks.StructBlock((('text', core_blocks.CharBlock(required=False)), ('url', core_blocks.CharBlock(default='/', required=False))))), ('email', core_blocks.StructBlock((('emails', core_blocks.ListBlock(core_blocks.StructBlock((('url', core_blocks.EmailBlock(label='Email address')), ('text', core_blocks.CharBlock(label='Link text (optional)', required=False)))))),))), ('phone', core_blocks.StructBlock((('fax', core_blocks.BooleanBlock(default=False, label='Is this number a fax?', required=False)), ('phones', core_blocks.ListBlock(core_blocks.StructBlock((('number', core_blocks.CharBlock(help_text='Do not include spaces or dashes. Ex. 8554112372', max_length=15, validators=[django.core.validators.RegexValidator(message='Enter a numeric phone number, without punctuation.', regex='^\\d*$')])), ('extension', core_blocks.CharBlock(max_length=4, required=False)), ('vanity', core_blocks.CharBlock(help_text='A phoneword version of the above number. Include any formatting. Ex. (555) 222-CFPB', max_length=15, required=False)), ('tty', core_blocks.CharBlock(help_text='Do not include spaces or dashes. Ex. 8554112372', label='TTY', max_length=15, required=False, validators=[django.core.validators.RegexValidator(message='Enter a numeric phone number, without punctuation.', regex='^\\d*$')])), ('tty_ext', core_blocks.CharBlock(label='TTY Extension', max_length=4, required=False))))))))), ('address', core_blocks.StructBlock((('label', core_blocks.CharBlock(required=False)), ('title', core_blocks.CharBlock(required=False)), ('street', core_blocks.CharBlock(required=False)), ('city', core_blocks.CharBlock(max_length=50, required=False)), ('state', core_blocks.CharBlock(max_length=25, required=False)), ('zip_code', core_blocks.CharBlock(max_length=15, required=False)))))), blank=True))))), ('well', core_blocks.StructBlock((('content', core_blocks.RichTextBlock(label='Well', required=False)),))), ('raw_html_block', core_blocks.RawHTMLBlock(label='Raw HTML block'))), blank=True),
        ),
        migrations.AlterField(
            model_name='repayingstudentdebtpage',
            name='content',
            field=core_fields.StreamField((('full_width_text', core_blocks.StreamBlock((('content', core_blocks.RichTextBlock(icon='edit')), ('content_with_anchor', core_blocks.StructBlock((('content_block', core_blocks.RichTextBlock()), ('anchor_link', core_blocks.StructBlock((('link_id', core_blocks.CharBlock(help_text='\n            ID will be auto-generated on save.\n            However, you may enter some human-friendly text that\n            will be incorporated to make it easier to read.\n        ', label='ID for this content block', required=False)),)))))), ('heading', core_blocks.StructBlock((('text', v1.blocks.HeadingTextBlock(required=False)), ('level', core_blocks.ChoiceBlock(choices=[('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')])), ('icon', v1.blocks.HeadingIconBlock(help_text='Input the name of an icon to appear to the left of the heading. E.g., approved, help-round, etc. <a href="https://cfpb.github.io/capital-framework/components/cf-icons/#the-icons">See full list of icons</a>', required=False))), required=False)), ('image', core_blocks.StructBlock((('image', core_blocks.StructBlock((('upload', images_blocks.ImageChooserBlock(required=False)), ('alt', core_blocks.CharBlock(help_text="If the image is decorative (i.e., if a screenreader wouldn't have anything useful to say about it), leave the Alt field blank.", required=False))))), ('image_width', core_blocks.ChoiceBlock(choices=[('full', 'full'), (470, '470px'), (270, '270px'), (170, '170px')])), ('image_position', core_blocks.ChoiceBlock(choices=[('right', 'right'), ('left', 'left')], help_text='Does not apply if the image is full-width')), ('text', core_blocks.RichTextBlock(label='Caption', required=False)), ('is_bottom_rule', core_blocks.BooleanBlock(default=True, help_text='Check to add a horizontal rule line to bottom of inset.', label='Has bottom rule line', required=False))))), ('table_block', v1.atomic_elements.organisms.AtomicTableBlock(table_options={'renderer': 'html'})), ('quote', core_blocks.StructBlock((('body', core_blocks.TextBlock()), ('citation', core_blocks.TextBlock(required=False)), ('is_large', core_blocks.BooleanBlock(required=False))))), ('cta', core_blocks.StructBlock((('slug_text', core_blocks.CharBlock(required=False)), ('paragraph_text', core_blocks.RichTextBlock(required=False)), ('button', core_blocks.StructBlock((('text', core_blocks.CharBlock(required=False)), ('url', core_blocks.CharBlock(default='/', required=False)), ('size', core_blocks.ChoiceBlock(choices=[('regular', 'Regular'), ('large', 'Large Primary')])))))))), ('related_links', core_blocks.StructBlock((('heading', core_blocks.CharBlock(required=False)), ('paragraph', core_blocks.RichTextBlock(required=False)), ('links', core_blocks.ListBlock(core_blocks.StructBlock((('text', core_blocks.CharBlock(required=False)), ('url', core_blocks.CharBlock(default='/', required=False))))))))), ('reusable_text', v1.blocks.ReusableTextChooserBlock('v1.ReusableText')), ('email_signup', core_blocks.StructBlock((('heading', core_blocks.CharBlock(default='Stay informed', required=False)), ('default_heading', core_blocks.BooleanBlock(default=True, help_text='If selected, heading will be styled as an H5 with green top rule. Deselect to style header as H3.', label='Default heading style', required=False)), ('text', core_blocks.CharBlock(help_text='Write a sentence or two about what kinds of emails the user is signing up for, how frequently they will be sent, etc.', required=False)), ('gd_code', core_blocks.CharBlock(help_text='Code for the topic (i.e., mailing list) you want people who submit this form to subscribe to. Format: USCFPB_###', label='GovDelivery code', required=False)), ('disclaimer_page', core_blocks.PageChooserBlock(help_text='Choose the page that the "See Privacy Act statement" link should go to. If in doubt, use "Generic Email Sign-Up Privacy Act Statement".', label='Privacy Act statement', required=False))))), ('well', core_blocks.StructBlock((('content', core_blocks.RichTextBlock(label='Well', required=False)),))), ('well_with_ask_search', core_blocks.StructBlock((('content', core_blocks.RichTextBlock(label='Well', required=False)), ('ask_search', core_blocks.StructBlock((('show_label', core_blocks.BooleanBlock(default=True, help_text='Whether to show form label.', required=False)), ('placeholder', core_blocks.TextBlock(help_text='Text to show for the input placeholder text.', required=False))))))))))), ('info_unit_group', core_blocks.StructBlock((('format', core_blocks.ChoiceBlock(choices=[('50-50', '50/50'), ('33-33-33', '33/33/33'), ('25-75', '25/75')], help_text='Choose the number and width of info unit columns.', label='Format')), ('heading', core_blocks.StructBlock((('text', v1.blocks.HeadingTextBlock(required=False)), ('level', core_blocks.ChoiceBlock(choices=[('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')])), ('icon', v1.blocks.HeadingIconBlock(help_text='Input the name of an icon to appear to the left of the heading. E.g., approved, help-round, etc. <a href="https://cfpb.github.io/capital-framework/components/cf-icons/#the-icons">See full list of icons</a>', required=False))), required=False)), ('intro', core_blocks.RichTextBlock(help_text='If this field is not empty, the Heading field must also be set.', required=False)), ('link_image_and_heading', core_blocks.BooleanBlock(default=True, help_text="Check this to link all images and headings to the URL of the first link in their unit's list, if there is a link.", required=False)), ('has_top_rule_line', core_blocks.BooleanBlock(default=False, help_text='Check this to add a horizontal rule line to top of info unit group.', required=False)), ('lines_between_items', core_blocks.BooleanBlock(default=False, help_text='Check this to show horizontal rule lines between info units.', label='Show rule lines between items', required=False)), ('info_units', core_blocks.ListBlock(core_blocks.StructBlock((('image', core_blocks.StructBlock((('upload', images_blocks.ImageChooserBlock(required=False)), ('alt', core_blocks.CharBlock(help_text="If the image is decorative (i.e., if a screenreader wouldn't have anything useful to say about it), leave the Alt field blank.", required=False))))), ('heading', core_blocks.StructBlock((('text', v1.blocks.HeadingTextBlock(required=False)), ('level', core_blocks.ChoiceBlock(choices=[('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')])), ('icon', v1.blocks.HeadingIconBlock(help_text='Input the name of an icon to appear to the left of the heading. E.g., approved, help-round, etc. <a href="https://cfpb.github.io/capital-framework/components/cf-icons/#the-icons">See full list of icons</a>', required=False))), default={'level': 'h3'}, required=False)), ('body', core_blocks.RichTextBlock(blank=True, required=False)), ('links', core_blocks.ListBlock(core_blocks.StructBlock((('text', core_blocks.CharBlock(required=False)), ('url', core_blocks.CharBlock(default='/', required=False)))), required=False)))))), ('sharing', core_blocks.StructBlock((('shareable', core_blocks.BooleanBlock(help_text='If checked, share links will be included below the items.', label='Include sharing links?', required=False)), ('share_blurb', core_blocks.CharBlock(help_text='Sets the tweet text, email subject line, and LinkedIn post text.', required=False)))))))), ('expandable_group', core_blocks.StructBlock((('heading', core_blocks.CharBlock(help_text='Added as an <code>&lt;h3&gt;</code> at the top of this block. Also adds a wrapping <code>&lt;div&gt;</code> whose <code>id</code> attribute comes from a slugified version of this heading, creating an anchor that can be used when linking to this part of the page.', required=False)), ('body', core_blocks.RichTextBlock(required=False)), ('is_accordion', core_blocks.BooleanBlock(required=False)), ('has_top_rule_line', core_blocks.BooleanBlock(default=False, help_text='Check this to add a horizontal rule line to top of expandable group.', required=False)), ('expandables', core_blocks.ListBlock(core_blocks.StructBlock((('label', core_blocks.CharBlock(required=False)), ('is_bordered', core_blocks.BooleanBlock(required=False)), ('is_midtone', core_blocks.BooleanBlock(required=False)), ('is_expanded', core_blocks.BooleanBlock(required=False)), ('content', core_blocks.StreamBlock((('paragraph', core_blocks.RichTextBlock(required=False)), ('well', core_blocks.StructBlock((('content', core_blocks.RichTextBlock(label='Well', required=False)),))), ('links', core_blocks.StructBlock((('text', core_blocks.CharBlock(required=False)), ('url', core_blocks.CharBlock(default='/', required=False))))), ('email', core_blocks.StructBlock((('emails', core_blocks.ListBlock(core_blocks.StructBlock((('url', core_blocks.EmailBlock(label='Email address')), ('text', core_blocks.CharBlock(label='Link text (optional)', required=False)))))),))), ('phone', core_blocks.StructBlock((('fax', core_blocks.BooleanBlock(default=False, label='Is this number a fax?', required=False)), ('phones', core_blocks.ListBlock(core_blocks.StructBlock((('number', core_blocks.CharBlock(help_text='Do not include spaces or dashes. Ex. 8554112372', max_length=15, validators=[django.core.validators.RegexValidator(message='Enter a numeric phone number, without punctuation.', regex='^\\d*$')])), ('extension', core_blocks.CharBlock(max_length=4, required=False)), ('vanity', core_blocks.CharBlock(help_text='A phoneword version of the above number. Include any formatting. Ex. (555) 222-CFPB', max_length=15, required=False)), ('tty', core_blocks.CharBlock(help_text='Do not include spaces or dashes. Ex. 8554112372', label='TTY', max_length=15, required=False, validators=[django.core.validators.RegexValidator(message='Enter a numeric phone number, without punctuation.', regex='^\\d*$')])), ('tty_ext', core_blocks.CharBlock(label='TTY Extension', max_length=4, required=False))))))))), ('address', core_blocks.StructBlock((('label', core_blocks.CharBlock(required=False)), ('title', core_blocks.CharBlock(required=False)), ('street', core_blocks.CharBlock(required=False)), ('city', core_blocks.CharBlock(max_length=50, required=False)), ('state', core_blocks.CharBlock(max_length=25, required=False)), ('zip_code', core_blocks.CharBlock(max_length=15, required=False)))))), blank=True))))))))), ('expandable', core_blocks.StructBlock((('label', core_blocks.CharBlock(required=False)), ('is_bordered', core_blocks.BooleanBlock(required=False)), ('is_midtone', core_blocks.BooleanBlock(required=False)), ('is_expanded', core_blocks.BooleanBlock(required=False)), ('content', core_blocks.StreamBlock((('paragraph', core_blocks.RichTextBlock(required=False)), ('well', core_blocks.StructBlock((('content', core_blocks.RichTextBlock(label='Well', required=False)),))), ('links', core_blocks.StructBlock((('text', core_blocks.CharBlock(required=False)), ('url', core_blocks.CharBlock(default='/', required=False))))), ('email', core_blocks.StructBlock((('emails', core_blocks.ListBlock(core_blocks.StructBlock((('url', core_blocks.EmailBlock(label='Email address')), ('text', core_blocks.CharBlock(label='Link text (optional)', required=False)))))),))), ('phone', core_blocks.StructBlock((('fax', core_blocks.BooleanBlock(default=False, label='Is this number a fax?', required=False)), ('phones', core_blocks.ListBlock(core_blocks.StructBlock((('number', core_blocks.CharBlock(help_text='Do not include spaces or dashes. Ex. 8554112372', max_length=15, validators=[django.core.validators.RegexValidator(message='Enter a numeric phone number, without punctuation.', regex='^\\d*$')])), ('extension', core_blocks.CharBlock(max_length=4, required=False)), ('vanity', core_blocks.CharBlock(help_text='A phoneword version of the above number. Include any formatting. Ex. (555) 222-CFPB', max_length=15, required=False)), ('tty', core_blocks.CharBlock(help_text='Do not include spaces or dashes. Ex. 8554112372', label='TTY', max_length=15, required=False, validators=[django.core.validators.RegexValidator(message='Enter a numeric phone number, without punctuation.', regex='^\\d*$')])), ('tty_ext', core_blocks.CharBlock(label='TTY Extension', max_length=4, required=False))))))))), ('address', core_blocks.StructBlock((('label', core_blocks.CharBlock(required=False)), ('title', core_blocks.CharBlock(required=False)), ('street', core_blocks.CharBlock(required=False)), ('city', core_blocks.CharBlock(max_length=50, required=False)), ('state', core_blocks.CharBlock(max_length=25, required=False)), ('zip_code', core_blocks.CharBlock(max_length=15, required=False)))))), blank=True))))), ('well', core_blocks.StructBlock((('content', core_blocks.RichTextBlock(label='Well', required=False)),))), ('raw_html_block', core_blocks.RawHTMLBlock(label='Raw HTML block'))), blank=True),
        ),
        migrations.AlterField(
            model_name='studentloanquizpage',
            name='content',
            field=core_fields.StreamField((('full_width_text', core_blocks.StreamBlock((('content', core_blocks.RichTextBlock(icon='edit')), ('content_with_anchor', core_blocks.StructBlock((('content_block', core_blocks.RichTextBlock()), ('anchor_link', core_blocks.StructBlock((('link_id', core_blocks.CharBlock(help_text='\n            ID will be auto-generated on save.\n            However, you may enter some human-friendly text that\n            will be incorporated to make it easier to read.\n        ', label='ID for this content block', required=False)),)))))), ('heading', core_blocks.StructBlock((('text', v1.blocks.HeadingTextBlock(required=False)), ('level', core_blocks.ChoiceBlock(choices=[('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')])), ('icon', v1.blocks.HeadingIconBlock(help_text='Input the name of an icon to appear to the left of the heading. E.g., approved, help-round, etc. <a href="https://cfpb.github.io/capital-framework/components/cf-icons/#the-icons">See full list of icons</a>', required=False))), required=False)), ('image', core_blocks.StructBlock((('image', core_blocks.StructBlock((('upload', images_blocks.ImageChooserBlock(required=False)), ('alt', core_blocks.CharBlock(help_text="If the image is decorative (i.e., if a screenreader wouldn't have anything useful to say about it), leave the Alt field blank.", required=False))))), ('image_width', core_blocks.ChoiceBlock(choices=[('full', 'full'), (470, '470px'), (270, '270px'), (170, '170px')])), ('image_position', core_blocks.ChoiceBlock(choices=[('right', 'right'), ('left', 'left')], help_text='Does not apply if the image is full-width')), ('text', core_blocks.RichTextBlock(label='Caption', required=False)), ('is_bottom_rule', core_blocks.BooleanBlock(default=True, help_text='Check to add a horizontal rule line to bottom of inset.', label='Has bottom rule line', required=False))))), ('table_block', v1.atomic_elements.organisms.AtomicTableBlock(table_options={'renderer': 'html'})), ('quote', core_blocks.StructBlock((('body', core_blocks.TextBlock()), ('citation', core_blocks.TextBlock(required=False)), ('is_large', core_blocks.BooleanBlock(required=False))))), ('cta', core_blocks.StructBlock((('slug_text', core_blocks.CharBlock(required=False)), ('paragraph_text', core_blocks.RichTextBlock(required=False)), ('button', core_blocks.StructBlock((('text', core_blocks.CharBlock(required=False)), ('url', core_blocks.CharBlock(default='/', required=False)), ('size', core_blocks.ChoiceBlock(choices=[('regular', 'Regular'), ('large', 'Large Primary')])))))))), ('related_links', core_blocks.StructBlock((('heading', core_blocks.CharBlock(required=False)), ('paragraph', core_blocks.RichTextBlock(required=False)), ('links', core_blocks.ListBlock(core_blocks.StructBlock((('text', core_blocks.CharBlock(required=False)), ('url', core_blocks.CharBlock(default='/', required=False))))))))), ('reusable_text', v1.blocks.ReusableTextChooserBlock('v1.ReusableText')), ('email_signup', core_blocks.StructBlock((('heading', core_blocks.CharBlock(default='Stay informed', required=False)), ('default_heading', core_blocks.BooleanBlock(default=True, help_text='If selected, heading will be styled as an H5 with green top rule. Deselect to style header as H3.', label='Default heading style', required=False)), ('text', core_blocks.CharBlock(help_text='Write a sentence or two about what kinds of emails the user is signing up for, how frequently they will be sent, etc.', required=False)), ('gd_code', core_blocks.CharBlock(help_text='Code for the topic (i.e., mailing list) you want people who submit this form to subscribe to. Format: USCFPB_###', label='GovDelivery code', required=False)), ('disclaimer_page', core_blocks.PageChooserBlock(help_text='Choose the page that the "See Privacy Act statement" link should go to. If in doubt, use "Generic Email Sign-Up Privacy Act Statement".', label='Privacy Act statement', required=False))))), ('well', core_blocks.StructBlock((('content', core_blocks.RichTextBlock(label='Well', required=False)),))), ('well_with_ask_search', core_blocks.StructBlock((('content', core_blocks.RichTextBlock(label='Well', required=False)), ('ask_search', core_blocks.StructBlock((('show_label', core_blocks.BooleanBlock(default=True, help_text='Whether to show form label.', required=False)), ('placeholder', core_blocks.TextBlock(help_text='Text to show for the input placeholder text.', required=False))))))))))), ('info_unit_group', core_blocks.StructBlock((('format', core_blocks.ChoiceBlock(choices=[('50-50', '50/50'), ('33-33-33', '33/33/33'), ('25-75', '25/75')], help_text='Choose the number and width of info unit columns.', label='Format')), ('heading', core_blocks.StructBlock((('text', v1.blocks.HeadingTextBlock(required=False)), ('level', core_blocks.ChoiceBlock(choices=[('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')])), ('icon', v1.blocks.HeadingIconBlock(help_text='Input the name of an icon to appear to the left of the heading. E.g., approved, help-round, etc. <a href="https://cfpb.github.io/capital-framework/components/cf-icons/#the-icons">See full list of icons</a>', required=False))), required=False)), ('intro', core_blocks.RichTextBlock(help_text='If this field is not empty, the Heading field must also be set.', required=False)), ('link_image_and_heading', core_blocks.BooleanBlock(default=True, help_text="Check this to link all images and headings to the URL of the first link in their unit's list, if there is a link.", required=False)), ('has_top_rule_line', core_blocks.BooleanBlock(default=False, help_text='Check this to add a horizontal rule line to top of info unit group.', required=False)), ('lines_between_items', core_blocks.BooleanBlock(default=False, help_text='Check this to show horizontal rule lines between info units.', label='Show rule lines between items', required=False)), ('info_units', core_blocks.ListBlock(core_blocks.StructBlock((('image', core_blocks.StructBlock((('upload', images_blocks.ImageChooserBlock(required=False)), ('alt', core_blocks.CharBlock(help_text="If the image is decorative (i.e., if a screenreader wouldn't have anything useful to say about it), leave the Alt field blank.", required=False))))), ('heading', core_blocks.StructBlock((('text', v1.blocks.HeadingTextBlock(required=False)), ('level', core_blocks.ChoiceBlock(choices=[('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')])), ('icon', v1.blocks.HeadingIconBlock(help_text='Input the name of an icon to appear to the left of the heading. E.g., approved, help-round, etc. <a href="https://cfpb.github.io/capital-framework/components/cf-icons/#the-icons">See full list of icons</a>', required=False))), default={'level': 'h3'}, required=False)), ('body', core_blocks.RichTextBlock(blank=True, required=False)), ('links', core_blocks.ListBlock(core_blocks.StructBlock((('text', core_blocks.CharBlock(required=False)), ('url', core_blocks.CharBlock(default='/', required=False)))), required=False)))))), ('sharing', core_blocks.StructBlock((('shareable', core_blocks.BooleanBlock(help_text='If checked, share links will be included below the items.', label='Include sharing links?', required=False)), ('share_blurb', core_blocks.CharBlock(help_text='Sets the tweet text, email subject line, and LinkedIn post text.', required=False)))))))), ('expandable_group', core_blocks.StructBlock((('heading', core_blocks.CharBlock(help_text='Added as an <code>&lt;h3&gt;</code> at the top of this block. Also adds a wrapping <code>&lt;div&gt;</code> whose <code>id</code> attribute comes from a slugified version of this heading, creating an anchor that can be used when linking to this part of the page.', required=False)), ('body', core_blocks.RichTextBlock(required=False)), ('is_accordion', core_blocks.BooleanBlock(required=False)), ('has_top_rule_line', core_blocks.BooleanBlock(default=False, help_text='Check this to add a horizontal rule line to top of expandable group.', required=False)), ('expandables', core_blocks.ListBlock(core_blocks.StructBlock((('label', core_blocks.CharBlock(required=False)), ('is_bordered', core_blocks.BooleanBlock(required=False)), ('is_midtone', core_blocks.BooleanBlock(required=False)), ('is_expanded', core_blocks.BooleanBlock(required=False)), ('content', core_blocks.StreamBlock((('paragraph', core_blocks.RichTextBlock(required=False)), ('well', core_blocks.StructBlock((('content', core_blocks.RichTextBlock(label='Well', required=False)),))), ('links', core_blocks.StructBlock((('text', core_blocks.CharBlock(required=False)), ('url', core_blocks.CharBlock(default='/', required=False))))), ('email', core_blocks.StructBlock((('emails', core_blocks.ListBlock(core_blocks.StructBlock((('url', core_blocks.EmailBlock(label='Email address')), ('text', core_blocks.CharBlock(label='Link text (optional)', required=False)))))),))), ('phone', core_blocks.StructBlock((('fax', core_blocks.BooleanBlock(default=False, label='Is this number a fax?', required=False)), ('phones', core_blocks.ListBlock(core_blocks.StructBlock((('number', core_blocks.CharBlock(help_text='Do not include spaces or dashes. Ex. 8554112372', max_length=15, validators=[django.core.validators.RegexValidator(message='Enter a numeric phone number, without punctuation.', regex='^\\d*$')])), ('extension', core_blocks.CharBlock(max_length=4, required=False)), ('vanity', core_blocks.CharBlock(help_text='A phoneword version of the above number. Include any formatting. Ex. (555) 222-CFPB', max_length=15, required=False)), ('tty', core_blocks.CharBlock(help_text='Do not include spaces or dashes. Ex. 8554112372', label='TTY', max_length=15, required=False, validators=[django.core.validators.RegexValidator(message='Enter a numeric phone number, without punctuation.', regex='^\\d*$')])), ('tty_ext', core_blocks.CharBlock(label='TTY Extension', max_length=4, required=False))))))))), ('address', core_blocks.StructBlock((('label', core_blocks.CharBlock(required=False)), ('title', core_blocks.CharBlock(required=False)), ('street', core_blocks.CharBlock(required=False)), ('city', core_blocks.CharBlock(max_length=50, required=False)), ('state', core_blocks.CharBlock(max_length=25, required=False)), ('zip_code', core_blocks.CharBlock(max_length=15, required=False)))))), blank=True))))))))), ('expandable', core_blocks.StructBlock((('label', core_blocks.CharBlock(required=False)), ('is_bordered', core_blocks.BooleanBlock(required=False)), ('is_midtone', core_blocks.BooleanBlock(required=False)), ('is_expanded', core_blocks.BooleanBlock(required=False)), ('content', core_blocks.StreamBlock((('paragraph', core_blocks.RichTextBlock(required=False)), ('well', core_blocks.StructBlock((('content', core_blocks.RichTextBlock(label='Well', required=False)),))), ('links', core_blocks.StructBlock((('text', core_blocks.CharBlock(required=False)), ('url', core_blocks.CharBlock(default='/', required=False))))), ('email', core_blocks.StructBlock((('emails', core_blocks.ListBlock(core_blocks.StructBlock((('url', core_blocks.EmailBlock(label='Email address')), ('text', core_blocks.CharBlock(label='Link text (optional)', required=False)))))),))), ('phone', core_blocks.StructBlock((('fax', core_blocks.BooleanBlock(default=False, label='Is this number a fax?', required=False)), ('phones', core_blocks.ListBlock(core_blocks.StructBlock((('number', core_blocks.CharBlock(help_text='Do not include spaces or dashes. Ex. 8554112372', max_length=15, validators=[django.core.validators.RegexValidator(message='Enter a numeric phone number, without punctuation.', regex='^\\d*$')])), ('extension', core_blocks.CharBlock(max_length=4, required=False)), ('vanity', core_blocks.CharBlock(help_text='A phoneword version of the above number. Include any formatting. Ex. (555) 222-CFPB', max_length=15, required=False)), ('tty', core_blocks.CharBlock(help_text='Do not include spaces or dashes. Ex. 8554112372', label='TTY', max_length=15, required=False, validators=[django.core.validators.RegexValidator(message='Enter a numeric phone number, without punctuation.', regex='^\\d*$')])), ('tty_ext', core_blocks.CharBlock(label='TTY Extension', max_length=4, required=False))))))))), ('address', core_blocks.StructBlock((('label', core_blocks.CharBlock(required=False)), ('title', core_blocks.CharBlock(required=False)), ('street', core_blocks.CharBlock(required=False)), ('city', core_blocks.CharBlock(max_length=50, required=False)), ('state', core_blocks.CharBlock(max_length=25, required=False)), ('zip_code', core_blocks.CharBlock(max_length=15, required=False)))))), blank=True))))), ('well', core_blocks.StructBlock((('content', core_blocks.RichTextBlock(label='Well', required=False)),))), ('raw_html_block', core_blocks.RawHTMLBlock(label='Raw HTML block')), ('guided_quiz', core_blocks.StructBlock((('situation', core_blocks.RichTextBlock(blank=True, features=['ol', 'ul', 'bold', 'italic', 'link', 'image', 'document-link'], required=False)), ('questions', core_blocks.ListBlock(core_blocks.StructBlock((('subtitle', core_blocks.CharBlock(max_length=500, required=False)), ('question', core_blocks.RichTextBlock(blank=True, features=['ol', 'ul', 'bold', 'italic', 'link', 'image', 'document-link'], required=False)), ('answers', core_blocks.ListBlock(core_blocks.StructBlock((('answer_choice', core_blocks.CharBlock(help_text='An answer that a quiz participant may choose', max_length=500)), ('choice_letter', core_blocks.CharBlock(help_text='An optional character to apply to an answer choice', max_length=20, required=False)), ('answer_response', core_blocks.RichTextBlock(blank=True, features=['ol', 'ul', 'bold', 'italic', 'link', 'image', 'document-link'], help_text='Our response explaining whether an answer is right', required=False)))))))), template='paying-for-college/blocks/quiz-questions.html')), ('summary', core_blocks.RichTextBlock(blank=True, features=['ol', 'ul', 'bold', 'italic', 'link', 'image', 'document-link'], required=False)))))), blank=True),
        ),
    ]
Esempio n. 26
0
class PageLinksMixin(models.Model):
    class Meta:
        abstract = True

    sidebar_title = models.CharField(
        "Title",
        max_length=255,
        blank=True,
        null=True,
        default="Related Pages",
        help_text="The title to appear above the links in the sidebar",
    )
    page_links = fields.StreamField(page_link_blocks, blank=True)

    panels = [
        FieldPanel("sidebar_title"),
        FieldPanel("automatic"),
        StreamFieldPanel("page_links"),
    ]

    automatic = models.BooleanField(
        default=False, help_text="Build automatically from sibling pages"
    )

    def _find_url(self, val):
        try:
            link = val["link"]
            if link["link_page"] is not None:
                return link["link_page"].url
            if link["link_external"] is not None and link["link_external"] != "":
                return link["link_external"]
            if link["link_document"] is not None:
                return link["link_document"].url
        except Exception:
            return "/"
        return "/"

    @cached_property
    def _streamed(self):
        rv = []
        for item in self.page_links:
            rv.append(
                {
                    "title": item.value.get("label", ""),
                    "url": self._find_url(item.value),
                }
            )

        return rv
Esempio n. 27
0
class ServicesPage(Page):
    intro = models.TextField(null=True, blank=True)
    body = fields.StreamField(
        blocks.StreamBlock(
            [('section', SectionBlock())],
            min_num=4,
            max_num=4,
        ),
        blank=False,
    )

    content_panels = Page.content_panels + [
        edit_handlers.FieldPanel("intro"),
        edit_handlers.StreamFieldPanel("body"),
    ]
Esempio n. 28
0
class AiLabResourceCollection(AiLabFilterableResourceMixin, SectionPage):
    parent_page_types = [
        "AiLabUnderstandIndexPage",
        "AiLabDevelopIndexPage",
        "AiLabAdoptIndexPage",
    ]

    resources = fields.StreamField(resource_link_blocks, blank=True)
    topics = ParentalManyToManyField("AiLabTopic", blank=False)
    summary = models.CharField(max_length=255)
    featured_image = models.ForeignKey(
        settings.WAGTAILIMAGES_IMAGE_MODEL,
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name="+",
    )

    content_panels = [
        FieldPanel("title"),
        FieldPanel("summary", widget=forms.Textarea),
        FieldPanel("sub_head"),
        ImageChooserPanel("featured_image"),
        StreamFieldPanel("body"),
        StreamFieldPanel("resources"),
        FieldPanel("topics", widget=forms.CheckboxSelectMultiple),
    ]

    ajax_template = "ai_lab/ai_lab_resource_index_page.js.html"

    def _get_resources(self, topic=None, resource_type=None):
        if topic is None:
            resource_ids = [resource.value.id for resource in self.resources]
        else:
            resource_ids = list([
                r.value.id for r in self.resources
                if len(r.value.specific.topics.filter(slug=topic)) > 0
            ])

        resources = Page.objects.live().filter(id__in=resource_ids).specific()

        if resource_type is None:
            return resources
        else:
            return resources.type(resource_type)

    class Meta:
        verbose_name = "Resource Collection"
Esempio n. 29
0
class BlogPage(HeadlessPreviewMixin, Page):
    intro = models.CharField(max_length=250)
    body = fields.StreamField(DEFAULT_BLOCK_TYPES)

    api_fields = [APIField('intro'), APIField('body')]

    search_fields = Page.search_fields + [
        index.SearchField('intro'),
        index.SearchField('body'),
    ]

    content_panels = Page.content_panels + [
        FieldPanel('intro'),
        StreamFieldPanel('body'),
    ]
    graphql_fields = [GraphQLString("intro"), GraphQLStreamfield("body")]
Esempio n. 30
0
class PageLinksMixin(models.Model):
    class Meta:
        abstract = True

    sidebar_title = models.CharField(
        "Title",
        max_length=255,
        blank=True,
        null=True,
        default="Related Pages",
        help_text="The title to appear above the links in the sidebar")
    page_links = fields.StreamField(page_link_blocks, blank=True)

    panels = [
        FieldPanel('sidebar_title'),
        FieldPanel('automatic'),
        StreamFieldPanel('page_links')
    ]

    automatic = models.BooleanField(
        default=False, help_text="Build automatically from sibling pages")

    def _find_url(self, val):
        try:
            link = val['link']
            if link['link_page'] is not None:
                return link['link_page'].url
            if link['link_external'] is not None and link[
                    'link_external'] != '':
                return link['link_external']
            if link['link_document'] is not None:
                return link['link_document'].url
        except Exception:
            return '/'
        return '/'

    @cached_property
    def _streamed(self):
        rv = []
        for item in self.page_links:
            rv.append({
                'title': item.value.get('label', ""),
                'url': self._find_url(item.value)
            })

        return rv