From 5220d4458b496339e143f41be4e492489eb3eab9 Mon Sep 17 00:00:00 2001 From: OndraRehounek <ondra.rehounek@seznam.cz> Date: Thu, 28 Apr 2022 10:42:40 +0200 Subject: [PATCH] article mixin: YouTube block with poster (migrations) --- .../0060_alter_districtarticlepage_content.py | 96 +++++++++++++++++++ .../0035_alter_regionarticlepage_content.py | 96 +++++++++++++++++++ .../0025_alter_uniwebarticlepage_content.py | 96 +++++++++++++++++++ 3 files changed, 288 insertions(+) create mode 100644 district/migrations/0060_alter_districtarticlepage_content.py create mode 100644 region/migrations/0035_alter_regionarticlepage_content.py create mode 100644 uniweb/migrations/0025_alter_uniwebarticlepage_content.py diff --git a/district/migrations/0060_alter_districtarticlepage_content.py b/district/migrations/0060_alter_districtarticlepage_content.py new file mode 100644 index 00000000..2414b4a4 --- /dev/null +++ b/district/migrations/0060_alter_districtarticlepage_content.py @@ -0,0 +1,96 @@ +# Generated by Django 4.0.3 on 2022-04-28 08:35 + +import wagtail.core.blocks +import wagtail.core.fields +import wagtail.images.blocks +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("district", "0059_alter_districtprogrampage_content"), + ] + + operations = [ + migrations.AlterField( + model_name="districtarticlepage", + name="content", + field=wagtail.core.fields.StreamField( + [ + ( + "text", + wagtail.core.blocks.RichTextBlock( + features=[ + "h2", + "h3", + "h4", + "bold", + "italic", + "ol", + "embed", + "ul", + "link", + "document-link", + "image", + ], + label="Textový editor", + ), + ), + ( + "gallery", + wagtail.core.blocks.StructBlock( + [ + ( + "gallery_items", + wagtail.core.blocks.ListBlock( + wagtail.images.blocks.ImageChooserBlock( + label="obrázek", required=True + ), + group="ostatní", + icon="image", + label="Galerie", + ), + ) + ], + label="Galerie", + ), + ), + ( + "youtube", + wagtail.core.blocks.StructBlock( + [ + ( + "poster_image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Není třeba vyplňovat, náhled bude dohledán automaticky.", + label="Náhled videa (automatické pole)", + required=False, + ), + ), + ( + "video_url", + wagtail.core.blocks.URLBlock( + help_text="Odkaz na YouTube video bude automaticky zkonvertován na ID videa a NEBUDE uložen.", + label="Odkaz na video", + required=False, + ), + ), + ( + "video_id", + wagtail.core.blocks.CharBlock( + help_text="Není třeba vyplňovat, bude automaticky načteno z odkazu.", + label="ID videa (automatické pole)", + required=False, + ), + ), + ], + label="YouTube video", + ), + ), + ], + blank=True, + verbose_name="Článek", + ), + ), + ] diff --git a/region/migrations/0035_alter_regionarticlepage_content.py b/region/migrations/0035_alter_regionarticlepage_content.py new file mode 100644 index 00000000..2a4c8cc4 --- /dev/null +++ b/region/migrations/0035_alter_regionarticlepage_content.py @@ -0,0 +1,96 @@ +# Generated by Django 4.0.3 on 2022-04-28 08:35 + +import wagtail.core.blocks +import wagtail.core.fields +import wagtail.images.blocks +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("region", "0034_alter_regionprogrampage_content"), + ] + + operations = [ + migrations.AlterField( + model_name="regionarticlepage", + name="content", + field=wagtail.core.fields.StreamField( + [ + ( + "text", + wagtail.core.blocks.RichTextBlock( + features=[ + "h2", + "h3", + "h4", + "bold", + "italic", + "ol", + "embed", + "ul", + "link", + "document-link", + "image", + ], + label="Textový editor", + ), + ), + ( + "gallery", + wagtail.core.blocks.StructBlock( + [ + ( + "gallery_items", + wagtail.core.blocks.ListBlock( + wagtail.images.blocks.ImageChooserBlock( + label="obrázek", required=True + ), + group="ostatní", + icon="image", + label="Galerie", + ), + ) + ], + label="Galerie", + ), + ), + ( + "youtube", + wagtail.core.blocks.StructBlock( + [ + ( + "poster_image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Není třeba vyplňovat, náhled bude dohledán automaticky.", + label="Náhled videa (automatické pole)", + required=False, + ), + ), + ( + "video_url", + wagtail.core.blocks.URLBlock( + help_text="Odkaz na YouTube video bude automaticky zkonvertován na ID videa a NEBUDE uložen.", + label="Odkaz na video", + required=False, + ), + ), + ( + "video_id", + wagtail.core.blocks.CharBlock( + help_text="Není třeba vyplňovat, bude automaticky načteno z odkazu.", + label="ID videa (automatické pole)", + required=False, + ), + ), + ], + label="YouTube video", + ), + ), + ], + blank=True, + verbose_name="Článek", + ), + ), + ] diff --git a/uniweb/migrations/0025_alter_uniwebarticlepage_content.py b/uniweb/migrations/0025_alter_uniwebarticlepage_content.py new file mode 100644 index 00000000..500ab523 --- /dev/null +++ b/uniweb/migrations/0025_alter_uniwebarticlepage_content.py @@ -0,0 +1,96 @@ +# Generated by Django 4.0.3 on 2022-04-28 08:35 + +import wagtail.core.blocks +import wagtail.core.fields +import wagtail.images.blocks +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("uniweb", "0024_alter_uniwebarticlepage_content"), + ] + + operations = [ + migrations.AlterField( + model_name="uniwebarticlepage", + name="content", + field=wagtail.core.fields.StreamField( + [ + ( + "text", + wagtail.core.blocks.RichTextBlock( + features=[ + "h2", + "h3", + "h4", + "bold", + "italic", + "ol", + "embed", + "ul", + "link", + "document-link", + "image", + ], + label="Textový editor", + ), + ), + ( + "gallery", + wagtail.core.blocks.StructBlock( + [ + ( + "gallery_items", + wagtail.core.blocks.ListBlock( + wagtail.images.blocks.ImageChooserBlock( + label="obrázek", required=True + ), + group="ostatní", + icon="image", + label="Galerie", + ), + ) + ], + label="Galerie", + ), + ), + ( + "youtube", + wagtail.core.blocks.StructBlock( + [ + ( + "poster_image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Není třeba vyplňovat, náhled bude dohledán automaticky.", + label="Náhled videa (automatické pole)", + required=False, + ), + ), + ( + "video_url", + wagtail.core.blocks.URLBlock( + help_text="Odkaz na YouTube video bude automaticky zkonvertován na ID videa a NEBUDE uložen.", + label="Odkaz na video", + required=False, + ), + ), + ( + "video_id", + wagtail.core.blocks.CharBlock( + help_text="Není třeba vyplňovat, bude automaticky načteno z odkazu.", + label="ID videa (automatické pole)", + required=False, + ), + ), + ], + label="YouTube video", + ), + ), + ], + blank=True, + verbose_name="Článek", + ), + ), + ] -- GitLab