From c7c841bd7fa56907c2fd7038f2e4b13ddf3adcac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Valenta?= <git@imaniti.org> Date: Thu, 4 Jan 2024 11:30:53 +0100 Subject: [PATCH] run hooks --- main/blocks.py | 16 +- ..._alter_mainarticlepage_content_and_more.py | 275 +++++++++++++++++- majak/settings/dev.py | 1 - shared/models/main.py | 8 +- 4 files changed, 278 insertions(+), 22 deletions(-) diff --git a/main/blocks.py b/main/blocks.py index 6e7a1325..e3778a26 100644 --- a/main/blocks.py +++ b/main/blocks.py @@ -118,7 +118,9 @@ class NewsBlock(StructBlock): class EuroparlNewsBlock(StructBlock): class Meta: - template = "styleguide2/includes/organisms/articles/europarl_articles_section.html" + template = ( + "styleguide2/includes/organisms/articles/europarl_articles_section.html" + ) icon = "doc-full-inverse" label = "Novinky z Eurovoleb" @@ -154,7 +156,9 @@ class PeopleOverviewBlock(StructBlock): list = ListBlock(BoxBlock, label="Boxíky") class Meta: - template = "styleguide2/includes/organisms/main_section/representatives_section.html" + template = ( + "styleguide2/includes/organisms/main_section/representatives_section.html" + ) icon = "group" label = "Skupina osob" @@ -266,12 +270,16 @@ class ArticleRightImageBlock(ArticleImageMixin): class CardLinkWithHeadlineBlock(CardLinkWithHeadlineBlockMixin): card_items = ListBlock( - CardLinkBlock(template="styleguide2/includes/molecules/boxes/card_box_block.html"), + CardLinkBlock( + template="styleguide2/includes/molecules/boxes/card_box_block.html" + ), label="Karty s odkazy", ) class Meta: - template = "styleguide2/includes/molecules/boxes/card_box_with_headline_block.html" + template = ( + "styleguide2/includes/molecules/boxes/card_box_with_headline_block.html" + ) icon = "link" label = "Karty odkazů s nadpisem" diff --git a/main/migrations/0066_alter_mainarticlepage_content_and_more.py b/main/migrations/0066_alter_mainarticlepage_content_and_more.py index 504abf9a..28852b9c 100644 --- a/main/migrations/0066_alter_mainarticlepage_content_and_more.py +++ b/main/migrations/0066_alter_mainarticlepage_content_and_more.py @@ -1,37 +1,282 @@ # Generated by Django 4.1.10 on 2024-01-04 10:19 -from django.db import migrations import wagtail.blocks import wagtail.documents.blocks import wagtail.fields import wagtail.images.blocks +from django.db import migrations class Migration(migrations.Migration): - dependencies = [ - ('main', '0065_alter_mainhomepage_footer_other_links'), + ("main", "0065_alter_mainhomepage_footer_other_links"), ] operations = [ migrations.AlterField( - model_name='mainarticlepage', - name='content', - field=wagtail.fields.StreamField([('text', wagtail.blocks.RichTextBlock(template='styleguide2/includes/atoms/text/prose_richtext.html')), ('quote', wagtail.blocks.StructBlock([('quote', wagtail.blocks.CharBlock(label='Citace')), ('autor_name', wagtail.blocks.CharBlock(label='Jméno autora'))])), ('download', wagtail.blocks.StructBlock([('file', wagtail.documents.blocks.DocumentChooserBlock(label='Stáhnutelný soubor'))]))], blank=True, use_json_field=True, verbose_name='Článek'), + model_name="mainarticlepage", + name="content", + field=wagtail.fields.StreamField( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + template="styleguide2/includes/atoms/text/prose_richtext.html" + ), + ), + ( + "quote", + wagtail.blocks.StructBlock( + [ + ("quote", wagtail.blocks.CharBlock(label="Citace")), + ( + "autor_name", + wagtail.blocks.CharBlock(label="Jméno autora"), + ), + ] + ), + ), + ( + "download", + wagtail.blocks.StructBlock( + [ + ( + "file", + wagtail.documents.blocks.DocumentChooserBlock( + label="Stáhnutelný soubor" + ), + ) + ] + ), + ), + ], + blank=True, + use_json_field=True, + verbose_name="Článek", + ), ), migrations.AlterField( - model_name='maincrossroadpage', - name='headlined_cards_content', - field=wagtail.fields.StreamField([('headlined_cards', wagtail.blocks.StructBlock([('headline', wagtail.blocks.CharBlock(label='Titulek bloku', required=False)), ('card_items', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock(label='Obrázek')), ('title', wagtail.blocks.CharBlock(label='Titulek', required=True)), ('text', wagtail.blocks.RichTextBlock(label='Krátký text pod nadpisem', required=False)), ('page', wagtail.blocks.PageChooserBlock(label='Stránka', page_type=['main.MainArticlesPage', 'main.MainArticlePage', 'main.MainProgramPage', 'main.MainPeoplePage', 'main.MainPersonPage', 'main.MainSimplePage', 'main.MainContactPage', 'main.MainCrossroadPage'], required=False)), ('link', wagtail.blocks.URLBlock(label='Odkaz', required=False))], template='styleguide2/includes/molecules/boxes/card_box_block.html'), label='Karty s odkazy'))]))], blank=True, use_json_field=True, verbose_name='Karty rozcestníku s nadpisem'), + model_name="maincrossroadpage", + name="headlined_cards_content", + field=wagtail.fields.StreamField( + [ + ( + "headlined_cards", + wagtail.blocks.StructBlock( + [ + ( + "headline", + wagtail.blocks.CharBlock( + label="Titulek bloku", required=False + ), + ), + ( + "card_items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Obrázek" + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + label="Titulek", required=True + ), + ), + ( + "text", + wagtail.blocks.RichTextBlock( + label="Krátký text pod nadpisem", + required=False, + ), + ), + ( + "page", + wagtail.blocks.PageChooserBlock( + label="Stránka", + page_type=[ + "main.MainArticlesPage", + "main.MainArticlePage", + "main.MainProgramPage", + "main.MainPeoplePage", + "main.MainPersonPage", + "main.MainSimplePage", + "main.MainContactPage", + "main.MainCrossroadPage", + ], + required=False, + ), + ), + ( + "link", + wagtail.blocks.URLBlock( + label="Odkaz", required=False + ), + ), + ], + template="styleguide2/includes/molecules/boxes/card_box_block.html", + ), + label="Karty s odkazy", + ), + ), + ] + ), + ) + ], + blank=True, + use_json_field=True, + verbose_name="Karty rozcestníku s nadpisem", + ), ), migrations.AlterField( - model_name='mainpeoplepage', - name='people', - field=wagtail.fields.StreamField([('people_group', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(label='Titulek')), ('slug', wagtail.blocks.CharBlock(help_text='Není třeba vyplňovat, bude automaticky vyplněno', label='Slug skupiny', required=False)), ('person_list', wagtail.blocks.ListBlock(wagtail.blocks.PageChooserBlock(label='Detail osoby', page_type=['main.MainPersonPage']), label='Skupina osob'))], label='Seznam osob')), ('team_group', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(label='Název sekce týmů')), ('slug', wagtail.blocks.CharBlock(help_text='Není třeba vyplňovat, bude automaticky vyplněno', label='Slug sekce', required=False)), ('team_list', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('headline', wagtail.blocks.CharBlock(label='Titulek bloku', required=False)), ('card_items', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock(label='Obrázek')), ('title', wagtail.blocks.CharBlock(label='Titulek', required=True)), ('text', wagtail.blocks.RichTextBlock(label='Krátký text pod nadpisem', required=False)), ('page', wagtail.blocks.PageChooserBlock(label='Stránka', page_type=['main.MainArticlesPage', 'main.MainArticlePage', 'main.MainProgramPage', 'main.MainPeoplePage', 'main.MainPersonPage', 'main.MainSimplePage', 'main.MainContactPage', 'main.MainCrossroadPage'], required=False)), ('link', wagtail.blocks.URLBlock(label='Odkaz', required=False))], template='styleguide2/includes/molecules/boxes/card_box_block.html'), label='Karty s odkazy'))], label='Karta týmu'), label='Týmy'))]))], blank=True, use_json_field=True, verbose_name='Lidé a týmy'), + model_name="mainpeoplepage", + name="people", + field=wagtail.fields.StreamField( + [ + ( + "people_group", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Titulek")), + ( + "slug", + wagtail.blocks.CharBlock( + help_text="Není třeba vyplňovat, bude automaticky vyplněno", + label="Slug skupiny", + required=False, + ), + ), + ( + "person_list", + wagtail.blocks.ListBlock( + wagtail.blocks.PageChooserBlock( + label="Detail osoby", + page_type=["main.MainPersonPage"], + ), + label="Skupina osob", + ), + ), + ], + label="Seznam osob", + ), + ), + ( + "team_group", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock(label="Název sekce týmů"), + ), + ( + "slug", + wagtail.blocks.CharBlock( + help_text="Není třeba vyplňovat, bude automaticky vyplněno", + label="Slug sekce", + required=False, + ), + ), + ( + "team_list", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "headline", + wagtail.blocks.CharBlock( + label="Titulek bloku", + required=False, + ), + ), + ( + "card_items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Obrázek" + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + label="Titulek", + required=True, + ), + ), + ( + "text", + wagtail.blocks.RichTextBlock( + label="Krátký text pod nadpisem", + required=False, + ), + ), + ( + "page", + wagtail.blocks.PageChooserBlock( + label="Stránka", + page_type=[ + "main.MainArticlesPage", + "main.MainArticlePage", + "main.MainProgramPage", + "main.MainPeoplePage", + "main.MainPersonPage", + "main.MainSimplePage", + "main.MainContactPage", + "main.MainCrossroadPage", + ], + required=False, + ), + ), + ( + "link", + wagtail.blocks.URLBlock( + label="Odkaz", + required=False, + ), + ), + ], + template="styleguide2/includes/molecules/boxes/card_box_block.html", + ), + label="Karty s odkazy", + ), + ), + ], + label="Karta týmu", + ), + label="Týmy", + ), + ), + ] + ), + ), + ], + blank=True, + use_json_field=True, + verbose_name="Lidé a týmy", + ), ), migrations.AlterField( - model_name='mainsimplepage', - name='content', - field=wagtail.fields.StreamField([('text', wagtail.blocks.RichTextBlock(template='styleguide2/includes/atoms/text/prose_richtext.html'))], blank=True, use_json_field=True, verbose_name='Hlavní obsah'), + model_name="mainsimplepage", + name="content", + field=wagtail.fields.StreamField( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + template="styleguide2/includes/atoms/text/prose_richtext.html" + ), + ) + ], + blank=True, + use_json_field=True, + verbose_name="Hlavní obsah", + ), ), ] diff --git a/majak/settings/dev.py b/majak/settings/dev.py index 2669685a..334335cd 100644 --- a/majak/settings/dev.py +++ b/majak/settings/dev.py @@ -1,7 +1,6 @@ from .base import * # noqa from .base import env # noqa - # GENERAL # ------------------------------------------------------------------------------ DEBUG = env.bool("DJANGO_DEBUG", default=True) diff --git a/shared/models/main.py b/shared/models/main.py index 45b567e7..bda41092 100644 --- a/shared/models/main.py +++ b/shared/models/main.py @@ -642,7 +642,9 @@ class MainArticlePageMixin( [ ( "text", - RichTextBlock(template="styleguide2/includes/atoms/text/prose_richtext.html"), + RichTextBlock( + template="styleguide2/includes/atoms/text/prose_richtext.html" + ), ), ("quote", ArticleQuoteBlock()), ("download", ArticleDownloadBlock()), @@ -801,7 +803,9 @@ class MainSimplePageMixin( [ ( "text", - RichTextBlock(template="styleguide2/includes/atoms/text/prose_richtext.html"), + RichTextBlock( + template="styleguide2/includes/atoms/text/prose_richtext.html" + ), ), ], verbose_name="Hlavní obsah", -- GitLab