diff --git a/publichealth/home/models/models.py b/publichealth/home/models/models.py index 6c63c7b..1ad4c20 100644 --- a/publichealth/home/models/models.py +++ b/publichealth/home/models/models.py @@ -17,6 +17,7 @@ from wagtail.admin.edit_handlers import FieldPanel, StreamFieldPanel, InlinePane from wagtail.images.blocks import ImageChooserBlock from wagtail.images.edit_handlers import ImageChooserPanel from wagtail.search import index +from wagtail.contrib.table_block.blocks import TableBlock from puput.models import EntryPage, BlogPage from feedler.models import Entry, Stream @@ -56,6 +57,34 @@ class ArticleIndexPage(Page): 'intro_en', ) + table_en = StreamField( + [ + ('table_en', TableBlock(template='home/program_table.html')) + ], + null=True, + blank=True, + ) + table_de = StreamField( + [ + ('table_de', TableBlock(template='home/program_table.html')) + ], + null=True, + blank=True, + ) + table_fr = StreamField( + [ + ('table_fr', TableBlock(template='home/program_table.html')) + ], + null=True, + blank=True, + ) + + trans_table = TranslatedField( + 'table_de', + 'table_fr', + 'table_en', + ) + subscribe_label_de = models.CharField("Button Label (de)", default='', blank=True, max_length=250) subscribe_label_fr = models.CharField("Button Label (fr)", default='', blank=True, max_length=250) subscribe_label_en = models.CharField("Button Label (en)", default='', blank=True, max_length=250) @@ -81,6 +110,9 @@ class ArticleIndexPage(Page): FieldPanel('title_en'), FieldPanel('intro_en'), ImageChooserPanel('header_image'), + FieldPanel('table_en'), + FieldPanel('table_fr'), + FieldPanel('table_de'), ImageChooserPanel('feed_image'), MultiFieldPanel( [ diff --git a/publichealth/home/templates/home/article_index_page.html b/publichealth/home/templates/home/article_index_page.html index f829852..7b878cb 100644 --- a/publichealth/home/templates/home/article_index_page.html +++ b/publichealth/home/templates/home/article_index_page.html @@ -45,6 +45,14 @@ {% endfor %} + +
+ {% if column.strip %} + {% if html_renderer %} + {{ column.strip|safe|linebreaksbr }} + {% else %} + {{ column.strip|linebreaksbr }} + {% endif %} + {% endif %} + | + {% endfor %} +|
---|---|
+ {% if column.strip %} + {% if html_renderer %} + {{ column.strip|safe|linebreaksbr }} + {% else %} + {{ column.strip|linebreaksbr }} + {% endif %} + {% endif %} + | + {% else %} ++ {% if column.strip %} + {% if html_renderer %} + {{ column.strip|safe|linebreaksbr }} + {% else %} + {{ column.strip|linebreaksbr }} + {% endif %} + {% endif %} + | + {% endif %} + {% endfor %} +