WIP 10694-table-block #3

Merged
mravi merged 15 commits from 10694-table-block into master 2022-07-12 06:45:55 +00:00
3 changed files with 40 additions and 8 deletions
Showing only changes of commit 3ff5f1eb50 - Show all commits

View file

@ -50,9 +50,32 @@ class ArticleIndexPage(Page):
'intro_en', 'intro_en',
) )
table_en = TableBlock()
table_fr = TableBlock() table_en = StreamField(
table_de = TableBlock() [
('table_en', TableBlock())
],
null=True,
blank = True,
)
table_de = StreamField(
[
('table_de', TableBlock())
],
null=True,
blank = True,
)
table_fr = StreamField(
[
('table_fr', TableBlock())
],
null=True,
blank = True,
)
#table_en = TableBlock()
#table_fr = TableBlock()
#table_de = TableBlock()
trans_table = TranslatedField( trans_table = TranslatedField(
'table_de', 'table_de',
'table_fr', 'table_fr',
@ -83,9 +106,9 @@ class ArticleIndexPage(Page):
FieldPanel('intro_fr'), FieldPanel('intro_fr'),
FieldPanel('title_en'), FieldPanel('title_en'),
FieldPanel('intro_en'), FieldPanel('intro_en'),
#FieldPanel('table_en'), FieldPanel('table_en'),
#FieldPanel('table_fr'), FieldPanel('table_fr'),
#FieldPanel('table_de'), FieldPanel('table_de'),
ImageChooserPanel('feed_image'), ImageChooserPanel('feed_image'),
MultiFieldPanel( MultiFieldPanel(
[ [

View file

@ -34,6 +34,14 @@
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
<!-- Table content -->
<div class="article-table" role="main">
{% for block in page.trans_table %}
{% if block.block_type == 'table_en' or block.block_type == 'table_fr' or block.block_type == 'table_de' %}
{% include_block block %}
{% endif %}
{% endfor %}
</div>
</div><!-- /container --> </div><!-- /container -->
</section> </section>

View file

@ -30,11 +30,12 @@
{% endfor %} {% endfor %}
</div> </div>
<h1>Mmmm</h1>
<!-- Table content --> <!-- Table content -->
<div class="article-table" role="main"> <div class="article-table" role="main">
{% for block in page.trans_table %} {% for block in page.trans_table %}
{% elif block.block_type == 'table' %} {% if block.block_type == 'table' %}
Inside if
{% include_block block %} {% include_block block %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}