示例#1
0
class TwoColumnBlock(blocks.StructBlock):
    # Value between 1 and 11
    left_side_size = blocks.IntegerBlock(default=7)

    left_column = blocks.StreamBlock([
        ('paragraph', blocks.RichTextBlock()),
        ('html', blocks.RawHTMLBlock()),
        ('image', ImageChooserBlock()),
        ('code', CodeBlock()),
    ],
                                     icon='arrow-left',
                                     label='Left column content')

    right_column = blocks.StreamBlock([
        ('paragraph', blocks.RichTextBlock()),
        ('html', blocks.RawHTMLBlock()),
        ('image', ImageChooserBlock()),
        ('code', CodeBlock()),
    ],
                                      icon='arrow-right',
                                      label='Right column content')

    def get_context(self, value, parent_context=None):
        value['right_side_size'] = 12 - value['left_side_size']
        context = super(TwoColumnBlock, self).get_context(value)
        return context

    class Meta:
        icon = 'placeholder'
        label = 'Two Columns'
        template = 'home/blocks/two_column_block.html'
示例#2
0
class TwoColumnBlock(blocks.StructBlock):

    left_column = blocks.StreamBlock([
        ('heading', blocks.CharBlock(classname="full title")),
        ('paragraph', blocks.RichTextBlock()),
        ('image', ImageChooserBlock()),
        ('embedded_video', EmbedBlock()),
        ('html', blocks.RawHTMLBlock()),
        ('media', MediaBlock(required=False)),
    ],
                                     icon='arrow-left',
                                     label='Left column content',
                                     required=False)

    right_column = blocks.StreamBlock(
        [('heading', blocks.CharBlock(classname="full title")),
         ('paragraph', blocks.RichTextBlock()), ('image', ImageChooserBlock()),
         ('embedded_video', EmbedBlock()),
         ('media', MediaBlock(required='False'))],
        icon='arrow-right',
        label='Right column content',
        required=False)

    class Meta:
        template = 'blocks/two_column_block.html'
        icon = 'placeholder'
        label = 'Two Columns'
class TripleFrameBlock(StructBlock):

    columns = blocks.ChoiceBlock(label=_('Proportions'),
                                 choices=[
                                     ('4-4-4', _('1/3 + 1/3 + 1/3')),
                                     ('6-3-3', _('1/2 + 1/4 + 1/4')),
                                     ('3-6-3', _('1/4 + 1/2 + 1/4')),
                                     ('3-3-6', _('1/4 + 1/4 + 1/2')),
                                 ],
                                 required=True,
                                 default='4-4-4',
                                 icon='fa fa-columns')

    left = blocks.StreamBlock(STREAMFIELD_BLOCKS_NOFRAMES, icon='cogs')
    middle = blocks.StreamBlock(STREAMFIELD_BLOCKS_NOFRAMES, icon='cogs')
    right = blocks.StreamBlock(STREAMFIELD_BLOCKS_NOFRAMES, icon='cogs')

    class Meta(object):
        icon = 'fa fa-columns'
        template = 'cosinnus/wagtail/widgets/triple_frame.html'

    def get_context(self, value):
        context = super(TripleFrameBlock, self).get_context(value)
        context['left'] = value.get('left')
        context['middle'] = value.get('middle')
        context['right'] = value.get('right')
        context['columns'] = value.get('columns')
        return context
示例#4
0
class TabBlock(blocks.StructBlock):

    nav = blocks.StreamBlock([
        ("tab",
         blocks.StructBlock(
             [("label", TitleBlock(required=True, closed=True)),
              ("content",
               blocks.StreamBlock([
                   ("title", TitleBlock(required=False, closed=True)),
                   ("paragraph", RichTextBlock(required=False, closed=True)),
                   ("quote", QuoteBlock(required=False, closed=True)),
                   ("image", ImageBlock(required=False, closed=True)),
                   ("html", blocks.RawHTMLBlock(required=False, closed=True)),
                   ("button", ButtonBlock(required=False, closed=True)),
                   ("popover", PopoverBlock(required=False, closed=True)),
                   ("link", LinkBlock(required=False, closed=True)),
               ],
                                  required=False,
                                  closed=True))],
             required=False,
             closed=True)),
    ],
                             required=False,
                             closed=True)
    parameters = blocks.StreamBlock(
        [("parameter", blocks.RawHTMLBlock(closed=True, required=False))],
        closed=True,
        required=False)
    style = StyleBlock(required=False, closed=True)

    class Meta:
        template = "components/container/tab_block.html"
        icon = "arrow-right-big"
        group = "Containers"
示例#5
0
class CountryGuideIndustryBlock(blocks.StructBlock):
    # Replacing a large set of fields each set of which was repeated six
    # times in V1's CountryGuidePage model as `accordion_*``

    icon = ImageChooserBlock(required=False, label='Industry icon')
    title = blocks.CharBlock(max_length=255, label='Industry title')
    teaser = blocks.TextBlock(required=False, label='Industry teaser')

    subsections = blocks.StreamBlock(
        [('subsection', CountryGuideIndustrySubsectionBlock())],
        block_counts={'subsection': {'max_num': 3}},
        required=False,
    )

    statistics = blocks.StreamBlock(
        [
            (
                'statistic',
                IndividualStatisticBlock(
                    icon='fa-calculator',
                    required=False,
                ),
            )
        ],
        null=True,
        blank=True,
        required=False,
        validators=[general_statistics_streamfield_validation],
    )

    case_study = CountryGuideCaseStudyBlock(required=False)

    class Meta:
        template = 'domestic/includes/blocks/accordions.html'
示例#6
0
class TwoColumnBlock(blocks.StructBlock):

    title = blocks.CharBlock(required=False, max_length=255)
    color = blocks.CharBlock(required=True, max_length=255)

    left_column = blocks.StreamBlock([
        ('heading', blocks.CharBlock(classname="full title")),
        ('paragraph', blocks.RichTextBlock()),
        ('image', ImageChooserBlock()),
        ('embedded_video', EmbedBlock()),
    ],
                                     icon='arrow-left',
                                     label='Left column content')

    right_column = blocks.StreamBlock([
        ('heading', blocks.CharBlock(classname="full title")),
        ('paragraph', blocks.RichTextBlock()),
        ('image', ImageChooserBlock()),
        ('button', blocks.PageChooserBlock(classname="btn")),
        ('embedded_video', EmbedBlock()),
    ],
                                      icon='arrow-right',
                                      label='Right column content')

    class Meta:
        template = 'home/two_column_block.html'
        icon = 'placeholder'
        label = 'Two Columns'
示例#7
0
class TwoColumnBlock(blocks.StructBlock):
    """Struct block for two columns section"""

    background_color = blocks.ChoiceBlock(choices=ColorChoices.choices)
    text_color = blocks.ChoiceBlock(choices=TextColorChoices.choices)
    left = blocks.StreamBlock(
        [
            ("simple_card", CardSimpleBlock()),
            ("detail_card", CardDetailBlock()),
            ("icon_bullets", IconBulletBlock()),
            ("rich_text", blocks.RichTextBlock()),
        ],
        min_num=1,
    )
    right = blocks.StreamBlock(
        [
            ("simple_card", CardSimpleBlock()),
            ("detail_card", CardDetailBlock()),
            ("icon_bullets", IconBulletBlock()),
            ("rich_text", blocks.RichTextBlock()),
        ],
        min_num=1,
    )

    class Meta:
        template = "pages/blocks/layout/two_columns_block.html"
示例#8
0
文件: blocks.py 项目: inyoka/case
class TwoColumnBlock(blocks.StructBlock):

    # background = blocks.ChoiceBlock(choices=COLOUR_CHOICES,default="white")
    left_column = blocks.StreamBlock([
        ('heading', blocks.CharBlock(classname="full title")),
        ('paragraph', blocks.RichTextBlock()),
        ('image', ImageChooserBlock()),
        ('embedded_video', EmbedBlock()),
        ('google_map', GoogleMapBlock()),
    ],
                                     icon='arrow-left',
                                     label='Left column content')

    right_column = blocks.StreamBlock([
        ('heading', blocks.CharBlock(classname="full title")),
        ('paragraph', blocks.RichTextBlock()),
        ('image', ImageChooserBlock()),
        ('embedded_video', EmbedBlock()),
        ('google_map', GoogleMapBlock()),
    ],
                                      icon='arrow-right',
                                      label='Right column content')

    class Meta:
        template = 'yourapp/blocks/two_column_block.html'
        icon = 'placeholder'
        label = 'Two Columns'
示例#9
0
class HeroSection(BaseStructBlock):
    background_color = BgColorChoiceBlock(required=False)
    background_image = ImageChooserBlock(required=False)

    css_classes = blocks.CharBlock(required=False)

    primary_content = blocks.StreamBlock(
        [
            ('headline', Display4Block()),
            ('subtitle', TitleBlock()),
            ('richtext', blocks.RichTextBlock(features=RICHTEXT_ALL_FEATURES)),
            ('button', ButtonBlock()),
            ('image', ImageChooserBlock()),
        ],
        required=False,
        block_counts={
            'headline': {
                'max_num': 1
            },
            'subtitle': {
                'max_num': 1
            }
        },
    )

    secondary_content = blocks.StreamBlock([('image', ImageChooserBlock())],
                                           required=False,
                                           max_num=1)

    class Meta:
        icon = 'image'
        template = 'website/sections/hero_section.html'
示例#10
0
class ModalBlock(ButtonMixin, BaseLayoutBlock):
    """
    Renders a button that then opens a popup/modal with content.
    """
    header = blocks.CharBlock(
        required=False,
        max_length=255,
        label=_('Modal heading'),
    )
    content = blocks.StreamBlock(
        [],
        label=_('Modal content'),
    )
    footer = blocks.StreamBlock(
        [
            ('text',
             blocks.CharBlock(icon='fa-file-text-o',
                              max_length=255,
                              label=_('Simple Text'))),
            ('button', ButtonBlock()),
        ],
        required=False,
        label=_('Modal footer'),
    )

    class Meta:
        template = 'coderedcms/blocks/modal_block.html'
        icon = 'fa-window-maximize'
        label = _('Modal')
示例#11
0
class OneYouTwoColumnShelf(StandardTwoColumnShelf):
    column_1_items = blocks.StreamBlock(STANDARD_GRID_PANELS,
                                        icon='arrow-left',
                                        label='Column 1 Content')
    column_2_items = blocks.StreamBlock(STANDARD_GRID_PANELS,
                                        icon='arrow-left',
                                        label='Column 2 Content')
示例#12
0
class TwoColumnBlock(blocks.StructBlock):

    left_column = blocks.StreamBlock([
        ('heading', blocks.CharBlock(classname="full title")),
        ('paragraph', blocks.RichTextBlock()),
        ('image', ImageChooserBlock()),
        ('embedded_video', EmbedBlock()),
        ('google_map', GoogleMapBlock()),
    ],
                                     icon='arrow-left',
                                     label='Left column content')

    right_column = blocks.StreamBlock([
        ('heading', blocks.CharBlock(classname="full title")),
        ('paragraph', blocks.RichTextBlock()),
        ('image', ImageChooserBlock()),
        ('embedded_video', EmbedBlock()),
        ('google_map', GoogleMapBlock()),
    ],
                                      icon='arrow-right',
                                      label='Right column content')

    class Meta:
        template = 'nicpages/blocks/two_column_block.html'
        icon = 'placeholder'
        label = 'Two Columns'
示例#13
0
class SimpleTable(blocks.StructBlock):
    columns_def = blocks.StreamBlock([('column_def', SimpleTableColumnDef())])
    records = blocks.StreamBlock([('record', SimpleTableItem())])

    class Meta:
        template = 'tmps/tmp_simple_table.html'
        icon = 'placeholder'
        label = 'Simple Table'
示例#14
0
class ActionPlanShelf(Shelf, WithTracking):
    action_groups = blocks.StreamBlock([
        ('action_group', ActionGroupPanel(required=False,
                                          icon='collapse-down')),
    ])
    ctas = blocks.StreamBlock([('simple_menu_item', SimpleCtaLinkBlock())],
                              icon='arrow-left',
                              label='Items',
                              required=False)
示例#15
0
class IgcTimelineBlock(blocks.StructBlock):
    date = blocks.CharBlock(required=True)
    title = blocks.CharBlock(required=False)
    body = blocks.RichTextBlock(
        features=['bold', 'italic', 'link'],
        required=False,
    )
    location = blocks.CharBlock(required=False)
    countries_represented = ImageChooserBlock(required=False)
    outcomes = blocks.StreamBlock(
        [
            ('outcome',
             blocks.StructBlock([
                 ('date', blocks.DateBlock(required=False)),
                 ('text',
                  blocks.RichTextBlock(
                      features=['bold', 'italic', 'link'],
                      required=False,
                  )),
             ])),
        ],
        required=False,
    )
    witnesses = blocks.StreamBlock(
        [
            ('witness_date',
             blocks.StructBlock([
                 ('date', blocks.DateBlock(required=False)),
                 ('witnesses',
                  blocks.StreamBlock([
                      ('witnesses_full_session',
                       blocks.StructBlock([
                           ('title', blocks.CharBlock(required=False)),
                           ('witness_transcript',
                            blocks.URLBlock(required=False)),
                           ('witness_video', blocks.URLBlock(required=False)),
                       ])),
                      ('witness',
                       blocks.StructBlock([
                           ('name', blocks.CharBlock(required=False)),
                           ('title', blocks.CharBlock(required=False)),
                           ('witness_transcript',
                            blocks.URLBlock(required=False)),
                           ('witness_video', blocks.URLBlock(required=False)),
                       ])),
                  ], )),
             ])),
        ],
        required=False,
    )

    class Meta:
        icon = 'arrows-up-down'
        label = 'IGC Timeline'
        template = 'streams/igc_timeline_block.html'
示例#16
0
class ResourceBlock(blocks.StructBlock):
    """A section of a ResourcePage"""
    title = blocks.CharBlock(required=True)
    hide_title = blocks.BooleanBlock(
        required=False, help_text='Should the section title be displayed?')
    content = blocks.StreamBlock([
        ('text',
         blocks.RichTextBlock(blank=False,
                              null=False,
                              required=False,
                              icon='pilcrow')),
        ('documents',
         blocks.ListBlock(ThumbnailBlock(),
                          template='blocks/section-documents.html',
                          icon='doc-empty')),
        ('contact_info', ContactInfoBlock()),
        ('internal_button', InternalButtonBlock()),
        ('external_button', ExternalButtonBlock()),
        ('page', blocks.PageChooserBlock(template='blocks/page-links.html')),
        ('disabled_page',
         blocks.CharBlock(blank=False,
                          null=False,
                          required=False,
                          template='blocks/disabled-page-links.html',
                          icon='placeholder',
                          help_text='Name of a disabled link')),
        ('document_list',
         blocks.ListBlock(FeedDocumentBlock(),
                          template='blocks/document-list.html',
                          icon='doc-empty')),
        ('current_commissioners', CurrentCommissionersBlock()),
        ('fec_jobs', CareersBlock()),
        ('mur_search', MURSearchBlock()),
        ('audit_search', AuditSearchBlock()),
        ('table', TableBlock()),
        ('html', blocks.RawHTMLBlock()),
        ('reporting_example_cards', ReportingExampleCards()),
        ('contribution_limits_table',
         SnippetChooserBlock('home.EmbedTableSnippet',
                             template='blocks/embed-table.html',
                             icon='table')),
    ])

    aside = blocks.StreamBlock([
        ('title', blocks.CharBlock(required=False, icon='title')),
        ('document', ThumbnailBlock()),
        ('link', AsideLinkBlock()),
    ],
                               template='blocks/section-aside.html',
                               icon='placeholder',
                               required=False)

    class Meta:
        template = 'blocks/section.html'
示例#17
0
文件: models.py 项目: joyider/digihel
class TwoColumnBlock(blocks.StructBlock):
    left_column = blocks.StreamBlock(rich_text_blocks,
                                     icon='arrow-left',
                                     label=_('Left column content'))
    right_column = blocks.StreamBlock(rich_text_blocks,
                                      icon='arrow-right',
                                      label=_('Right column content'))

    class Meta:
        icon = 'placeholder'
        label = _('Two columns')
        template = 'content/blocks/two_column.html'
示例#18
0
class TabsBlock(blocks.StructBlock):
    tab_1_title = blocks.CharBlock()
    tab_1_content = blocks.StreamBlock([
        ('accordion', AccordionBlock()),
    ])
    tab_2_content = blocks.StreamBlock([
        ('paragraph', RichTextBlock()),
        ('accordion', AccordionBlock()),
    ])

    class Meta:
        icon = "fa-columns"
示例#19
0
class TwoColumnBlock(blocks.StructBlock):
    background = blocks.ChoiceBlock(choices=COLOUR_CHOICES, default="white")
    left_column = blocks.StreamBlock(COLUMN_BLOCKS,
                                     icon='arrow-left',
                                     label='Left column content')
    right_column = blocks.StreamBlock(COLUMN_BLOCKS,
                                      icon='arrow-right',
                                      label='Right column content')

    class Meta:
        template = 'blocks/two_column_block.html'
        icon = 'list-ul'
        label = 'Two Columns'
示例#20
0
class TwoImageBlock(blocks.StructBlock):

    left_image = blocks.StreamBlock([("image", ImageChooserBlock()),
                                     ("image_w_caption", ImageCaptionBlock())])

    right_image = blocks.StreamBlock([("image", ImageChooserBlock()),
                                      ("image_w_caption", ImageCaptionBlock())
                                      ])

    class Meta:
        template = "blog/blocks/two_image_block.html"
        icon = "placeholder"
        label = "Two Images"
示例#21
0
class Layout3ColSection(BaseStructBlock):
    background_color = BgColorChoiceBlock(required=False)
    background_image = ImageChooserBlock(required=False)

    column_1 = blocks.StreamBlock(stream_block_choices, required=True)

    column_2 = blocks.StreamBlock(stream_block_choices, required=True)

    column_3 = blocks.StreamBlock(stream_block_choices, required=True)

    css_classes = blocks.CharBlock(required=False)

    class Meta:
        template = 'website/sections/layout_3_col_section.html'
示例#22
0
class AboutBlock(blocks.StructBlock):
    profile_image = ImageChooserBlock(required=False,
                                      label="Profile/Logo Image")
    background_image = ImageChooserBlock(label="Background Image")
    links = blocks.StructBlock([
        ('websites',
         blocks.StreamBlock(
             [('website_information',
               blocks.StructBlock([
                   ('website_name', blocks.CharBlock()),
                   ('website_link', blocks.URLBlock()),
                   ('website_icon', ImageChooserBlock(required=False)),
               ]))],
             max_num=2,
             required=False)),
        ('social_media',
         blocks.StreamBlock(
             [('social_media_information',
               blocks.StructBlock([
                   ('social_media_name', blocks.CharBlock()),
                   ('social_media_link', blocks.URLBlock()),
                   ('social_media_icon', ImageChooserBlock(required=False)),
               ]))],
             max_num=5,
             required=False,
             label="Social Media")),
        ('other',
         blocks.StreamBlock(
             [('other_information',
               blocks.StructBlock([
                   ('other_name', blocks.CharBlock()),
                   ('other_link', blocks.URLBlock()),
                   ('other_icon', ImageChooserBlock(required=False)),
               ]))],
             max_num=4,
             required=False)),
    ],
                               label="Links:")
    skills = blocks.StreamBlock([
        ('skills', blocks.CharBlock()),
    ],
                                max_num=5,
                                label="Skills:")
    interests = blocks.StreamBlock([
        ('interests', blocks.CharBlock()),
    ],
                                   max_num=5,
                                   label="Interests:")
    who_i_am = blocks.RichTextBlock(label="Who I Am")
    what_i_do = blocks.RichTextBlock(label="What I Do")
示例#23
0
class Index(Page):
    portifolio = StreamField(blocks.StreamBlock([('portifolio', PortifolioBlock())],
                             required=False),
                             blank=True)
    service = StreamField(blocks.StreamBlock([('service', ServiceBlock())],
                          required=False),
                          blank=True)



    content_panels = Page.content_panels + [
        StreamFieldPanel('portifolio'),
        StreamFieldPanel('service'),
    ]
示例#24
0
class WhoIsThere(blocks.StructBlock):

    title = blocks.CharBlock(required=False, max_length=255)
    color = blocks.CharBlock(required=True, max_length=255)

    attendees = blocks.StreamBlock(
        [
            ('attendee',
             blocks.StructBlock(
                 [('name', blocks.CharBlock()),
                  ('nickname', blocks.CharBlock()),
                  ('company', blocks.CharBlock()),
                  ('dates', blocks.CharBlock()), ('sure', blocks.CharBlock()),
                  ('remote', blocks.CharBlock()),
                  ('tshirt',
                   blocks.ChoiceBlock(choices=[('xxs', 'xxs'), (
                       'xs', 'xs'), ('s', 's'), ('m', 'm'), (
                           'l', 'l'), ('xl', 'xl'), ('xxl', 'xxl')])),
                  ('food',
                   blocks.ChoiceBlock(choices=[(
                       'normal', 'normal'), ('vegie',
                                             'vegie'), ('other', 'other')])),
                  ('email', blocks.CharBlock(required=False)),
                  ('comment', blocks.CharBlock(required=False))],
                 template='home/blocks/attendee_content.html')),
        ],
        icon='cogs',
    )

    class Meta:
        template = 'home/who_column_block.html'
        icon = 'placeholder'
        label = 'WHOS THERE'
示例#25
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')),
            ],
        ),
    ]
示例#26
0
class ExhibitionCardBlock(blocks.StructBlock):
    title = blocks.CharBlock()
    image = ImageChooserBlock()
    start_date = blocks.DateBlock()
    end_date = blocks.DateBlock()
    body = blocks.StreamBlock([
        ('paragraph', RichTextBlock()),
        ('button', ButtonBlock()),
        ('accordion', AccordionBlock()),
        ('link', LinkBlock()),
    ])

    class Meta:
        icon = "fa-picture-o"

    def clean(self, value):
        errors = {}
        if value['start_date'] > value['end_date']:
            errors['start_date'] = ErrorList(
                ['Start date should be less than End Date.'])
            errors['end_date'] = ErrorList(
                ['End date should be greater than Start Date.'])

        if errors:
            raise ValidationError('Validation error in ExhibitionCardBlock',
                                  params=errors)

        return super().clean(value)
示例#27
0
class CardBlock(BaseBlock):
    """
    A component of information with image, text, and buttons.
    """
    image = ImageChooserBlock(
        required=False,
        max_length=255,
        label=_('Image'),
    )
    title = blocks.CharBlock(
        required=False,
        max_length=255,
        label=_('Title'),
    )
    subtitle = blocks.CharBlock(
        required=False,
        max_length=255,
        label=_('Subtitle'),
    )
    description = blocks.RichTextBlock(
        features=['bold', 'italic', 'ol', 'ul', 'hr', 'link', 'document-link'],
        label=_('Body'),
    )
    links = blocks.StreamBlock(
        [('Links', ButtonBlock())],
        blank=True,
        required=False,
        label=_('Links'),
    )

    class Meta:
        template = 'coderedcms/blocks/card_foot.html'
        icon = 'fa-list-alt'
        label = _('Card')
示例#28
0
class GridBlock(CollapsibleFieldsMixin, blocks.StructBlock):
    heading = blocks.CharBlock(**heading_block_kwargs)
    items = blocks.StreamBlock([
        ("teaser", TeaserBlock()),
        ("image", ImageBlock()),
        ("video", VideoBlock()),
        ("slogan", SloganBlock()),
    ])
    COLUMN_CHOICES = ((2, _("2")), (3, _("3")), (4, _("4")))
    columns = blocks.ChoiceBlock(choices=COLUMN_CHOICES, default=3)
    font_color = blocks.ChoiceBlock(choices=COLOR_CHOICES,
                                    default=COLOR_XR_BLACK)
    background_color = blocks.ChoiceBlock(choices=BG_COLOR_CHOICES,
                                          default=COLOR_XR_TRANSPARENT)

    fields = [
        "heading",
        "columns",
        "items",
        {
            "label": _("Settings"),
            "fields": ["align", "font_color", "background_color"]
        },
    ]

    class Meta:
        icon = "grip"
        template = "xr_pages/blocks/grid.html"
示例#29
0
class FooterBlock(blocks.StructBlock):

    content = blocks.StreamBlock([
        ("title", TitleBlock(required=False, closed=True)),
        ("paragraph", RichTextBlock(required=False, closed=True)),
        ("quote", QuoteBlock(required=False, closed=True)),
        ("html", blocks.RawHTMLBlock(required=False, closed=True,
                                     group="Text")),
        ("image", ImageBlock(required=False, closed=True)),
        ("carousel", CarouselBlock(required=False, closed=True)),
        ("button", ButtonBlock(required=False, closed=True)),
        ("link", LinkBlock(required=False, closed=True)),
        ("button_group", ButtonGroupBlock(required=False, closed=True)),
        ("form", FormBlock(required=False, closed=True)),
        ("account", AccountFormBlock(required=False, closed=True)),
        ("nav", NavBlock(required=False, closed=True)),
        ("pagination", PaginationBlock(required=False, closed=True)),
        ("tab", TabBlock(required=False, closed=True)),
        ("table", TabBlock(required=False, closed=True)),
        ("list", ListBlock(required=False, closed=True)),
        ("popover", PopoverBlock(required=False, closed=True)),
        ("card", CardBlock(required=False, closed=True)),
        ("modal", ModalBlock(required=False, closed=True)),
        ("layout", LayoutBlock(required=False, closed=True)),
    ],
                                 required=False,
                                 closed=True)
    footer_style = ContainerBaseBlock(required=False, closed=True)

    class Meta:
        template = "blocks/footer_block.html"
        icon = "doc-full-inverse"
        label = "footer"
示例#30
0
class ContainerBlock(blocks.StructBlock):

    content = blocks.StreamBlock([
        ("title", TitleBlock(required=False, closed=True)),
        ("quote", QuoteBlock(required=False, closed=True)),
        ("html", blocks.RawHTMLBlock(required=False, closed=True,
                                     group="Text")),
        ("image", ImageBlock(required=False, closed=True)),
        ("carousel", CarouselBlock(required=False, closed=True)),
        ("form", FormBlock(required=False, closed=True)),
        ("account", AccountFormBlock(required=False, closed=True)),
        ("button", ButtonBlock(required=False, closed=True)),
        ("link", LinkBlock(required=False, closed=True)),
        ("tab", TabBlock(required=False, closed=True)),
        ("group", ButtonGroupBlock(required=False, closed=True)),
        ("table", TabBlock(required=False, closed=True)),
        ("pagination", PaginationBlock(required=False, closed=True)),
        ("popover", PopoverBlock(required=False, closed=True)),
    ],
                                 required=False,
                                 closed=True)
    container_style = ContainerBaseBlock(required=False, closed=True)

    class Meta:
        icon = "grip"
        template = "components/container/container_block.html"
        group = "Containers"