Skip to content

Commit

Permalink
Merge pull request #8587 from cfpb/table-caption
Browse files Browse the repository at this point in the history
Add caption field to tables
  • Loading branch information
csebianlander authored Sep 23, 2024
2 parents 874e173 + ca21b5b commit 82a3e12
Show file tree
Hide file tree
Showing 8 changed files with 191 additions and 0 deletions.
19 changes: 19 additions & 0 deletions cfgov/ask_cfpb/migrations/0009_add_table_caption.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 4.2.16 on 2024-09-23 13:54

from django.db import migrations
import wagtail.fields


class Migration(migrations.Migration):

dependencies = [
('ask_cfpb', '0008_add_footnotes'),
]

operations = [
migrations.AlterField(
model_name='answerpage',
name='answer_content',
field=wagtail.fields.StreamField([('text', 2), ('table', 14), ('tip', 16), ('video_player', 19), ('how_to_schema', 33), ('faq_schema', 38)], blank=True, block_lookup={0: ('wagtail.blocks.CharBlock', (), {'help_text': "Add an optional anchor link tag to allow linking directly to this block. Tag should be unique and use dashes or underscores for separation instead of spaces (ie, 'block-one-tag')", 'label': 'Anchor tag', 'required': False}), 1: ('wagtail.blocks.RichTextBlock', (), {'features': ['bold', 'italic', 'h2', 'h3', 'link', 'ol', 'ul', 'document-link', 'image', 'embed'], 'label': 'Text'}), 2: ('wagtail.blocks.StructBlock', [[('anchor_tag', 0), ('content', 1)]], {}), 3: ('wagtail.blocks.CharBlock', (), {'required': False}), 4: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4'), ('h5', 'H5')]}), 5: ('wagtail.blocks.CharBlock', (), {'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/design-system/foundation/iconography">See full list of icons</a>', 'required': False}), 6: ('wagtail.blocks.StructBlock', [[('text', 3), ('level', 4), ('icon', 5)]], {'required': False}), 7: ('wagtail.blocks.MultipleChoiceBlock', [], {'choices': [('is_full_width', 'Display the table at full width'), ('stack_on_mobile', 'Stack the table columns on mobile')], 'required': False}), 8: ('wagtail.blocks.CharBlock', (), {}), 9: ('wagtail.blocks.FloatBlock', (), {}), 10: ('wagtail.blocks.RichTextBlock', (), {'features': ['bold', 'italic', 'ol', 'ul', 'link', 'document-link', 'superscript']}), 11: ('wagtail_footnotes.blocks.RichTextBlockWithFootnotes', (), {'features': ['bold', 'italic', 'ol', 'ul', 'link', 'document-link', 'superscript', 'footnotes']}), 12: ('wagtail.contrib.typed_table_block.blocks.TypedTableBlock', [[('text', 8), ('numeric', 9), ('rich_text', 10), ('rich_text_with_footnotes', 11)]], {}), 13: ('wagtail.blocks.RichTextBlock', (), {'features': ['bold', 'italic', 'link', 'document-link'], 'required': False}), 14: ('wagtail.blocks.StructBlock', [[('heading', 6), ('text_introduction', 3), ('options', 7), ('data', 12), ('caption', 13)]], {}), 15: ('wagtail.blocks.RichTextBlock', (), {'features': ['link', 'document-link'], 'label': 'Tip'}), 16: ('wagtail.blocks.StructBlock', [[('content', 15)]], {'label': 'Tip (floats right)'}), 17: ('wagtail.blocks.RegexBlock', (), {'error_messages': {'invalid': 'The YouTube video ID is in the wrong format.'}, '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.', 'label': 'YouTube video ID', 'regex': '^[\\w-]{11}$', 'required': False}), 18: ('wagtail.images.blocks.ImageChooserBlock', (), {'help_text': '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.', 'required': False}), 19: ('wagtail.blocks.StructBlock', [[('video_id', 17), ('thumbnail_image', 18)]], {}), 20: ('wagtail.blocks.CharBlock', (), {'label': 'Title of How To section', 'max_length': 500}), 21: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], 'help_text': 'Choose a tag for the title of the How To section.', 'label': 'Tag for How To section title'}), 22: ('wagtail.blocks.BooleanBlock', (), {'default': True, 'help_text': 'The How To schema requires a title to let search engines understand what it is about. If you do not want the title to be displayed in the page, uncheck this box and the title content will only be made available to crawlers and screen readers.', 'label': 'Show How To section title', 'required': False}), 23: ('wagtail.blocks.RichTextBlock', (), {'blank': True, 'features': ['ol', 'ul', 'bold', 'italic', 'link', 'document-link'], 'required': False}), 24: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4'), ('b', 'Bold'), ('p', 'Paragraph')], 'help_text': 'Choose a tag for the title of each HowTo step.', 'label': 'Tag for step titles'}), 25: ('wagtail.blocks.BooleanBlock', (), {'default': False, 'help_text': 'Check this box to display numbers before step titles. ', 'label': 'Show numbers for steps', 'required': False}), 26: ('wagtail.blocks.CharBlock', (), {'blank': True, 'help_text': "Add an optional anchor link tag to allow linking directly to this step. Tag should be unique and use dashes or underscores for separation instead of spaces (ie, 'step-one-tag').", 'max_length': 500, 'required': False}), 27: ('wagtail.blocks.CharBlock', (), {'help_text': 'Enter a title for this HowTo step. You do not need to include a number in the title -- numbers will be added automatically in the template if the show numbers checkbox is checked.', 'max_length': 500}), 28: ('wagtail.blocks.RichTextBlock', (), {'features': ['bold', 'italic', 'h3', 'h4', 'link', 'ol', 'ul', 'document-link', 'image', 'embed'], 'label': 'Text'}), 29: ('wagtail.blocks.StructBlock', [[('content', 28)]], {}), 30: ('wagtail.blocks.StreamBlock', [[('text', 29), ('table', 14), ('video_player', 19)]], {}), 31: ('wagtail.blocks.StructBlock', [[('anchor_tag', 26), ('title', 27), ('step_content', 30)]], {}), 32: ('wagtail.blocks.ListBlock', (31,), {}), 33: ('wagtail.blocks.StructBlock', [[('title', 20), ('title_tag', 21), ('show_title', 22), ('description', 23), ('step_title_tag', 24), ('has_numbers', 25), ('steps', 32)]], {'label': 'Google Schema - How To'}), 34: ('wagtail.blocks.CharBlock', (), {'blank': True, 'help_text': "Add an optional anchor link tag for this question. Tag should be unique and use dashes or underscores for separation instead of spaces (ie, 'question-one-tag')", 'max_length': 500, 'required': False}), 35: ('wagtail.blocks.CharBlock', (), {'max_length': 500}), 36: ('wagtail.blocks.StructBlock', [[('anchor_tag', 34), ('question', 35), ('answer_content', 30)]], {}), 37: ('wagtail.blocks.ListBlock', (36,), {}), 38: ('wagtail.blocks.StructBlock', [[('description', 23), ('questions', 37)]], {'label': 'Google Schema - FAQ'})}, verbose_name='Answer'),
),
]

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions cfgov/form_explainer/migrations/0012_add_table_caption.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 4.2.16 on 2024-09-23 13:54

from django.db import migrations
import wagtail.fields


class Migration(migrations.Migration):

dependencies = [
('form_explainer', '0011_remove_form_explainer_css'),
]

operations = [
migrations.AlterField(
model_name='formexplainerpage',
name='content',
field=wagtail.fields.StreamField([('explainer', 19), ('well', 21), ('info_unit_group', 41), ('full_width_text', 70)], block_lookup={0: ('wagtail.blocks.CharBlock', (), {'required': False}), 1: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4'), ('h5', 'H5')]}), 2: ('wagtail.blocks.CharBlock', (), {'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/design-system/foundation/iconography">See full list of icons</a>', 'required': False}), 3: ('wagtail.blocks.StructBlock', [[('text', 0), ('level', 1), ('icon', 2)]], {'label': 'Heading (optional)', 'required': False}), 4: ('wagtail.images.blocks.ImageChooserBlock', (), {'icon': 'image', 'required': True}), 5: ('wagtail.blocks.CharBlock', (), {'help_text': 'Optional. Leave blank if there is only one type of note for this image.', 'label': 'Category title', 'required': False}), 6: ('wagtail.blocks.CharBlock', (), {'label': 'Expandable header', 'required': True}), 7: ('wagtail.blocks.RichTextBlock', (), {'features': ['bold', 'italic', 'link', 'document-link'], 'label': 'Expandable text', 'required': True}), 8: ('wagtail.blocks.FloatBlock', (), {'label': 'X value (in percentage)', 'max_value': 100, 'min_value': 0, 'required': True}), 9: ('wagtail.blocks.FloatBlock', (), {'label': 'Y value (in percentage)', 'max_value': 100, 'min_value': 0, 'required': True}), 10: ('wagtail.blocks.FloatBlock', (), {'label': 'Width (in percentage)', 'max_value': 100, 'min_value': 0, 'required': True}), 11: ('wagtail.blocks.FloatBlock', (), {'label': 'Height (in percentage)', 'max_value': 100, 'min_value': 0, 'required': True}), 12: ('wagtail.blocks.StructBlock', [[('left', 8), ('top', 9), ('width', 10), ('height', 11)]], {'help_text': 'Enter percentage values for the highlighted area of the image associated with this expandable. See <a href="https://github.cfpb.gov/CFPB/hubcap/wiki/Form-explainer-page#add-image-coordinates">Hubcap documentation</a> for more information on identifying coordinates.', 'label': 'Image coordinates'}), 13: ('wagtail.blocks.StructBlock', [[('heading', 6), ('body', 7), ('coordinates', 12)]], {'required': False}), 14: ('wagtail.blocks.ListBlock', (13,), {'default': []}), 15: ('wagtail.blocks.StructBlock', [[('title', 5), ('notes', 14)]], {'required': False}), 16: ('wagtail.blocks.ListBlock', (15,), {}), 17: ('wagtail.blocks.StructBlock', [[('image', 4), ('categories', 16)]], {'required': False}), 18: ('wagtail.blocks.ListBlock', (17,), {}), 19: ('wagtail.blocks.StructBlock', [[('heading', 3), ('pages', 18)]], {}), 20: ('wagtail.blocks.RichTextBlock', (), {'label': 'Well', 'required': False}), 21: ('wagtail.blocks.StructBlock', [[('content', 20)]], {}), 22: ('wagtail.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'}), 23: ('wagtail.blocks.StructBlock', [[('text', 0), ('level', 1), ('icon', 2)]], {'required': False}), 24: ('wagtail.blocks.RichTextBlock', (), {'required': False}), 25: ('wagtail.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}), 26: ('wagtail.blocks.BooleanBlock', (), {'default': False, 'help_text': 'Check this to add a horizontal rule line to top of info unit group.', 'required': False}), 27: ('wagtail.blocks.BooleanBlock', (), {'default': False, 'help_text': 'Check this to show horizontal rule lines between info units.', 'label': 'Show rule lines between items', 'required': False}), 28: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('none', 'None'), ('rounded', 'Rounded corners'), ('circle', 'Circle')], 'help_text': 'Adds a <em>border-radius</em> class to images in this group, allowing for a rounded or circular border.', 'label': 'Border radius for images?', 'required': False}), 29: ('wagtail.images.blocks.ImageChooserBlock', (), {'required': False}), 30: ('wagtail.blocks.CharBlock', (), {'help_text': "No character limit, but be as succinct as possible. If the image is decorative (i.e., a screenreader wouldn't have anything useful to say about it), leave this field blank.", 'required': False}), 31: ('wagtail.blocks.StructBlock', [[('upload', 29), ('alt', 30)]], {}), 32: ('wagtail.blocks.StructBlock', [[('text', 0), ('level', 1), ('icon', 2)]], {'default': {'level': 'h3'}, 'required': False}), 33: ('wagtail.blocks.RichTextBlock', (), {'blank': True, 'required': False}), 34: ('wagtail.blocks.CharBlock', (), {'help_text': 'Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', 'required': False}), 35: ('wagtail.blocks.CharBlock', (), {'default': '/', 'required': False}), 36: ('wagtail.blocks.BooleanBlock', (), {'default': False, 'required': False}), 37: ('wagtail.blocks.StructBlock', [[('text', 0), ('aria_label', 34), ('url', 35), ('is_link_boldface', 36)]], {}), 38: ('wagtail.blocks.ListBlock', (37,), {'required': False}), 39: ('wagtail.blocks.StructBlock', [[('image', 31), ('heading', 32), ('body', 33), ('links', 38)]], {}), 40: ('wagtail.blocks.ListBlock', (39,), {'default': []}), 41: ('wagtail.blocks.StructBlock', [[('format', 22), ('heading', 23), ('intro', 24), ('link_image_and_heading', 25), ('has_top_rule_line', 26), ('lines_between_items', 27), ('border_radius_image', 28), ('info_units', 40)]], {}), 42: ('wagtail.blocks.RichTextBlock', (), {'icon': 'edit'}), 43: ('wagtail.blocks.RichTextBlock', (), {}), 44: ('wagtail.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}), 45: ('wagtail.blocks.StructBlock', [[('link_id', 44)]], {}), 46: ('wagtail.blocks.StructBlock', [[('content_block', 43), ('anchor_link', 45)]], {}), 47: ('wagtail_footnotes.blocks.RichTextBlockWithFootnotes', (), {'features': ['anchor-identifier', 'h2', 'h3', 'h4', 'h5', 'hr', 'ol', 'ul', 'bold', 'italic', 'superscript', 'blockquote', 'link', 'document-link', 'image', 'icon', 'footnotes']}), 48: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('full', 'Full width'), (470, '470px'), (270, '270px'), (170, '170px')]}), 49: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('right', 'right'), ('left', 'left')], 'help_text': 'Does not apply if the image is full-width'}), 50: ('wagtail.blocks.RichTextBlock', (), {'label': 'Caption', 'required': False}), 51: ('wagtail.blocks.BooleanBlock', (), {'default': True, 'help_text': 'Check to add a horizontal rule line to bottom of inset.', 'label': 'Has bottom rule line', 'required': False}), 52: ('wagtail.blocks.StructBlock', [[('image', 31), ('image_width', 48), ('image_position', 49), ('text', 50), ('is_bottom_rule', 51)]], {}), 53: ('wagtail.blocks.MultipleChoiceBlock', [], {'choices': [('is_full_width', 'Display the table at full width'), ('stack_on_mobile', 'Stack the table columns on mobile')], 'required': False}), 54: ('wagtail.blocks.CharBlock', (), {}), 55: ('wagtail.blocks.FloatBlock', (), {}), 56: ('wagtail.blocks.RichTextBlock', (), {'features': ['bold', 'italic', 'ol', 'ul', 'link', 'document-link', 'superscript']}), 57: ('wagtail_footnotes.blocks.RichTextBlockWithFootnotes', (), {'features': ['bold', 'italic', 'ol', 'ul', 'link', 'document-link', 'superscript', 'footnotes']}), 58: ('wagtail.contrib.typed_table_block.blocks.TypedTableBlock', [[('text', 54), ('numeric', 55), ('rich_text', 56), ('rich_text_with_footnotes', 57)]], {}), 59: ('wagtail.blocks.RichTextBlock', (), {'features': ['bold', 'italic', 'link', 'document-link'], 'required': False}), 60: ('wagtail.blocks.StructBlock', [[('heading', 23), ('text_introduction', 0), ('options', 53), ('data', 58), ('caption', 59)]], {}), 61: ('wagtail.blocks.TextBlock', (), {}), 62: ('wagtail.blocks.TextBlock', (), {'required': False}), 63: ('wagtail.blocks.StructBlock', [[('body', 61), ('citation', 62)]], {}), 64: ('wagtail.blocks.StructBlock', [[('slug_text', 0), ('paragraph_text', 24), ('button', 37)]], {}), 65: ('wagtail.blocks.ListBlock', (37,), {}), 66: ('wagtail.blocks.StructBlock', [[('heading', 0), ('paragraph', 24), ('links', 65)]], {}), 67: ('v1.blocks.ReusableTextChooserBlock', ('v1.ReusableText',), {}), 68: ('v1.blocks.ReusableNotificationChooserBlock', ('v1.ReusableNotification',), {}), 69: ('v1.blocks.EmailSignUpChooserBlock', (), {}), 70: ('wagtail.blocks.StreamBlock', [[('content', 42), ('content_with_anchor', 46), ('content_with_footnotes', 47), ('heading', 23), ('image', 52), ('table', 60), ('quote', 63), ('cta', 64), ('related_links', 66), ('reusable_text', 67), ('reusable_notification', 68), ('email_signup', 69), ('well', 21)]], {})}),
),
]
Loading

0 comments on commit 82a3e12

Please sign in to comment.