From 53e1ee44e59a40b7629c3ac9a6477801915afb62 Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Thu, 5 Feb 2015 10:46:59 +0000 Subject: [PATCH] ditch HeadingBlock in favour of a CharBlock that doesn't know its own native rendering --- wagtail/wagtailadmin/blocks.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/wagtail/wagtailadmin/blocks.py b/wagtail/wagtailadmin/blocks.py index d5c184e44..0a9b19824 100644 --- a/wagtail/wagtailadmin/blocks.py +++ b/wagtail/wagtailadmin/blocks.py @@ -273,13 +273,11 @@ class FieldBlock(Block): def clean(self, value): return self.field.clean(value) -class HeadingBlock(FieldBlock): - def __init__(self, tag_name='h1', **kwargs): - self.tag_name = tag_name - super(HeadingBlock, self).__init__(CharField(), **kwargs) - - def render(self, value): - return format_html("<{tag}>{value}", tag=self.tag_name, value=value) +class CharBlock(FieldBlock): + def __init__(self, **kwargs): + super(CharBlock, self).__init__(CharField(), **kwargs) + # TODO: some kwargs, such as max_length, and *possibly* things like help_text, should be passed to + # the CharField constructor. Figure out a system for doing this # ======= # Chooser