diff --git a/publichealth/home/models/models.py b/publichealth/home/models/models.py index fce7401..fb29684 100644 --- a/publichealth/home/models/models.py +++ b/publichealth/home/models/models.py @@ -14,7 +14,6 @@ from wagtail.core.blocks import StructBlock, CharBlock, URLBlock, RichTextBlock, from wagtail.core.models import Page, Orderable from wagtail.core.fields import StreamField, RichTextField from wagtail.admin.edit_handlers import FieldPanel, StreamFieldPanel, InlinePanel, MultiFieldPanel -from wagtail.embeds.blocks import EmbedBlock from wagtail.images.blocks import ImageChooserBlock from wagtail.images.edit_handlers import ImageChooserPanel from wagtail.search import index @@ -186,8 +185,7 @@ class ArticlePage(Page): ('info', InfoBlock(icon='help')), ('media', ChoiceBlock(choices=[ ('gallery', 'Image gallery'), - ], icon='media')), - ('iframe', EmbedBlock()) + ], icon='media')) ], null=True, blank=True) body_fr = StreamField([ ('paragraph', RichTextBlock()), @@ -195,8 +193,7 @@ class ArticlePage(Page): ('info', InfoBlock(icon='help')), ('media', ChoiceBlock(choices=[ ('gallery', 'Image gallery'), - ], icon='media')), - ('iframe', EmbedBlock()) + ], icon='media')) ], null=True, blank=True) body_en = StreamField([ ('paragraph', RichTextBlock()), @@ -204,8 +201,7 @@ class ArticlePage(Page): ('info', InfoBlock(icon='help')), ('media', ChoiceBlock(choices=[ ('gallery', 'Image gallery'), - ], icon='media')), - ('iframe', EmbedBlock()) + ], icon='media')) ], null=True, blank=True) trans_body = TranslatedField( 'body_de', @@ -218,6 +214,8 @@ class ArticlePage(Page): on_homepage = models.BooleanField(default=False, verbose_name="Featured", help_text="Auf der Frontpage anzeigen") + html_content = RichTextField(blank=True) + feed_image = models.ForeignKey( 'wagtailimages.Image', null=True, blank=True, @@ -260,6 +258,9 @@ class ArticlePage(Page): ], heading="Images"), StreamFieldPanel('gallery'), ] + content_panels = Page.content_panels + [ + FieldPanel('html_content', classname='full'), + ] promote_panels = [ InlinePanel('related_links', label="Links"), MultiFieldPanel([ diff --git a/publichealth/home/templates/home/page_content.html b/publichealth/home/templates/home/page_content.html index a2c4165..b4c646c 100644 --- a/publichealth/home/templates/home/page_content.html +++ b/publichealth/home/templates/home/page_content.html @@ -31,6 +31,13 @@ {% endfor %} +{% if page.html_content %} + +