diff --git a/publichealth/home/models/models.py b/publichealth/home/models/models.py index 1a4224f..5d04089 100644 --- a/publichealth/home/models/models.py +++ b/publichealth/home/models/models.py @@ -185,7 +185,8 @@ class ArticlePage(Page): ('info', InfoBlock(icon='help')), ('media', ChoiceBlock(choices=[ ('gallery', 'Image gallery'), - ], icon='media')) + ], icon='media')), + ('iframe', RichTextBlock()) ], null=True, blank=True) body_fr = StreamField([ ('paragraph', RichTextBlock()), @@ -193,7 +194,8 @@ class ArticlePage(Page): ('info', InfoBlock(icon='help')), ('media', ChoiceBlock(choices=[ ('gallery', 'Image gallery'), - ], icon='media')) + ], icon='media')), + ('iframe', RichTextBlock()) ], null=True, blank=True) body_en = StreamField([ ('paragraph', RichTextBlock()), @@ -201,7 +203,8 @@ class ArticlePage(Page): ('info', InfoBlock(icon='help')), ('media', ChoiceBlock(choices=[ ('gallery', 'Image gallery'), - ], icon='media')) + ], icon='media')), + ('iframe', RichTextBlock()) ], null=True, blank=True) trans_body = TranslatedField( 'body_de', @@ -214,8 +217,6 @@ 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, @@ -257,7 +258,6 @@ class ArticlePage(Page): ImageChooserPanel('feed_image'), ], heading="Images"), StreamFieldPanel('gallery'), - FieldPanel('html_content', classname='full'), ] promote_panels = [ InlinePanel('related_links', label="Links"), diff --git a/publichealth/home/templates/home/page_content.html b/publichealth/home/templates/home/page_content.html index 8b1d979..45814a2 100644 --- a/publichealth/home/templates/home/page_content.html +++ b/publichealth/home/templates/home/page_content.html @@ -23,6 +23,10 @@ {% if block.value == 'gallery' %} {% include 'home/photo_gallery.html' %} {% endif %} + {% elif block.block_type == 'iframe' %} + {% autoescape off %} + {{ block.value|ph_html_decode }} + {% endautoescape %} {% elif block.block_type != 'info' %}
{% include_block block %} @@ -31,15 +35,6 @@ {% endfor %} -{% if page.html_content %} - -