@@ -1066,30 +1066,34 @@ def MixedButtonsBlock(
10661066 )
10671067
10681068
1069- class ButtonRowBlock (blocks .StructBlock ):
1070- spacing = blocks .ChoiceBlock (
1071- choices = [
1072- ("" , "No spacing" ),
1073- ("small" , "Small" ),
1074- ("large" , "Large" ),
1075- ],
1076- default = "" ,
1077- required = False ,
1078- )
1079- buttons = MixedButtonsBlock (
1080- button_types = get_button_types (allow_uitour = False ),
1081- min_num = 1 ,
1082- max_num = 4 ,
1083- )
1084-
1085- class Meta :
1086- label = "Button Row"
1087- label_format = "Button Row"
1088- template = "cms/blocks/button-row.html"
1089- form_layout = blocks .BlockGroup (
1090- children = ["buttons" ],
1091- settings = ["spacing" ],
1069+ def ButtonRowBlock (allow_uitour = False , ** kwargs ):
1070+ class _ButtonRowBlock (blocks .StructBlock ):
1071+ spacing = blocks .ChoiceBlock (
1072+ choices = [
1073+ ("" , "No spacing" ),
1074+ ("small" , "Small" ),
1075+ ("large" , "Large" ),
1076+ ],
1077+ default = "" ,
1078+ required = False ,
10921079 )
1080+ buttons = MixedButtonsBlock (
1081+ button_types = get_button_types (allow_uitour ),
1082+ themes = BUTTON_THEMES_2026 ,
1083+ min_num = 1 ,
1084+ max_num = 3 ,
1085+ )
1086+
1087+ class Meta :
1088+ label = "Button Row"
1089+ label_format = "Button Row"
1090+ template = "cms/blocks/button-row.html"
1091+ form_layout = blocks .BlockGroup (
1092+ children = ["buttons" ],
1093+ settings = ["spacing" ],
1094+ )
1095+
1096+ return _ButtonRowBlock (** kwargs )
10931097
10941098
10951099class CTASettings (blocks .StructBlock ):
@@ -2217,17 +2221,7 @@ class _TwoColumnCardBlock(blocks.StructBlock):
22172221 ("pricing_heading" , PricingHeadingBlock ()),
22182222 ("rich_text" , blocks .RichTextBlock (features = EXPANDED_TEXT_FEATURES )),
22192223 ("icon_list" , IconListBlock ()),
2220- (
2221- "button" ,
2222- MixedButtonsBlock (
2223- button_types = get_button_types (allow_uitour ),
2224- themes = BUTTON_THEMES_2026 ,
2225- min_num = 0 ,
2226- max_num = 1 ,
2227- required = False ,
2228- label = "Button" ,
2229- ),
2230- ),
2224+ ("button_row" , ButtonRowBlock (allow_uitour = allow_uitour )),
22312225 ("media" , MediaBlock (max_num = 1 , min_num = 0 , required = False )),
22322226 ("numbered_list" , NumberedListBlock ()),
22332227 ("timeline" , TimelineBlock ()),
@@ -2573,6 +2567,7 @@ class _SectionBlock(blocks.StructBlock):
25732567 ("kit_banner" , KitBannerBlock (allow_uitour = allow_uitour )),
25742568 ("line_cards" , LineCardsBlock (allow_uitour = allow_uitour )),
25752569 ("two_column_cards" , TwoColumnCardsBlock (allow_uitour = allow_uitour )),
2570+ ("button_row" , ButtonRowBlock (allow_uitour = allow_uitour )),
25762571 ],
25772572 required = False ,
25782573 )
0 commit comments