Skip to content

Commit

Permalink
Refactor Wordmark component to improve layout flow (#398)
Browse files Browse the repository at this point in the history
Drop the range of padding options because we needed things to be more
responsive, which meant it's simpler to just have one size.

Add an option to disable the bottom padding, so that it can be used
above a block with the same color background without looking over-spaced
  • Loading branch information
stevejalim authored Jun 3, 2024
1 parent e04f038 commit 4784b6b
Show file tree
Hide file tree
Showing 6 changed files with 3,566 additions and 27 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ Nothing yet

Nothing yet

## [1.8.2]

### Changed

* Padding fixup for Wordmark component

## [1.8.1]

### Changed
Expand All @@ -25,6 +31,7 @@ Nothing yet

###  Added

* Support new Wordmark component, designed to show SVG wordmarks
* Support adding (small/narrow) tables in Blog Posts (#370)

### Changed
Expand Down
16 changes: 4 additions & 12 deletions birdbox/microsite/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@


"""Custom Wagtail blocks that map to Protocol components, intended for use in a StreamField"""

from django import forms
from django.conf import settings
from django.db.models import TextChoices
Expand Down Expand Up @@ -125,14 +126,6 @@ class TableWidthOptions(TextChoices):
TABLE_WIDTH_FULL = "bb-table-width-full", "Full width"


class HorizontalImageBlockOptions(TextChoices):
HORIZONTAL_IMAGE_LAYOUT_DEFAULT = "bb-horizontal-image-default-spacing", "Default spacing (none extra)"
HORIZONTAL_IMAGE_LAYOUT_SMALL = "bb-horizontal-image-small-spacing", "Small spacing"
HORIZONTAL_IMAGE_LAYOUT_MEDIUM = "bb-horizontal-image-medium-spacing", "Medium spacing"
HORIZONTAL_IMAGE_LAYOUT_LARGE = "bb-horizontal-image-large-spacing", "Large spacing"
HORIZONTAL_IMAGE_LAYOUT_EXTRA_LARGE = "bb-horizontal-image-xl-spacing", "XL spacing"


class LinkStructValue(wagtail_blocks.StructValue):
def url(self):
external_url = self.get("external_url")
Expand Down Expand Up @@ -952,7 +945,6 @@ def get_context(self, value, parent_context=None):


class HeadedTableBlock(wagtail_blocks.StructBlock):

"""IMPORTANT: if you include this block in a StreamField and the streamfield
is set to collapsed=True, the table will not be visible to edit unless the
browser window is resized slightly. This is ticketed at
Expand Down Expand Up @@ -1046,9 +1038,9 @@ class HorizontalImageBlock(AccessibleImageBlockBase):
required=True,
)

layout = wagtail_blocks.ChoiceBlock(
choices=HorizontalImageBlockOptions.choices,
default=HorizontalImageBlockOptions.HORIZONTAL_IMAGE_LAYOUT_DEFAULT,
disable_bottom_spacing = wagtail_blocks.BooleanBlock(
default=True,
required=False,
)

class Meta:
Expand Down
Loading

0 comments on commit 4784b6b

Please sign in to comment.