diff --git a/district/migrations/0054_alter_districtcenterpage_content_and_more.py b/district/migrations/0054_alter_districtcenterpage_content_and_more.py new file mode 100644 index 0000000000000000000000000000000000000000..c83fb63967f9650516e266234c1562e9f925a5bc --- /dev/null +++ b/district/migrations/0054_alter_districtcenterpage_content_and_more.py @@ -0,0 +1,76 @@ +# Generated by Django 4.0.3 on 2022-04-14 14:06 + +import wagtail.contrib.table_block.blocks +import wagtail.core.blocks +import wagtail.core.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("district", "0053_alter_districtcrossroadpage_cards_content"), + ] + + operations = [ + migrations.AlterField( + model_name="districtcenterpage", + name="content", + field=wagtail.core.fields.StreamField( + [ + ("text", wagtail.core.blocks.RichTextBlock()), + ( + "table", + wagtail.contrib.table_block.blocks.TableBlock( + table_options={"renderer": "html"} + ), + ), + ], + blank=True, + verbose_name="Obsah", + ), + ), + migrations.AlterField( + model_name="districtcustompage", + name="content", + field=wagtail.core.fields.StreamField( + [ + ("text", wagtail.core.blocks.RichTextBlock()), + ( + "table", + wagtail.contrib.table_block.blocks.TableBlock( + table_options={"renderer": "html"} + ), + ), + ( + "people_group", + wagtail.core.blocks.StructBlock( + [ + ( + "group_title", + wagtail.core.blocks.CharBlock( + label="Titulek", required=True + ), + ), + ( + "person_list", + wagtail.core.blocks.ListBlock( + wagtail.core.blocks.PageChooserBlock( + label="Osoba", + page_type=[ + "district.DistrictPersonPage", + "region.RegionPersonPage", + ], + ), + label="List osob", + ), + ), + ] + ), + ), + ], + blank=True, + verbose_name="Obsah", + ), + ), + ] diff --git a/district/models.py b/district/models.py index 4c946bd705530fc6260c3233839d6a4a8f19a45e..2aaa34ce52902495105db4ab24a7f06f39c6bab5 100644 --- a/district/models.py +++ b/district/models.py @@ -888,7 +888,7 @@ class DistrictCenterPage(CalendarMixin, SubpageMixin, MetadataPageMixin, Page): content = StreamField( [ ("text", RichTextBlock()), - ("table", TableBlock()), + ("table", TableBlock(table_options={"renderer": "html"})), ], verbose_name="Obsah", blank=True, @@ -1001,7 +1001,7 @@ class DistrictCustomPage(SubpageMixin, MetadataPageMixin, Page): content = StreamField( [ ("text", RichTextBlock()), - ("table", TableBlock()), + ("table", TableBlock(table_options={"renderer": "html"})), ("people_group", blocks.PeopleGroupListBlock()), ], verbose_name="Obsah", diff --git a/region/migrations/0029_alter_regioncenterpage_content_and_more.py b/region/migrations/0029_alter_regioncenterpage_content_and_more.py new file mode 100644 index 0000000000000000000000000000000000000000..49ce1df6612f01b9a8ddbbbeea0442c781f73893 --- /dev/null +++ b/region/migrations/0029_alter_regioncenterpage_content_and_more.py @@ -0,0 +1,76 @@ +# Generated by Django 4.0.3 on 2022-04-14 14:06 + +import wagtail.contrib.table_block.blocks +import wagtail.core.blocks +import wagtail.core.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("region", "0028_alter_regioncrossroadpage_cards_content"), + ] + + operations = [ + migrations.AlterField( + model_name="regioncenterpage", + name="content", + field=wagtail.core.fields.StreamField( + [ + ("text", wagtail.core.blocks.RichTextBlock()), + ( + "table", + wagtail.contrib.table_block.blocks.TableBlock( + table_options={"renderer": "html"} + ), + ), + ], + blank=True, + verbose_name="Obsah", + ), + ), + migrations.AlterField( + model_name="regioncustompage", + name="content", + field=wagtail.core.fields.StreamField( + [ + ("text", wagtail.core.blocks.RichTextBlock()), + ( + "table", + wagtail.contrib.table_block.blocks.TableBlock( + table_options={"renderer": "html"} + ), + ), + ( + "people_group", + wagtail.core.blocks.StructBlock( + [ + ( + "group_title", + wagtail.core.blocks.CharBlock( + label="Titulek", required=True + ), + ), + ( + "person_list", + wagtail.core.blocks.ListBlock( + wagtail.core.blocks.PageChooserBlock( + label="Osoba", + page_type=[ + "district.DistrictPersonPage", + "region.RegionPersonPage", + ], + ), + label="List osob", + ), + ), + ] + ), + ), + ], + blank=True, + verbose_name="Obsah", + ), + ), + ] diff --git a/region/models.py b/region/models.py index d1f6072b4bdd5b51b562098f9db4d29440f7adab..6f4c634930f98b8674f3467d9c7e693eec1cb65f 100644 --- a/region/models.py +++ b/region/models.py @@ -874,7 +874,7 @@ class RegionCenterPage(CalendarMixin, SubpageMixin, MetadataPageMixin, Page): content = StreamField( [ ("text", RichTextBlock()), - ("table", TableBlock()), + ("table", TableBlock(table_options={"renderer": "html"})), ], verbose_name="Obsah", blank=True, @@ -987,7 +987,7 @@ class RegionCustomPage(SubpageMixin, MetadataPageMixin, Page): content = StreamField( [ ("text", RichTextBlock()), - ("table", TableBlock()), + ("table", TableBlock(table_options={"renderer": "html"})), ("people_group", blocks.PeopleGroupListBlock()), ], verbose_name="Obsah", diff --git a/shared/static/shared/css/helpers.css b/shared/static/shared/css/helpers.css index 0ba59e24bf3c7bc8acb442cf1cf30bfcebc7180b..7123673df97a98c277022b2c5450cbe1358d7aea 100644 --- a/shared/static/shared/css/helpers.css +++ b/shared/static/shared/css/helpers.css @@ -1,3 +1,8 @@ +table caption { + font-weight: 700; + text-align: left; +} + .responsive-object { position: relative; }