Skip to content
Snippets Groups Projects
Commit de231a0f authored by OndraRehounek's avatar OndraRehounek Committed by jan.bednarik
Browse files

district (and region): table - markdown enabled template - use one migration with YT block

parent 5220d445
Branches
No related tags found
2 merge requests!480Release,!478Feature/youtube block
# Generated by Django 4.0.3 on 2022-04-28 08:35 # Generated by Django 4.0.3 on 2022-04-28 09:31
import wagtail.contrib.table_block.blocks
import wagtail.core.blocks import wagtail.core.blocks
import wagtail.core.fields import wagtail.core.fields
import wagtail.images.blocks import wagtail.images.blocks
...@@ -93,4 +94,64 @@ class Migration(migrations.Migration): ...@@ -93,4 +94,64 @@ class Migration(migrations.Migration):
verbose_name="Článek", verbose_name="Článek",
), ),
), ),
migrations.AlterField(
model_name="districtcenterpage",
name="content",
field=wagtail.core.fields.StreamField(
[
("text", wagtail.core.blocks.RichTextBlock()),
(
"table",
wagtail.contrib.table_block.blocks.TableBlock(
template="shared/blocks/table_block.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(
template="shared/blocks/table_block.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",
),
),
] ]
...@@ -922,7 +922,7 @@ class DistrictCenterPage( ...@@ -922,7 +922,7 @@ class DistrictCenterPage(
content = StreamField( content = StreamField(
[ [
("text", RichTextBlock()), ("text", RichTextBlock()),
("table", TableBlock()), ("table", TableBlock(template="shared/blocks/table_block.html")),
], ],
verbose_name="Obsah", verbose_name="Obsah",
blank=True, blank=True,
...@@ -1039,7 +1039,7 @@ class DistrictCustomPage( ...@@ -1039,7 +1039,7 @@ class DistrictCustomPage(
content = StreamField( content = StreamField(
[ [
("text", RichTextBlock()), ("text", RichTextBlock()),
("table", TableBlock()), ("table", TableBlock(template="shared/blocks/table_block.html")),
("people_group", blocks.PeopleGroupListBlock()), ("people_group", blocks.PeopleGroupListBlock()),
], ],
verbose_name="Obsah", verbose_name="Obsah",
......
# Generated by Django 4.0.3 on 2022-04-28 08:35 # Generated by Django 4.0.3 on 2022-04-28 09:31
import wagtail.contrib.table_block.blocks
import wagtail.core.blocks import wagtail.core.blocks
import wagtail.core.fields import wagtail.core.fields
import wagtail.images.blocks import wagtail.images.blocks
...@@ -93,4 +94,64 @@ class Migration(migrations.Migration): ...@@ -93,4 +94,64 @@ class Migration(migrations.Migration):
verbose_name="Článek", verbose_name="Článek",
), ),
), ),
migrations.AlterField(
model_name="regioncenterpage",
name="content",
field=wagtail.core.fields.StreamField(
[
("text", wagtail.core.blocks.RichTextBlock()),
(
"table",
wagtail.contrib.table_block.blocks.TableBlock(
template="shared/blocks/table_block.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(
template="shared/blocks/table_block.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",
),
),
] ]
...@@ -907,7 +907,7 @@ class RegionCenterPage( ...@@ -907,7 +907,7 @@ class RegionCenterPage(
content = StreamField( content = StreamField(
[ [
("text", RichTextBlock()), ("text", RichTextBlock()),
("table", TableBlock()), ("table", TableBlock(template="shared/blocks/table_block.html")),
], ],
verbose_name="Obsah", verbose_name="Obsah",
blank=True, blank=True,
...@@ -1024,7 +1024,7 @@ class RegionCustomPage( ...@@ -1024,7 +1024,7 @@ class RegionCustomPage(
content = StreamField( content = StreamField(
[ [
("text", RichTextBlock()), ("text", RichTextBlock()),
("table", TableBlock()), ("table", TableBlock(template="shared/blocks/table_block.html")),
("people_group", blocks.PeopleGroupListBlock()), ("people_group", blocks.PeopleGroupListBlock()),
], ],
verbose_name="Obsah", verbose_name="Obsah",
......
{% load table_block_tags shared_filters %}
<div class="my-6">
<table class="table table--bordered content-block">
{% if table_caption %}
<caption class="head-heavy-sm my-4">{{ table_caption }}</caption>
{% endif %}
{% if table_header %}
<thead>
<tr>
{% for column in table_header %}
{% with forloop.counter0 as col_index %}
<th scope="col" {% cell_classname 0 col_index %}>
{% if column.strip %}
{{ column.strip|markdown }}
{% endif %}
</th>
{% endwith %}
{% endfor %}
</tr>
</thead>
{% endif %}
<tbody>
{% for row in data %}
{% with forloop.counter0 as row_index %}
<tr>
{% for column in row %}
{% with forloop.counter0 as col_index %}
{% if first_col_is_header and forloop.first %}
<th scope="row" {% cell_classname row_index col_index table_header %}>
{% if column.strip %}
{{ column.strip|markdown }}
{% endif %}
</th>
{% else %}
<td {% cell_classname row_index col_index table_header %}>
{% if column.strip %}
{{ column.strip|markdown }}
{% endif %}
</td>
{% endif %}
{% endwith %}
{% endfor %}
</tr>
{% endwith %}
{% endfor %}
</tbody>
</table>
</div>
# Generated by Django 4.0.3 on 2022-04-28 08:35 # Generated by Django 4.0.3 on 2022-04-28 09:31
import wagtail.core.blocks import wagtail.core.blocks
import wagtail.core.fields import wagtail.core.fields
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment