class SectionBlock(blocks.StructBlock): title = blocks.CharBlock(required=True, form_classname="full title") # Ensure that new choices are available in the icon sprite `./templates/services/includes/svg_sprite.html` ICON_CHOICES = [ ("astronaut", "Astronaut"), ("cloud", "Cloud"), ("money-check", "Money check"), ("tools", "Tools"), ] icon = blocks.ChoiceBlock( choices=ICON_CHOICES, required=False, ) section_media = SectionMediaBlock(required=False) section_image = image_blocks.ImageChooserBlock( required=False, help_text="Section image is used as a fallback when no media is defined." ) section_image_caption = blocks.CharBlock( required=False, label="Section image/media caption", help_text="Rendered below the image/media" ) content = SectionContentBlock(required=False) class Meta: icon = "form" template = "services/blocks/section.html"
class ArticleBlock(SectionBlock): image = image_blocks.ImageChooserBlock(required=False) paragraph = common_blocks.SimpleRichTextBlock() class Meta: icon = 'snippet' template = 'blocks/article_block.html'
class ServicesCard(blocks.StructBlock): """ Services cards """ # blocks.StructBlock( # [ # ('image', images_blocks.ImageChooserBlock(required=True)), # ('title', blocks.CharBlock(max_length=48)), # ('text', blocks.TextBlock(max_length=256)), # ('button_page', blocks.PageChooserBlock(required=False)), # ('button_url', blocks.PageChooserBlock(required=False, helptext="button page has priority")), # ] # ) image = images_blocks.ImageChooserBlock( required=True, help_text= "Please limit the image size to max 40KiB, recommended dimensions = 512x288px" ) title = blocks.CharBlock(max_length=48, required=False) sub_title = blocks.CharBlock(max_length=48, required=False) text = blocks.TextBlock(max_length=1024, required=False) button = blocks.PageChooserBlock(required=False) button_text = blocks.CharBlock(max_length=32, required=True, default="Lear more") # ('button_url', blocks.PageChooserBlock(required=False, helptext="button page has priority")), class Meta: template = 'streams/service_block.html' icon = 'placeholder' label = 'Services'
class HorizontalCardsBlock(blocks.StructBlock): """ Cards with image and title else """ # title = blocks.CharBlock(required=False, help_text='Add a title for the cards if necessary, ') cards = blocks.ListBlock( blocks.StructBlock([ ('image', images_blocks.ImageChooserBlock( required=True, help_text='Use a 400x300px picture,')), ('title', blocks.CharBlock(max_length=48, required=False)), ('subtitle', blocks.TextBlock(max_length=48, required=False)), ('text', blocks.TextBlock(max_length=256, required=False)), ('link_page', blocks.PageChooserBlock(required=False)), ('link_url', blocks.URLBlock(required=False)), ('link_text', blocks.CharBlock(max_length=32, required=False)), ('reverse', blocks.BooleanBlock(required=False, help_text="Place image to the right?")) ])) class Meta: template = 'streams/fullwidthcards_block.html' icon = 'placeholder' label = 'Full width cards'
class SectionedImageChooserBlock(SectionBlock): image_list = core_blocks.ListBlock( image_blocks.ImageChooserBlock(required=False)) class Meta: icon = 'image' template = 'blocks/image_chooser_block.html'
class PeopleBlock(SectionBlock): people = core_blocks.ListBlock(PersonBlock(required=False)) group_photo = image_blocks.ImageChooserBlock() group_bio = common_blocks.SimpleRichTextBlock() class Meta: icon = 'user' template = 'blocks/people_block.html'
class DownloadableBlock(blocks.StructBlock): image = imageBlocks.ImageChooserBlock() title = blocks.RichTextBlock() document = docBlocks.DocumentChooserBlock() class Meta: icon = 'download' label = 'Downloadable Item' template = 'downloader/blocks/downloadable_block.html'
class CardBlock(blocks.StructBlock): image = image_blocks.ImageChooserBlock(required=True) text = blocks.RichTextBlock(required=True, features=["bold", "italic"]) link = blocks.URLBlock(required=True) link_text = blocks.CharBlock(required=True, default="Find out more") class Meta: icon = "tag" template = "services/blocks/card.html"
class EventBlock(SectionBlock): start_date = core_blocks.DateTimeBlock() stop_date = core_blocks.DateTimeBlock() photo = image_blocks.ImageChooserBlock(required=False) description = common_blocks.SimpleRichTextBlock(required=False) class Meta: icon = 'date' template = 'blocks/event_block.html'
class VideoPlayer(blocks.StructBlock): YOUTUBE_ID_HELP_TEXT = ( 'Enter the YouTube video ID, which is located at the end of the video ' 'URL, after "v=". For example, the video ID for ' 'https://www.youtube.com/watch?v=1V0Ax9OIc84 is 1V0Ax9OIc84.') video_id = blocks.RegexBlock( label='YouTube video ID', # Set required=False to allow for non-required VideoPlayers. # See https://github.com/wagtail/wagtail/issues/2665. required=False, # This is a reasonable but not official regex for YouTube video IDs. # https://webapps.stackexchange.com/a/54448 regex=r'^[\w-]{11}$', error_messages={ 'invalid': "The YouTube video ID is in the wrong format.", }, help_text=YOUTUBE_ID_HELP_TEXT) thumbnail_image = images_blocks.ImageChooserBlock( required=False, help_text=mark_safe( 'Optional thumbnail image to show before and after the video ' 'plays. If the thumbnail image is not set here, the video player ' 'will default to showing the thumbnail that was set in (or ' 'automatically chosen by) YouTube.')) def clean(self, value): cleaned = super().clean(value) errors = {} if not cleaned['video_id']: if getattr(self.meta, 'required', True): errors['video_id'] = ErrorList([ ValidationError('This field is required.'), ]) elif cleaned['thumbnail_image']: errors['thumbnail_image'] = ErrorList([ ValidationError( 'This field should not be used if YouTube video ID is ' 'not set.') ]) if errors: raise ValidationError('Validation error in VideoPlayer', params=errors) return cleaned class Meta: icon = 'media' template = '_includes/organisms/video-player.html' value_class = VideoPlayerStructValue class Media: js = ['video-player.js']
class PersonBlock(SectionBlock): first_name = core_blocks.CharBlock() middle_name = core_blocks.CharBlock(required=False) last_name = core_blocks.CharBlock() titles = core_blocks.CharBlock(required=False) photo = image_blocks.ImageChooserBlock() biography = common_blocks.SimpleRichTextBlock() class Meta: icon = 'user' template = 'blocks/person_block.html'
class ImgBannerSeparator(blocks.StructBlock): """Image separator""" image = images_blocks.ImageChooserBlock( required=True, help_text= "Please limit the image size to max 100KiB, recommended dimensions = 1280x450px" ) class Meta: template = 'streams/banner_block.html' icon = 'image' label = 'Image separator'
class AlignedImageBlock(blocks.StructBlock): image = imageBlocks.ImageChooserBlock() alignment = blocks.ChoiceBlock(choices=[ ('center', 'Center'), ('right', 'Right'), ('left', 'Left'), ], default='center') class Meta: icon = 'image' label = 'Image(aligned)' template = 'blog/blocks/aligned_image_block.html'
class Post(wagtail_models.Page): """ A standard post. """ 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="+", ) tags = modelcluster_taggit.ClusterTaggableManager( through="home.TaggedPost", blank=True) categories = modelcluster_fields.ParentalManyToManyField("home.Category", blank=True) body = wagtail_fields.StreamField([ ("heading", wagtail_blocks.CharBlock()), ("paragraph", wagtail_blocks.RichTextBlock()), ("section", SectionBlock()), ("image", wagtail_image_blocks.ImageChooserBlock()), ]) content_panels = wagtail_models.Page.content_panels + [ wagtail_panels.FieldPanel("description"), wagtail_panels.FieldPanel("excerpt"), wagtail_panels.FieldPanel("authors"), wagtail_panels.FieldPanel("date"), wagtail_panels.FieldPanel("tags"), wagtail_panels.FieldPanel("categories"), wagtail_image_panels.ImageChooserPanel("featured_image"), wagtail_panels.StreamFieldPanel("body"), ] parent_page_types = ["home.PostIndexPage"] subpage_types = [] def set_url_path(self, parent): super().set_url_path(parent=parent) self.url_path = self.url_path.replace( self.slug, "{:%Y/%b/%d/}".format(self.date).lower() + self.slug)
class TeamCardsBlock(blocks.StructBlock): """ Cards with image and title else """ title = blocks.CharBlock( required=False, help_text='Add a title for the cards if necessary, ') cards = blocks.ListBlock( blocks.StructBlock([ ('image', images_blocks.ImageChooserBlock( required=True, help_text='Use a 400x300px picture,')), ('name', blocks.CharBlock(max_length=48)), ('position', blocks.TextBlock(max_length=48)), ('text', blocks.TextBlock(max_length=256, required=False)), ])) class Meta: template = 'streams/team_block.html' icon = 'fa-address-card' label = 'Staff cards'
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><h3></code> at the top of this block. Also adds a wrapping <code><div></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><h3></code> at the top of this block. Also adds a wrapping <code><div></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><h3></code> at the top of this block. Also adds a wrapping <code><div></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), ), ]
class Migration(migrations.Migration): replaces = [ ('regulations3k', '0002_rename_cfr_title'), ('regulations3k', '0003_alter_regulationpage_header'), ('regulations3k', '0004_add_acquired_and_draft_to_effectiveversion'), ('regulations3k', '0005_add_sortable_label_subpart_type'), ('regulations3k', '0006_set_sortable_label_subpart_type'), ('regulations3k', '0007_make_sortable_label_required'), ('regulations3k', '0008_regulationssearchpage'), ('regulations3k', '0009_sectionparagraph'), ('regulations3k', '0010_rename_acquired_field'), ('regulations3k', '0011_add_header_content_to_regs_landing_page'), ('regulations3k', '0012_add_regulation_page_content_organisms'), ('regulations3k', '0013_add_image_to_fullwidthtext'), ('regulations3k', '0014_rm_imageinset_and_media_from_fullwidthtext'), ('regulations3k', '0015_rename_regpage_part_related_field'), ('regulations3k', '0016_require_effective_date'), ('regulations3k', '0017_set_default_created_date'), ('regulations3k', '0018_add_notification_block'), ('regulations3k', '0019_add_disclaimer_pagechooserblock_to_emailsignup'), ('regulations3k', '0020_rm_formfieldwithbutton'), ('regulations3k', '0021_rm_hero_links'), ('regulations3k', '0022_update_help_cf_link'), ('regulations3k', '0023_update_hero_labels_and_help_text'), ('regulations3k', '0024_add_standard_notification_regs_landing'), ('regulations3k', '0025_part_short_name'), ('regulations3k', '0026_migrate_letter_code_to_short_name'), ('regulations3k', '0027_remove_part_letter_code'), ('regulations3k', '0028_add_ask_search') ] dependencies = [ ('v1', '0198_recreated'), ('regulations3k', '0029_recreated'), ] operations = [ migrations.CreateModel( name='RegulationLandingPage', 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>• 41 characters max (one-line heading)</li><li>• 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>• 165-186 characters (after a one-line heading)</li><li>• 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))))),), blank=True)), ('content', core_fields.StreamField((('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))))), ('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)))))))), ('regulations_list', core_blocks.StructBlock((('heading', core_blocks.CharBlock(help_text='Regulations list heading', required=False)), ('more_regs_page', core_blocks.PageChooserBlock(help_text='Link to more regulations')), ('more_regs_text', core_blocks.CharBlock(help_text='Text to show on link to more regulations', required=False))))))))), blank=True)), ], options={ 'abstract': False, }, bases=(routable_models.RoutablePageMixin, 'v1.cfgovpage'), ), migrations.CreateModel( name='RegulationPage', 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((('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((('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)))))))), ('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)))))))))))), blank=True, null=True)), ('secondary_nav_exclude_sibling_pages', models.BooleanField(default=False)), ('regulation', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='page', to='regulations3k.Part')), ], options={ 'abstract': False, }, bases=(routable_models.RoutablePageMixin, ask_cfpb.models.pages.SecondaryNavigationJSMixin, 'v1.cfgovpage'), ), migrations.CreateModel( name='RegulationsSearchPage', 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')), ], options={ 'abstract': False, }, bases=(routable_models.RoutablePageMixin, 'v1.cfgovpage'), ), migrations.CreateModel( name='Section', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('label', models.CharField(blank=True, max_length=255)), ('title', models.CharField(blank=True, max_length=255)), ('contents', models.TextField(blank=True)), ('sortable_label', models.CharField(max_length=255)), ], options={ 'ordering': ['sortable_label'], }, ), migrations.CreateModel( name='SectionParagraph', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('paragraph', models.TextField(blank=True)), ('paragraph_id', models.CharField(blank=True, max_length=255)), ('section', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='paragraphs', to='regulations3k.Section')), ], ), migrations.CreateModel( name='Subpart', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('label', models.CharField(blank=True, max_length=255)), ('title', models.CharField(blank=True, max_length=255)), ('subpart_type', models.IntegerField(choices=[(0, 'Regulation Body'), (1000, 'Appendix'), (2000, 'Interpretation')], default=0)), ('version', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='subparts', to='regulations3k.EffectiveVersion')), ], options={ 'ordering': ['subpart_type', 'label'], }, ), migrations.AddField( model_name='section', name='subpart', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sections', to='regulations3k.Subpart'), ), migrations.AddField( model_name='effectiveversion', name='part', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='versions', to='regulations3k.Part'), ), ]
class DataSnapshot(blocks.StructBlock): """ A basic Data Snapshot object. """ # Market key corresponds to market short name for lookup market_key = blocks.CharBlock( max_length=20, required=True, help_text='Market identifier, e.g. AUT' ) num_originations = blocks.CharBlock( max_length=20, help_text='Number of originations, e.g. 1.2 million' ) value_originations = blocks.CharBlock( max_length=20, help_text='Total dollar value of originations, e.g. $3.4 billion' ) year_over_year_change = blocks.CharBlock( max_length=20, help_text='Percentage change, e.g. 5.6% increase' ) last_updated_projected_data = blocks.DateBlock( help_text='Month of latest entry in dataset' ) # Market-specific descriptor text num_originations_text = blocks.CharBlock( max_length=100, help_text='Descriptive sentence, e.g. Auto loans originated' ) value_originations_text = blocks.CharBlock( max_length=100, help_text='Descriptive sentence, e.g. Dollar volume of new loans' ) year_over_year_change_text = blocks.CharBlock( max_length=100, help_text='Descriptive sentence, e.g. In year-over-year originations' ) # Inquiry/Tightness Indices inquiry_month = blocks.DateBlock( required=False, max_length=20, help_text='Month of latest entry in dataset for inquiry data' ) inquiry_year_over_year_change = blocks.CharBlock( required=False, max_length=20, help_text='Percentage change, e.g. 5.6% increase' ) inquiry_year_over_year_change_text = blocks.CharBlock( required=False, max_length=100, help_text='Descriptive sentence, e.g. In year-over-year inquiries' ) tightness_month = blocks.DateBlock( required=False, max_length=20, help_text='Month of latest entry in dataset for credit tightness data' ) tightness_year_over_year_change = blocks.CharBlock( required=False, max_length=20, help_text='Percentage change, e.g. 5.6% increase' ) tightness_year_over_year_change_text = blocks.CharBlock( required=False, max_length=100, help_text='Descriptive sentence, e.g. In year-over-year credit tightness' # noqa ) # Select an image image = images_blocks.ImageChooserBlock(required=False, icon='image') class Meta: icon = 'image' label = 'CCT Data Snapshot' template = '_includes/organisms/data_snapshot.html'
class Migration(migrations.Migration): dependencies = [ ('teachers_digital_platform', '0020_activityindexpage_text_introduction'), ] operations = [ migrations.AddField( model_name='activityindexpage', name='header_sidebar', field=core_fields.StreamField([ ('image', core_blocks.StructBlock([ ('image', images_blocks.ImageChooserBlock( help_text= 'Should be exactly 390px tall, and up to 940px wide, unless this is an overlay or bleeding style hero.' )), ('small_image', images_blocks.ImageChooserBlock( help_text= 'Provide an alternate image for small displays when using a bleeding or overlay hero.', required=False)) ])) ], blank=True), ), migrations.AlterField( 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))])), ('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)) ]))], blank=True), ), ]
class Migration(migrations.Migration): initial = True dependencies = [] operations = [ migrations.CreateModel( name='Menu', fields=[ ('language', models.CharField(choices=[('en', 'English'), ('es', 'Spanish')], max_length=2, primary_key=True, serialize=False)), ('submenus', 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)), ('body', core_blocks.CharBlock()), ('image', images_blocks.ImageChooserBlock()))), 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=[]))))), ))), ], options={ 'ordering': ('language', ), }, ), ]
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><h3></code> at the top of this block. Also adds a wrapping <code><div></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')), ], ), ]
class CaptionedImageBlock(core_blocks.StructBlock): image = image_blocks.ImageChooserBlock(required=True) caption = core_blocks.CharBlock()
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>• 41 characters max (one-line heading)</li><li>• 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>• 165-186 characters (after a one-line heading)</li><li>• 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 BlogDetailPage(RoutablePageMixin, Page): template = 'blog/blog_page.html' date = models.DateField("Post date", auto_now=True) intro = models.CharField(max_length=250) thumbnail = models.ForeignKey('wagtailimages.Image', blank=True, null=True, on_delete=models.SET_NULL, related_name='+') body = StreamField([ ('heading', core_blocks.CharBlock(classname="full title")), ('paragraph', core_blocks.RichTextBlock()), ('image', image_blocks.ImageChooserBlock()), ('image_slider', core_blocks.ListBlock( CaptionedImageBlock(), icon='image', label='Slider')), ], blank=True) # https://docs.djangoproject.com/en/dev/topics/db/models/#be-careful-with-related-name liked_users = ParentalManyToManyField( AUTH_USER_MODEL, blank=True, related_name='%(app_label)s_%(class)s_likes') disliked_users = ParentalManyToManyField( AUTH_USER_MODEL, blank=True, related_name='%(app_label)s_%(class)s_dislikes') search_fields = Page.search_fields + [ index.SearchField('intro'), index.SearchField('body'), ] content_panels = Page.content_panels + [ ImageChooserPanel('thumbnail'), FieldPanel('intro'), StreamFieldPanel('body'), ] @property def likes(self): return self.liked_users.count() @property def dislikes(self): return self.disliked_users.count() def get_context(self, request, *args, **kwargs): context = super(BlogDetailPage, self).get_context(request) user = request.user context['liked'] = user in self.liked_users.all() context['likes'] = self.likes context['disliked'] = user in self.disliked_users.all() context['dislikes'] = self.dislikes return context # Needed for django-comments-xtd to work def get_absolute_url(self): if DEBUG: return 'http://*****:*****@route(r'^like/') def toggle_like(self, request): if request.is_ajax(): user = request.user dislike_count_change = 0 if user in self.disliked_users.all(): self.disliked_users.remove(user) dislike_count_change = -1 liked = False if user not in self.liked_users.all(): self.liked_users.add(user) liked = True like_count_change = 1 else: self.liked_users.remove(user) like_count_change = -1 self.save() print(self.likes, self.dislikes) data = { 'liked': liked, 'like_count_change': like_count_change, 'disliked': False, 'dislike_count_change': dislike_count_change } return JsonResponse(data) else: return JsonResponse({}) @route(r'^dislike/') def toggle_dislike(self, request): if request.is_ajax(): user = request.user like_count_change = 0 if user in self.liked_users.all(): self.liked_users.remove(user) like_count_change = -1 disliked = False if user not in self.disliked_users.all(): self.disliked_users.add(user) disliked = True dislike_count_change = 1 else: self.disliked_users.remove(user) dislike_count_change = -1 self.save() print(self.likes, self.dislikes) data = { 'liked': False, 'like_count_change': like_count_change, 'disliked': disliked, 'dislike_count_change': dislike_count_change, } return JsonResponse(data) else: return JsonResponse({})
class Migration(migrations.Migration): initial = True dependencies = [ ('wagtailcore', '0032_add_bulk_delete_page_permission'), ] 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')), ('text_field', commonblocks.fields.SimpleRichTextField(blank=True)), ('body_blocks', core_fields.StreamField( (('text', commonblocks.blocks.SimpleRichTextBlock()), ('quote', core_blocks.StructBlock( (('quote', commonblocks.blocks.SimpleRichTextBlock( required=True)), ('author', core_blocks.CharBlock(required=False)), ('author_title', core_blocks.CharBlock(required=False)), ('image', images_blocks.ImageChooserBlock( required=False))))), ('image', core_blocks.StructBlock( (('image', images_blocks.ImageChooserBlock(required=True)), ('alternative_title', core_blocks.CharBlock(required=False)), ('caption', commonblocks.blocks.SimpleRichTextBlock( required=False)), ('attribution', core_blocks.CharBlock(required=False)), ('license_url', core_blocks.URLBlock(required=False)), ('license_name', core_blocks.CharBlock(required=False))))), ('heading', core_blocks.StructBlock( (('size', core_blocks.ChoiceBlock( choices=[('', 'Choose your heading'), ('h2', 'h2'), ('h3', 'h3'), ('h4', 'h4'), ('h5', 'h5')], help_text='Heading Size')), ('title', core_blocks.CharBlock(required=True)), ('subtitle', core_blocks.CharBlock(required=False))))), ('video', core_blocks.StructBlock((( 'video', embeds_blocks.EmbedBlock( help_text= 'Paste your video URL ie: https://www.youtube.com/watch?v=05GKqTZGRXU', required=True)), ( 'caption', commonblocks.blocks.SimpleRichTextBlock( required=False))))), ('internal', core_blocks.StructBlock( (('link', core_blocks.PageChooserBlock(required=True)), ('title', core_blocks.CharBlock(required=False))))), ('external', core_blocks.StructBlock( (('link', core_blocks.URLBlock(required=True)), ('title', core_blocks.CharBlock(required=True)), ('target', core_blocks.ChoiceBlock( choices=[('', 'Open link in'), ('_self', 'Same window'), ('_blank', 'New window')], help_text='Open link in'))))), ('links', core_blocks.StreamBlock( (('internal_link', core_blocks.StructBlock(( ('link', core_blocks.PageChooserBlock(required=True)), ('title', core_blocks.CharBlock(required=False))), label='Internal page')), ('external_link', core_blocks.StructBlock( (('link', core_blocks.URLBlock(required=True)), ('title', core_blocks.CharBlock(required=True)), ('target', core_blocks.ChoiceBlock( choices=[('', 'Open link in'), ('_self', 'Same window'), ('_blank', 'New window')], help_text='Open link in'))), label='External Page')))))), blank=True)), ], options={ 'abstract': False, }, bases=('wagtailcore.page', ), ), ]
class ExplainerPage(blocks.StructBlock): image = images_blocks.ImageChooserBlock(required=True, icon='image') categories = blocks.ListBlock(ExplainerCategory(required=False))
class HeroBlock(blocks.StructBlock): image = images.ImageChooserBlock() fluid = blocks.BooleanBlock(required=False) class Meta: template = 'blocks/hero.html'