diff --git a/README.md b/README.md index 095a78a0dd622c147f846f0efe112b0f6344a998..f19d903a59e31619a51dd98483d8e3fdff4d7a38 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,6 @@ Rozšíření která používáme: ├── senate = app na web senat.pirati.cz ├── senat_campaign = app na weby kandidátů na senátory ├── districts = app na web kraje.pirati.cz - ├── region = app na weby krajskych sdruzeni ├── district = app na weby oblastních sdružení ├── uniweb = app na univerzalni webove stranky ... diff --git a/majak/settings/base.py b/majak/settings/base.py index 633f8245969c5d9bff8f5484dd3de18d0eceb6a8..7997448e548fafcc69f2cc26445b063d74b6d1b6 100644 --- a/majak/settings/base.py +++ b/majak/settings/base.py @@ -39,7 +39,6 @@ INSTALLED_APPS = [ "donate", "senat_campaign", "uniweb", - "region", "district", "czech_inspirational", "shared", diff --git a/redmine_utils/management/commands/update_redmine_issues.py b/redmine_utils/management/commands/update_redmine_issues.py index b708361b2ca930828bdad2c33533d745e94e9394..3f1b8170a2cb81a8dbcefc1d4ba0a66285d87601 100644 --- a/redmine_utils/management/commands/update_redmine_issues.py +++ b/redmine_utils/management/commands/update_redmine_issues.py @@ -2,17 +2,16 @@ from django.core.management.base import BaseCommand from district.models import DistrictProgramPage from redmine_utils.functions import fill_data_from_redmine_for_page -from region.models import RegionProgramPage class Command(BaseCommand): def handle(self, *args, **options): """ - Pro updated_models (DistrictProgramPage, RegionProgramPage) projedu obsah, - zda má v sobě `redmine_program_block` - ten má IntegerBlock `redmine_issue`. - Podle něj pak stahujeme data z Redmine. + Pro updated_models (DistrictProgramPage) projedu obsah, zda má v sobě + `redmine_program_block` - ten má IntegerBlock `redmine_issue`. Podle něj + pak stahujeme data z Redmine. """ - updated_models = DistrictProgramPage, RegionProgramPage + updated_models = DistrictProgramPage self.stdout.write("Updating Redmine issues...") for model in updated_models: diff --git a/region/__init__.py b/region/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/region/apps.py b/region/apps.py deleted file mode 100644 index 79e029812f9ec7ad9db8ebcd08f9a02d7aa86fa3..0000000000000000000000000000000000000000 --- a/region/apps.py +++ /dev/null @@ -1,5 +0,0 @@ -from django.apps import AppConfig - - -class RegionConfig(AppConfig): - name = "region" diff --git a/region/blocks.py b/region/blocks.py deleted file mode 100644 index feb697d799ede3f47dd5d622382a81eaa180115f..0000000000000000000000000000000000000000 --- a/region/blocks.py +++ /dev/null @@ -1,253 +0,0 @@ -from django.forms.utils import ErrorList -from wagtail.core.blocks import ( - CharBlock, - IntegerBlock, - ListBlock, - PageChooserBlock, - RichTextBlock, - StructBlock, - TextBlock, - URLBlock, -) -from wagtail.core.blocks.struct_block import StructBlockValidationError -from wagtail.images.blocks import ImageChooserBlock - -from shared.blocks import ProgramItemBlock - - -class AddressBlock(StructBlock): - title = CharBlock(label="Titulek", required=True) - map_image = ImageChooserBlock(label="Obrázek mapy", required=False) - map_link = URLBlock(label="Odkaz na detail mapy", required=False) - address = TextBlock(label="Adresa", required=True) - address_info = TextBlock(label="Info k adrese", required=False) - - class Meta: - template = "region/blocks/address_block.html" - icon = "home" - label = "Adresa" - - -class CallToActionButtonBlock(StructBlock): - button_link = URLBlock(label="Odkaz", max_length=64) - button_text = CharBlock(label="Text") - - class Meta: - template = "region/blocks/call_to_action_button_block.html" - icon = "link" - label = "Call-to-action tlačítko" - - -class CandidateListBlock(StructBlock): - title = CharBlock(label="Titulek", required=True) - call_to_action_text = CharBlock(label="Text 'call-to-action' baneru") - call_to_action_link = URLBlock( - label="Odkaz 'call-to-action' baneru", required=False - ) - call_to_action_button_text = CharBlock( - label="Text tlačítka 'call-to-action' baneru", max_length=24, required=False - ) - candidate_list_big_count = IntegerBlock( - label="Počet kanditátů s velkým náhledem", default=7 - ) - candidate_list_shown_count = IntegerBlock( - label="Počet zobrazených kandidátů při načtení stránky (včetně velkých náhledů)", - default=16, - ) - - candidate_list = ListBlock( - PageChooserBlock(label="Osoba", page_type=["region.RegionPersonPage"]), - label="Kandidáti", - ) - - class Meta: - template = "region/blocks/candidate_list_block.html" - icon = "list-ol" - label = "List kanditátů" - - -class CardLinkBlock(StructBlock): - image = ImageChooserBlock(label="Obrázek") - title = CharBlock(label="Titulek", required=True) - text = RichTextBlock(label="Krátký text pod nadpisem", required=False) - - page = PageChooserBlock( - label="Stránka", - page_type=[ - "region.RegionAfterElectionPage", - "region.RegionArticlePage", - "region.RegionArticlesPage", - "region.RegionCenterPage", - "region.RegionContactPage", - "region.RegionCrossroadPage", - "region.RegionCustomPage", - "region.RegionElectionPage", - "region.RegionElectionPointPage", - "region.RegionPeoplePage", - "region.RegionPersonPage", - "region.RegionProgramPage", - "region.RegionTagsPage", - ], - required=False, - ) - link = URLBlock(label="Odkaz", required=False) - - class Meta: - template = "region/blocks/card_link_block.html" - icon = "link" - label = "Karta odkazu" - - def clean(self, value): - errors = {} - - if value["page"] and value["link"]: - errors["page"] = ErrorList( - ["Stránka nemůže být vybrána současně s odkazem."] - ) - errors["link"] = ErrorList( - ["Odkaz nemůže být vybrán současně se stránkou."] - ) - elif not value["page"] and not value["link"]: - errors["page"] = ErrorList(["Zvolte stránku nebo vyplňte odkaz."]) - errors["link"] = ErrorList(["Vyplňte odkaz nebo zvolte stránku."]) - if errors: - raise StructBlockValidationError(errors) - return super().clean(value) - - -class CardLinkWithHeadlineBlock(StructBlock): - headline = CharBlock(label="Titulek bloku", required=False) - card_items = ListBlock(CardLinkBlock(), label="Karty odkazu") - - class Meta: - template = "region/blocks/card_link_with_headline_block.html" - icon = "link" - label = "Karta odkazu s nadpisem" - - -class CenterContactPersonBlock(StructBlock): - person = PageChooserBlock(label="Osoba", page_type=["region.RegionPersonPage"]) - position = CharBlock(label="Pozice", required=False) - - -class CenterContactBlock(StructBlock): - title = CharBlock(label="Titulek", required=True) - contact_list = ListBlock(CenterContactPersonBlock()) - - class Meta: - template = "region/blocks/contact_block.html" - icon = "mail" - label = "Kontakt" - - -class ContactItemBlock(StructBlock): - name = CharBlock(label="Role") - person = PageChooserBlock( - label="Osoba", - page_type=["region.RegionPersonPage"], - ) - - class Meta: - icon = "mail" - label = "Kontakt" - - -class ElectionHeaderBlock(StructBlock): - flag_text = CharBlock(label="Text ve 'vlajce'", max_length=32, required=False) - motto = CharBlock(label="Motto (podnadpis)", max_length=128, required=False) - image = ImageChooserBlock(label="Obrázek (kandidátů)", required=False) - background_image = ImageChooserBlock(label="Obrázek na pozadí", required=True) - button_list = ListBlock( - CallToActionButtonBlock(), - label="Call to action tlačítka", - ) - - class Meta: - template = "region/blocks/election_header_block.html" - icon = "mail" - label = "Header pro volební rozcestník" - - -class HomepageHeaderBlock(StructBlock): - title = CharBlock(label="Titulek", required=False, help_text="Nap") - image = ImageChooserBlock() - button_text = CharBlock(label="Text tlačítka", required=False) - button_link = URLBlock(label="Odkaz tlačítka", required=False) - - class Meta: - template = "region/blocks/homepage_header_block.html" - icon = "image" - label = "Nadpis s obrázkem a tlačítky" - - -class HomepageSimpleHeaderBlock(StructBlock): - title = CharBlock(label="Titulek", required=True) - subtitle = CharBlock(label="Podtitulek", required=False) - image = ImageChooserBlock() - - class Meta: - template = "region/blocks/homepage_simple_header_block.html" - icon = "image" - label = "Nadpis s obrázkem v pozadí" - - -class PeopleGroupListBlock(StructBlock): - group_title = CharBlock(label="Titulek", required=True) - person_list = ListBlock( - PageChooserBlock( - label="Osoba", - page_type=["district.DistrictPersonPage", "region.RegionPersonPage"], - ), - label="List osob", - ) - - class Meta: - template = "region/blocks/people_group_block.html" - icon = "list-ul" - label = "Skupina členů" - - -class PersonUrlBlock(StructBlock): - title = CharBlock(label="Název", required=True) - url = URLBlock(label="URL", required=True) - custom_icon = CharBlock( - label="Vlastní ikonka ze styleguide", - required=False, - help_text="Pro vlastní ikonku zadejde název ikonky z https://styleguide.pirati.cz/latest/?p=viewall-atoms-icons (bez tečky), např. 'ico--beer'", - ) - - -class StaticProgramBlock(StructBlock): - headline = CharBlock(label="Titulek bloku", required=True) - perex = TextBlock(label="Krátký text pod nadpisem", required=True) - person = PageChooserBlock(label="Garant", page_type=["region.RegionPersonPage"]) - completion_percentage = IntegerBlock(label="Procento dokončení", required=True) - program_items = ListBlock(ProgramItemBlock(), label="Seznam bodů") - - class Meta: - template = "region/blocks/program_block.html" - icon = "list-ul" - label = "Blok programu" - - -class RedmineProgramBlock(StructBlock): - headline = CharBlock(label="Titulek bloku", required=True) - perex = TextBlock(label="Krátký text pod nadpisem", required=True) - person = PageChooserBlock(label="Garant", page_type=["region.RegionPersonPage"]) - redmine_issue = IntegerBlock(label="Číslo Redmine issue", required=True) - completion_percentage = IntegerBlock( - label="Procento dokončení - bude doplněno automaticky", - required=False, - help_text="Hodnota se automaticky načte s Redmine", - ) - program_items = ListBlock( - ProgramItemBlock(), - label="Seznam bodů - bude doplněno automaticky", - help_text="Hodnota se automaticky načte s Redmine", - required=False, - ) - - class Meta: - template = "region/blocks/program_block.html" - icon = "site" - label = "Blok programu stahovaný z Redmine" diff --git a/region/forms.py b/region/forms.py deleted file mode 100644 index 690cda87f601967b70b8fb52c816902faa5543f4..0000000000000000000000000000000000000000 --- a/region/forms.py +++ /dev/null @@ -1,89 +0,0 @@ -from django import forms -from wagtail.admin.forms import WagtailAdminPageForm -from wagtail.core.models.collections import Collection - -from .tasks import import_jekyll_articles - - -class JekyllImportForm(WagtailAdminPageForm): - do_import = forms.BooleanField( - initial=False, required=False, label="Provést import z Jekyllu" - ) - collection = forms.ModelChoiceField( - queryset=Collection.objects.all(), required=False, label="Kolekce obrázků" - ) - dry_run = forms.BooleanField( - initial=True, - required=False, - label="Jenom na zkoušku", - help_text="Žádné články se neuloží, vypíše případné problémy či " - "již existující články - 'ostrému' importu existující " - "články nevadí, přeskočí je", - ) - use_git = forms.BooleanField( - initial=False, - required=False, - label="Použít Git", - help_text="Umožňuje jednodušší zpracování, ale vyžaduje nainstalovaný Git.", - ) - jekyll_repo_url = forms.URLField( - max_length=512, - required=False, - help_text="V GitHubu tlačítko Code -> a odkaz z Download zip" - "např. 'https://github.com/pirati-web/cb.pirati.cz/archive/refs/heads/gh-pages.zip'," - "pokud máte nainstalovaný Git, zvolte Použít Git a vložte" - "jednoduše URL repozitáře " - "např. 'https://github.com/pirati-web/cb.pirati.cz'", - ) - readonly_log = forms.CharField( - disabled=True, - label="Log z posledního importu", - required=False, - widget=forms.Textarea, - ) - - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - self.fields["readonly_log"].initial = self.instance.last_import_log - - def clean(self): - cleaned_data = super().clean() - - if not cleaned_data.get("do_import"): - return cleaned_data - - if cleaned_data.get("do_import") and not self.instance.id: - self.add_error( - "do_import", "Import proveďte prosím až po vytvoření stránky" - ) - - if not cleaned_data.get("collection"): - self.add_error("collection", "Pro import je toto pole povinné") - if not cleaned_data.get("jekyll_repo_url"): - self.add_error("jekyll_repo_url", "Pro import je toto pole povinné") - - if cleaned_data.get("use_git"): - if cleaned_data.get("jekyll_repo_url", "").endswith(".zip"): - self.add_error( - "jekyll_repo_url", "Vložte odkaz pouze na repozitář, ne na zip" - ) - else: - if not cleaned_data.get("jekyll_repo_url", "").endswith(".zip"): - self.add_error("jekyll_repo_url", "Odkaz nesměřuje na soubor '.zip'") - - return cleaned_data - - def handle_import(self): - import_jekyll_articles.delay( - article_parent_page_id=self.instance.id, - collection_id=self.cleaned_data["collection"].id, - url=self.cleaned_data["jekyll_repo_url"], - dry_run=self.cleaned_data["dry_run"], - use_git=self.cleaned_data["use_git"], - ) - - def save(self, commit=True): - if self.cleaned_data.get("do_import"): - self.handle_import() - - return super().save(commit=commit) diff --git a/region/management/__init__.py b/region/management/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/region/management/commands/__init__.py b/region/management/commands/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/region/management/commands/convert_region_to_district.py b/region/management/commands/convert_region_to_district.py deleted file mode 100644 index 90042a4ae541648a64489fd40f8f89056b87dadb..0000000000000000000000000000000000000000 --- a/region/management/commands/convert_region_to_district.py +++ /dev/null @@ -1,154 +0,0 @@ -from django.core.management.base import BaseCommand -from django.db import transaction -from wagtail.core.models import Page, Site - -from district.models import ( - DistrictArticlePage, - DistrictArticlesPage, - DistrictArticleTag, - DistrictCenterPage, - DistrictContactPage, - DistrictCrossroadPage, - DistrictCustomPage, - DistrictElectionBasePage, - DistrictHomePage, - DistrictPeoplePage, - DistrictPersonPage, - DistrictPersonPageForm, - DistrictPersonTag, - DistrictProgramPage, - DistrictTagsPage, -) -from region.models import ( - RegionArticlePage, - RegionArticlesPage, - RegionArticleTag, - RegionCenterPage, - RegionContactPage, - RegionCrossroadPage, - RegionCustomPage, - RegionElectionBasePage, - RegionHomePage, - RegionPeoplePage, - RegionPersonPage, - RegionPersonPageForm, - RegionPersonTag, - RegionProgramPage, - RegionTagsPage, -) - -""" -Dict that holds related model from district module for region model -""" -migration_map = { - RegionHomePage: DistrictHomePage, - RegionArticleTag: DistrictArticleTag, - RegionArticlePage: DistrictArticlePage, - RegionArticlesPage: DistrictArticlesPage, - RegionContactPage: DistrictContactPage, - RegionTagsPage: DistrictTagsPage, - RegionPersonTag: DistrictPersonTag, - RegionPersonPageForm: DistrictPersonPageForm, - RegionPersonPage: DistrictPersonPage, - RegionPeoplePage: DistrictPeoplePage, - RegionElectionBasePage: DistrictElectionBasePage, - RegionProgramPage: DistrictProgramPage, - RegionCenterPage: DistrictCenterPage, - RegionCrossroadPage: DistrictCrossroadPage, - RegionCustomPage: DistrictCustomPage, -} - - -def get_page_data_dict(data_dict): - """ - Function that clear unnecessary data from page dict - """ - data_dict.pop("id") - data_dict.pop("alias_of_id") - data_dict.pop("content_type_id") - data_dict.pop("depth") - data_dict.pop("expire_at") - data_dict.pop("expired") - data_dict.pop("footperson_coord_id", None) - data_dict.pop("footperson_electman_id", None) - data_dict.pop("footperson_media_id", None) - data_dict.pop("go_live_at") - data_dict.pop("has_unpublished_changes") - data_dict.pop("last_published_at") - data_dict.pop("latest_revision_created_at") - data_dict.pop("live_revision_id") - data_dict.pop("live") - data_dict.pop("locale_id") - data_dict.pop("locked") - data_dict.pop("locked_at") - data_dict.pop("locked_by_id") - data_dict.pop("numchild") - data_dict.pop("path") - data_dict.pop("translation_key") - data_dict.pop("url_path") - data_dict.pop("page_ptr_id") - data_dict.pop("specific", None) - data_dict.pop("specific_class", None) - data_dict.pop("_cached_parent_obj", None) - data_dict.pop("_state") - data_dict.pop("_wagtail_cached_site_root_paths", None) - return data_dict - - -def handle_child_pages(region_root_page, district_root_page): - child_pages = list(region_root_page.get_children()) - while child_pages: - child = child_pages.pop(0) - child_specific = child.specific - page_class = child_specific.__class__ - - if page_class not in migration_map: - continue - - DistrictChildPage = migration_map[page_class] - - tmp_data_dict = child_specific.__dict__.copy() - data_dict = get_page_data_dict(tmp_data_dict) - - district_child_page = DistrictChildPage(**data_dict) - - district_root_page.add_child(instance=district_child_page) - - district_child_page.save() - district_child_page.save_revision().publish() - - if child.get_children(): - handle_child_pages(child, district_child_page) - - -class Command(BaseCommand): - help = """Zmigruje všechny stránky z modulu region do modulu district""" - - def handle(self, *args, **options): - with transaction.atomic(): - for region_hp in RegionHomePage.objects.all(): - - data_dict = region_hp.__dict__.copy() - - data = get_page_data_dict(data_dict) - - district_hp = DistrictHomePage(**data) - district_hp.slug = region_hp.slug - - region_hp.slug = "old_" + region_hp.slug - region_hp.save() - - root = Page.get_first_root_node() - root.add_child(instance=district_hp) - - district_hp.save() - district_hp.save_revision().publish() - - sites = Site.objects.filter(root_page_id=region_hp.id) - for site in sites: - site.root_page = district_hp - site.save() - - handle_child_pages(region_hp, district_hp) - - region_hp.delete() diff --git a/region/migrations/0001_initial.py b/region/migrations/0001_initial.py deleted file mode 100644 index 48c4c34c4435ee270a121c72802e060b78518b61..0000000000000000000000000000000000000000 --- a/region/migrations/0001_initial.py +++ /dev/null @@ -1,484 +0,0 @@ -# Generated by Django 3.2.8 on 2021-11-08 20:43 - -import django.db.models.deletion -import django.utils.timezone -import modelcluster.contrib.taggit -import modelcluster.fields -import wagtail.core.blocks -import wagtail.core.fields -import wagtailmetadata.models -from django.db import migrations, models - -import shared.models - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ("wagtailcore", "0062_comment_models_and_pagesubscription"), - ("wagtailimages", "0023_add_choose_permissions"), - ("shared", "0001_initial"), - ("taggit", "0003_taggeditem_add_unique_index"), - ] - - operations = [ - migrations.CreateModel( - name="RegionArticlePage", - fields=[ - ( - "page_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="wagtailcore.page", - ), - ), - ( - "date", - models.DateField( - default=django.utils.timezone.now, verbose_name="datum" - ), - ), - ("perex", models.TextField(verbose_name="perex")), - ( - "text", - wagtail.core.fields.RichTextField( - blank=True, verbose_name="článek" - ), - ), - ( - "author", - models.CharField( - blank=True, max_length=250, null=True, verbose_name="autor" - ), - ), - ( - "image", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.PROTECT, - to="wagtailimages.image", - verbose_name="obrázek", - ), - ), - ( - "search_image", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="wagtailimages.image", - verbose_name="Search image", - ), - ), - ], - options={ - "verbose_name": "Aktualita", - }, - bases=( - shared.models.SubpageMixin, - wagtailmetadata.models.WagtailImageMetadataMixin, - "wagtailcore.page", - models.Model, - ), - ), - migrations.CreateModel( - name="RegionTagsPage", - fields=[ - ( - "page_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="wagtailcore.page", - ), - ), - ( - "search_image", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="wagtailimages.image", - verbose_name="Search image", - ), - ), - ], - options={ - "verbose_name": "Stránka s tagy", - }, - bases=( - shared.models.SubpageMixin, - wagtailmetadata.models.WagtailImageMetadataMixin, - "wagtailcore.page", - models.Model, - ), - ), - migrations.CreateModel( - name="RegionPersonPage", - fields=[ - ( - "page_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="wagtailcore.page", - ), - ), - ("perex", models.TextField(blank=True, verbose_name="Perex osoby")), - ( - "person", - models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.PROTECT, - to="shared.person", - ), - ), - ( - "search_image", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="wagtailimages.image", - verbose_name="Search image", - ), - ), - ], - options={ - "verbose_name": "Detail osoby", - }, - bases=( - shared.models.SubpageMixin, - wagtailmetadata.models.WagtailImageMetadataMixin, - "wagtailcore.page", - models.Model, - ), - ), - migrations.CreateModel( - name="RegionPeoplePage", - fields=[ - ( - "page_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="wagtailcore.page", - ), - ), - ( - "search_image", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="wagtailimages.image", - verbose_name="Search image", - ), - ), - ], - options={ - "verbose_name": "Lidé", - }, - bases=( - shared.models.SubpageMixin, - wagtailmetadata.models.WagtailImageMetadataMixin, - "wagtailcore.page", - models.Model, - ), - ), - migrations.CreateModel( - name="RegionHomePage", - fields=[ - ( - "page_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="wagtailcore.page", - ), - ), - ( - "content", - wagtail.core.fields.StreamField( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - icon="title", label="nadpis" - ), - ) - ], - blank=True, - verbose_name="obsah stránky", - ), - ), - ( - "facebook", - models.URLField(blank=True, null=True, verbose_name="Facebook URL"), - ), - ( - "forum", - models.URLField(blank=True, null=True, verbose_name="Fórum URL"), - ), - ( - "contact_email", - models.EmailField( - blank=True, max_length=250, verbose_name="kontaktni email" - ), - ), - ( - "contact_phone", - models.TextField( - blank=True, max_length=250, verbose_name="kontaktni telefon" - ), - ), - ( - "contact_newcomers", - models.URLField( - blank=True, null=True, verbose_name="URL pro zájemce o členství" - ), - ), - ( - "donation_page", - models.URLField( - blank=True, null=True, verbose_name="URL pro příjem darů" - ), - ), - ( - "matomo_id", - models.IntegerField( - blank=True, - null=True, - verbose_name="Matomo ID pro sledování návštěvnosti", - ), - ), - ( - "footperson_coord", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.PROTECT, - related_name="region_footperson_coord", - to="shared.person", - verbose_name="Koordinátor", - ), - ), - ( - "footperson_electman", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.PROTECT, - related_name="region_footperson_electman", - to="shared.person", - verbose_name="Volební manažer", - ), - ), - ( - "footperson_media", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.PROTECT, - related_name="region_footperson_media", - to="shared.person", - verbose_name="Kontakt pro média", - ), - ), - ( - "search_image", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="wagtailimages.image", - verbose_name="Search image", - ), - ), - ], - options={ - "verbose_name": "Web regionálního sdružení", - }, - bases=( - wagtailmetadata.models.WagtailImageMetadataMixin, - "wagtailcore.page", - models.Model, - ), - ), - migrations.CreateModel( - name="RegionContactPage", - fields=[ - ( - "page_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="wagtailcore.page", - ), - ), - ( - "contact_people", - wagtail.core.fields.StreamField( - [ - ( - "item", - wagtail.core.blocks.StructBlock( - [ - ( - "name", - wagtail.core.blocks.CharBlock(label="Role"), - ), - ( - "person", - wagtail.core.blocks.PageChooserBlock( - label="Osoba", - page_type=["region.RegionPersonPage"], - ), - ), - ] - ), - ) - ], - blank=True, - verbose_name="Kontakty", - ), - ), - ( - "text", - wagtail.core.fields.RichTextField(blank=True, verbose_name="Text"), - ), - ( - "search_image", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="wagtailimages.image", - verbose_name="Search image", - ), - ), - ], - options={ - "verbose_name": "Kontakty", - }, - bases=( - shared.models.SubpageMixin, - wagtailmetadata.models.WagtailImageMetadataMixin, - "wagtailcore.page", - models.Model, - ), - ), - migrations.CreateModel( - name="RegionArticleTag", - fields=[ - ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ( - "content_object", - modelcluster.fields.ParentalKey( - on_delete=django.db.models.deletion.CASCADE, - to="region.regionarticlepage", - ), - ), - ( - "tag", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="region_regionarticletag_items", - to="taggit.tag", - ), - ), - ], - options={ - "abstract": False, - }, - ), - migrations.CreateModel( - name="RegionArticlesPage", - fields=[ - ( - "page_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="wagtailcore.page", - ), - ), - ( - "max_items", - models.IntegerField( - default=12, verbose_name="Počet článků na stránce" - ), - ), - ( - "search_image", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="wagtailimages.image", - verbose_name="Search image", - ), - ), - ], - options={ - "verbose_name": "Aktuality", - }, - bases=( - shared.models.SubpageMixin, - wagtailmetadata.models.WagtailImageMetadataMixin, - "wagtailcore.page", - models.Model, - ), - ), - migrations.AddField( - model_name="regionarticlepage", - name="tags", - field=modelcluster.contrib.taggit.ClusterTaggableManager( - blank=True, - help_text="A comma-separated list of tags.", - through="region.RegionArticleTag", - to="taggit.Tag", - verbose_name="Tags", - ), - ), - ] diff --git a/region/migrations/0002_regionhomepage_subheader.py b/region/migrations/0002_regionhomepage_subheader.py deleted file mode 100644 index 3b37cf3207c96424a6d2718be522f6fb6a645a1b..0000000000000000000000000000000000000000 --- a/region/migrations/0002_regionhomepage_subheader.py +++ /dev/null @@ -1,52 +0,0 @@ -# Generated by Django 3.2.8 on 2021-11-11 08:48 - -import wagtail.core.blocks -import wagtail.core.fields -import wagtail.images.blocks -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0001_initial"), - ] - - operations = [ - migrations.AddField( - model_name="regionhomepage", - name="subheader", - field=wagtail.core.fields.StreamField( - [ - ( - "header", - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - help_text="Nap", label="Titulek", required=False - ), - ), - ("image", wagtail.images.blocks.ImageChooserBlock()), - ( - "button_text", - wagtail.core.blocks.CharBlock( - label="Titulek", required=False - ), - ), - ( - "button_link", - wagtail.core.blocks.URLBlock( - label="Odkaz tlačítka", required=False - ), - ), - ] - ), - ) - ], - blank=True, - verbose_name="Blok pod headerem", - ), - ), - ] diff --git a/region/migrations/0003_auto_20211112_1255.py b/region/migrations/0003_auto_20211112_1255.py deleted file mode 100644 index b66282d3ad75439554a0f3428e8d09a0ff6cf633..0000000000000000000000000000000000000000 --- a/region/migrations/0003_auto_20211112_1255.py +++ /dev/null @@ -1,56 +0,0 @@ -# Generated by Django 3.2.8 on 2021-11-12 11:55 - -import wagtail.core.blocks -import wagtail.core.fields -import wagtail.images.blocks -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0002_regionhomepage_subheader"), - ] - - operations = [ - migrations.RemoveField( - model_name="regionhomepage", - name="subheader", - ), - migrations.AlterField( - model_name="regionhomepage", - name="content", - field=wagtail.core.fields.StreamField( - [ - ( - "header", - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - help_text="Nap", label="Titulek", required=False - ), - ), - ("image", wagtail.images.blocks.ImageChooserBlock()), - ( - "button_text", - wagtail.core.blocks.CharBlock( - label="Titulek", required=False - ), - ), - ( - "button_link", - wagtail.core.blocks.URLBlock( - label="Odkaz tlačítka", required=False - ), - ), - ] - ), - ) - ], - blank=True, - verbose_name="Blok pod headerem", - ), - ), - ] diff --git a/region/migrations/0004_auto_20211112_1349.py b/region/migrations/0004_auto_20211112_1349.py deleted file mode 100644 index cb72cce0447dfc255d64d927b29c784712bef45a..0000000000000000000000000000000000000000 --- a/region/migrations/0004_auto_20211112_1349.py +++ /dev/null @@ -1,107 +0,0 @@ -# Generated by Django 3.2.8 on 2021-11-12 12:49 - -import django.db.models.deletion -import wagtail.core.blocks -import wagtail.core.fields -import wagtail.images.blocks -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("calendar_utils", "0002_auto_20200523_0243"), - ("region", "0003_auto_20211112_1255"), - ] - - operations = [ - migrations.AddField( - model_name="regionhomepage", - name="articles_title", - field=models.CharField( - default="Aktuální témata", max_length=256, verbose_name="Nadpis článků" - ), - preserve_default=False, - ), - migrations.AddField( - model_name="regionhomepage", - name="calendar", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.PROTECT, - to="calendar_utils.calendar", - ), - ), - migrations.AddField( - model_name="regionhomepage", - name="calendar_button_text", - field=models.CharField( - default="Kalendář", - max_length=256, - verbose_name="Text tlačítka kalendáře", - ), - ), - migrations.AddField( - model_name="regionhomepage", - name="calendar_url", - field=models.URLField( - blank=True, null=True, verbose_name="URL kalendáře ve formátu iCal" - ), - ), - migrations.AddField( - model_name="regionhomepage", - name="region_map_button_text", - field=models.CharField( - default="Piráti v krajích", - max_length=256, - verbose_name="Text tlačítka mapy", - ), - ), - migrations.AddField( - model_name="regionhomepage", - name="twitter", - field=models.URLField(blank=True, null=True, verbose_name="Twitter URL"), - ), - migrations.AddField( - model_name="regionhomepage", - name="youtube", - field=models.URLField(blank=True, null=True, verbose_name="YouTube URL"), - ), - migrations.AlterField( - model_name="regionhomepage", - name="content", - field=wagtail.core.fields.StreamField( - [ - ( - "header", - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - help_text="Nap", label="Titulek", required=False - ), - ), - ("image", wagtail.images.blocks.ImageChooserBlock()), - ( - "button_text", - wagtail.core.blocks.CharBlock( - label="Text tlačítka", required=False - ), - ), - ( - "button_link", - wagtail.core.blocks.URLBlock( - label="Odkaz tlačítka", required=False - ), - ), - ] - ), - ) - ], - blank=True, - verbose_name="Blok pod headerem", - ), - ), - ] diff --git a/region/migrations/0005_auto_20211128_1152.py b/region/migrations/0005_auto_20211128_1152.py deleted file mode 100644 index 0430646a1c500e7aaf37d59cc2dcae66b1e4ce6b..0000000000000000000000000000000000000000 --- a/region/migrations/0005_auto_20211128_1152.py +++ /dev/null @@ -1,880 +0,0 @@ -# Generated by Django 3.2.8 on 2021-11-28 10:52 - -import django.db.models.deletion -import modelcluster.fields -import wagtail.core.blocks -import wagtail.core.fields -import wagtail.images.blocks -import wagtailmetadata.models -from django.db import migrations, models - -import shared.models - - -class Migration(migrations.Migration): - - dependencies = [ - ("calendar_utils", "0002_auto_20200523_0243"), - ("taggit", "0003_taggeditem_add_unique_index"), - ("wagtailimages", "0023_add_choose_permissions"), - ("wagtailcore", "0062_comment_models_and_pagesubscription"), - ("region", "0004_auto_20211112_1349"), - ] - - operations = [ - migrations.RemoveField( - model_name="regionhomepage", - name="content", - ), - migrations.AddField( - model_name="regionarticlepage", - name="author_page", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - to="region.regionpersonpage", - ), - ), - migrations.AddField( - model_name="regionarticlepage", - name="is_black", - field=models.BooleanField(default=False, verbose_name="Má tmavé pozadí?"), - ), - migrations.AddField( - model_name="regionhomepage", - name="election_countdown_datetime", - field=models.DateTimeField( - blank=True, - help_text="Pro skrytí nechte nevyplněné", - null=True, - verbose_name="Datum a čas pro odpočet do voleb", - ), - ), - migrations.AddField( - model_name="regionhomepage", - name="fallback_image", - field=models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.PROTECT, - related_name="+", - to="wagtailimages.image", - ), - ), - migrations.AddField( - model_name="regionhomepage", - name="show_calendar_on_hp", - field=models.BooleanField( - default=True, verbose_name="Zobrazit kalendář dole na homepage" - ), - ), - migrations.AddField( - model_name="regionhomepage", - name="subheader", - field=wagtail.core.fields.StreamField( - [ - ( - "header_simple", - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", required=True - ), - ), - ( - "subtitle", - wagtail.core.blocks.CharBlock( - label="Podtitulek", required=False - ), - ), - ("image", wagtail.images.blocks.ImageChooserBlock()), - ] - ), - ), - ( - "header", - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - help_text="Nap", label="Titulek", required=False - ), - ), - ("image", wagtail.images.blocks.ImageChooserBlock()), - ( - "button_text", - wagtail.core.blocks.CharBlock( - label="Text tlačítka", required=False - ), - ), - ( - "button_link", - wagtail.core.blocks.URLBlock( - label="Odkaz tlačítka", required=False - ), - ), - ] - ), - ), - ], - blank=True, - verbose_name="Blok pod headerem", - ), - ), - migrations.AddField( - model_name="regionpeoplepage", - name="content", - field=wagtail.core.fields.StreamField( - [ - ( - "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=["region.RegionPersonPage"], - ), - label="List osob", - ), - ), - ] - ), - ) - ], - blank=True, - verbose_name="Obsah stránky", - ), - ), - migrations.AddField( - model_name="regionpersonpage", - name="age", - field=models.IntegerField(blank=True, null=True, verbose_name="Věk"), - ), - migrations.AddField( - model_name="regionpersonpage", - name="background_photo", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.PROTECT, - related_name="+", - to="wagtailimages.image", - ), - ), - migrations.AddField( - model_name="regionpersonpage", - name="city", - field=models.CharField( - blank=True, max_length=64, null=True, verbose_name="Město/obec" - ), - ), - migrations.AddField( - model_name="regionpersonpage", - name="email", - field=models.EmailField( - blank=True, max_length=254, null=True, verbose_name="Email" - ), - ), - migrations.AddField( - model_name="regionpersonpage", - name="facebook_url", - field=models.URLField( - blank=True, null=True, verbose_name="Odkaz na Facebook" - ), - ), - migrations.AddField( - model_name="regionpersonpage", - name="flickr_url", - field=models.URLField( - blank=True, null=True, verbose_name="Odkaz na Flickr" - ), - ), - migrations.AddField( - model_name="regionpersonpage", - name="instagram_url", - field=models.URLField( - blank=True, null=True, verbose_name="Odkaz na Instagram" - ), - ), - migrations.AddField( - model_name="regionpersonpage", - name="is_pirate", - field=models.BooleanField( - default=True, verbose_name="Je členem Pirátské strany?" - ), - ), - migrations.AddField( - model_name="regionpersonpage", - name="job", - field=models.CharField( - blank=True, - help_text="Např. 'Informatik'", - max_length=64, - null=True, - verbose_name="Povolání", - ), - ), - migrations.AddField( - model_name="regionpersonpage", - name="job_function", - field=models.CharField( - blank=True, - help_text="Např. 'Předseda'", - max_length=64, - null=True, - verbose_name="Funkce", - ), - ), - migrations.AddField( - model_name="regionpersonpage", - name="phone", - field=models.CharField( - blank=True, max_length=16, null=True, verbose_name="Telefon" - ), - ), - migrations.AddField( - model_name="regionpersonpage", - name="profile_photo", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.PROTECT, - related_name="+", - to="wagtailimages.image", - ), - ), - migrations.AddField( - model_name="regionpersonpage", - name="text", - field=wagtail.core.fields.RichTextField(blank=True, verbose_name="text"), - ), - migrations.AddField( - model_name="regionpersonpage", - name="twitter_url", - field=models.URLField( - blank=True, null=True, verbose_name="Odkaz na Twitter" - ), - ), - migrations.AddField( - model_name="regionpersonpage", - name="youtube_url", - field=models.URLField( - blank=True, null=True, verbose_name="Odkaz na Youtube kanál" - ), - ), - migrations.AlterField( - model_name="regionhomepage", - name="footperson_coord", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.PROTECT, - related_name="+", - to="region.regionpersonpage", - verbose_name="Koordinátor", - ), - ), - migrations.AlterField( - model_name="regionhomepage", - name="footperson_electman", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.PROTECT, - related_name="+", - to="region.regionpersonpage", - verbose_name="Volební manažer", - ), - ), - migrations.AlterField( - model_name="regionhomepage", - name="footperson_media", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.PROTECT, - related_name="+", - to="region.regionpersonpage", - verbose_name="Kontakt pro média", - ), - ), - migrations.CreateModel( - name="RegionProgramPage", - fields=[ - ( - "page_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="wagtailcore.page", - ), - ), - ("perex", models.TextField(blank=True, verbose_name="Perex")), - ( - "content", - wagtail.core.fields.StreamField( - [ - ( - "static_program_block", - wagtail.core.blocks.StructBlock( - [ - ( - "headline", - wagtail.core.blocks.CharBlock( - label="Titulek bloku", required=True - ), - ), - ( - "perex", - wagtail.core.blocks.TextBlock( - label="Krátký text pod nadpisem", - required=True, - ), - ), - ( - "completion_percentage", - wagtail.core.blocks.IntegerBlock( - label="Procento dokončení", - required=True, - ), - ), - ( - "program_items", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Název", - required=True, - ), - ), - ( - "completion_percentage", - wagtail.core.blocks.IntegerBlock( - label="Procento dokončení", - required=True, - ), - ), - ] - ) - ), - ), - ( - "person", - wagtail.core.blocks.PageChooserBlock( - label="Garant", - page_type=["region.RegionPersonPage"], - ), - ), - ] - ), - ), - ( - "redmine_program_block", - wagtail.core.blocks.StructBlock( - [ - ( - "headline", - wagtail.core.blocks.CharBlock( - label="Titulek bloku", required=True - ), - ), - ( - "perex", - wagtail.core.blocks.TextBlock( - label="Krátký text pod nadpisem", - required=True, - ), - ), - ( - "person", - wagtail.core.blocks.PageChooserBlock( - label="Garant", - page_type=["region.RegionPersonPage"], - ), - ), - ( - "redmine_issue", - wagtail.core.blocks.IntegerBlock( - label="Číslo Redmine issue", - required=True, - ), - ), - ] - ), - ), - ], - blank=True, - verbose_name="obsah stránky", - ), - ), - ( - "search_image", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="wagtailimages.image", - verbose_name="Search image", - ), - ), - ], - options={ - "verbose_name": "Program", - }, - bases=( - shared.models.SubpageMixin, - wagtailmetadata.models.WagtailImageMetadataMixin, - "wagtailcore.page", - models.Model, - ), - ), - migrations.CreateModel( - name="RegionPersonTag", - fields=[ - ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ( - "content_object", - modelcluster.fields.ParentalKey( - on_delete=django.db.models.deletion.CASCADE, - to="region.regionpersonpage", - ), - ), - ( - "tag", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="region_regionpersontag_items", - to="taggit.tag", - ), - ), - ], - options={ - "abstract": False, - }, - ), - migrations.CreateModel( - name="RegionElectionPointPage", - fields=[ - ( - "page_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="wagtailcore.page", - ), - ), - ( - "text", - wagtail.core.fields.RichTextField(blank=True, verbose_name="text"), - ), - ( - "perex", - models.TextField( - help_text="Pro přehled volebního programu", verbose_name="Perex" - ), - ), - ( - "guarantor", - models.ForeignKey( - on_delete=django.db.models.deletion.PROTECT, - to="region.regionpersonpage", - ), - ), - ( - "list_image", - models.ForeignKey( - on_delete=django.db.models.deletion.PROTECT, - related_name="+", - to="wagtailimages.image", - ), - ), - ( - "search_image", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="wagtailimages.image", - verbose_name="Search image", - ), - ), - ], - options={ - "verbose_name": "Bod programu voleb", - }, - bases=( - shared.models.SubpageMixin, - wagtailmetadata.models.WagtailImageMetadataMixin, - "wagtailcore.page", - models.Model, - ), - ), - migrations.CreateModel( - name="RegionElectionPage", - fields=[ - ( - "page_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="wagtailcore.page", - ), - ), - ( - "header", - wagtail.core.fields.StreamField( - [ - ( - "election_header_block", - wagtail.core.blocks.StructBlock( - [ - ( - "flag_text", - wagtail.core.blocks.CharBlock( - label="Text ve 'vlajce'", - max_length=32, - required=False, - ), - ), - ( - "motto", - wagtail.core.blocks.CharBlock( - label="Motto (podnadpis)", - max_length=128, - required=False, - ), - ), - ( - "image", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek (kandidátů)", - required=False, - ), - ), - ( - "background_image", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek na pozadí", required=True - ), - ), - ( - "button_list", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "button_link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - max_length=64, - ), - ), - ( - "button_text", - wagtail.core.blocks.CharBlock( - label="Text" - ), - ), - ] - ), - label="Call to action tlačítka", - ), - ), - ] - ), - ) - ], - blank=True, - verbose_name="Obsah headeru", - ), - ), - ( - "content", - wagtail.core.fields.StreamField( - [ - ( - "candidate_list", - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", required=True - ), - ), - ( - "call_to_action_text", - wagtail.core.blocks.CharBlock( - label="Text 'call-to-action' baneru" - ), - ), - ( - "call_to_action_link", - wagtail.core.blocks.URLBlock( - label="Odkaz 'call-to-action' baneru", - required=False, - ), - ), - ( - "call_to_action_button_text", - wagtail.core.blocks.CharBlock( - label="Text tlačítka 'call-to-action' baneru", - max_length=24, - required=False, - ), - ), - ( - "candidate_list", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.PageChooserBlock( - label="Osoba", - page_type=[ - "region.RegionPersonPage" - ], - ), - label="Kandidáti", - ), - ), - ] - ), - ) - ], - blank=True, - verbose_name="Obsah stránky", - ), - ), - ( - "search_image", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="wagtailimages.image", - verbose_name="Search image", - ), - ), - ], - options={ - "verbose_name": "Volební rozcestník", - }, - bases=( - shared.models.SubpageMixin, - wagtailmetadata.models.WagtailImageMetadataMixin, - "wagtailcore.page", - models.Model, - ), - ), - migrations.CreateModel( - name="RegionCenterPage", - fields=[ - ( - "page_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="wagtailcore.page", - ), - ), - ( - "calendar_url", - models.URLField( - blank=True, - null=True, - verbose_name="URL kalendáře ve formátu iCal", - ), - ), - ( - "perex", - models.TextField(blank=True, null=True, verbose_name="Perex"), - ), - ( - "text", - wagtail.core.fields.RichTextField(null=True, verbose_name="Text"), - ), - ( - "sidebar_content", - wagtail.core.fields.StreamField( - [ - ( - "address", - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", required=True - ), - ), - ( - "embed_map", - wagtail.core.blocks.URLBlock( - help_text="Hodnota 'src' v <iframe>", - label="Odkaz na embed mapku", - required=False, - ), - ), - ( - "address", - wagtail.core.blocks.TextBlock( - label="Adresa", required=True - ), - ), - ( - "address_info", - wagtail.core.blocks.TextBlock( - label="Info k adrese", required=False - ), - ), - ] - ), - ), - ( - "contact", - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", required=True - ), - ), - ( - "contact_list", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.PageChooserBlock( - label="Osoba", - page_type=[ - "region.RegionPersonPage" - ], - ), - label="List kontaktů", - ), - ), - ] - ), - ), - ], - blank=True, - verbose_name="Obsah bočního panelu", - ), - ), - ( - "background_photo", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.PROTECT, - related_name="+", - to="wagtailimages.image", - ), - ), - ( - "calendar", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.PROTECT, - to="calendar_utils.calendar", - ), - ), - ( - "search_image", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="wagtailimages.image", - verbose_name="Search image", - ), - ), - ], - options={ - "verbose_name": "Stránka pirátského centra", - }, - bases=( - shared.models.SubpageMixin, - wagtailmetadata.models.WagtailImageMetadataMixin, - "wagtailcore.page", - models.Model, - ), - ), - migrations.CreateModel( - name="RegionAfterElectionPage", - fields=[ - ( - "page_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="wagtailcore.page", - ), - ), - ( - "text", - wagtail.core.fields.RichTextField(blank=True, verbose_name="text"), - ), - ( - "search_image", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="wagtailimages.image", - verbose_name="Search image", - ), - ), - ], - options={ - "verbose_name": "Povolební strategie", - }, - bases=( - shared.models.SubpageMixin, - wagtailmetadata.models.WagtailImageMetadataMixin, - "wagtailcore.page", - models.Model, - ), - ), - ] diff --git a/region/migrations/0006_alter_regioncenterpage_sidebar_content.py b/region/migrations/0006_alter_regioncenterpage_sidebar_content.py deleted file mode 100644 index dc3db76ad857687edbd554fd0f7ad2d9b96af228..0000000000000000000000000000000000000000 --- a/region/migrations/0006_alter_regioncenterpage_sidebar_content.py +++ /dev/null @@ -1,81 +0,0 @@ -# Generated by Django 3.2.8 on 2021-11-28 13:35 - -import wagtail.core.blocks -import wagtail.core.fields -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0005_auto_20211128_1152"), - ] - - operations = [ - migrations.AlterField( - model_name="regioncenterpage", - name="sidebar_content", - field=wagtail.core.fields.StreamField( - [ - ( - "address", - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", required=True - ), - ), - ( - "embed_map", - wagtail.core.blocks.URLBlock( - help_text="Hodnota 'src' v iframe", - label="Odkaz na embed mapku", - required=False, - ), - ), - ( - "address", - wagtail.core.blocks.TextBlock( - label="Adresa", required=True - ), - ), - ( - "address_info", - wagtail.core.blocks.TextBlock( - label="Info k adrese", required=False - ), - ), - ] - ), - ), - ( - "contact", - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", required=True - ), - ), - ( - "contact_list", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.PageChooserBlock( - label="Osoba", - page_type=["region.RegionPersonPage"], - ), - label="List kontaktů", - ), - ), - ] - ), - ), - ], - blank=True, - verbose_name="Obsah bočního panelu", - ), - ), - ] diff --git a/region/migrations/0007_alter_regionelectionpage_content.py b/region/migrations/0007_alter_regionelectionpage_content.py deleted file mode 100644 index 71ff15f40e932da28defa0812fa0722a3dfc464a..0000000000000000000000000000000000000000 --- a/region/migrations/0007_alter_regionelectionpage_content.py +++ /dev/null @@ -1,83 +0,0 @@ -# Generated by Django 3.2.8 on 2021-11-28 16:13 - -import wagtail.core.blocks -import wagtail.core.fields -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0006_alter_regioncenterpage_sidebar_content"), - ] - - operations = [ - migrations.AlterField( - model_name="regionelectionpage", - name="content", - field=wagtail.core.fields.StreamField( - [ - ( - "candidate_list", - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", required=True - ), - ), - ( - "call_to_action_text", - wagtail.core.blocks.CharBlock( - label="Text 'call-to-action' baneru" - ), - ), - ( - "call_to_action_link", - wagtail.core.blocks.URLBlock( - label="Odkaz 'call-to-action' baneru", - required=False, - ), - ), - ( - "call_to_action_button_text", - wagtail.core.blocks.CharBlock( - label="Text tlačítka 'call-to-action' baneru", - max_length=24, - required=False, - ), - ), - ( - "candidate_list_big_count", - wagtail.core.blocks.IntegerBlock( - default=7, - label="Počet kanditátů s velkým náhledem", - ), - ), - ( - "candidate_list_shown_count", - wagtail.core.blocks.IntegerBlock( - default=16, - label="Počet zobrazených kandidátů při načtení stránky (včetně velkých náhledů)", - ), - ), - ( - "candidate_list", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.PageChooserBlock( - label="Osoba", - page_type=["region.RegionPersonPage"], - ), - label="Kandidáti", - ), - ), - ] - ), - ) - ], - blank=True, - verbose_name="Obsah stránky", - ), - ), - ] diff --git a/region/migrations/0008_auto_20220114_1527.py b/region/migrations/0008_auto_20220114_1527.py deleted file mode 100644 index 40661f630e183deeb2df4c41cd3e4a4ccdf8901c..0000000000000000000000000000000000000000 --- a/region/migrations/0008_auto_20220114_1527.py +++ /dev/null @@ -1,43 +0,0 @@ -# Generated by Django 3.2.8 on 2022-01-14 14:27 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("wagtailimages", "0023_add_choose_permissions"), - ("region", "0007_alter_regionelectionpage_content"), - ] - - operations = [ - migrations.RemoveField( - model_name="regionpersonpage", - name="person", - ), - migrations.AlterField( - model_name="regionpersonpage", - name="background_photo", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.PROTECT, - related_name="+", - to="wagtailimages.image", - verbose_name="obrázek do záhlaví", - ), - ), - migrations.AlterField( - model_name="regionpersonpage", - name="profile_photo", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.PROTECT, - related_name="+", - to="wagtailimages.image", - verbose_name="profilová fotka", - ), - ), - ] diff --git a/region/migrations/0009_alter_regionhomepage_options.py b/region/migrations/0009_alter_regionhomepage_options.py deleted file mode 100644 index bb4b4cf06f0bbd0525630d0aab7047d5edb24ce5..0000000000000000000000000000000000000000 --- a/region/migrations/0009_alter_regionhomepage_options.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.2.11 on 2022-01-14 16:41 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0008_auto_20220114_1527"), - ] - - operations = [ - migrations.AlterModelOptions( - name="regionhomepage", - options={"verbose_name": "Krajské sdružení"}, - ), - ] diff --git a/region/migrations/0010_alter_regionhomepage_donation_page.py b/region/migrations/0010_alter_regionhomepage_donation_page.py deleted file mode 100644 index 0ec28773f0d68fb4a7a7a65d7a3f151457107c83..0000000000000000000000000000000000000000 --- a/region/migrations/0010_alter_regionhomepage_donation_page.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.2.11 on 2022-02-20 18:21 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0009_alter_regionhomepage_options"), - ] - - operations = [ - migrations.AlterField( - model_name="regionhomepage", - name="donation_page", - field=models.URLField( - blank=True, - null=True, - verbose_name="URL pro příjem darů (tlačítko Přispěj)", - ), - ), - ] diff --git a/region/migrations/0011_alter_regioncenterpage_sidebar_content.py b/region/migrations/0011_alter_regioncenterpage_sidebar_content.py deleted file mode 100644 index 4a6819d3e5fdc8cba88634acb022865c2e92052e..0000000000000000000000000000000000000000 --- a/region/migrations/0011_alter_regioncenterpage_sidebar_content.py +++ /dev/null @@ -1,86 +0,0 @@ -# Generated by Django 3.2.11 on 2022-02-23 09:50 - -import wagtail.core.blocks -import wagtail.core.fields -import wagtail.images.blocks -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0010_alter_regionhomepage_donation_page"), - ] - - operations = [ - migrations.AlterField( - model_name="regioncenterpage", - name="sidebar_content", - field=wagtail.core.fields.StreamField( - [ - ( - "address", - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", required=True - ), - ), - ( - "map_image", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek mapy", required=False - ), - ), - ( - "map_link", - wagtail.core.blocks.URLBlock( - label="Odkaz na detail mapy", required=False - ), - ), - ( - "address", - wagtail.core.blocks.TextBlock( - label="Adresa", required=True - ), - ), - ( - "address_info", - wagtail.core.blocks.TextBlock( - label="Info k adrese", required=False - ), - ), - ] - ), - ), - ( - "contact", - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", required=True - ), - ), - ( - "contact_list", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.PageChooserBlock( - label="Osoba", - page_type=["region.RegionPersonPage"], - ), - label="List kontaktů", - ), - ), - ] - ), - ), - ], - blank=True, - verbose_name="Obsah bočního panelu", - ), - ), - ] diff --git a/region/migrations/0012_remove_regionpersonpage_perex.py b/region/migrations/0012_remove_regionpersonpage_perex.py deleted file mode 100644 index 0893baf1858f5b26e34eeecca5e0189e98a3df9a..0000000000000000000000000000000000000000 --- a/region/migrations/0012_remove_regionpersonpage_perex.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.2.8 on 2022-03-03 07:35 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0011_alter_regioncenterpage_sidebar_content"), - ] - - operations = [ - migrations.RemoveField( - model_name="regionpersonpage", - name="perex", - ), - ] diff --git a/region/migrations/0013_regionpersonpage_other_urls.py b/region/migrations/0013_regionpersonpage_other_urls.py deleted file mode 100644 index e1ae7abfa8c9511241cbe1ae3e291d3a11822f4f..0000000000000000000000000000000000000000 --- a/region/migrations/0013_regionpersonpage_other_urls.py +++ /dev/null @@ -1,52 +0,0 @@ -# Generated by Django 3.2.11 on 2022-03-03 08:46 - -import wagtail.core.blocks -import wagtail.core.fields -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0012_remove_regionpersonpage_perex"), - ] - - operations = [ - migrations.AddField( - model_name="regionpersonpage", - name="other_urls", - field=wagtail.core.fields.StreamField( - [ - ( - "other_url", - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Název", required=True - ), - ), - ( - "url", - wagtail.core.blocks.URLBlock( - label="URL", required=True - ), - ), - ( - "custom_icon", - wagtail.core.blocks.CharBlock( - help_text="Pro vlastní ikonku zadejde název ikonky z https://styleguide.pirati.cz/latest/?p=viewall-atoms-icons (bez tečky), např. 'ico--beer'", - label="Vlastní ikonka ze styleguide", - required=False, - ), - ), - ] - ), - ) - ], - blank=True, - verbose_name="Další odkaz", - ), - ), - ] diff --git a/region/migrations/0014_regioncrossroadpage_regioncustompage.py b/region/migrations/0014_regioncrossroadpage_regioncustompage.py deleted file mode 100644 index e5fae5491fb8e71ac57921f84f898d6867d1cb12..0000000000000000000000000000000000000000 --- a/region/migrations/0014_regioncrossroadpage_regioncustompage.py +++ /dev/null @@ -1,155 +0,0 @@ -# Generated by Django 3.2.11 on 2022-03-03 11:18 - -import django.db.models.deletion -import wagtail.contrib.table_block.blocks -import wagtail.core.blocks -import wagtail.core.fields -import wagtail.images.blocks -import wagtailmetadata.models -from django.db import migrations, models - -import shared.models - - -class Migration(migrations.Migration): - - dependencies = [ - ("wagtailimages", "0023_add_choose_permissions"), - ("wagtailcore", "0066_collection_management_permissions"), - ("region", "0013_regionpersonpage_other_urls"), - ] - - operations = [ - migrations.CreateModel( - name="RegionCustomPage", - fields=[ - ( - "page_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="wagtailcore.page", - ), - ), - ( - "content", - wagtail.core.fields.StreamField( - [ - ("text", wagtail.core.blocks.RichTextBlock()), - ("table", wagtail.contrib.table_block.blocks.TableBlock()), - ], - blank=True, - verbose_name="Obsah", - ), - ), - ( - "search_image", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="wagtailimages.image", - verbose_name="Search image", - ), - ), - ], - options={ - "verbose_name": "Libovolná vlastní stránka", - }, - bases=( - shared.models.SubpageMixin, - wagtailmetadata.models.WagtailImageMetadataMixin, - "wagtailcore.page", - models.Model, - ), - ), - migrations.CreateModel( - name="RegionCrossroadPage", - fields=[ - ( - "page_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="wagtailcore.page", - ), - ), - ( - "cards_content", - wagtail.core.fields.StreamField( - [ - ( - "cards", - wagtail.core.blocks.StructBlock( - [ - ( - "image", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek" - ), - ), - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", required=True - ), - ), - ( - "page", - wagtail.core.blocks.PageChooserBlock( - label="Stránka", - page_type=[ - "region.RegionAfterElectionPage", - "region.RegionArticlePage", - "region.RegionArticlesPage", - "region.RegionCenterPage", - "region.RegionContactPage", - "region.RegionCrossroadPage", - "region.RegionCustomPage", - "region.RegionElectionPage", - "region.RegionElectionPointPage", - "region.RegionPeoplePage", - "region.RegionPersonPage", - "region.RegionProgramPage", - "region.RegionTagsPage", - ], - ), - ), - ] - ), - ) - ], - blank=True, - verbose_name="Karty rozcestníku", - ), - ), - ( - "search_image", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="wagtailimages.image", - verbose_name="Search image", - ), - ), - ], - options={ - "verbose_name": "Rozcestník s kartami", - }, - bases=( - shared.models.SubpageMixin, - wagtailmetadata.models.WagtailImageMetadataMixin, - "wagtailcore.page", - models.Model, - ), - ), - ] diff --git a/region/migrations/0015_regionhomepage_menu.py b/region/migrations/0015_regionhomepage_menu.py deleted file mode 100644 index 85a6406d856266eb5ac6cc03630a540ad23b2c81..0000000000000000000000000000000000000000 --- a/region/migrations/0015_regionhomepage_menu.py +++ /dev/null @@ -1,90 +0,0 @@ -# Generated by Django 3.2.11 on 2022-03-09 08:24 - -import wagtail.core.blocks -import wagtail.core.fields -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0014_regioncrossroadpage_regioncustompage"), - ] - - operations = [ - migrations.AddField( - model_name="regionhomepage", - name="menu", - field=wagtail.core.fields.StreamField( - [ - ( - "menu_item", - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", required=True - ), - ), - ( - "page", - wagtail.core.blocks.PageChooserBlock( - label="Stránka", required=False - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", required=False - ), - ), - ] - ), - ), - ( - "menu_parent", - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", required=True - ), - ), - ( - "menu_items", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", required=True - ), - ), - ( - "page", - wagtail.core.blocks.PageChooserBlock( - label="Stránka", required=False - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", required=False - ), - ), - ] - ) - ), - ), - ] - ), - ), - ], - blank=True, - verbose_name="Menu", - ), - ), - ] diff --git a/region/migrations/0016_auto_20220309_1109.py b/region/migrations/0016_auto_20220309_1109.py deleted file mode 100644 index 635a6e34c20554c0b797e3af3375ade994ae3ae7..0000000000000000000000000000000000000000 --- a/region/migrations/0016_auto_20220309_1109.py +++ /dev/null @@ -1,42 +0,0 @@ -# Generated by Django 3.2.11 on 2022-03-09 10:09 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0015_regionhomepage_menu"), - ] - - operations = [ - migrations.AddField( - model_name="regionpersonpage", - name="custom_web_url", - field=models.URLField( - blank=True, null=True, verbose_name="Odkaz na vlastní web" - ), - ), - migrations.AlterField( - model_name="regionpersonpage", - name="job", - field=models.CharField( - blank=True, - help_text="Např. 'Informatik'", - max_length=128, - null=True, - verbose_name="Povolání", - ), - ), - migrations.AlterField( - model_name="regionpersonpage", - name="job_function", - field=models.CharField( - blank=True, - help_text="Např. 'Předseda'", - max_length=128, - null=True, - verbose_name="Funkce", - ), - ), - ] diff --git a/region/migrations/0017_auto_20220309_1357.py b/region/migrations/0017_auto_20220309_1357.py deleted file mode 100644 index 6a529c6f1f1c425b5487a84877355a110a470155..0000000000000000000000000000000000000000 --- a/region/migrations/0017_auto_20220309_1357.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 3.2.11 on 2022-03-09 12:57 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0016_auto_20220309_1109"), - ] - - operations = [ - migrations.AddField( - model_name="regionpersonpage", - name="show_email", - field=models.BooleanField( - default=True, verbose_name="Zobrazovat email na stránce?" - ), - ), - migrations.AlterField( - model_name="regionpersonpage", - name="email", - field=models.EmailField(max_length=254, null=True, verbose_name="Email"), - ), - ] diff --git a/region/migrations/0018_alter_regionarticletag_tag_alter_regionpersontag_tag.py b/region/migrations/0018_alter_regionarticletag_tag_alter_regionpersontag_tag.py deleted file mode 100644 index b6bdbae6664487ca7c40b0b5558b031626acfcfe..0000000000000000000000000000000000000000 --- a/region/migrations/0018_alter_regionarticletag_tag_alter_regionpersontag_tag.py +++ /dev/null @@ -1,33 +0,0 @@ -# Generated by Django 4.0.3 on 2022-03-11 22:09 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("taggit", "0004_alter_taggeditem_content_type_alter_taggeditem_tag"), - ("region", "0017_auto_20220309_1357"), - ] - - operations = [ - migrations.AlterField( - model_name="regionarticletag", - name="tag", - field=models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="%(app_label)s_%(class)s_items", - to="taggit.tag", - ), - ), - migrations.AlterField( - model_name="regionpersontag", - name="tag", - field=models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="%(app_label)s_%(class)s_items", - to="taggit.tag", - ), - ), - ] diff --git a/region/migrations/0019_remove_regionarticlepage_text_and_more.py b/region/migrations/0019_remove_regionarticlepage_text_and_more.py deleted file mode 100644 index 60cf751d47817e35abcb04766e35e79d2dc303c5..0000000000000000000000000000000000000000 --- a/region/migrations/0019_remove_regionarticlepage_text_and_more.py +++ /dev/null @@ -1,136 +0,0 @@ -# Generated by Django 3.2.11 on 2022-03-13 15:44 - -# -*- coding: utf-8 -*- -import json - -import wagtail.core.blocks -import wagtail.core.fields -from django.core.serializers.json import DjangoJSONEncoder -from django.db import migrations -from wagtail.core.rich_text import RichText - - -def page_to_streamfield(page): - changed = False - if page.text and not page.content: - page.content = [("text", RichText(page.text))] - changed = True - return page, changed - - -def pagerevision_to_streamfield(revision_data): - changed = False - body = revision_data.get("text") - if body: - try: - json.loads(body) - except ValueError: - revision_data["content"] = json.dumps( - [{"value": body, "type": "text"}], cls=DjangoJSONEncoder - ) - changed = True - else: - # It's already valid JSON. Leave it. - pass - return revision_data, changed - - -def page_to_richtext(page): - changed = False - if page.content.raw_text is None: - raw_text = "".join( - [child.value.source for child in page.content if child.block_type == "text"] - ) - page.text = raw_text - changed = True - return page, changed - - -def pagerevision_to_richtext(revision_data): - changed = False - body = revision_data.get("content", "definitely non-JSON string") - if body: - try: - body_data = json.loads(body) - except ValueError: - # It's not apparently a StreamField. Leave it. - pass - else: - raw_text = "".join( - [child["value"] for child in body_data if child["type"] == "text"] - ) - revision_data["text"] = raw_text - changed = True - return revision_data, changed - - -def convert(apps, schema_editor, page_converter, pagerevision_converter): - RegionArticlePage = apps.get_model("region", "RegionArticlePage") - for page in RegionArticlePage.objects.all(): - - page, changed = page_converter(page) - if changed: - page.save() - - for revision in page.revisions.all(): - revision_data = json.loads(revision.content_json) - revision_data, changed = pagerevision_converter(revision_data) - if changed: - revision.content_json = json.dumps(revision_data, cls=DjangoJSONEncoder) - revision.save() - - -def convert_to_streamfield(apps, schema_editor): - return convert( - apps, schema_editor, page_to_streamfield, pagerevision_to_streamfield - ) - - -def convert_to_richtext(apps, schema_editor): - return convert(apps, schema_editor, page_to_richtext, pagerevision_to_richtext) - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0018_alter_regionarticletag_tag_alter_regionpersontag_tag"), - ] - - operations = [ - migrations.AddField( - model_name="regionarticlepage", - name="content", - field=wagtail.core.fields.StreamField( - [ - ( - "text", - wagtail.core.blocks.RichTextBlock( - features=[ - "h2", - "h3", - "h4", - "bold", - "italic", - "ol", - "ul", - "link", - "document-link", - "image", - ], - label="Textový editor", - ), - ) - ], - blank=True, - verbose_name="Článek", - ), - ), - migrations.RunPython( - convert_to_streamfield, - convert_to_richtext, - ), - migrations.RemoveField( - model_name="regionarticlepage", - name="text", - ), - ] diff --git a/region/migrations/0020_regionhomepage_custom_logo_regionhomepage_flickr_and_more.py b/region/migrations/0020_regionhomepage_custom_logo_regionhomepage_flickr_and_more.py deleted file mode 100644 index 38c3bea3ab72ba3bc76e41cb345ec004e4e51092..0000000000000000000000000000000000000000 --- a/region/migrations/0020_regionhomepage_custom_logo_regionhomepage_flickr_and_more.py +++ /dev/null @@ -1,126 +0,0 @@ -# Generated by Django 4.0.3 on 2022-03-18 14:28 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("wagtailimages", "0023_add_choose_permissions"), - ("region", "0019_remove_regionarticlepage_text_and_more"), - ] - - operations = [ - migrations.AddField( - model_name="regionhomepage", - name="custom_logo", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - to="wagtailimages.image", - ), - ), - migrations.AddField( - model_name="regionhomepage", - name="flickr", - field=models.URLField( - blank=True, - default="https://www.flickr.com/photos/pirati/", - null=True, - verbose_name="Flickr URL", - ), - ), - migrations.AddField( - model_name="regionhomepage", - name="instagram", - field=models.URLField( - blank=True, - default="https://www.instagram.com/pirati.cz/", - null=True, - verbose_name="Instagram URL", - ), - ), - migrations.AddField( - model_name="regionhomepage", - name="show_eshop_link", - field=models.BooleanField( - default=True, verbose_name="Zobrazit v záhlaví odkaz na pirátský eshop" - ), - ), - migrations.AddField( - model_name="regionhomepage", - name="show_magazine_link", - field=models.BooleanField( - default=True, verbose_name="Zobrazit v záhlaví odkaz na pirátské listy" - ), - ), - migrations.AddField( - model_name="regionhomepage", - name="show_pirati_cz_link", - field=models.BooleanField( - default=True, verbose_name="Zobrazit v záhlaví odkaz 'pirati.cz'" - ), - ), - migrations.AlterField( - model_name="regionhomepage", - name="contact_newcomers", - field=models.URLField( - blank=True, - default="https://nalodeni.pirati.cz", - null=True, - verbose_name="URL pro zájemce o členství", - ), - ), - migrations.AlterField( - model_name="regionhomepage", - name="donation_page", - field=models.URLField( - blank=True, - default="https://dary.pirati.cz", - null=True, - verbose_name="URL pro příjem darů (tlačítko Přispěj)", - ), - ), - migrations.AlterField( - model_name="regionhomepage", - name="facebook", - field=models.URLField( - blank=True, - default="https://www.facebook.com/ceska.piratska.strana", - null=True, - verbose_name="Facebook URL", - ), - ), - migrations.AlterField( - model_name="regionhomepage", - name="forum", - field=models.URLField( - blank=True, - default="https://forum.pirati.cz/", - null=True, - verbose_name="Fórum URL", - ), - ), - migrations.AlterField( - model_name="regionhomepage", - name="twitter", - field=models.URLField( - blank=True, - default="https://www.twitter.com/PiratskaStrana", - null=True, - verbose_name="Twitter URL", - ), - ), - migrations.AlterField( - model_name="regionhomepage", - name="youtube", - field=models.URLField( - blank=True, - default="https://www.youtube.com/channel/UC_zxYLGrkmrYazYt0MzyVlA", - null=True, - verbose_name="YouTube URL", - ), - ), - ] diff --git a/region/migrations/0021_regioncenterpage_content.py b/region/migrations/0021_regioncenterpage_content.py deleted file mode 100644 index bc782775fe1248c5a68b1ee215a0835370dc3248..0000000000000000000000000000000000000000 --- a/region/migrations/0021_regioncenterpage_content.py +++ /dev/null @@ -1,28 +0,0 @@ -# Generated by Django 4.0.3 on 2022-03-23 09:23 - -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", "0020_regionhomepage_custom_logo_regionhomepage_flickr_and_more"), - ] - - operations = [ - migrations.AddField( - model_name="regioncenterpage", - name="content", - field=wagtail.core.fields.StreamField( - [ - ("text", wagtail.core.blocks.RichTextBlock()), - ("table", wagtail.contrib.table_block.blocks.TableBlock()), - ], - blank=True, - verbose_name="Obsah", - ), - ), - ] diff --git a/region/migrations/0022_regioncrossroadpage_content_and_more.py b/region/migrations/0022_regioncrossroadpage_content_and_more.py deleted file mode 100644 index c5fcddf36cae493a5eda723d8d9eb195f4e2eb98..0000000000000000000000000000000000000000 --- a/region/migrations/0022_regioncrossroadpage_content_and_more.py +++ /dev/null @@ -1,84 +0,0 @@ -# Generated by Django 4.0.3 on 2022-03-25 09:33 - -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", "0021_regioncenterpage_content"), - ] - - operations = [ - migrations.AddField( - model_name="regioncrossroadpage", - name="content", - field=wagtail.core.fields.StreamField( - [ - ( - "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=["region.RegionPersonPage"], - ), - label="List osob", - ), - ), - ] - ), - ) - ], - blank=True, - verbose_name="Obsah stránky", - ), - ), - migrations.AlterField( - model_name="regioncustompage", - name="content", - field=wagtail.core.fields.StreamField( - [ - ("text", wagtail.core.blocks.RichTextBlock()), - ("table", wagtail.contrib.table_block.blocks.TableBlock()), - ( - "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=["region.RegionPersonPage"], - ), - label="List osob", - ), - ), - ] - ), - ), - ], - blank=True, - verbose_name="Obsah", - ), - ), - ] diff --git a/region/migrations/0023_regionhomepage_footperson_coord_title_and_more.py b/region/migrations/0023_regionhomepage_footperson_coord_title_and_more.py deleted file mode 100644 index 66392b22864733226f17fa2baa8739de7dfd989e..0000000000000000000000000000000000000000 --- a/region/migrations/0023_regionhomepage_footperson_coord_title_and_more.py +++ /dev/null @@ -1,34 +0,0 @@ -# Generated by Django 4.0.3 on 2022-03-25 10:09 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0022_regioncrossroadpage_content_and_more"), - ] - - operations = [ - migrations.AddField( - model_name="regionhomepage", - name="footperson_coord_title", - field=models.CharField( - default="Koordinátor", max_length=128, verbose_name="Název funkce" - ), - ), - migrations.AddField( - model_name="regionhomepage", - name="footperson_electman_title", - field=models.CharField( - default="Volební manažer", max_length=128, verbose_name="Název funkce" - ), - ), - migrations.AddField( - model_name="regionhomepage", - name="footperson_media_title", - field=models.CharField( - default="Kontakt pro média", max_length=128, verbose_name="Název funkce" - ), - ), - ] diff --git a/region/migrations/0024_alter_regioncrossroadpage_cards_content.py b/region/migrations/0024_alter_regioncrossroadpage_cards_content.py deleted file mode 100644 index 2b170f734c9622265a0c5a8e002a49bbd3685623..0000000000000000000000000000000000000000 --- a/region/migrations/0024_alter_regioncrossroadpage_cards_content.py +++ /dev/null @@ -1,89 +0,0 @@ -# Generated by Django 4.0.3 on 2022-04-01 10:21 - -import wagtail.core.blocks -import wagtail.core.fields -import wagtail.images.blocks -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0023_regionhomepage_footperson_coord_title_and_more"), - ] - - operations = [ - migrations.AlterField( - model_name="regioncrossroadpage", - name="cards_content", - field=wagtail.core.fields.StreamField( - [ - ( - "cards", - wagtail.core.blocks.StructBlock( - [ - ( - "headline", - wagtail.core.blocks.CharBlock( - label="Titulek bloku", required=False - ), - ), - ( - "card_items", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "image", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek" - ), - ), - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", required=True - ), - ), - ( - "page", - wagtail.core.blocks.PageChooserBlock( - label="Stránka", - page_type=[ - "region.RegionAfterElectionPage", - "region.RegionArticlePage", - "region.RegionArticlesPage", - "region.RegionCenterPage", - "region.RegionContactPage", - "region.RegionCrossroadPage", - "region.RegionCustomPage", - "region.RegionElectionPage", - "region.RegionElectionPointPage", - "region.RegionPeoplePage", - "region.RegionPersonPage", - "region.RegionProgramPage", - "region.RegionTagsPage", - ], - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", required=False - ), - ), - ] - ), - label="Karty odkazu", - ), - ), - ] - ), - ) - ], - blank=True, - verbose_name="Karty rozcestníku", - ), - ), - ] diff --git a/region/migrations/0024_regionarticlespage_last_import_log.py b/region/migrations/0024_regionarticlespage_last_import_log.py deleted file mode 100644 index bc469fad56bbb57112f84298f61b0704b9df04c8..0000000000000000000000000000000000000000 --- a/region/migrations/0024_regionarticlespage_last_import_log.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 4.0.3 on 2022-04-03 08:03 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0023_regionhomepage_footperson_coord_title_and_more"), - ] - - operations = [ - migrations.AddField( - model_name="regionarticlespage", - name="last_import_log", - field=models.TextField( - blank=True, null=True, verbose_name="Výstup z posledního importu" - ), - ), - ] diff --git a/region/migrations/0025_alter_regioncrossroadpage_content_and_more.py b/region/migrations/0025_alter_regioncrossroadpage_content_and_more.py deleted file mode 100644 index 564ad88606de9eb92259943faacbcdb728af1568..0000000000000000000000000000000000000000 --- a/region/migrations/0025_alter_regioncrossroadpage_content_and_more.py +++ /dev/null @@ -1,126 +0,0 @@ -# Generated by Django 4.0.3 on 2022-04-01 10:48 - -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", "0024_alter_regioncrossroadpage_cards_content"), - ] - - operations = [ - migrations.AlterField( - model_name="regioncrossroadpage", - name="content", - field=wagtail.core.fields.StreamField( - [ - ( - "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 stránky", - ), - ), - migrations.AlterField( - model_name="regioncustompage", - name="content", - field=wagtail.core.fields.StreamField( - [ - ("text", wagtail.core.blocks.RichTextBlock()), - ("table", wagtail.contrib.table_block.blocks.TableBlock()), - ( - "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", - ), - ), - migrations.AlterField( - model_name="regionpeoplepage", - name="content", - field=wagtail.core.fields.StreamField( - [ - ( - "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 stránky", - ), - ), - ] diff --git a/region/migrations/0026_alter_regionarticlepage_content.py b/region/migrations/0026_alter_regionarticlepage_content.py deleted file mode 100644 index 929b04706388f4b0789ef7f519910b16c65128e2..0000000000000000000000000000000000000000 --- a/region/migrations/0026_alter_regionarticlepage_content.py +++ /dev/null @@ -1,64 +0,0 @@ -# Generated by Django 4.0.3 on 2022-04-01 14:55 - -import wagtail.core.blocks -import wagtail.core.fields -import wagtail.images.blocks -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0025_alter_regioncrossroadpage_content_and_more"), - ] - - 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", - ), - ), - ], - blank=True, - verbose_name="Článek", - ), - ), - ] diff --git a/region/migrations/0027_merge_20220404_1539.py b/region/migrations/0027_merge_20220404_1539.py deleted file mode 100644 index c9616294fc154ed0ef04a19cf9d1e9098fc85ea4..0000000000000000000000000000000000000000 --- a/region/migrations/0027_merge_20220404_1539.py +++ /dev/null @@ -1,13 +0,0 @@ -# Generated by Django 4.0.3 on 2022-04-04 13:39 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0024_regionarticlespage_last_import_log"), - ("region", "0026_alter_regionarticlepage_content"), - ] - - operations = [] diff --git a/region/migrations/0028_alter_regioncrossroadpage_cards_content.py b/region/migrations/0028_alter_regioncrossroadpage_cards_content.py deleted file mode 100644 index 231372d3be61434a89bada50d29c803c72a433fa..0000000000000000000000000000000000000000 --- a/region/migrations/0028_alter_regioncrossroadpage_cards_content.py +++ /dev/null @@ -1,96 +0,0 @@ -# Generated by Django 4.0.3 on 2022-04-14 12:31 - -import wagtail.core.blocks -import wagtail.core.fields -import wagtail.images.blocks -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0027_merge_20220404_1539"), - ] - - operations = [ - migrations.AlterField( - model_name="regioncrossroadpage", - name="cards_content", - field=wagtail.core.fields.StreamField( - [ - ( - "cards", - wagtail.core.blocks.StructBlock( - [ - ( - "headline", - wagtail.core.blocks.CharBlock( - label="Titulek bloku", required=False - ), - ), - ( - "card_items", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "image", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek" - ), - ), - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", required=True - ), - ), - ( - "text", - wagtail.core.blocks.RichTextBlock( - label="Krátký text pod nadpisem", - required=False, - ), - ), - ( - "page", - wagtail.core.blocks.PageChooserBlock( - label="Stránka", - page_type=[ - "region.RegionAfterElectionPage", - "region.RegionArticlePage", - "region.RegionArticlesPage", - "region.RegionCenterPage", - "region.RegionContactPage", - "region.RegionCrossroadPage", - "region.RegionCustomPage", - "region.RegionElectionPage", - "region.RegionElectionPointPage", - "region.RegionPeoplePage", - "region.RegionPersonPage", - "region.RegionProgramPage", - "region.RegionTagsPage", - ], - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", required=False - ), - ), - ] - ), - label="Karty odkazu", - ), - ), - ] - ), - ) - ], - blank=True, - verbose_name="Karty rozcestníku", - ), - ), - ] diff --git a/region/migrations/0029_alter_regioncenterpage_content_and_more.py b/region/migrations/0029_alter_regioncenterpage_content_and_more.py deleted file mode 100644 index 49ce1df6612f01b9a8ddbbbeea0442c781f73893..0000000000000000000000000000000000000000 --- a/region/migrations/0029_alter_regioncenterpage_content_and_more.py +++ /dev/null @@ -1,76 +0,0 @@ -# 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/migrations/0030_alter_regionarticlepage_content_and_more.py b/region/migrations/0030_alter_regionarticlepage_content_and_more.py deleted file mode 100644 index eac001256d15b1c4f6b229a40c63cf852e411871..0000000000000000000000000000000000000000 --- a/region/migrations/0030_alter_regionarticlepage_content_and_more.py +++ /dev/null @@ -1,269 +0,0 @@ -# Generated by Django 4.0.3 on 2022-04-21 08:57 - -import wagtail.contrib.table_block.blocks -import wagtail.core.blocks -import wagtail.core.fields -import wagtail.images.blocks -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0029_alter_regioncenterpage_content_and_more"), - ] - - 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( - [ - ( - "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", - ), - ), - migrations.AlterField( - model_name="regioncenterpage", - name="content", - field=wagtail.core.fields.StreamField( - [ - ("text", wagtail.core.blocks.RichTextBlock()), - ("table", wagtail.contrib.table_block.blocks.TableBlock()), - ], - 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()), - ( - "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", - ), - ), - migrations.AlterField( - model_name="regionprogrampage", - name="content", - field=wagtail.core.fields.StreamField( - [ - ( - "static_program_block", - wagtail.core.blocks.StructBlock( - [ - ( - "headline", - wagtail.core.blocks.CharBlock( - label="Titulek bloku", required=True - ), - ), - ( - "perex", - wagtail.core.blocks.TextBlock( - label="Krátký text pod nadpisem", required=True - ), - ), - ( - "person", - wagtail.core.blocks.PageChooserBlock( - label="Garant", - page_type=["region.RegionPersonPage"], - ), - ), - ( - "completion_percentage", - wagtail.core.blocks.IntegerBlock( - label="Procento dokončení", required=True - ), - ), - ( - "program_items", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Název", required=True - ), - ), - ( - "completion_percentage", - wagtail.core.blocks.IntegerBlock( - label="Procento dokončení", - required=True, - ), - ), - ] - ), - label="Seznam bodů", - ), - ), - ] - ), - ), - ( - "redmine_program_block", - wagtail.core.blocks.StructBlock( - [ - ( - "headline", - wagtail.core.blocks.CharBlock( - label="Titulek bloku", required=True - ), - ), - ( - "perex", - wagtail.core.blocks.TextBlock( - label="Krátký text pod nadpisem", required=True - ), - ), - ( - "person", - wagtail.core.blocks.PageChooserBlock( - label="Garant", - page_type=["region.RegionPersonPage"], - ), - ), - ( - "redmine_issue", - wagtail.core.blocks.IntegerBlock( - label="Číslo Redmine issue", required=True - ), - ), - ( - "completion_percentage", - wagtail.core.blocks.IntegerBlock( - help_text="Hodnota se automaticky načte s Redmine", - label="Procento dokončení - bude doplněno automaticky", - required=False, - ), - ), - ( - "program_items", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Název", required=True - ), - ), - ( - "completion_percentage", - wagtail.core.blocks.IntegerBlock( - label="Procento dokončení", - required=True, - ), - ), - ] - ), - help_text="Hodnota se automaticky načte s Redmine", - label="Seznam bodů - bude doplněno automaticky", - required=False, - ), - ), - ] - ), - ), - ], - blank=True, - verbose_name="obsah stránky", - ), - ), - ] diff --git a/region/migrations/0030_alter_regioncenterpage_content_and_more.py b/region/migrations/0030_alter_regioncenterpage_content_and_more.py deleted file mode 100644 index c791d2caa472a9a2ebe677d9d2c08cf6c0b13aec..0000000000000000000000000000000000000000 --- a/region/migrations/0030_alter_regioncenterpage_content_and_more.py +++ /dev/null @@ -1,196 +0,0 @@ -# Generated by Django 4.0.3 on 2022-04-21 08:03 - -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", "0029_alter_regioncenterpage_content_and_more"), - ] - - 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()), - ], - 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()), - ( - "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", - ), - ), - migrations.AlterField( - model_name="regionprogrampage", - name="content", - field=wagtail.core.fields.StreamField( - [ - ( - "static_program_block", - wagtail.core.blocks.StructBlock( - [ - ( - "headline", - wagtail.core.blocks.CharBlock( - label="Titulek bloku", required=True - ), - ), - ( - "perex", - wagtail.core.blocks.TextBlock( - label="Krátký text pod nadpisem", required=True - ), - ), - ( - "person", - wagtail.core.blocks.PageChooserBlock( - label="Garant", - page_type=["region.RegionPersonPage"], - ), - ), - ( - "completion_percentage", - wagtail.core.blocks.IntegerBlock( - label="Procento dokončení", required=True - ), - ), - ( - "program_items", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Název", required=True - ), - ), - ( - "completion_percentage", - wagtail.core.blocks.IntegerBlock( - label="Procento dokončení", - required=True, - ), - ), - ] - ), - label="Seznam bodů", - ), - ), - ] - ), - ), - ( - "redmine_program_block", - wagtail.core.blocks.StructBlock( - [ - ( - "headline", - wagtail.core.blocks.CharBlock( - label="Titulek bloku", required=True - ), - ), - ( - "perex", - wagtail.core.blocks.TextBlock( - label="Krátký text pod nadpisem", required=True - ), - ), - ( - "person", - wagtail.core.blocks.PageChooserBlock( - label="Garant", - page_type=["region.RegionPersonPage"], - ), - ), - ( - "redmine_issue", - wagtail.core.blocks.IntegerBlock( - label="Číslo Redmine issue", required=True - ), - ), - ( - "completion_percentage", - wagtail.core.blocks.IntegerBlock( - help_text="Hodnota se automaticky načte s Redmine", - label="Procento dokončení - bude doplněno automaticky", - required=False, - ), - ), - ( - "program_items", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Název", required=True - ), - ), - ( - "completion_percentage", - wagtail.core.blocks.IntegerBlock( - label="Procento dokončení", - required=True, - ), - ), - ] - ), - help_text="Hodnota se automaticky načte s Redmine", - label="Seznam bodů - bude doplněno automaticky", - required=False, - ), - ), - ] - ), - ), - ], - blank=True, - verbose_name="obsah stránky", - ), - ), - ] diff --git a/region/migrations/0031_alter_regioncenterpage_sidebar_content.py b/region/migrations/0031_alter_regioncenterpage_sidebar_content.py deleted file mode 100644 index 0fe7cbd7c176a811da70f2673b59f9e86c0d48b0..0000000000000000000000000000000000000000 --- a/region/migrations/0031_alter_regioncenterpage_sidebar_content.py +++ /dev/null @@ -1,175 +0,0 @@ -# Generated by Django 4.0.3 on 2022-04-25 09:18 - -import wagtail.core.blocks -import wagtail.core.fields -import wagtail.images.blocks -from django.db import migrations -from wagtail.core.blocks.stream_block import StreamValue - - -def plain_to_structured(block): - modified_items = [] - - for item in block["value"]["contact_list"]: - modified_items.append( - { - **item, - "value": { - "person": item["value"], - "position": "", - }, - } - ) - - block["value"]["contact_list"] = modified_items - - return block - - -def structured_to_plain(block): - modified_items = [] - - for item in block["value"]["contact_list"]: - modified_items.append({**item, "value": item["value"]["person"]}) - - block["value"]["contact_list"] = modified_items - - return block - - -def get_sidebar_content(page, mapper): - stream_data = [] - mapped = False - - for block in page.sidebar_content.raw_data: - if block["type"] == "contact": - stream_data.append(mapper(block)) - mapped = True - - else: - stream_data.append(block) - - return stream_data, mapped - - -def migrate(apps, mapper): - DistrictCenterPage = apps.get_model("region", "RegionCenterPage") - - for page in DistrictCenterPage.objects.all(): - sidebar_content, mapped = get_sidebar_content(page, mapper) - - if mapped: - page.sidebar_content = StreamValue( - page.sidebar_content, sidebar_content, is_lazy=True - ) - page.save() - - -def forwards(apps, schema_editor): - migrate(apps, plain_to_structured) - - -def backwards(apps, schema_editor): - migrate(apps, structured_to_plain) - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0030_alter_regioncenterpage_content_and_more"), - ] - - operations = [ - migrations.AlterField( - model_name="regioncenterpage", - name="sidebar_content", - field=wagtail.core.fields.StreamField( - [ - ( - "address", - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", required=True - ), - ), - ( - "map_image", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek mapy", required=False - ), - ), - ( - "map_link", - wagtail.core.blocks.URLBlock( - label="Odkaz na detail mapy", required=False - ), - ), - ( - "address", - wagtail.core.blocks.TextBlock( - label="Adresa", required=True - ), - ), - ( - "address_info", - wagtail.core.blocks.TextBlock( - label="Info k adrese", required=False - ), - ), - ] - ), - ), - ( - "contact", - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", required=True - ), - ), - ( - "contact_list", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "person", - wagtail.core.blocks.PageChooserBlock( - label="Osoba", - page_type=[ - "region.RegionPersonPage" - ], - ), - ), - ( - "position", - wagtail.core.blocks.CharBlock( - label="Pozice", required=False - ), - ), - ] - ) - ), - ), - ] - ), - ), - ], - blank=True, - verbose_name="Obsah bočního panelu", - ), - ), - migrations.AlterField( - model_name="regioncenterpage", - name="text", - field=wagtail.core.fields.RichTextField( - blank=True, null=True, verbose_name="Text" - ), - ), - migrations.RunPython(forwards, backwards), - ] diff --git a/region/migrations/0031_alter_regionprogrampage_content.py b/region/migrations/0031_alter_regionprogrampage_content.py deleted file mode 100644 index 702e1582b9b14f1b2ed7081de5066014cc4ef326..0000000000000000000000000000000000000000 --- a/region/migrations/0031_alter_regionprogrampage_content.py +++ /dev/null @@ -1,159 +0,0 @@ -# Generated by Django 4.0.3 on 2022-04-21 09:25 - -import wagtail.core.blocks -import wagtail.core.fields -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0030_alter_regionarticlepage_content_and_more"), - ] - - operations = [ - migrations.AlterField( - model_name="regionprogrampage", - name="content", - field=wagtail.core.fields.StreamField( - [ - ( - "static_program_block", - wagtail.core.blocks.StructBlock( - [ - ( - "headline", - wagtail.core.blocks.CharBlock( - label="Titulek bloku", required=True - ), - ), - ( - "perex", - wagtail.core.blocks.TextBlock( - label="Krátký text pod nadpisem", required=True - ), - ), - ( - "person", - wagtail.core.blocks.PageChooserBlock( - label="Garant", - page_type=["region.RegionPersonPage"], - ), - ), - ( - "completion_percentage", - wagtail.core.blocks.IntegerBlock( - label="Procento dokončení", required=True - ), - ), - ( - "program_items", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Název", required=True - ), - ), - ( - "completion_percentage", - wagtail.core.blocks.IntegerBlock( - label="Procento dokončení", - required=True, - ), - ), - ( - "issue_link", - wagtail.core.blocks.URLBlock( - label="Odkaz na Redmine issue", - required=False, - ), - ), - ] - ), - label="Seznam bodů", - ), - ), - ] - ), - ), - ( - "redmine_program_block", - wagtail.core.blocks.StructBlock( - [ - ( - "headline", - wagtail.core.blocks.CharBlock( - label="Titulek bloku", required=True - ), - ), - ( - "perex", - wagtail.core.blocks.TextBlock( - label="Krátký text pod nadpisem", required=True - ), - ), - ( - "person", - wagtail.core.blocks.PageChooserBlock( - label="Garant", - page_type=["region.RegionPersonPage"], - ), - ), - ( - "redmine_issue", - wagtail.core.blocks.IntegerBlock( - label="Číslo Redmine issue", required=True - ), - ), - ( - "completion_percentage", - wagtail.core.blocks.IntegerBlock( - help_text="Hodnota se automaticky načte s Redmine", - label="Procento dokončení - bude doplněno automaticky", - required=False, - ), - ), - ( - "program_items", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Název", required=True - ), - ), - ( - "completion_percentage", - wagtail.core.blocks.IntegerBlock( - label="Procento dokončení", - required=True, - ), - ), - ( - "issue_link", - wagtail.core.blocks.URLBlock( - label="Odkaz na Redmine issue", - required=False, - ), - ), - ] - ), - help_text="Hodnota se automaticky načte s Redmine", - label="Seznam bodů - bude doplněno automaticky", - required=False, - ), - ), - ] - ), - ), - ], - blank=True, - verbose_name="obsah stránky", - ), - ), - ] diff --git a/region/migrations/0032_merge_20220426_1342.py b/region/migrations/0032_merge_20220426_1342.py deleted file mode 100644 index 306f7f291b90e0cb87153736f6c1a7ce807cb083..0000000000000000000000000000000000000000 --- a/region/migrations/0032_merge_20220426_1342.py +++ /dev/null @@ -1,13 +0,0 @@ -# Generated by Django 4.0.3 on 2022-04-26 11:42 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0030_alter_regioncenterpage_content_and_more"), - ("region", "0031_alter_regionprogrampage_content"), - ] - - operations = [] diff --git a/region/migrations/0033_merge_20220426_1409.py b/region/migrations/0033_merge_20220426_1409.py deleted file mode 100644 index 89abb22621dc248145f45b5bc6d8532960a76ff4..0000000000000000000000000000000000000000 --- a/region/migrations/0033_merge_20220426_1409.py +++ /dev/null @@ -1,13 +0,0 @@ -# Generated by Django 4.0.3 on 2022-04-26 12:09 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0031_alter_regioncenterpage_sidebar_content"), - ("region", "0032_merge_20220426_1342"), - ] - - operations = [] diff --git a/region/migrations/0034_alter_regionprogrampage_content.py b/region/migrations/0034_alter_regionprogrampage_content.py deleted file mode 100644 index 4088d593d0bc3538c0f7c55a62f7bd272f0192eb..0000000000000000000000000000000000000000 --- a/region/migrations/0034_alter_regionprogrampage_content.py +++ /dev/null @@ -1,159 +0,0 @@ -# Generated by Django 4.0.3 on 2022-04-26 12:09 - -import wagtail.core.blocks -import wagtail.core.fields -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0033_merge_20220426_1409"), - ] - - operations = [ - migrations.AlterField( - model_name="regionprogrampage", - name="content", - field=wagtail.core.fields.StreamField( - [ - ( - "static_program_block", - wagtail.core.blocks.StructBlock( - [ - ( - "headline", - wagtail.core.blocks.CharBlock( - label="Titulek bloku", required=True - ), - ), - ( - "perex", - wagtail.core.blocks.TextBlock( - label="Krátký text pod nadpisem", required=True - ), - ), - ( - "person", - wagtail.core.blocks.PageChooserBlock( - label="Garant", - page_type=["region.RegionPersonPage"], - ), - ), - ( - "completion_percentage", - wagtail.core.blocks.IntegerBlock( - label="Procento dokončení", required=True - ), - ), - ( - "program_items", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Název", required=True - ), - ), - ( - "completion_percentage", - wagtail.core.blocks.IntegerBlock( - label="Procento dokončení", - required=True, - ), - ), - ( - "issue_link", - wagtail.core.blocks.URLBlock( - label="Odkaz na Redmine issue", - required=False, - ), - ), - ] - ), - label="Seznam bodů", - ), - ), - ] - ), - ), - ( - "redmine_program_block", - wagtail.core.blocks.StructBlock( - [ - ( - "headline", - wagtail.core.blocks.CharBlock( - label="Titulek bloku", required=True - ), - ), - ( - "perex", - wagtail.core.blocks.TextBlock( - label="Krátký text pod nadpisem", required=True - ), - ), - ( - "person", - wagtail.core.blocks.PageChooserBlock( - label="Garant", - page_type=["region.RegionPersonPage"], - ), - ), - ( - "redmine_issue", - wagtail.core.blocks.IntegerBlock( - label="Číslo Redmine issue", required=True - ), - ), - ( - "completion_percentage", - wagtail.core.blocks.IntegerBlock( - help_text="Hodnota se automaticky načte s Redmine", - label="Procento dokončení - bude doplněno automaticky", - required=False, - ), - ), - ( - "program_items", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Název", required=True - ), - ), - ( - "completion_percentage", - wagtail.core.blocks.IntegerBlock( - label="Procento dokončení", - required=True, - ), - ), - ( - "issue_link", - wagtail.core.blocks.URLBlock( - label="Odkaz na Redmine issue", - required=False, - ), - ), - ] - ), - help_text="Hodnota se automaticky načte s Redmine", - label="Seznam bodů - bude doplněno automaticky", - required=False, - ), - ), - ] - ), - ), - ], - blank=True, - verbose_name="obsah stránky", - ), - ), - ] diff --git a/region/migrations/0035_regionhomepage_title_suffix.py b/region/migrations/0035_regionhomepage_title_suffix.py deleted file mode 100644 index 7059c69ff24bf52574355b18b457f608cbc881de..0000000000000000000000000000000000000000 --- a/region/migrations/0035_regionhomepage_title_suffix.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 4.0.3 on 2022-04-27 13:27 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0034_alter_regionprogrampage_content"), - ] - - operations = [ - migrations.AddField( - model_name="regionhomepage", - name="title_suffix", - field=models.CharField( - blank=True, - help_text="Umožňuje přidat příponu k základnímu titulku stránky. Pokud je např. titulek stránky pojmenovaný 'Kontakt' a do přípony vyplníte 'MS Pardubice | Piráti', výsledný titulek bude 'Kontakt | MS Pardubice | Piráti'. Pokud příponu nevyplníte, použije se název webu.", - max_length=100, - null=True, - verbose_name="Přípona titulku stránky", - ), - ), - ] diff --git a/region/migrations/0036_alter_regionarticlepage_content_and_more.py b/region/migrations/0036_alter_regionarticlepage_content_and_more.py deleted file mode 100644 index 2c918df4ef2be4c2e21cc051d12768397463429b..0000000000000000000000000000000000000000 --- a/region/migrations/0036_alter_regionarticlepage_content_and_more.py +++ /dev/null @@ -1,157 +0,0 @@ -# Generated by Django 4.0.3 on 2022-04-28 12:43 - -import wagtail.contrib.table_block.blocks -import wagtail.core.blocks -import wagtail.core.fields -import wagtail.images.blocks -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0035_regionhomepage_title_suffix"), - ] - - 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", - ), - ), - 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", - ), - ), - ] diff --git a/region/migrations/0037_alter_regionarticlepage_content.py b/region/migrations/0037_alter_regionarticlepage_content.py deleted file mode 100644 index 4dcde9ce341bd305d7889e4a288404ed871b671b..0000000000000000000000000000000000000000 --- a/region/migrations/0037_alter_regionarticlepage_content.py +++ /dev/null @@ -1,228 +0,0 @@ -# Generated by Django 4.0.3 on 2022-05-01 10:03 - -import wagtail.core.blocks -import wagtail.core.fields -import wagtail.images.blocks -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0036_alter_regionarticlepage_content_and_more"), - ] - - 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", - ), - ), - ( - "map_point", - wagtail.core.blocks.StructBlock( - [ - ( - "lat", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 50.04075", - label="Zeměpisná šířka", - ), - ), - ( - "lon", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 15.77659", - label="Zeměpisná délka", - ), - ), - ( - "hex_color", - wagtail.core.blocks.CharBlock( - default="000000", - help_text="Zadejte barvu pomocí HEX notace (bez # na začátku).", - label="Barva špendlíku (HEX)", - ), - ), - ( - "zoom", - wagtail.core.blocks.IntegerBlock( - default=15, - label="Výchozí zoom", - max_value=18, - min_value=1, - ), - ), - ( - "style", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ("osm-mapnik", "OSM Mapnik"), - ("stamen-toner", "Stamen Toner"), - ("stamen-terrain", "Stamen Terrain"), - ( - "stadia-osm-bright", - "Stadia OSM Bright (vyžaduje API klíč)", - ), - ( - "stadia-outdoors", - "Stadia Outdoors (vyžaduje API klíč)", - ), - ], - label="Styl", - ), - ), - ( - "height", - wagtail.core.blocks.IntegerBlock( - label="Výška v px", - max_value=1000, - min_value=100, - ), - ), - ], - label="Špendlík na mapě", - ), - ), - ( - "map_collection", - wagtail.core.blocks.StructBlock( - [ - ( - "lat", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 50.04075", - label="Zeměpisná šířka", - ), - ), - ( - "lon", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 15.77659", - label="Zeměpisná délka", - ), - ), - ( - "hex_color", - wagtail.core.blocks.CharBlock( - default="000000", - help_text="Zadejte barvu pomocí HEX notace (bez # na začátku).", - label="Barva špendlíku (HEX)", - ), - ), - ( - "zoom", - wagtail.core.blocks.IntegerBlock( - default=15, - label="Výchozí zoom", - max_value=18, - min_value=1, - ), - ), - ( - "style", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ("osm-mapnik", "OSM Mapnik"), - ("stamen-toner", "Stamen Toner"), - ("stamen-terrain", "Stamen Terrain"), - ( - "stadia-osm-bright", - "Stadia OSM Bright (vyžaduje API klíč)", - ), - ( - "stadia-outdoors", - "Stadia Outdoors (vyžaduje API klíč)", - ), - ], - label="Styl", - ), - ), - ( - "height", - wagtail.core.blocks.IntegerBlock( - label="Výška v px", - max_value=1000, - min_value=100, - ), - ), - ], - label="Mapová kolekce", - ), - ), - ], - blank=True, - verbose_name="Článek", - ), - ), - ] diff --git a/region/migrations/0038_alter_regionarticlepage_content.py b/region/migrations/0038_alter_regionarticlepage_content.py deleted file mode 100644 index cdfd526467ea8c4306ae3c29c05034b27a98dccb..0000000000000000000000000000000000000000 --- a/region/migrations/0038_alter_regionarticlepage_content.py +++ /dev/null @@ -1,4688 +0,0 @@ -# Generated by Django 4.0.3 on 2022-05-06 08:44 - -import wagtail.contrib.table_block.blocks -import wagtail.core.blocks -import wagtail.core.fields -import wagtail.images.blocks -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0037_alter_regionarticlepage_content"), - ] - - operations = [ - migrations.AlterField( - model_name="regionarticlepage", - name="content", - field=wagtail.core.fields.StreamField( - [ - ( - "text", - wagtail.core.blocks.RichTextBlock( - features=[ - "h2", - "h3", - "h4", - "h5", - "bold", - "italic", - "ol", - "ul", - "hr", - "link", - "document-link", - "image", - "superscript", - "subscript", - "strikethrough", - "blockquote", - ], - label="Textový editor", - ), - ), - ( - "table", - wagtail.contrib.table_block.blocks.TableBlock( - template="shared/blocks/table_block.html" - ), - ), - ( - "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", - ), - ), - ( - "figure", - wagtail.core.blocks.StructBlock( - [ - ( - "img", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", required=True - ), - ), - ( - "caption", - wagtail.core.blocks.TextBlock( - label="Popisek", required=False - ), - ), - ] - ), - ), - ( - "card", - wagtail.core.blocks.StructBlock( - [ - ( - "img", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", required=False - ), - ), - ( - "elevation", - wagtail.core.blocks.IntegerBlock( - default=2, - help_text="0 = žádný stín, 21 = maximální stín", - label="Velikost stínu", - max_value=21, - min_value=0, - ), - ), - ( - "headline", - wagtail.core.blocks.TextBlock( - label="Titulek", required=False - ), - ), - ( - "hoveractive", - wagtail.core.blocks.BooleanBlock( - default=False, - help_text="Pokud je zapnuto, stín se zvýrazní, když na kartu uživatel najede myší.", - label="Zvýraznit stín na hover", - required=False, - ), - ), - ( - "content", - wagtail.core.blocks.StreamBlock( - [ - ( - "text", - wagtail.core.blocks.RichTextBlock( - features=[ - "h2", - "h3", - "h4", - "h5", - "bold", - "italic", - "ol", - "ul", - "hr", - "link", - "document-link", - "image", - "superscript", - "subscript", - "strikethrough", - "blockquote", - ], - label="Textový editor", - ), - ), - ( - "table", - wagtail.contrib.table_block.blocks.TableBlock( - template="shared/blocks/table_block.html" - ), - ), - ( - "figure", - wagtail.core.blocks.StructBlock( - [ - ( - "img", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=True, - ), - ), - ( - "caption", - wagtail.core.blocks.TextBlock( - label="Popisek", - required=False, - ), - ), - ] - ), - ), - ( - "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, - ), - ), - ] - ), - ), - ( - "map_point", - wagtail.core.blocks.StructBlock( - [ - ( - "lat", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 50.04075", - label="Zeměpisná šířka", - ), - ), - ( - "lon", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 15.77659", - label="Zeměpisná délka", - ), - ), - ( - "hex_color", - wagtail.core.blocks.CharBlock( - default="000000", - help_text="Zadejte barvu pomocí HEX notace (bez # na začátku).", - label="Barva špendlíku (HEX)", - ), - ), - ( - "zoom", - wagtail.core.blocks.IntegerBlock( - default=15, - label="Výchozí zoom", - max_value=18, - min_value=1, - ), - ), - ( - "style", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "osm-mapnik", - "OSM Mapnik", - ) - ], - label="Styl", - ), - ), - ( - "height", - wagtail.core.blocks.IntegerBlock( - label="Výška v px", - max_value=1000, - min_value=100, - ), - ), - ], - label="Špendlík na mapě", - ), - ), - ( - "map_collection", - wagtail.core.blocks.StructBlock( - [ - ( - "features", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", - required=True, - ), - ), - ( - "description", - wagtail.core.blocks.TextBlock( - label="Popisek", - required=False, - ), - ), - ( - "geojson", - wagtail.core.blocks.TextBlock( - help_text="Vložte surový GeoJSON objekt typu 'Feature'. Vyrobit jej můžete např. pomocí online služby geojson.io.", - label="Geodata", - required=True, - ), - ), - ( - "image", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ( - "hex_color", - wagtail.core.blocks.CharBlock( - default="000000", - help_text="Zadejte barvu pomocí HEX notace (bez # na začátku).", - label="Barva (HEX)", - ), - ), - ], - required=True, - ), - label="Součásti", - ), - ), - ( - "zoom", - wagtail.core.blocks.IntegerBlock( - default=15, - label="Výchozí zoom", - max_value=18, - min_value=1, - ), - ), - ( - "style", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "osm-mapnik", - "OSM Mapnik", - ) - ], - label="Styl", - ), - ), - ( - "height", - wagtail.core.blocks.IntegerBlock( - label="Výška v px", - max_value=1000, - min_value=100, - ), - ), - ], - label="Mapová kolekce", - ), - ), - ], - label="Obsah", - required=False, - ), - ), - ( - "page", - wagtail.core.blocks.PageChooserBlock( - label="Stránka", required=False - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", required=False - ), - ), - ] - ), - ), - ( - "two_columns", - wagtail.core.blocks.StructBlock( - [ - ( - "left_column_content", - wagtail.core.blocks.StreamBlock( - [ - ( - "text", - wagtail.core.blocks.RichTextBlock( - features=[ - "h2", - "h3", - "h4", - "h5", - "bold", - "italic", - "ol", - "ul", - "hr", - "link", - "document-link", - "image", - "superscript", - "subscript", - "strikethrough", - "blockquote", - ], - label="Textový editor", - ), - ), - ( - "table", - wagtail.contrib.table_block.blocks.TableBlock( - template="shared/blocks/table_block.html" - ), - ), - ( - "card", - wagtail.core.blocks.StructBlock( - [ - ( - "img", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=False, - ), - ), - ( - "elevation", - wagtail.core.blocks.IntegerBlock( - default=2, - help_text="0 = žádný stín, 21 = maximální stín", - label="Velikost stínu", - max_value=21, - min_value=0, - ), - ), - ( - "headline", - wagtail.core.blocks.TextBlock( - label="Titulek", - required=False, - ), - ), - ( - "hoveractive", - wagtail.core.blocks.BooleanBlock( - default=False, - help_text="Pokud je zapnuto, stín se zvýrazní, když na kartu uživatel najede myší.", - label="Zvýraznit stín na hover", - required=False, - ), - ), - ( - "content", - wagtail.core.blocks.StreamBlock( - [ - ( - "text", - wagtail.core.blocks.RichTextBlock( - features=[ - "h2", - "h3", - "h4", - "h5", - "bold", - "italic", - "ol", - "ul", - "hr", - "link", - "document-link", - "image", - "superscript", - "subscript", - "strikethrough", - "blockquote", - ], - label="Textový editor", - ), - ), - ( - "table", - wagtail.contrib.table_block.blocks.TableBlock( - template="shared/blocks/table_block.html" - ), - ), - ( - "figure", - wagtail.core.blocks.StructBlock( - [ - ( - "img", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=True, - ), - ), - ( - "caption", - wagtail.core.blocks.TextBlock( - label="Popisek", - required=False, - ), - ), - ] - ), - ), - ( - "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, - ), - ), - ] - ), - ), - ( - "map_point", - wagtail.core.blocks.StructBlock( - [ - ( - "lat", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 50.04075", - label="Zeměpisná šířka", - ), - ), - ( - "lon", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 15.77659", - label="Zeměpisná délka", - ), - ), - ( - "hex_color", - wagtail.core.blocks.CharBlock( - default="000000", - help_text="Zadejte barvu pomocí HEX notace (bez # na začátku).", - label="Barva špendlíku (HEX)", - ), - ), - ( - "zoom", - wagtail.core.blocks.IntegerBlock( - default=15, - label="Výchozí zoom", - max_value=18, - min_value=1, - ), - ), - ( - "style", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "osm-mapnik", - "OSM Mapnik", - ) - ], - label="Styl", - ), - ), - ( - "height", - wagtail.core.blocks.IntegerBlock( - label="Výška v px", - max_value=1000, - min_value=100, - ), - ), - ], - label="Špendlík na mapě", - ), - ), - ( - "map_collection", - wagtail.core.blocks.StructBlock( - [ - ( - "features", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", - required=True, - ), - ), - ( - "description", - wagtail.core.blocks.TextBlock( - label="Popisek", - required=False, - ), - ), - ( - "geojson", - wagtail.core.blocks.TextBlock( - help_text="Vložte surový GeoJSON objekt typu 'Feature'. Vyrobit jej můžete např. pomocí online služby geojson.io.", - label="Geodata", - required=True, - ), - ), - ( - "image", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ( - "hex_color", - wagtail.core.blocks.CharBlock( - default="000000", - help_text="Zadejte barvu pomocí HEX notace (bez # na začátku).", - label="Barva (HEX)", - ), - ), - ], - required=True, - ), - label="Součásti", - ), - ), - ( - "zoom", - wagtail.core.blocks.IntegerBlock( - default=15, - label="Výchozí zoom", - max_value=18, - min_value=1, - ), - ), - ( - "style", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "osm-mapnik", - "OSM Mapnik", - ) - ], - label="Styl", - ), - ), - ( - "height", - wagtail.core.blocks.IntegerBlock( - label="Výška v px", - max_value=1000, - min_value=100, - ), - ), - ], - label="Mapová kolekce", - ), - ), - ], - label="Obsah", - required=False, - ), - ), - ( - "page", - wagtail.core.blocks.PageChooserBlock( - label="Stránka", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ] - ), - ), - ( - "figure", - wagtail.core.blocks.StructBlock( - [ - ( - "img", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=True, - ), - ), - ( - "caption", - wagtail.core.blocks.TextBlock( - label="Popisek", - required=False, - ), - ), - ] - ), - ), - ( - "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, - ), - ), - ] - ), - ), - ( - "map_point", - wagtail.core.blocks.StructBlock( - [ - ( - "lat", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 50.04075", - label="Zeměpisná šířka", - ), - ), - ( - "lon", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 15.77659", - label="Zeměpisná délka", - ), - ), - ( - "hex_color", - wagtail.core.blocks.CharBlock( - default="000000", - help_text="Zadejte barvu pomocí HEX notace (bez # na začátku).", - label="Barva špendlíku (HEX)", - ), - ), - ( - "zoom", - wagtail.core.blocks.IntegerBlock( - default=15, - label="Výchozí zoom", - max_value=18, - min_value=1, - ), - ), - ( - "style", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "osm-mapnik", - "OSM Mapnik", - ) - ], - label="Styl", - ), - ), - ( - "height", - wagtail.core.blocks.IntegerBlock( - label="Výška v px", - max_value=1000, - min_value=100, - ), - ), - ], - label="Špendlík na mapě", - ), - ), - ( - "map_collection", - wagtail.core.blocks.StructBlock( - [ - ( - "features", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", - required=True, - ), - ), - ( - "description", - wagtail.core.blocks.TextBlock( - label="Popisek", - required=False, - ), - ), - ( - "geojson", - wagtail.core.blocks.TextBlock( - help_text="Vložte surový GeoJSON objekt typu 'Feature'. Vyrobit jej můžete např. pomocí online služby geojson.io.", - label="Geodata", - required=True, - ), - ), - ( - "image", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ( - "hex_color", - wagtail.core.blocks.CharBlock( - default="000000", - help_text="Zadejte barvu pomocí HEX notace (bez # na začátku).", - label="Barva (HEX)", - ), - ), - ], - required=True, - ), - label="Součásti", - ), - ), - ( - "zoom", - wagtail.core.blocks.IntegerBlock( - default=15, - label="Výchozí zoom", - max_value=18, - min_value=1, - ), - ), - ( - "style", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "osm-mapnik", - "OSM Mapnik", - ) - ], - label="Styl", - ), - ), - ( - "height", - wagtail.core.blocks.IntegerBlock( - label="Výška v px", - max_value=1000, - min_value=100, - ), - ), - ], - label="Mapová kolekce", - ), - ), - ( - "button", - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", - max_length=128, - required=True, - ), - ), - ( - "icon", - wagtail.core.blocks.CharBlock( - help_text="Identifikátor ikonky ze styleguide (https://styleguide.pirati.cz/latest/?p=viewall-atoms-icons), např. ico--key.", - label="Ikonka", - max_length=128, - required=False, - ), - ), - ( - "size", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ("sm", "Malá"), - ("base", "Střední"), - ("lg", "Velká"), - ], - label="Velikost", - ), - ), - ( - "color", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ("black", "Černá"), - ("white", "Bílá"), - ( - "grey-125", - "Světle šedá", - ), - ( - "blue-300", - "Modrá", - ), - ( - "cyan-200", - "Tyrkysová", - ), - ( - "green-400", - "Zelené", - ), - ( - "violet-400", - "Vínová", - ), - ( - "red-600", - "Červená", - ), - ], - label="Barva", - ), - ), - ( - "hoveractive", - wagtail.core.blocks.BooleanBlock( - default=True, - help_text="Pokud je zapnuto, tlačítko mění barvu, když na něj uživatel najede myší.", - label="Animovat na hover", - required=False, - ), - ), - ( - "page", - wagtail.core.blocks.PageChooserBlock( - label="Stránka", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ] - ), - ), - ( - "button_group", - wagtail.core.blocks.StructBlock( - [ - ( - "buttons", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", - max_length=128, - required=True, - ), - ), - ( - "icon", - wagtail.core.blocks.CharBlock( - help_text="Identifikátor ikonky ze styleguide (https://styleguide.pirati.cz/latest/?p=viewall-atoms-icons), např. ico--key.", - label="Ikonka", - max_length=128, - required=False, - ), - ), - ( - "size", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "sm", - "Malá", - ), - ( - "base", - "Střední", - ), - ( - "lg", - "Velká", - ), - ], - label="Velikost", - ), - ), - ( - "color", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "black", - "Černá", - ), - ( - "white", - "Bílá", - ), - ( - "grey-125", - "Světle šedá", - ), - ( - "blue-300", - "Modrá", - ), - ( - "cyan-200", - "Tyrkysová", - ), - ( - "green-400", - "Zelené", - ), - ( - "violet-400", - "Vínová", - ), - ( - "red-600", - "Červená", - ), - ], - label="Barva", - ), - ), - ( - "hoveractive", - wagtail.core.blocks.BooleanBlock( - default=True, - help_text="Pokud je zapnuto, tlačítko mění barvu, když na něj uživatel najede myší.", - label="Animovat na hover", - required=False, - ), - ), - ( - "page", - wagtail.core.blocks.PageChooserBlock( - label="Stránka", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ] - ), - label="Tlačítka", - ), - ) - ] - ), - ), - ], - label="Obsah levého sloupce", - required=True, - ), - ), - ( - "right_column_content", - wagtail.core.blocks.StreamBlock( - [ - ( - "text", - wagtail.core.blocks.RichTextBlock( - features=[ - "h2", - "h3", - "h4", - "h5", - "bold", - "italic", - "ol", - "ul", - "hr", - "link", - "document-link", - "image", - "superscript", - "subscript", - "strikethrough", - "blockquote", - ], - label="Textový editor", - ), - ), - ( - "table", - wagtail.contrib.table_block.blocks.TableBlock( - template="shared/blocks/table_block.html" - ), - ), - ( - "card", - wagtail.core.blocks.StructBlock( - [ - ( - "img", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=False, - ), - ), - ( - "elevation", - wagtail.core.blocks.IntegerBlock( - default=2, - help_text="0 = žádný stín, 21 = maximální stín", - label="Velikost stínu", - max_value=21, - min_value=0, - ), - ), - ( - "headline", - wagtail.core.blocks.TextBlock( - label="Titulek", - required=False, - ), - ), - ( - "hoveractive", - wagtail.core.blocks.BooleanBlock( - default=False, - help_text="Pokud je zapnuto, stín se zvýrazní, když na kartu uživatel najede myší.", - label="Zvýraznit stín na hover", - required=False, - ), - ), - ( - "content", - wagtail.core.blocks.StreamBlock( - [ - ( - "text", - wagtail.core.blocks.RichTextBlock( - features=[ - "h2", - "h3", - "h4", - "h5", - "bold", - "italic", - "ol", - "ul", - "hr", - "link", - "document-link", - "image", - "superscript", - "subscript", - "strikethrough", - "blockquote", - ], - label="Textový editor", - ), - ), - ( - "table", - wagtail.contrib.table_block.blocks.TableBlock( - template="shared/blocks/table_block.html" - ), - ), - ( - "figure", - wagtail.core.blocks.StructBlock( - [ - ( - "img", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=True, - ), - ), - ( - "caption", - wagtail.core.blocks.TextBlock( - label="Popisek", - required=False, - ), - ), - ] - ), - ), - ( - "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, - ), - ), - ] - ), - ), - ( - "map_point", - wagtail.core.blocks.StructBlock( - [ - ( - "lat", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 50.04075", - label="Zeměpisná šířka", - ), - ), - ( - "lon", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 15.77659", - label="Zeměpisná délka", - ), - ), - ( - "hex_color", - wagtail.core.blocks.CharBlock( - default="000000", - help_text="Zadejte barvu pomocí HEX notace (bez # na začátku).", - label="Barva špendlíku (HEX)", - ), - ), - ( - "zoom", - wagtail.core.blocks.IntegerBlock( - default=15, - label="Výchozí zoom", - max_value=18, - min_value=1, - ), - ), - ( - "style", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "osm-mapnik", - "OSM Mapnik", - ) - ], - label="Styl", - ), - ), - ( - "height", - wagtail.core.blocks.IntegerBlock( - label="Výška v px", - max_value=1000, - min_value=100, - ), - ), - ], - label="Špendlík na mapě", - ), - ), - ( - "map_collection", - wagtail.core.blocks.StructBlock( - [ - ( - "features", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", - required=True, - ), - ), - ( - "description", - wagtail.core.blocks.TextBlock( - label="Popisek", - required=False, - ), - ), - ( - "geojson", - wagtail.core.blocks.TextBlock( - help_text="Vložte surový GeoJSON objekt typu 'Feature'. Vyrobit jej můžete např. pomocí online služby geojson.io.", - label="Geodata", - required=True, - ), - ), - ( - "image", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ( - "hex_color", - wagtail.core.blocks.CharBlock( - default="000000", - help_text="Zadejte barvu pomocí HEX notace (bez # na začátku).", - label="Barva (HEX)", - ), - ), - ], - required=True, - ), - label="Součásti", - ), - ), - ( - "zoom", - wagtail.core.blocks.IntegerBlock( - default=15, - label="Výchozí zoom", - max_value=18, - min_value=1, - ), - ), - ( - "style", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "osm-mapnik", - "OSM Mapnik", - ) - ], - label="Styl", - ), - ), - ( - "height", - wagtail.core.blocks.IntegerBlock( - label="Výška v px", - max_value=1000, - min_value=100, - ), - ), - ], - label="Mapová kolekce", - ), - ), - ], - label="Obsah", - required=False, - ), - ), - ( - "page", - wagtail.core.blocks.PageChooserBlock( - label="Stránka", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ] - ), - ), - ( - "figure", - wagtail.core.blocks.StructBlock( - [ - ( - "img", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=True, - ), - ), - ( - "caption", - wagtail.core.blocks.TextBlock( - label="Popisek", - required=False, - ), - ), - ] - ), - ), - ( - "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, - ), - ), - ] - ), - ), - ( - "map_point", - wagtail.core.blocks.StructBlock( - [ - ( - "lat", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 50.04075", - label="Zeměpisná šířka", - ), - ), - ( - "lon", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 15.77659", - label="Zeměpisná délka", - ), - ), - ( - "hex_color", - wagtail.core.blocks.CharBlock( - default="000000", - help_text="Zadejte barvu pomocí HEX notace (bez # na začátku).", - label="Barva špendlíku (HEX)", - ), - ), - ( - "zoom", - wagtail.core.blocks.IntegerBlock( - default=15, - label="Výchozí zoom", - max_value=18, - min_value=1, - ), - ), - ( - "style", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "osm-mapnik", - "OSM Mapnik", - ) - ], - label="Styl", - ), - ), - ( - "height", - wagtail.core.blocks.IntegerBlock( - label="Výška v px", - max_value=1000, - min_value=100, - ), - ), - ], - label="Špendlík na mapě", - ), - ), - ( - "map_collection", - wagtail.core.blocks.StructBlock( - [ - ( - "features", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", - required=True, - ), - ), - ( - "description", - wagtail.core.blocks.TextBlock( - label="Popisek", - required=False, - ), - ), - ( - "geojson", - wagtail.core.blocks.TextBlock( - help_text="Vložte surový GeoJSON objekt typu 'Feature'. Vyrobit jej můžete např. pomocí online služby geojson.io.", - label="Geodata", - required=True, - ), - ), - ( - "image", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ( - "hex_color", - wagtail.core.blocks.CharBlock( - default="000000", - help_text="Zadejte barvu pomocí HEX notace (bez # na začátku).", - label="Barva (HEX)", - ), - ), - ], - required=True, - ), - label="Součásti", - ), - ), - ( - "zoom", - wagtail.core.blocks.IntegerBlock( - default=15, - label="Výchozí zoom", - max_value=18, - min_value=1, - ), - ), - ( - "style", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "osm-mapnik", - "OSM Mapnik", - ) - ], - label="Styl", - ), - ), - ( - "height", - wagtail.core.blocks.IntegerBlock( - label="Výška v px", - max_value=1000, - min_value=100, - ), - ), - ], - label="Mapová kolekce", - ), - ), - ( - "button", - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", - max_length=128, - required=True, - ), - ), - ( - "icon", - wagtail.core.blocks.CharBlock( - help_text="Identifikátor ikonky ze styleguide (https://styleguide.pirati.cz/latest/?p=viewall-atoms-icons), např. ico--key.", - label="Ikonka", - max_length=128, - required=False, - ), - ), - ( - "size", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ("sm", "Malá"), - ("base", "Střední"), - ("lg", "Velká"), - ], - label="Velikost", - ), - ), - ( - "color", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ("black", "Černá"), - ("white", "Bílá"), - ( - "grey-125", - "Světle šedá", - ), - ( - "blue-300", - "Modrá", - ), - ( - "cyan-200", - "Tyrkysová", - ), - ( - "green-400", - "Zelené", - ), - ( - "violet-400", - "Vínová", - ), - ( - "red-600", - "Červená", - ), - ], - label="Barva", - ), - ), - ( - "hoveractive", - wagtail.core.blocks.BooleanBlock( - default=True, - help_text="Pokud je zapnuto, tlačítko mění barvu, když na něj uživatel najede myší.", - label="Animovat na hover", - required=False, - ), - ), - ( - "page", - wagtail.core.blocks.PageChooserBlock( - label="Stránka", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ] - ), - ), - ( - "button_group", - wagtail.core.blocks.StructBlock( - [ - ( - "buttons", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", - max_length=128, - required=True, - ), - ), - ( - "icon", - wagtail.core.blocks.CharBlock( - help_text="Identifikátor ikonky ze styleguide (https://styleguide.pirati.cz/latest/?p=viewall-atoms-icons), např. ico--key.", - label="Ikonka", - max_length=128, - required=False, - ), - ), - ( - "size", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "sm", - "Malá", - ), - ( - "base", - "Střední", - ), - ( - "lg", - "Velká", - ), - ], - label="Velikost", - ), - ), - ( - "color", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "black", - "Černá", - ), - ( - "white", - "Bílá", - ), - ( - "grey-125", - "Světle šedá", - ), - ( - "blue-300", - "Modrá", - ), - ( - "cyan-200", - "Tyrkysová", - ), - ( - "green-400", - "Zelené", - ), - ( - "violet-400", - "Vínová", - ), - ( - "red-600", - "Červená", - ), - ], - label="Barva", - ), - ), - ( - "hoveractive", - wagtail.core.blocks.BooleanBlock( - default=True, - help_text="Pokud je zapnuto, tlačítko mění barvu, když na něj uživatel najede myší.", - label="Animovat na hover", - required=False, - ), - ), - ( - "page", - wagtail.core.blocks.PageChooserBlock( - label="Stránka", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ] - ), - label="Tlačítka", - ), - ) - ] - ), - ), - ], - label="Obsah pravého sloupce", - required=True, - ), - ), - ] - ), - ), - ( - "three_columns", - wagtail.core.blocks.StructBlock( - [ - ( - "left_column_content", - wagtail.core.blocks.StreamBlock( - [ - ( - "text", - wagtail.core.blocks.RichTextBlock( - features=[ - "h2", - "h3", - "h4", - "h5", - "bold", - "italic", - "ol", - "ul", - "hr", - "link", - "document-link", - "image", - "superscript", - "subscript", - "strikethrough", - "blockquote", - ], - label="Textový editor", - ), - ), - ( - "table", - wagtail.contrib.table_block.blocks.TableBlock( - template="shared/blocks/table_block.html" - ), - ), - ( - "card", - wagtail.core.blocks.StructBlock( - [ - ( - "img", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=False, - ), - ), - ( - "elevation", - wagtail.core.blocks.IntegerBlock( - default=2, - help_text="0 = žádný stín, 21 = maximální stín", - label="Velikost stínu", - max_value=21, - min_value=0, - ), - ), - ( - "headline", - wagtail.core.blocks.TextBlock( - label="Titulek", - required=False, - ), - ), - ( - "hoveractive", - wagtail.core.blocks.BooleanBlock( - default=False, - help_text="Pokud je zapnuto, stín se zvýrazní, když na kartu uživatel najede myší.", - label="Zvýraznit stín na hover", - required=False, - ), - ), - ( - "content", - wagtail.core.blocks.StreamBlock( - [ - ( - "text", - wagtail.core.blocks.RichTextBlock( - features=[ - "h2", - "h3", - "h4", - "h5", - "bold", - "italic", - "ol", - "ul", - "hr", - "link", - "document-link", - "image", - "superscript", - "subscript", - "strikethrough", - "blockquote", - ], - label="Textový editor", - ), - ), - ( - "table", - wagtail.contrib.table_block.blocks.TableBlock( - template="shared/blocks/table_block.html" - ), - ), - ( - "figure", - wagtail.core.blocks.StructBlock( - [ - ( - "img", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=True, - ), - ), - ( - "caption", - wagtail.core.blocks.TextBlock( - label="Popisek", - required=False, - ), - ), - ] - ), - ), - ( - "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, - ), - ), - ] - ), - ), - ( - "map_point", - wagtail.core.blocks.StructBlock( - [ - ( - "lat", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 50.04075", - label="Zeměpisná šířka", - ), - ), - ( - "lon", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 15.77659", - label="Zeměpisná délka", - ), - ), - ( - "hex_color", - wagtail.core.blocks.CharBlock( - default="000000", - help_text="Zadejte barvu pomocí HEX notace (bez # na začátku).", - label="Barva špendlíku (HEX)", - ), - ), - ( - "zoom", - wagtail.core.blocks.IntegerBlock( - default=15, - label="Výchozí zoom", - max_value=18, - min_value=1, - ), - ), - ( - "style", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "osm-mapnik", - "OSM Mapnik", - ) - ], - label="Styl", - ), - ), - ( - "height", - wagtail.core.blocks.IntegerBlock( - label="Výška v px", - max_value=1000, - min_value=100, - ), - ), - ], - label="Špendlík na mapě", - ), - ), - ( - "map_collection", - wagtail.core.blocks.StructBlock( - [ - ( - "features", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", - required=True, - ), - ), - ( - "description", - wagtail.core.blocks.TextBlock( - label="Popisek", - required=False, - ), - ), - ( - "geojson", - wagtail.core.blocks.TextBlock( - help_text="Vložte surový GeoJSON objekt typu 'Feature'. Vyrobit jej můžete např. pomocí online služby geojson.io.", - label="Geodata", - required=True, - ), - ), - ( - "image", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ( - "hex_color", - wagtail.core.blocks.CharBlock( - default="000000", - help_text="Zadejte barvu pomocí HEX notace (bez # na začátku).", - label="Barva (HEX)", - ), - ), - ], - required=True, - ), - label="Součásti", - ), - ), - ( - "zoom", - wagtail.core.blocks.IntegerBlock( - default=15, - label="Výchozí zoom", - max_value=18, - min_value=1, - ), - ), - ( - "style", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "osm-mapnik", - "OSM Mapnik", - ) - ], - label="Styl", - ), - ), - ( - "height", - wagtail.core.blocks.IntegerBlock( - label="Výška v px", - max_value=1000, - min_value=100, - ), - ), - ], - label="Mapová kolekce", - ), - ), - ], - label="Obsah", - required=False, - ), - ), - ( - "page", - wagtail.core.blocks.PageChooserBlock( - label="Stránka", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ] - ), - ), - ( - "figure", - wagtail.core.blocks.StructBlock( - [ - ( - "img", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=True, - ), - ), - ( - "caption", - wagtail.core.blocks.TextBlock( - label="Popisek", - required=False, - ), - ), - ] - ), - ), - ( - "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, - ), - ), - ] - ), - ), - ( - "map_point", - wagtail.core.blocks.StructBlock( - [ - ( - "lat", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 50.04075", - label="Zeměpisná šířka", - ), - ), - ( - "lon", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 15.77659", - label="Zeměpisná délka", - ), - ), - ( - "hex_color", - wagtail.core.blocks.CharBlock( - default="000000", - help_text="Zadejte barvu pomocí HEX notace (bez # na začátku).", - label="Barva špendlíku (HEX)", - ), - ), - ( - "zoom", - wagtail.core.blocks.IntegerBlock( - default=15, - label="Výchozí zoom", - max_value=18, - min_value=1, - ), - ), - ( - "style", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "osm-mapnik", - "OSM Mapnik", - ) - ], - label="Styl", - ), - ), - ( - "height", - wagtail.core.blocks.IntegerBlock( - label="Výška v px", - max_value=1000, - min_value=100, - ), - ), - ], - label="Špendlík na mapě", - ), - ), - ( - "map_collection", - wagtail.core.blocks.StructBlock( - [ - ( - "features", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", - required=True, - ), - ), - ( - "description", - wagtail.core.blocks.TextBlock( - label="Popisek", - required=False, - ), - ), - ( - "geojson", - wagtail.core.blocks.TextBlock( - help_text="Vložte surový GeoJSON objekt typu 'Feature'. Vyrobit jej můžete např. pomocí online služby geojson.io.", - label="Geodata", - required=True, - ), - ), - ( - "image", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ( - "hex_color", - wagtail.core.blocks.CharBlock( - default="000000", - help_text="Zadejte barvu pomocí HEX notace (bez # na začátku).", - label="Barva (HEX)", - ), - ), - ], - required=True, - ), - label="Součásti", - ), - ), - ( - "zoom", - wagtail.core.blocks.IntegerBlock( - default=15, - label="Výchozí zoom", - max_value=18, - min_value=1, - ), - ), - ( - "style", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "osm-mapnik", - "OSM Mapnik", - ) - ], - label="Styl", - ), - ), - ( - "height", - wagtail.core.blocks.IntegerBlock( - label="Výška v px", - max_value=1000, - min_value=100, - ), - ), - ], - label="Mapová kolekce", - ), - ), - ( - "button", - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", - max_length=128, - required=True, - ), - ), - ( - "icon", - wagtail.core.blocks.CharBlock( - help_text="Identifikátor ikonky ze styleguide (https://styleguide.pirati.cz/latest/?p=viewall-atoms-icons), např. ico--key.", - label="Ikonka", - max_length=128, - required=False, - ), - ), - ( - "size", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ("sm", "Malá"), - ("base", "Střední"), - ("lg", "Velká"), - ], - label="Velikost", - ), - ), - ( - "color", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ("black", "Černá"), - ("white", "Bílá"), - ( - "grey-125", - "Světle šedá", - ), - ( - "blue-300", - "Modrá", - ), - ( - "cyan-200", - "Tyrkysová", - ), - ( - "green-400", - "Zelené", - ), - ( - "violet-400", - "Vínová", - ), - ( - "red-600", - "Červená", - ), - ], - label="Barva", - ), - ), - ( - "hoveractive", - wagtail.core.blocks.BooleanBlock( - default=True, - help_text="Pokud je zapnuto, tlačítko mění barvu, když na něj uživatel najede myší.", - label="Animovat na hover", - required=False, - ), - ), - ( - "page", - wagtail.core.blocks.PageChooserBlock( - label="Stránka", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ] - ), - ), - ( - "button_group", - wagtail.core.blocks.StructBlock( - [ - ( - "buttons", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", - max_length=128, - required=True, - ), - ), - ( - "icon", - wagtail.core.blocks.CharBlock( - help_text="Identifikátor ikonky ze styleguide (https://styleguide.pirati.cz/latest/?p=viewall-atoms-icons), např. ico--key.", - label="Ikonka", - max_length=128, - required=False, - ), - ), - ( - "size", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "sm", - "Malá", - ), - ( - "base", - "Střední", - ), - ( - "lg", - "Velká", - ), - ], - label="Velikost", - ), - ), - ( - "color", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "black", - "Černá", - ), - ( - "white", - "Bílá", - ), - ( - "grey-125", - "Světle šedá", - ), - ( - "blue-300", - "Modrá", - ), - ( - "cyan-200", - "Tyrkysová", - ), - ( - "green-400", - "Zelené", - ), - ( - "violet-400", - "Vínová", - ), - ( - "red-600", - "Červená", - ), - ], - label="Barva", - ), - ), - ( - "hoveractive", - wagtail.core.blocks.BooleanBlock( - default=True, - help_text="Pokud je zapnuto, tlačítko mění barvu, když na něj uživatel najede myší.", - label="Animovat na hover", - required=False, - ), - ), - ( - "page", - wagtail.core.blocks.PageChooserBlock( - label="Stránka", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ] - ), - label="Tlačítka", - ), - ) - ] - ), - ), - ], - label="Obsah levého sloupce", - required=True, - ), - ), - ( - "middle_column_content", - wagtail.core.blocks.StreamBlock( - [ - ( - "text", - wagtail.core.blocks.RichTextBlock( - features=[ - "h2", - "h3", - "h4", - "h5", - "bold", - "italic", - "ol", - "ul", - "hr", - "link", - "document-link", - "image", - "superscript", - "subscript", - "strikethrough", - "blockquote", - ], - label="Textový editor", - ), - ), - ( - "table", - wagtail.contrib.table_block.blocks.TableBlock( - template="shared/blocks/table_block.html" - ), - ), - ( - "card", - wagtail.core.blocks.StructBlock( - [ - ( - "img", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=False, - ), - ), - ( - "elevation", - wagtail.core.blocks.IntegerBlock( - default=2, - help_text="0 = žádný stín, 21 = maximální stín", - label="Velikost stínu", - max_value=21, - min_value=0, - ), - ), - ( - "headline", - wagtail.core.blocks.TextBlock( - label="Titulek", - required=False, - ), - ), - ( - "hoveractive", - wagtail.core.blocks.BooleanBlock( - default=False, - help_text="Pokud je zapnuto, stín se zvýrazní, když na kartu uživatel najede myší.", - label="Zvýraznit stín na hover", - required=False, - ), - ), - ( - "content", - wagtail.core.blocks.StreamBlock( - [ - ( - "text", - wagtail.core.blocks.RichTextBlock( - features=[ - "h2", - "h3", - "h4", - "h5", - "bold", - "italic", - "ol", - "ul", - "hr", - "link", - "document-link", - "image", - "superscript", - "subscript", - "strikethrough", - "blockquote", - ], - label="Textový editor", - ), - ), - ( - "table", - wagtail.contrib.table_block.blocks.TableBlock( - template="shared/blocks/table_block.html" - ), - ), - ( - "figure", - wagtail.core.blocks.StructBlock( - [ - ( - "img", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=True, - ), - ), - ( - "caption", - wagtail.core.blocks.TextBlock( - label="Popisek", - required=False, - ), - ), - ] - ), - ), - ( - "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, - ), - ), - ] - ), - ), - ( - "map_point", - wagtail.core.blocks.StructBlock( - [ - ( - "lat", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 50.04075", - label="Zeměpisná šířka", - ), - ), - ( - "lon", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 15.77659", - label="Zeměpisná délka", - ), - ), - ( - "hex_color", - wagtail.core.blocks.CharBlock( - default="000000", - help_text="Zadejte barvu pomocí HEX notace (bez # na začátku).", - label="Barva špendlíku (HEX)", - ), - ), - ( - "zoom", - wagtail.core.blocks.IntegerBlock( - default=15, - label="Výchozí zoom", - max_value=18, - min_value=1, - ), - ), - ( - "style", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "osm-mapnik", - "OSM Mapnik", - ) - ], - label="Styl", - ), - ), - ( - "height", - wagtail.core.blocks.IntegerBlock( - label="Výška v px", - max_value=1000, - min_value=100, - ), - ), - ], - label="Špendlík na mapě", - ), - ), - ( - "map_collection", - wagtail.core.blocks.StructBlock( - [ - ( - "features", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", - required=True, - ), - ), - ( - "description", - wagtail.core.blocks.TextBlock( - label="Popisek", - required=False, - ), - ), - ( - "geojson", - wagtail.core.blocks.TextBlock( - help_text="Vložte surový GeoJSON objekt typu 'Feature'. Vyrobit jej můžete např. pomocí online služby geojson.io.", - label="Geodata", - required=True, - ), - ), - ( - "image", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ( - "hex_color", - wagtail.core.blocks.CharBlock( - default="000000", - help_text="Zadejte barvu pomocí HEX notace (bez # na začátku).", - label="Barva (HEX)", - ), - ), - ], - required=True, - ), - label="Součásti", - ), - ), - ( - "zoom", - wagtail.core.blocks.IntegerBlock( - default=15, - label="Výchozí zoom", - max_value=18, - min_value=1, - ), - ), - ( - "style", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "osm-mapnik", - "OSM Mapnik", - ) - ], - label="Styl", - ), - ), - ( - "height", - wagtail.core.blocks.IntegerBlock( - label="Výška v px", - max_value=1000, - min_value=100, - ), - ), - ], - label="Mapová kolekce", - ), - ), - ], - label="Obsah", - required=False, - ), - ), - ( - "page", - wagtail.core.blocks.PageChooserBlock( - label="Stránka", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ] - ), - ), - ( - "figure", - wagtail.core.blocks.StructBlock( - [ - ( - "img", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=True, - ), - ), - ( - "caption", - wagtail.core.blocks.TextBlock( - label="Popisek", - required=False, - ), - ), - ] - ), - ), - ( - "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, - ), - ), - ] - ), - ), - ( - "map_point", - wagtail.core.blocks.StructBlock( - [ - ( - "lat", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 50.04075", - label="Zeměpisná šířka", - ), - ), - ( - "lon", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 15.77659", - label="Zeměpisná délka", - ), - ), - ( - "hex_color", - wagtail.core.blocks.CharBlock( - default="000000", - help_text="Zadejte barvu pomocí HEX notace (bez # na začátku).", - label="Barva špendlíku (HEX)", - ), - ), - ( - "zoom", - wagtail.core.blocks.IntegerBlock( - default=15, - label="Výchozí zoom", - max_value=18, - min_value=1, - ), - ), - ( - "style", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "osm-mapnik", - "OSM Mapnik", - ) - ], - label="Styl", - ), - ), - ( - "height", - wagtail.core.blocks.IntegerBlock( - label="Výška v px", - max_value=1000, - min_value=100, - ), - ), - ], - label="Špendlík na mapě", - ), - ), - ( - "map_collection", - wagtail.core.blocks.StructBlock( - [ - ( - "features", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", - required=True, - ), - ), - ( - "description", - wagtail.core.blocks.TextBlock( - label="Popisek", - required=False, - ), - ), - ( - "geojson", - wagtail.core.blocks.TextBlock( - help_text="Vložte surový GeoJSON objekt typu 'Feature'. Vyrobit jej můžete např. pomocí online služby geojson.io.", - label="Geodata", - required=True, - ), - ), - ( - "image", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ( - "hex_color", - wagtail.core.blocks.CharBlock( - default="000000", - help_text="Zadejte barvu pomocí HEX notace (bez # na začátku).", - label="Barva (HEX)", - ), - ), - ], - required=True, - ), - label="Součásti", - ), - ), - ( - "zoom", - wagtail.core.blocks.IntegerBlock( - default=15, - label="Výchozí zoom", - max_value=18, - min_value=1, - ), - ), - ( - "style", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "osm-mapnik", - "OSM Mapnik", - ) - ], - label="Styl", - ), - ), - ( - "height", - wagtail.core.blocks.IntegerBlock( - label="Výška v px", - max_value=1000, - min_value=100, - ), - ), - ], - label="Mapová kolekce", - ), - ), - ( - "button", - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", - max_length=128, - required=True, - ), - ), - ( - "icon", - wagtail.core.blocks.CharBlock( - help_text="Identifikátor ikonky ze styleguide (https://styleguide.pirati.cz/latest/?p=viewall-atoms-icons), např. ico--key.", - label="Ikonka", - max_length=128, - required=False, - ), - ), - ( - "size", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ("sm", "Malá"), - ("base", "Střední"), - ("lg", "Velká"), - ], - label="Velikost", - ), - ), - ( - "color", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ("black", "Černá"), - ("white", "Bílá"), - ( - "grey-125", - "Světle šedá", - ), - ( - "blue-300", - "Modrá", - ), - ( - "cyan-200", - "Tyrkysová", - ), - ( - "green-400", - "Zelené", - ), - ( - "violet-400", - "Vínová", - ), - ( - "red-600", - "Červená", - ), - ], - label="Barva", - ), - ), - ( - "hoveractive", - wagtail.core.blocks.BooleanBlock( - default=True, - help_text="Pokud je zapnuto, tlačítko mění barvu, když na něj uživatel najede myší.", - label="Animovat na hover", - required=False, - ), - ), - ( - "page", - wagtail.core.blocks.PageChooserBlock( - label="Stránka", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ] - ), - ), - ( - "button_group", - wagtail.core.blocks.StructBlock( - [ - ( - "buttons", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", - max_length=128, - required=True, - ), - ), - ( - "icon", - wagtail.core.blocks.CharBlock( - help_text="Identifikátor ikonky ze styleguide (https://styleguide.pirati.cz/latest/?p=viewall-atoms-icons), např. ico--key.", - label="Ikonka", - max_length=128, - required=False, - ), - ), - ( - "size", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "sm", - "Malá", - ), - ( - "base", - "Střední", - ), - ( - "lg", - "Velká", - ), - ], - label="Velikost", - ), - ), - ( - "color", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "black", - "Černá", - ), - ( - "white", - "Bílá", - ), - ( - "grey-125", - "Světle šedá", - ), - ( - "blue-300", - "Modrá", - ), - ( - "cyan-200", - "Tyrkysová", - ), - ( - "green-400", - "Zelené", - ), - ( - "violet-400", - "Vínová", - ), - ( - "red-600", - "Červená", - ), - ], - label="Barva", - ), - ), - ( - "hoveractive", - wagtail.core.blocks.BooleanBlock( - default=True, - help_text="Pokud je zapnuto, tlačítko mění barvu, když na něj uživatel najede myší.", - label="Animovat na hover", - required=False, - ), - ), - ( - "page", - wagtail.core.blocks.PageChooserBlock( - label="Stránka", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ] - ), - label="Tlačítka", - ), - ) - ] - ), - ), - ], - label="Obsah prostředního sloupce", - required=True, - ), - ), - ( - "right_column_content", - wagtail.core.blocks.StreamBlock( - [ - ( - "text", - wagtail.core.blocks.RichTextBlock( - features=[ - "h2", - "h3", - "h4", - "h5", - "bold", - "italic", - "ol", - "ul", - "hr", - "link", - "document-link", - "image", - "superscript", - "subscript", - "strikethrough", - "blockquote", - ], - label="Textový editor", - ), - ), - ( - "table", - wagtail.contrib.table_block.blocks.TableBlock( - template="shared/blocks/table_block.html" - ), - ), - ( - "card", - wagtail.core.blocks.StructBlock( - [ - ( - "img", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=False, - ), - ), - ( - "elevation", - wagtail.core.blocks.IntegerBlock( - default=2, - help_text="0 = žádný stín, 21 = maximální stín", - label="Velikost stínu", - max_value=21, - min_value=0, - ), - ), - ( - "headline", - wagtail.core.blocks.TextBlock( - label="Titulek", - required=False, - ), - ), - ( - "hoveractive", - wagtail.core.blocks.BooleanBlock( - default=False, - help_text="Pokud je zapnuto, stín se zvýrazní, když na kartu uživatel najede myší.", - label="Zvýraznit stín na hover", - required=False, - ), - ), - ( - "content", - wagtail.core.blocks.StreamBlock( - [ - ( - "text", - wagtail.core.blocks.RichTextBlock( - features=[ - "h2", - "h3", - "h4", - "h5", - "bold", - "italic", - "ol", - "ul", - "hr", - "link", - "document-link", - "image", - "superscript", - "subscript", - "strikethrough", - "blockquote", - ], - label="Textový editor", - ), - ), - ( - "table", - wagtail.contrib.table_block.blocks.TableBlock( - template="shared/blocks/table_block.html" - ), - ), - ( - "figure", - wagtail.core.blocks.StructBlock( - [ - ( - "img", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=True, - ), - ), - ( - "caption", - wagtail.core.blocks.TextBlock( - label="Popisek", - required=False, - ), - ), - ] - ), - ), - ( - "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, - ), - ), - ] - ), - ), - ( - "map_point", - wagtail.core.blocks.StructBlock( - [ - ( - "lat", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 50.04075", - label="Zeměpisná šířka", - ), - ), - ( - "lon", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 15.77659", - label="Zeměpisná délka", - ), - ), - ( - "hex_color", - wagtail.core.blocks.CharBlock( - default="000000", - help_text="Zadejte barvu pomocí HEX notace (bez # na začátku).", - label="Barva špendlíku (HEX)", - ), - ), - ( - "zoom", - wagtail.core.blocks.IntegerBlock( - default=15, - label="Výchozí zoom", - max_value=18, - min_value=1, - ), - ), - ( - "style", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "osm-mapnik", - "OSM Mapnik", - ) - ], - label="Styl", - ), - ), - ( - "height", - wagtail.core.blocks.IntegerBlock( - label="Výška v px", - max_value=1000, - min_value=100, - ), - ), - ], - label="Špendlík na mapě", - ), - ), - ( - "map_collection", - wagtail.core.blocks.StructBlock( - [ - ( - "features", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", - required=True, - ), - ), - ( - "description", - wagtail.core.blocks.TextBlock( - label="Popisek", - required=False, - ), - ), - ( - "geojson", - wagtail.core.blocks.TextBlock( - help_text="Vložte surový GeoJSON objekt typu 'Feature'. Vyrobit jej můžete např. pomocí online služby geojson.io.", - label="Geodata", - required=True, - ), - ), - ( - "image", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ( - "hex_color", - wagtail.core.blocks.CharBlock( - default="000000", - help_text="Zadejte barvu pomocí HEX notace (bez # na začátku).", - label="Barva (HEX)", - ), - ), - ], - required=True, - ), - label="Součásti", - ), - ), - ( - "zoom", - wagtail.core.blocks.IntegerBlock( - default=15, - label="Výchozí zoom", - max_value=18, - min_value=1, - ), - ), - ( - "style", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "osm-mapnik", - "OSM Mapnik", - ) - ], - label="Styl", - ), - ), - ( - "height", - wagtail.core.blocks.IntegerBlock( - label="Výška v px", - max_value=1000, - min_value=100, - ), - ), - ], - label="Mapová kolekce", - ), - ), - ], - label="Obsah", - required=False, - ), - ), - ( - "page", - wagtail.core.blocks.PageChooserBlock( - label="Stránka", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ] - ), - ), - ( - "figure", - wagtail.core.blocks.StructBlock( - [ - ( - "img", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=True, - ), - ), - ( - "caption", - wagtail.core.blocks.TextBlock( - label="Popisek", - required=False, - ), - ), - ] - ), - ), - ( - "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, - ), - ), - ] - ), - ), - ( - "map_point", - wagtail.core.blocks.StructBlock( - [ - ( - "lat", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 50.04075", - label="Zeměpisná šířka", - ), - ), - ( - "lon", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 15.77659", - label="Zeměpisná délka", - ), - ), - ( - "hex_color", - wagtail.core.blocks.CharBlock( - default="000000", - help_text="Zadejte barvu pomocí HEX notace (bez # na začátku).", - label="Barva špendlíku (HEX)", - ), - ), - ( - "zoom", - wagtail.core.blocks.IntegerBlock( - default=15, - label="Výchozí zoom", - max_value=18, - min_value=1, - ), - ), - ( - "style", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "osm-mapnik", - "OSM Mapnik", - ) - ], - label="Styl", - ), - ), - ( - "height", - wagtail.core.blocks.IntegerBlock( - label="Výška v px", - max_value=1000, - min_value=100, - ), - ), - ], - label="Špendlík na mapě", - ), - ), - ( - "map_collection", - wagtail.core.blocks.StructBlock( - [ - ( - "features", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", - required=True, - ), - ), - ( - "description", - wagtail.core.blocks.TextBlock( - label="Popisek", - required=False, - ), - ), - ( - "geojson", - wagtail.core.blocks.TextBlock( - help_text="Vložte surový GeoJSON objekt typu 'Feature'. Vyrobit jej můžete např. pomocí online služby geojson.io.", - label="Geodata", - required=True, - ), - ), - ( - "image", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ( - "hex_color", - wagtail.core.blocks.CharBlock( - default="000000", - help_text="Zadejte barvu pomocí HEX notace (bez # na začátku).", - label="Barva (HEX)", - ), - ), - ], - required=True, - ), - label="Součásti", - ), - ), - ( - "zoom", - wagtail.core.blocks.IntegerBlock( - default=15, - label="Výchozí zoom", - max_value=18, - min_value=1, - ), - ), - ( - "style", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "osm-mapnik", - "OSM Mapnik", - ) - ], - label="Styl", - ), - ), - ( - "height", - wagtail.core.blocks.IntegerBlock( - label="Výška v px", - max_value=1000, - min_value=100, - ), - ), - ], - label="Mapová kolekce", - ), - ), - ( - "button", - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", - max_length=128, - required=True, - ), - ), - ( - "icon", - wagtail.core.blocks.CharBlock( - help_text="Identifikátor ikonky ze styleguide (https://styleguide.pirati.cz/latest/?p=viewall-atoms-icons), např. ico--key.", - label="Ikonka", - max_length=128, - required=False, - ), - ), - ( - "size", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ("sm", "Malá"), - ("base", "Střední"), - ("lg", "Velká"), - ], - label="Velikost", - ), - ), - ( - "color", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ("black", "Černá"), - ("white", "Bílá"), - ( - "grey-125", - "Světle šedá", - ), - ( - "blue-300", - "Modrá", - ), - ( - "cyan-200", - "Tyrkysová", - ), - ( - "green-400", - "Zelené", - ), - ( - "violet-400", - "Vínová", - ), - ( - "red-600", - "Červená", - ), - ], - label="Barva", - ), - ), - ( - "hoveractive", - wagtail.core.blocks.BooleanBlock( - default=True, - help_text="Pokud je zapnuto, tlačítko mění barvu, když na něj uživatel najede myší.", - label="Animovat na hover", - required=False, - ), - ), - ( - "page", - wagtail.core.blocks.PageChooserBlock( - label="Stránka", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ] - ), - ), - ( - "button_group", - wagtail.core.blocks.StructBlock( - [ - ( - "buttons", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", - max_length=128, - required=True, - ), - ), - ( - "icon", - wagtail.core.blocks.CharBlock( - help_text="Identifikátor ikonky ze styleguide (https://styleguide.pirati.cz/latest/?p=viewall-atoms-icons), např. ico--key.", - label="Ikonka", - max_length=128, - required=False, - ), - ), - ( - "size", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "sm", - "Malá", - ), - ( - "base", - "Střední", - ), - ( - "lg", - "Velká", - ), - ], - label="Velikost", - ), - ), - ( - "color", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "black", - "Černá", - ), - ( - "white", - "Bílá", - ), - ( - "grey-125", - "Světle šedá", - ), - ( - "blue-300", - "Modrá", - ), - ( - "cyan-200", - "Tyrkysová", - ), - ( - "green-400", - "Zelené", - ), - ( - "violet-400", - "Vínová", - ), - ( - "red-600", - "Červená", - ), - ], - label="Barva", - ), - ), - ( - "hoveractive", - wagtail.core.blocks.BooleanBlock( - default=True, - help_text="Pokud je zapnuto, tlačítko mění barvu, když na něj uživatel najede myší.", - label="Animovat na hover", - required=False, - ), - ), - ( - "page", - wagtail.core.blocks.PageChooserBlock( - label="Stránka", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ] - ), - label="Tlačítka", - ), - ) - ] - ), - ), - ], - label="Obsah pravého sloupce", - required=True, - ), - ), - ] - ), - ), - ( - "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", - ), - ), - ( - "map_point", - wagtail.core.blocks.StructBlock( - [ - ( - "lat", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 50.04075", - label="Zeměpisná šířka", - ), - ), - ( - "lon", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 15.77659", - label="Zeměpisná délka", - ), - ), - ( - "hex_color", - wagtail.core.blocks.CharBlock( - default="000000", - help_text="Zadejte barvu pomocí HEX notace (bez # na začátku).", - label="Barva špendlíku (HEX)", - ), - ), - ( - "zoom", - wagtail.core.blocks.IntegerBlock( - default=15, - label="Výchozí zoom", - max_value=18, - min_value=1, - ), - ), - ( - "style", - wagtail.core.blocks.ChoiceBlock( - choices=[("osm-mapnik", "OSM Mapnik")], - label="Styl", - ), - ), - ( - "height", - wagtail.core.blocks.IntegerBlock( - label="Výška v px", - max_value=1000, - min_value=100, - ), - ), - ], - label="Špendlík na mapě", - ), - ), - ( - "map_collection", - wagtail.core.blocks.StructBlock( - [ - ( - "lat", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 50.04075", - label="Zeměpisná šířka", - ), - ), - ( - "lon", - wagtail.core.blocks.DecimalBlock( - help_text="Např. 15.77659", - label="Zeměpisná délka", - ), - ), - ( - "hex_color", - wagtail.core.blocks.CharBlock( - default="000000", - help_text="Zadejte barvu pomocí HEX notace (bez # na začátku).", - label="Barva špendlíku (HEX)", - ), - ), - ( - "zoom", - wagtail.core.blocks.IntegerBlock( - default=15, - label="Výchozí zoom", - max_value=18, - min_value=1, - ), - ), - ( - "style", - wagtail.core.blocks.ChoiceBlock( - choices=[("osm-mapnik", "OSM Mapnik")], - label="Styl", - ), - ), - ( - "height", - wagtail.core.blocks.IntegerBlock( - label="Výška v px", - max_value=1000, - min_value=100, - ), - ), - ], - label="Mapová kolekce", - ), - ), - ( - "button", - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", max_length=128, required=True - ), - ), - ( - "icon", - wagtail.core.blocks.CharBlock( - help_text="Identifikátor ikonky ze styleguide (https://styleguide.pirati.cz/latest/?p=viewall-atoms-icons), např. ico--key.", - label="Ikonka", - max_length=128, - required=False, - ), - ), - ( - "size", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ("sm", "Malá"), - ("base", "Střední"), - ("lg", "Velká"), - ], - label="Velikost", - ), - ), - ( - "color", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ("black", "Černá"), - ("white", "Bílá"), - ("grey-125", "Světle šedá"), - ("blue-300", "Modrá"), - ("cyan-200", "Tyrkysová"), - ("green-400", "Zelené"), - ("violet-400", "Vínová"), - ("red-600", "Červená"), - ], - label="Barva", - ), - ), - ( - "hoveractive", - wagtail.core.blocks.BooleanBlock( - default=True, - help_text="Pokud je zapnuto, tlačítko mění barvu, když na něj uživatel najede myší.", - label="Animovat na hover", - required=False, - ), - ), - ( - "page", - wagtail.core.blocks.PageChooserBlock( - label="Stránka", required=False - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", required=False - ), - ), - ] - ), - ), - ( - "button_group", - wagtail.core.blocks.StructBlock( - [ - ( - "buttons", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", - max_length=128, - required=True, - ), - ), - ( - "icon", - wagtail.core.blocks.CharBlock( - help_text="Identifikátor ikonky ze styleguide (https://styleguide.pirati.cz/latest/?p=viewall-atoms-icons), např. ico--key.", - label="Ikonka", - max_length=128, - required=False, - ), - ), - ( - "size", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ("sm", "Malá"), - ("base", "Střední"), - ("lg", "Velká"), - ], - label="Velikost", - ), - ), - ( - "color", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ("black", "Černá"), - ("white", "Bílá"), - ("grey-125", "Světle šedá"), - ("blue-300", "Modrá"), - ("cyan-200", "Tyrkysová"), - ("green-400", "Zelené"), - ("violet-400", "Vínová"), - ("red-600", "Červená"), - ], - label="Barva", - ), - ), - ( - "hoveractive", - wagtail.core.blocks.BooleanBlock( - default=True, - help_text="Pokud je zapnuto, tlačítko mění barvu, když na něj uživatel najede myší.", - label="Animovat na hover", - required=False, - ), - ), - ( - "page", - wagtail.core.blocks.PageChooserBlock( - label="Stránka", required=False - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", required=False - ), - ), - ] - ), - label="Tlačítka", - ), - ) - ] - ), - ), - ( - "image_banner", - wagtail.core.blocks.StructBlock( - [ - ( - "image", - wagtail.images.blocks.ImageChooserBlock( - label="Obrázek", required=True - ), - ), - ( - "headline", - wagtail.core.blocks.CharBlock( - label="Headline", max_length=128, required=True - ), - ), - ( - "content", - wagtail.core.blocks.StreamBlock( - [ - ( - "text", - wagtail.core.blocks.RichTextBlock( - features=( - "h2", - "h3", - "h4", - "h5", - "bold", - "italic", - "ol", - "ul", - "hr", - "link", - "document-link", - "superscript", - "subscript", - "strikethrough", - "blockquote", - ), - label="Textový editor", - ), - ), - ( - "button", - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", - max_length=128, - required=True, - ), - ), - ( - "icon", - wagtail.core.blocks.CharBlock( - help_text="Identifikátor ikonky ze styleguide (https://styleguide.pirati.cz/latest/?p=viewall-atoms-icons), např. ico--key.", - label="Ikonka", - max_length=128, - required=False, - ), - ), - ( - "size", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ("sm", "Malá"), - ("base", "Střední"), - ("lg", "Velká"), - ], - label="Velikost", - ), - ), - ( - "color", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ("black", "Černá"), - ("white", "Bílá"), - ( - "grey-125", - "Světle šedá", - ), - ( - "blue-300", - "Modrá", - ), - ( - "cyan-200", - "Tyrkysová", - ), - ( - "green-400", - "Zelené", - ), - ( - "violet-400", - "Vínová", - ), - ( - "red-600", - "Červená", - ), - ], - label="Barva", - ), - ), - ( - "hoveractive", - wagtail.core.blocks.BooleanBlock( - default=True, - help_text="Pokud je zapnuto, tlačítko mění barvu, když na něj uživatel najede myší.", - label="Animovat na hover", - required=False, - ), - ), - ( - "page", - wagtail.core.blocks.PageChooserBlock( - label="Stránka", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ] - ), - ), - ( - "button_group", - wagtail.core.blocks.StructBlock( - [ - ( - "buttons", - wagtail.core.blocks.ListBlock( - wagtail.core.blocks.StructBlock( - [ - ( - "title", - wagtail.core.blocks.CharBlock( - label="Titulek", - max_length=128, - required=True, - ), - ), - ( - "icon", - wagtail.core.blocks.CharBlock( - help_text="Identifikátor ikonky ze styleguide (https://styleguide.pirati.cz/latest/?p=viewall-atoms-icons), např. ico--key.", - label="Ikonka", - max_length=128, - required=False, - ), - ), - ( - "size", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "sm", - "Malá", - ), - ( - "base", - "Střední", - ), - ( - "lg", - "Velká", - ), - ], - label="Velikost", - ), - ), - ( - "color", - wagtail.core.blocks.ChoiceBlock( - choices=[ - ( - "black", - "Černá", - ), - ( - "white", - "Bílá", - ), - ( - "grey-125", - "Světle šedá", - ), - ( - "blue-300", - "Modrá", - ), - ( - "cyan-200", - "Tyrkysová", - ), - ( - "green-400", - "Zelené", - ), - ( - "violet-400", - "Vínová", - ), - ( - "red-600", - "Červená", - ), - ], - label="Barva", - ), - ), - ( - "hoveractive", - wagtail.core.blocks.BooleanBlock( - default=True, - help_text="Pokud je zapnuto, tlačítko mění barvu, když na něj uživatel najede myší.", - label="Animovat na hover", - required=False, - ), - ), - ( - "page", - wagtail.core.blocks.PageChooserBlock( - label="Stránka", - required=False, - ), - ), - ( - "link", - wagtail.core.blocks.URLBlock( - label="Odkaz", - required=False, - ), - ), - ] - ), - label="Tlačítka", - ), - ) - ] - ), - ), - ], - label="Obsah pravého sloupce", - required=False, - ), - ), - ] - ), - ), - ], - blank=True, - verbose_name="Článek", - ), - ), - ] diff --git a/region/migrations/0038_alter_regionarticlepage_content_and_more.py b/region/migrations/0038_alter_regionarticlepage_content_and_more.py deleted file mode 100644 index 36501679d43d489418485bae905e6f5c567f4f2b..0000000000000000000000000000000000000000 --- a/region/migrations/0038_alter_regionarticlepage_content_and_more.py +++ /dev/null @@ -1,62 +0,0 @@ -# Generated by Django 4.0.4 on 2022-05-11 12:58 - -import django.db.models.deletion -import wagtail.core.blocks -import wagtail.core.fields -import wagtail.images.blocks -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0037_alter_regionarticlepage_content"), - ] - - operations = [ - migrations.AlterField( - model_name="regionelectionpointpage", - name="guarantor", - field=models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.SET_NULL, - to="region.regionpersonpage", - ), - ), - migrations.AlterField( - model_name="regionhomepage", - name="footperson_coord", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="region.regionpersonpage", - verbose_name="Koordinátor", - ), - ), - migrations.AlterField( - model_name="regionhomepage", - name="footperson_electman", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="region.regionpersonpage", - verbose_name="Volební manažer", - ), - ), - migrations.AlterField( - model_name="regionhomepage", - name="footperson_media", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="region.regionpersonpage", - verbose_name="Kontakt pro média", - ), - ), - ] diff --git a/region/migrations/0039_merge_20220517_1859.py b/region/migrations/0039_merge_20220517_1859.py deleted file mode 100644 index 6aab0e4444902ad4bdc6e51c92a3e5e09246b1a2..0000000000000000000000000000000000000000 --- a/region/migrations/0039_merge_20220517_1859.py +++ /dev/null @@ -1,13 +0,0 @@ -# Generated by Django 4.0.4 on 2022-05-17 16:59 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("region", "0038_alter_regionarticlepage_content"), - ("region", "0038_alter_regionarticlepage_content_and_more"), - ] - - operations = [] diff --git a/region/migrations/__init__.py b/region/migrations/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/region/models.py b/region/models.py deleted file mode 100644 index d654ee369d9665a4d7f94740a3dac02c7c959029..0000000000000000000000000000000000000000 --- a/region/models.py +++ /dev/null @@ -1,1054 +0,0 @@ -import random - -from django.core.exceptions import ValidationError -from django.core.paginator import Paginator -from django.db import models -from django.shortcuts import render -from django.utils.translation import gettext_lazy -from modelcluster.contrib.taggit import ClusterTaggableManager -from modelcluster.fields import ParentalKey -from taggit.models import Tag, TaggedItemBase -from wagtail.admin.edit_handlers import ( - FieldPanel, - HelpPanel, - MultiFieldPanel, - ObjectList, - PageChooserPanel, - StreamFieldPanel, - TabbedInterface, -) -from wagtail.admin.forms import WagtailAdminPageForm -from wagtail.contrib.table_block.blocks import TableBlock -from wagtail.core.blocks import RichTextBlock -from wagtail.core.fields import RichTextField, StreamField -from wagtail.core.models import Page -from wagtail.images.edit_handlers import ImageChooserPanel -from wagtailmetadata.models import MetadataPageMixin - -from calendar_utils.models import CalendarMixin -from shared.models import ( - ArticleMixin, - ExtendedMetadataHomePageMixin, - ExtendedMetadataPageMixin, - MenuMixin, - SubpageMixin, -) -from shared.utils import make_promote_panels -from tuning import admin_help -from uniweb.constants import RICH_TEXT_FEATURES - -from . import blocks -from .forms import JekyllImportForm - - -class RegionHomePage( - MenuMixin, ExtendedMetadataHomePageMixin, MetadataPageMixin, CalendarMixin, Page -): - ### FIELDS - - subheader = StreamField( - [ - ("header_simple", blocks.HomepageSimpleHeaderBlock()), - ("header", blocks.HomepageHeaderBlock()), - ], - verbose_name="Blok pod headerem", - blank=True, - ) - articles_title = models.CharField("Nadpis článků", max_length=256) - election_countdown_datetime = models.DateTimeField( - "Datum a čas pro odpočet do voleb", - null=True, - blank=True, - help_text="Pro skrytí nechte nevyplněné", - ) - show_calendar_on_hp = models.BooleanField( - "Zobrazit kalendář dole na homepage", default=True - ) - - region_map_button_text = models.CharField( - "Text tlačítka mapy", max_length=256, default="Piráti v krajích" - ) - calendar_button_text = models.CharField( - "Text tlačítka kalendáře", max_length=256, default="Kalendář" - ) - - custom_logo = models.ForeignKey( - "wagtailimages.Image", blank=True, null=True, on_delete=models.SET_NULL - ) - - show_pirati_cz_link = models.BooleanField( - "Zobrazit v záhlaví odkaz 'pirati.cz'", default=True - ) - show_eshop_link = models.BooleanField( - "Zobrazit v záhlaví odkaz na pirátský eshop", default=True - ) - show_magazine_link = models.BooleanField( - "Zobrazit v záhlaví odkaz na pirátské listy", default=True - ) - - facebook = models.URLField( - "Facebook URL", - blank=True, - null=True, - default="https://www.facebook.com/ceska.piratska.strana", - ) - twitter = models.URLField( - "Twitter URL", - blank=True, - null=True, - default="https://www.twitter.com/PiratskaStrana", - ) - youtube = models.URLField( - "YouTube URL", - blank=True, - null=True, - default="https://www.youtube.com/channel/UC_zxYLGrkmrYazYt0MzyVlA", - ) - instagram = models.URLField( - "Instagram URL", - blank=True, - null=True, - default="https://www.instagram.com/pirati.cz/", - ) - flickr = models.URLField( - "Flickr URL", - blank=True, - null=True, - default="https://www.flickr.com/photos/pirati/", - ) - forum = models.URLField( - "Fórum URL", blank=True, null=True, default="https://forum.pirati.cz/" - ) - - contact_email = models.EmailField("kontaktni email", max_length=250, blank=True) - contact_phone = models.TextField("kontaktni telefon", max_length=250, blank=True) - contact_newcomers = models.URLField( - "URL pro zájemce o členství", - blank=True, - null=True, - default="https://nalodeni.pirati.cz", - ) - - donation_page = models.URLField( - "URL pro příjem darů (tlačítko Přispěj)", - blank=True, - null=True, - default="https://dary.pirati.cz", - ) - - # Lide uvedeni v paticce - footperson_coord_title = models.CharField( - "Název funkce", max_length=128, default="Koordinátor" - ) - footperson_coord = models.ForeignKey( - "region.RegionPersonPage", - verbose_name="Koordinátor", - on_delete=models.SET_NULL, - null=True, - blank=True, - related_name="+", - ) - footperson_electman_title = models.CharField( - "Název funkce", max_length=128, default="Volební manažer" - ) - footperson_electman = models.ForeignKey( - "region.RegionPersonPage", - verbose_name="Volební manažer", - on_delete=models.SET_NULL, - null=True, - blank=True, - related_name="+", - ) - footperson_media_title = models.CharField( - "Název funkce", max_length=128, default="Kontakt pro média" - ) - footperson_media = models.ForeignKey( - "region.RegionPersonPage", - verbose_name="Kontakt pro média", - on_delete=models.SET_NULL, - null=True, - blank=True, - related_name="+", - ) - - # settings - matomo_id = models.IntegerField( - "Matomo ID pro sledování návštěvnosti", blank=True, null=True - ) - fallback_image = models.ForeignKey( - "wagtailimages.Image", - on_delete=models.PROTECT, - null=True, - related_name="+", - ) - - ### PANELS - - content_panels = Page.content_panels + [ - StreamFieldPanel("subheader"), - FieldPanel("articles_title"), - FieldPanel("election_countdown_datetime"), - FieldPanel("show_calendar_on_hp"), - ] - - promote_panels = make_promote_panels(admin_help.build(admin_help.IMPORTANT_TITLE)) - - settings_panels = [ - ImageChooserPanel("custom_logo"), - FieldPanel("matomo_id"), - FieldPanel("title_suffix"), - MultiFieldPanel( - [ - FieldPanel("show_pirati_cz_link"), - FieldPanel("show_eshop_link"), - FieldPanel("show_magazine_link"), - FieldPanel("donation_page"), - FieldPanel("contact_newcomers"), - FieldPanel("facebook"), - FieldPanel("twitter"), - FieldPanel("youtube"), - FieldPanel("instagram"), - FieldPanel("flickr"), - FieldPanel("forum"), - ], - gettext_lazy("Odkazy na webu"), - ), - MultiFieldPanel( - [ - FieldPanel("footperson_coord_title"), - PageChooserPanel("footperson_coord"), - FieldPanel("footperson_electman_title"), - PageChooserPanel("footperson_electman"), - FieldPanel("footperson_media_title"), - PageChooserPanel("footperson_media"), - ], - gettext_lazy("Lidé v zápatí stránky"), - ), - MultiFieldPanel( - [ - FieldPanel("region_map_button_text"), - FieldPanel("calendar_button_text"), - FieldPanel("calendar_url"), - ], - gettext_lazy("Nastavení lišty s kalendářem a mapou"), - ), - ImageChooserPanel("fallback_image"), - ] - - ### EDIT HANDLERS - - edit_handler = TabbedInterface( - [ - ObjectList(content_panels, heading="Obsah"), - ObjectList(promote_panels, heading="Propagovat"), - ObjectList(settings_panels, heading="Nastavení"), - ObjectList(MenuMixin.menu_panels, heading="Menu"), - ] - ) - - ### RELATIONS - - subpage_types = [ - "region.RegionArticlesPage", - "region.RegionCenterPage", - "region.RegionContactPage", - "region.RegionCrossroadPage", - "region.RegionCustomPage", - "region.RegionElectionPage", - "region.RegionPeoplePage", - "region.RegionProgramPage", - "region.RegionTagsPage", - ] - - ### OTHERS - - class Meta: - verbose_name = "(zastaralé, nepozžívat) Krajské sdružení" - - def _first_subpage_of_type(self, page_type) -> Page or None: - try: - return self.get_descendants().type(page_type).live().specific()[0] - except IndexError: - return None - - @property - def articles(self): - return ( - self.get_descendants() - .type(RegionArticlePage) - .live() - .specific() - .order_by("-regionarticlepage__date")[:6] - ) - - @property - def articles_page(self): - return self._first_subpage_of_type(RegionArticlesPage) - - @property - def center_page(self): - return self._first_subpage_of_type(RegionCenterPage) - - @property - def contact_page(self): - return self._first_subpage_of_type(RegionContactPage) - - @property - def election_page(self): - return self._first_subpage_of_type(RegionElectionPage) - - @staticmethod - def get_404_response(request): - return render(request, "region/404.html", status=404) - - @property - def people_page(self): - return self._first_subpage_of_type(RegionPeoplePage) - - @property - def program_page(self): - return self._first_subpage_of_type(RegionProgramPage) - - @property - def root_page(self): - return self - - @property - def tags_page(self): - return self._first_subpage_of_type(RegionTagsPage) - - @property - def has_calendar(self): - return self.calendar_id is not None - - -class RegionArticleTag(TaggedItemBase): - content_object = ParentalKey("region.RegionArticlePage", on_delete=models.CASCADE) - - -class RegionArticlePage( - ArticleMixin, ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, Page -): - ### FIELDS - - author_page = models.ForeignKey( - "region.RegionPersonPage", on_delete=models.SET_NULL, null=True, blank=True - ) - is_black = models.BooleanField("Má tmavé pozadí?", default=False) - tags = ClusterTaggableManager(through=RegionArticleTag, blank=True) - - ### PANELS - - content_panels = ArticleMixin.content_panels + [ - FieldPanel("author_page"), - FieldPanel("is_black"), - FieldPanel("tags"), - ] - - promote_panels = make_promote_panels( - admin_help.build(admin_help.NO_SEO_TITLE, admin_help.NO_DESCRIPTION_USE_PEREX), - search_image=False, - ) - - ### RELATIONS - - parent_page_types = ["region.RegionArticlesPage"] - subpage_types = [] - - ### OTHERS - - class Meta: - verbose_name = "Aktualita" - - def get_context(self, request): - context = super().get_context(request) - context["related_articles"] = ( - self.get_siblings(inclusive=False) - .live() - .specific() - .order_by("-regionarticlepage__date")[:3] - ) - return context - - -class RegionArticlesPage( - ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, Page -): - ### FIELDS - - last_import_log = models.TextField( - "Výstup z posledního importu", null=True, blank=True - ) - max_items = models.IntegerField("Počet článků na stránce", default=12) - - ### PANELS - - content_panels = Page.content_panels + [ - FieldPanel("max_items"), - ] - - promote_panels = make_promote_panels() - - import_panels = [ - MultiFieldPanel( - [ - FieldPanel("do_import"), - FieldPanel("collection"), - FieldPanel("dry_run"), - FieldPanel("use_git"), - FieldPanel("jekyll_repo_url"), - FieldPanel("readonly_log"), - HelpPanel( - "Import provádějte vždy až po vytvoření stránky aktualit. " - 'Pro uložení logu je nutné volit možnost "Publikovat", nikoliv' - 'pouze "Uložit koncept". ' - "Import proběhne na pozadí a může trvat až několik minut. " - "Dejte si po spuštění importu kávu a potom obnovte stránku pro " - "zobrazení výsledku importu." - ), - ], - "import z Jekyll repozitáře", - ), - ] - - ### EDIT HANDLERS - - edit_handler = TabbedInterface( - [ - ObjectList(content_panels, heading="Obsah"), - ObjectList(promote_panels, heading="Propagovat"), - ObjectList(import_panels, heading="Import"), - ] - ) - - ### RELATIONS - - parent_page_types = ["region.RegionHomePage"] - subpage_types = ["region.RegionArticlePage"] - - ### OTHERS - - base_form_class = JekyllImportForm - - class Meta: - verbose_name = "Aktuality" - - def get_context(self, request): - context = super().get_context(request) - context["articles"] = Paginator( - self.get_children().live().specific().order_by("-regionarticlepage__date"), - self.max_items, - ).get_page(request.GET.get("page")) - return context - - -class RegionContactPage( - ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, Page -): - ### FIELDS - - contact_people = StreamField( - [("item", blocks.ContactItemBlock())], - verbose_name="Kontakty", - blank=True, - ) - text = RichTextField("Text", blank=True, features=RICH_TEXT_FEATURES) - - ### PANELS - - content_panels = Page.content_panels + [ - StreamFieldPanel("contact_people"), - FieldPanel("text"), - ] - - promote_panels = make_promote_panels() - - settings_panels = [] - - ### RELATIONS - - parent_page_types = ["region.RegionHomePage"] - subpage_types = [] - - ### OTHERS - - class Meta: - verbose_name = "Kontakty" - - -class RegionTagsPage(ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, Page): - ### PANELS - - promote_panels = make_promote_panels() - - settings_panels = [] - - ### RELATIONS - - parent_page_types = ["region.RegionHomePage"] - subpage_types = [] - - ### OTHERS - - class Meta: - verbose_name = "Stránka s tagy" - - def get_context(self, request, *args, **kwargs) -> dict: - context = super().get_context(request) - - # Potřebujeme IDčka článků pro správnou root_page pro filtrování zobrazených - # tagů i samotných stránek, protože se filtrují přes specifický field - # (tags__slug) - site_article_ids = ( - self.root_page.articles_page.get_children() - .live() - .specific() - .values_list("id", flat=True) - ) - - # Naplním "tag" a "article_page_list" parametry - context.update(**self.get_tag_and_articles(request, site_article_ids)) - context["tag_list"] = self.get_tag_qs(site_article_ids) - - # Pro obecnou paginaci posílám "extra_query", abych si podržel tag pro další GET - context["extra_query"] = "&tag={}".format(request.GET.get("tag", "")) - return context - - def get_tag_and_articles(self, request, site_article_ids: list) -> dict: - """ - Vrátí vyfiltrované články podle tagu a page query pro z daného "výběru" - pro danou stránku (site_article_ids). Lepší by bylo články a tag řešit - separátně, ale pak by se musel rozpadnout ten try/except na více bloků. - """ - article_page_qs = RegionArticlePage.objects.filter(id__in=site_article_ids) - - try: - tag = RegionArticleTag.objects.filter(tag__slug=request.GET["tag"])[0].tag - article_page_qs = article_page_qs.filter(tags__slug=tag.slug) - except (KeyError, IndexError): - tag = None - - return { - "article_page_list": Paginator( - article_page_qs.order_by("-date"), - self.root_page.articles_page.max_items, - ).get_page(request.GET.get("page")), - "tag": tag, - } - - @staticmethod - def get_tag_qs(site_article_ids: list) -> models.QuerySet: - """ - Getuje Tagy pouze pro RegionArticlePage omezeno IDčky getnutých přes - root_page. Počítá, kolik článků je s daným tagem. - """ - return ( - Tag.objects.filter(regionarticlepage__id__in=site_article_ids) - .order_by("slug") - .annotate(count=models.Count("slug")) - .values("name", "slug", "count") - ) - - -class RegionPersonTag(TaggedItemBase): - content_object = ParentalKey("region.RegionPersonPage", on_delete=models.CASCADE) - - -class RegionPersonPageForm(WagtailAdminPageForm): - def clean(self): - cleaned_data = super().clean() - email = cleaned_data.get("email", None) - if email: - pages_with_email = RegionPersonPage.objects.filter(email=email) - num_pages_with_email = len(pages_with_email) - if num_pages_with_email > 1 or ( - num_pages_with_email == 1 and pages_with_email[0] != self.instance - ): - raise ValidationError({"email": "Stránka s tímto emailem již existuje"}) - return cleaned_data - - -class RegionPersonPage( - ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, Page -): - base_form_class = RegionPersonPageForm - ### FIELDS - - job = models.CharField( - "Povolání", - max_length=128, - blank=True, - null=True, - help_text="Např. 'Informatik'", - ) - job_function = models.CharField( - "Funkce", max_length=128, blank=True, null=True, help_text="Např. 'Předseda'" - ) - background_photo = models.ForeignKey( - "wagtailimages.Image", - on_delete=models.PROTECT, - blank=True, - null=True, - related_name="+", - verbose_name="obrázek do záhlaví", - ) - profile_photo = models.ForeignKey( - "wagtailimages.Image", - on_delete=models.PROTECT, - blank=True, - null=True, - related_name="+", - verbose_name="profilová fotka", - ) - text = RichTextField("text", blank=True, features=RICH_TEXT_FEATURES) - - email = models.EmailField("Email", null=True) - show_email = models.BooleanField("Zobrazovat email na stránce?", default=True) - phone = models.CharField("Telefon", max_length=16, blank=True, null=True) - city = models.CharField("Město/obec", max_length=64, blank=True, null=True) - age = models.IntegerField("Věk", blank=True, null=True) - is_pirate = models.BooleanField("Je členem Pirátské strany?", default=True) - - facebook_url = models.URLField("Odkaz na Facebook", blank=True, null=True) - instagram_url = models.URLField("Odkaz na Instagram", blank=True, null=True) - twitter_url = models.URLField("Odkaz na Twitter", blank=True, null=True) - youtube_url = models.URLField("Odkaz na Youtube kanál", blank=True, null=True) - flickr_url = models.URLField("Odkaz na Flickr", blank=True, null=True) - custom_web_url = models.URLField("Odkaz na vlastní web", blank=True, null=True) - other_urls = StreamField( - [("other_url", blocks.PersonUrlBlock())], - verbose_name="Další odkaz", - blank=True, - ) - - ### PANELS - - content_panels = Page.content_panels + [ - MultiFieldPanel( - [ - FieldPanel("job"), - FieldPanel("job_function"), - ], - "Základní údaje", - ), - MultiFieldPanel( - [ - ImageChooserPanel("profile_photo"), - ImageChooserPanel("background_photo"), - ], - "Fotky", - ), - FieldPanel("text"), - MultiFieldPanel( - [ - FieldPanel("email"), - FieldPanel("show_email"), - FieldPanel("phone"), - FieldPanel("city"), - FieldPanel("age"), - FieldPanel("is_pirate"), - ], - "Kontaktní informace", - ), - MultiFieldPanel( - [ - FieldPanel("facebook_url"), - FieldPanel("instagram_url"), - FieldPanel("twitter_url"), - FieldPanel("youtube_url"), - FieldPanel("flickr_url"), - FieldPanel("custom_web_url"), - ], - "Sociální sítě", - ), - ] - - settings_panels = [] - - ### RELATIONS - - parent_page_types = ["region.RegionPeoplePage"] - subpage_types = [] - - ### OTHERS - - class Meta: - verbose_name = "Detail osoby" - - def get_background_photo(self): - """ - Vrací background_photo pro pozadí na stránce, pokud není nastaveno, - vezme falbback z homepage - """ - return ( - self.background_photo - if self.background_photo - else self.root_page.fallback_image - ) - - def get_context(self, request): - context = super().get_context(request) - # Na strance detailu cloveka se vpravo zobrazuji 3 dalsi nahodne profily - context["random_people"] = list( - self.get_siblings(inclusive=False).live().specific() - ) - random.shuffle(context["random_people"]) - context["random_people"] = context["random_people"][:3] - return context - - -class RegionPeoplePage( - ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, Page -): - ### FIELDS - - content = StreamField( - [("people_group", blocks.PeopleGroupListBlock())], - verbose_name="Obsah stránky", - blank=True, - ) - - ### PANELS - - content_panels = Page.content_panels + [StreamFieldPanel("content")] - - promote_panels = make_promote_panels() - - settings_panels = [] - - ### RELATIONS - - parent_page_types = ["region.RegionHomePage"] - subpage_types = ["region.RegionPersonPage"] - - ### OTHERS - - class Meta: - verbose_name = "Lidé" - - -class RegionElectionBasePage( - ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, Page -): - ### FIELDS - - text = RichTextField("text", blank=True, features=RICH_TEXT_FEATURES) - - ### PANELS - - content_panels = Page.content_panels + [FieldPanel("text")] - - promote_panels = make_promote_panels() - - settings_panels = [] - - ### RELATIONS - - parent_page_types = ["region.RegionElectionPage"] - subpage_types = [] - - def get_context(self, request, *args, **kwargs): - context = super().get_context(request, *args, **kwargs) - context["election_points"] = ( - self.get_siblings().type(RegionElectionPointPage).live().specific() - ) - context["strategy_page"] = self.get_parent().specific.strategy_page - return context - - class Meta: - abstract = True - - -class RegionAfterElectionPage(RegionElectionBasePage): - class Meta: - verbose_name = "Povolební strategie" - - -class RegionElectionPointPage(RegionElectionBasePage): - ### FIELDS - guarantor = models.ForeignKey( - "region.RegionPersonPage", on_delete=models.SET_NULL, null=True - ) - list_image = models.ForeignKey( - "wagtailimages.Image", - on_delete=models.PROTECT, - related_name="+", - ) - perex = models.TextField("Perex", help_text="Pro přehled volebního programu") - - ### PANELS - - content_panels = RegionElectionBasePage.content_panels + [ - PageChooserPanel("guarantor"), - ImageChooserPanel("list_image"), - FieldPanel("perex"), - ] - - ### OTHERS - - class Meta: - verbose_name = "Bod programu voleb" - - -class RegionElectionPage( - ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, Page -): - ### FIELDS - header = StreamField( - [("election_header_block", blocks.ElectionHeaderBlock())], - verbose_name="Obsah headeru", - blank=True, - ) - - content = StreamField( - [("candidate_list", blocks.CandidateListBlock())], - verbose_name="Obsah stránky", - blank=True, - ) - - ### PANELS - - content_panels = Page.content_panels + [ - StreamFieldPanel("header"), - StreamFieldPanel("content"), - ] - - promote_panels = make_promote_panels() - - settings_panels = [] - - ### RELATIONS - - parent_page_types = ["region.RegionHomePage"] - subpage_types = [ - "region.RegionElectionPointPage", - "region.RegionAfterElectionPage", - ] - - ### OTHERS - - class Meta: - verbose_name = "Volební rozcestník" - - def get_context(self, request, *args, **kwargs): - context = super().get_context(request, *args, **kwargs) - context["election_points"] = ( - self.get_children().live().type(RegionElectionPointPage).specific() - ) - return context - - @property - def strategy_page(self): - try: - return ( - self.get_descendants() - .type(RegionAfterElectionPage) - .live() - .specific()[0] - ) - except IndexError: - return None - - -class RegionProgramPage( - ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, Page -): - ### FIELDS - - perex = models.TextField("Perex", blank=True) - content = StreamField( - [ - ("static_program_block", blocks.StaticProgramBlock()), - ("redmine_program_block", blocks.RedmineProgramBlock()), - ], - verbose_name="obsah stránky", - blank=True, - ) - - ### PANELS - - content_panels = Page.content_panels + [ - FieldPanel("perex"), - StreamFieldPanel("content"), - ] - - promote_panels = make_promote_panels() - - settings_panels = [] - - ### RELATIONS - - parent_page_types = ["region.RegionHomePage"] - subpage_types = [] - - ### OTHERS - - class Meta: - verbose_name = "Program" - - def save(self, **kwargs): - from redmine_utils.functions import fill_data_from_redmine_for_page - - fill_data_from_redmine_for_page(self) - return super().save(**kwargs) - - -class RegionCenterPage( - CalendarMixin, ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, Page -): - ### FIELDS - - perex = models.TextField("Perex", blank=True, null=True) - background_photo = models.ForeignKey( - "wagtailimages.Image", - on_delete=models.PROTECT, - blank=True, - null=True, - related_name="+", - ) - content = StreamField( - [ - ("text", RichTextBlock()), - ("table", TableBlock(template="shared/blocks/table_block.html")), - ], - verbose_name="Obsah", - blank=True, - ) - text = RichTextField("Text", blank=True, null=True) - sidebar_content = StreamField( - [("address", blocks.AddressBlock()), ("contact", blocks.CenterContactBlock())], - verbose_name="Obsah bočního panelu", - blank=True, - ) - - ### PANELS - - content_panels = Page.content_panels + [ - FieldPanel("perex"), - ImageChooserPanel("background_photo"), - FieldPanel("text"), - StreamFieldPanel("content"), - FieldPanel("calendar_url"), - StreamFieldPanel("sidebar_content"), - ] - - promote_panels = make_promote_panels() - - settings_panels = [] - - ### RELATIONS - - parent_page_types = ["region.RegionHomePage"] - subpage_types = [] - - ### OTHERS - - class Meta: - verbose_name = "Stránka pirátského centra" - - def get_background_photo(self): - """ - Vrací background_photo pro pozadí na stránce, pokud není nastaveno, - vezme falbback z homepage - """ - return ( - self.background_photo - if self.background_photo - else self.root_page.fallback_image - ) - - @property - def has_calendar(self): - return self.calendar_id is not None - - -class RegionCrossroadPage( - ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, Page -): - - ### FIELDS - - cards_content = StreamField( - [("cards", blocks.CardLinkWithHeadlineBlock())], - verbose_name="Karty rozcestníku", - blank=True, - ) - - content = StreamField( - [ - ("people_group", blocks.PeopleGroupListBlock()), - ], - verbose_name="Obsah stránky", - blank=True, - ) - - ### PANELS - - content_panels = Page.content_panels + [ - StreamFieldPanel("cards_content"), - StreamFieldPanel("content"), - ] - - promote_panels = make_promote_panels() - - settings_panels = [] - - ### RELATIONS - - parent_page_types = ["region.RegionHomePage"] - subpage_types = [ - "region.RegionAfterElectionPage", - "region.RegionArticlePage", - "region.RegionArticlesPage", - "region.RegionCenterPage", - "region.RegionContactPage", - "region.RegionCrossroadPage", - "region.RegionCustomPage", - "region.RegionElectionPage", - "region.RegionElectionPointPage", - "region.RegionPeoplePage", - "region.RegionPersonPage", - "region.RegionProgramPage", - "region.RegionTagsPage", - ] - ### OTHERS - - class Meta: - verbose_name = "Rozcestník s kartami" - - -class RegionCustomPage( - ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, Page -): - - ### FIELDS - - content = StreamField( - [ - ("text", RichTextBlock()), - ("table", TableBlock(template="shared/blocks/table_block.html")), - ("people_group", blocks.PeopleGroupListBlock()), - ], - verbose_name="Obsah", - blank=True, - ) - - ### PANELS - - content_panels = Page.content_panels + [ - StreamFieldPanel("content"), - ] - - promote_panels = make_promote_panels() - - settings_panels = [] - - ### RELATIONS - - parent_page_types = ["region.RegionHomePage", "region.RegionCrossroadPage"] - subpage_types = [] - - ### OTHERS - - class Meta: - verbose_name = "Libovolná vlastní stránka" diff --git a/region/tasks.py b/region/tasks.py deleted file mode 100644 index 8eb9c6d1de7b5f6892c2c0a058d22862cca16a2d..0000000000000000000000000000000000000000 --- a/region/tasks.py +++ /dev/null @@ -1,27 +0,0 @@ -import logging - -from majak.celery import app -from shared.jekyll_import import JekyllArticleImporter - -logger = logging.getLogger(__name__) - - -@app.task -def import_jekyll_articles( - article_parent_page_id: int, - collection_id: int, - url: str, - dry_run: bool, - use_git: bool, -): - from .models import RegionArticlePage, RegionArticlesPage - - return JekyllArticleImporter( - article_parent_page_id=article_parent_page_id, - collection_id=collection_id, - url=url, - dry_run=dry_run, - use_git=use_git, - parent_page_model=RegionArticlesPage, - page_model=RegionArticlePage, - ).perform_import() diff --git a/region/templates/region/404.html b/region/templates/region/404.html deleted file mode 100644 index b2a244b4ef7e1b974de4b6fafd57d1e8715c0ae3..0000000000000000000000000000000000000000 --- a/region/templates/region/404.html +++ /dev/null @@ -1,22 +0,0 @@ -{% load static %} - -<html lang="cs"> - <head> - <link rel="stylesheet" href="{% static 'styleguide234/assets/css/styles.css' %}"> - <title>404</title> - </head> - <body> - <div class="flex flex-col my-40 items-center"> - <h1 class="head-alt-lg mb-8"> - 404 - </h1> - <img src="{% static 'shared/img/logo_black.svg' %}" alt class="mb-8"/> - <h1 class="head-alt-md mb-8"> - Narazili jsme na mělčinu... - </h1> - <a href="/"> - Zpět do přístavu - </a> - </div> - </body> -</html> diff --git a/region/templates/region/base.html b/region/templates/region/base.html deleted file mode 100644 index df54a1ac577744396e7607b8d68e266bf805fecc..0000000000000000000000000000000000000000 --- a/region/templates/region/base.html +++ /dev/null @@ -1,312 +0,0 @@ -{% load static wagtailcore_tags wagtailimages_tags wagtailmetadata_tags %} -<!doctype html> -<html lang="cs"> -<head> - <!-- Meta --> - <meta charset="utf-8"> - <meta name="viewport" content="width=device-width" /> - {% meta_tags %} - {% if settings.MAJAK_ENV == "test" %} - <meta name="robots" content="noindex, nofollow"> - {% endif %} - - <!-- Favicon --> - {% include "shared/favicon_snippet.html" %} - - <!-- Bootstrap CSS --> - - <!-- Styles --> - <link rel="stylesheet" href="{% static "styleguide234/assets/css/styles.css" %}"> - <link href="{% static "shared/vendor/fancybox/jquery.fancybox.min.css" %}" rel="stylesheet"> - <link rel="stylesheet" href="{% static "shared/css/helpers.css" %}"> - - <style type="text/css"> - .inline-block { - display: inline-block; - } - </style> - - {% if page.root_page.matomo_id %} - {% include "shared/matomo_snippet.html" with matomo_id=page.root_page.matomo_id %} - {% endif %} -</head> - -<body> - - <nav class="navbar __js-root py-lg-6"> - <ui-app inline-template> - <ui-navbar inline-template> - <div> - <div class="container container--wide navbar__content" :class="{'navbar__content--initialized': true}"> - - <div class="navbar__brand my-4 flex items-center lg:block lg:pr-8 lg:my-0"> - <a href="/"> - {% if page.root_page.custom_logo %} - {% image page.root_page.custom_logo width-128 as logo %} - <img - src="{{ logo.url }}" - class="w-10 lg:w-full lg:border-r lg:border-grey-300 lg:pr-8" - alt="logo" - /> - {% else %} - <img - src="{% static "styleguide234/assets/images/logo-round-white.svg" %}" - class="w-10 lg:w-full lg:border-r lg:border-grey-300 lg:pr-8" - alt="logo" - /> - {% endif %} - </a> - <span class="lg:hidden pl-4 font-bold text-xl">{{ page.root_page.title }}</span> - </div> - - <div class="navbar__menutoggle my-4 flex justify-end lg:hidden"> - <a href="#" @click="show = !show" class="no-underline hover:no-underline"> - <i class="ico--menu text-3xl"></i> - </a> - </div> - - <div v-if="show || isLgScreenSize" class="navbar__external navbar__section navbar__section--expandable container-padding--zero lg:container-padding--auto lg:flex lg:space-x-8 lg:pb-2"> - - <div class="text-grey-200 text-sm lg:space-x-8 leading-loose lg:leading-normal"> - - <a href="https://www.pirati.cz" class="contact-line icon-link content-block--nostyle block lg:inline-block" target="_blank" rel="noopener noreferrer"> - <i class="ico--home"></i> - <span>pirati.cz</span> - </a> - - <a href="https://piratskyobchod.cz" class="contact-line icon-link content-block--nostyle block lg:inline-block" target="_blank" rel="noopener noreferrer"> - <i class="ico--cart"></i> - <span>piratskyobchod.cz</span> - </a> - - <a href="http://www.piratskelisty.cz" class="contact-line icon-link content-block--nostyle block lg:inline-block" target="_blank" rel="noopener noreferrer"> - <i class="ico--newspaper"></i> - <span>Pirátské listy</span> - </a> - - </div> - - <div class="social-icon-group space-x-2 text-grey-200 py-4 lg:py-0"> - {% include "shared/social_icons_snippet.html" %} - </div> - - </div> - - <div v-if="show || isLgScreenSize" class="navbar__main navbar__section navbar__section--expandable container-padding--zero lg:container-padding--auto"> - <ul class="navbar-menu text-white"> - {% for block in page.root_page.menu %} - {% include_block block %} - {% endfor %} - </ul> - </div> - - <div v-if="show || isLgScreenSize" class="navbar__actions navbar__section navbar__section--expandable container-padding--zero lg:container-padding--auto self-start flex flex-col sm:flex-row lg:flex-col sm:space-x-4 space-y-2 sm:space-y-0 lg:space-y-2 xl:flex-row xl:space-x-2 xl:space-y-0"> - <a href="{{ page.root_page.donation_page|default:"https://dary.pirati.cz" }}" rel="noopener noreferrer" target="_blank" class="btn btn--icon btn--cyan-200 btn--hoveractive btn--condensed btn--fullwidth md:btn--autowidth lg:text-sm xl:text-base"> - <div class="btn__body-wrap"> - <div class="btn__body ">Přispěj</div> - <div class="btn__icon "> - <i class="ico--pig"></i> - </div> - </div> - </a> - <a href="{{ page.root_page.contact_newcomers|default:"https://nalodeni.pirati.cz" }}" rel="noopener noreferrer" target="_blank" class="btn btn--icon btn--blue-300 btn--hoveractive btn--condensed btn--fullwidth md:btn--autowidth lg:text-sm xl:text-base"> - <div class="btn__body-wrap"> - <div class="btn__body ">Naloď se</div> - <div class="btn__icon "> - <i class="ico--anchor"></i> - </div> - </div> - </a> - </div> - </div> - </div> - </ui-navbar> - </ui-app> -</nav> - -<div class="__js-root"> - <ui-app inline-template> - - <ui-view-provider :initial="{regions: false, calendar: false}" v-slot="{ isCurrentView, toggleView }"> - <nav class="subnav py-2"> - <div class="container container--wide"> - <div class="flex"> - <button - class="btn btn--condensed btn--grey-500 btn--hoveractive btn--to-white text-sm mr-2 px-0" - :class="{'btn--activated': isCurrentView('regions')}" - @click="toggleView('regions')" - > - <div class="btn__body py-2"> - <span>{{ page.root_page.region_map_button_text }}</span> - <i class="ico--chevron-down ml-4"></i> - </div> - </button> - - {% if page.root_page.has_calendar %} - <button - class="btn btn--inline-icon btn--condensed btn--hoveractive btn--grey-500 btn--to-orange-300 text-sm px-0" - :class="{'btn--activated': isCurrentView('calendar')}" - @click="toggleView('calendar')" - > - <div class="btn__body py-2"> - <i class="btn__inline-icon ico--calendar mr-0 md:mr-2 text-orange-300"></i> - <span class="hidden md:block"> - {{ page.root_page.calendar_button_text|default_if_none:"Kalendář" }} - </span> - </div> - </button> - - {% with page.root_page.calendar.current_events.0 as first_event %} - {% if first_event %} - <span class="btn text-sm max-w-full hidden lg:block" @click="toggleView('calendar')"> - <div class="btn__body bg-grey-800 text-grey-200 flex divide-x"> - <span class="pr-4">{{ first_event.summary }}</span> - <span class="pl-4">{{ first_event.start|date:"l j. E"|capfirst }}</span> - </div> - </span> - {% endif %} - {% endwith %} - {% endif %} - - {% if page.root_page.facebook %} - <a href="{{ page.root_page.facebook }}" target="_blank" rel="noopener noreferrer" class="btn btn--inline-icon btn--condensed btn--hoveractive btn--grey-500 btn--to-brands-facebook text-sm ml-2 px-0"> - <div class="btn__body py-2"> - <i class="btn__inline-icon ico--facebook mr-0 md:mr-2 text-brands-facebook"></i> - <span class="hidden md:block">{{ page.root_page }}</span> - </div> - </a> - {% endif %} - - </div> - </div> - </nav> - - <aside class="subnav-aside"> - <div class="subnav-aside__item" :class="{'subnav-aside__item--visible': isCurrentView('regions')}"> - <ui-region-map class="container container--default" /> - </div> - <div class="subnav-aside__item" :class="{'subnav-aside__item--visible': isCurrentView('calendar')}"> - <div class="container container--default"> - {% include "shared/calendar_current_events_snippet.html" %} - </div> - </div> - </aside> - </ui-view-provider> - </ui-app> -</div> - - -{% block subheader %}{% endblock %} - -{% block container %} - <main class="container container--default {% block container_spacing %}py-8 lg:py-16{% endblock %}"> - {% block content %}{% endblock %} - </main> -{% endblock%} - - - <footer class="footer bg-grey-700 text-white __js-root"> - - <ui-app inline-template> - - <div> - <div class="footer__main py-4 lg:py-16 container container--default pt-5"> - - <section class="footer__brand"> - <img src="{% static "shared/img/logo-full-white.svg" %}" alt="Pirátská strana" class="w-32 md:w-40 pb-6" /> - <p class="para hidden md:block md:mb-4 lg:mb-0 text-grey-200"> - Piráti, {% now "Y" %}. Všechna práva vyhlazena. - Sdílejte a nechte ostatní sdílet za stejných podmínek. - </p> - </section> - - <section class="footer__main-links bg-grey-700 text-white lg:grid grid-cols-3 gap-4"> - <div class="pt-8 pb-4 lg:py-0"> - <ui-footer-collapsible label="Připoj se"> - <ul class="mt-6 space-y-2 text-grey-200"> - <li><a href="{{ page.root_page.contact_newcomers|default:"https://nalodeni.pirati.cz" }}">Zájemci o členství</a></li> - <li><a href="{{ page.root_page.contact_page.url }}">Dej nám vědět</a></li> - <li><a href="https://nalodeni.pirati.cz">Nalodění</a></li> - </ul> - </ui-footer-collapsible> - </div> - - <div class="py-4 lg:py-0 border-t border-grey-400 lg:border-t-0"> - <ui-footer-collapsible label="Makáme"> - <ul class="mt-6 space-y-2 text-grey-200"> - <li><a href="{{ page.root_page.people_page.url }}">{{ page.root_page.people_page }}</a></li> - <li><a href="{{ page.root_page.articles_page.url }}">{{ page.root_page.articles_page }}</a></li> - </ul> - </ui-footer-collapsible> - </div> - - <div class="py-4 lg:py-0 border-t border-grey-400 lg:border-t-0"> - <ui-footer-collapsible label="Otevřenost"> - <ul class="mt-6 space-y-2 text-grey-200"> - <li><a href="https://ucet.pirati.cz">Transparentní účet</a></li> - <li><a href="https://smlouvy.pirati.cz">Registr smluv</a></li> - <li><a href="https://wiki.pirati.cz/fo/otevrene_ucetnictvi">Otevřené účetnictví</a></li> - </ul> - </ui-footer-collapsible> - </div> - </section> - - <section class="footer__social lg:text-right"> - <div class="mb-4"> - <div class="social-icon-group space-x-2 text-white pb-4"> - {% include "shared/social_icons_snippet.html" %} - </div> - <a href="mailto:{{ page.root_page.contact_email|default:"info@pirati.cz" }}" class="contact-line icon-link content-block--nostyle " ><i class="ico--envelope"></i><span>Dejte nám vědět</span></a> - </div> - - <div class="flex flex-col md:flex-row lg:flex-col lg:items-end space-y-2 md:space-y-0 md:space-x-2 lg:space-x-0 lg:space-y-2"> - - <a href="{{ page.root_page.donation_page|default:"https://dary.pirati.cz" }}" rel="noopener noreferrer" target="_blank" class="btn btn--icon btn--cyan-200 btn--hoveractive text-lg btn--fullwidth sm:btn--autowidth px-0 mx-0"> - <div class="btn__body-wrap"> - <div class="btn__body ">Přispěj</div> - <div class="btn__icon "><i class="ico--pig"></i></div> - </div> - </a> - - <a href="https://nalodeni.pirati.cz" rel="noopener noreferrer" target="_blank" class="btn btn--icon btn--blue-300 btn--hoveractive text-lg btn--fullwidth sm:btn--autowidth mt-0 px-0 mx-0"> - <div class="btn__body-wrap"> - <div class="btn__body ">Naloď se</div> - <div class="btn__icon "><i class="ico--anchor"></i></div> - </div> - </a> - - </div> - - </section> - </div> - - {% if page.root_page.footperson_coord or page.root_page.footperson_electman or page.root_page.footperson_media %} - <section class="bg-black py-4 lg:py-12"> - <div class="container container--default"> - <div class="grid gap-4 grid-cols-1 md:grid-cols-2 xl:grid-cols-3"> - {% if page.root_page.footperson_coord %} - {% include "shared/person_badge_snippet.html" with person_page=page.root_page.footperson_coord title=page.root_page.footperson_coord_title %} - {% endif %} - {% if page.root_page.footperson_electman %} - {% include "shared/person_badge_snippet.html" with person_page=page.root_page.footperson_electman title=page.root_page.footperson_electman_title %} - {% endif %} - {% if page.root_page.footperson_media %} - {% include "shared/person_badge_snippet.html" with person_page=page.root_page.footperson_media title=page.root_page.footperson_media_title %} - {% endif %} - </div> - </div> - </section> - {% endif%} - - </div> - </ui-app> -</footer> - - - <script src="{% static "styleguide234/assets/js/vue.2.6.11.js" %}"></script> - <script src="{% static "styleguide234/assets/js/main.bundle.js" %}"></script> - <script src="{% static "shared/vendor/jquery/jquery-3.4.1.min.js" %}"></script> - <script src="{% static "shared/vendor/lazysizes/lazysizes.min.js" %}"></script> - <script src="{% static "shared/vendor/fancybox/jquery.fancybox.min.js" %}"></script> -</body> -</html> diff --git a/region/templates/region/blocks/address_block.html b/region/templates/region/blocks/address_block.html deleted file mode 100644 index 12a0b344a7b098b4ed16eac5ee6ff6d6da574008..0000000000000000000000000000000000000000 --- a/region/templates/region/blocks/address_block.html +++ /dev/null @@ -1,24 +0,0 @@ -{% load wagtailimages_tags %} - -<h2 class="head-heavy-sm mb-2"> - {{ self.title }} -</h2> - -{% if self.map_image %} - <a href="{{ self.map_link }}"> - {% image self.map_image width-1000 as img %} - <img src="{{ img.url }}" alt="{{ img.alt }}" class="h-80 w-full object-cover"> - </a> -{% endif %} - -<p> - {{ self.address | linebreaks }} -</p> - -{% if self.address_info %} - <p> - <small> - {{ self.address_info }} - </small> - </p> -{% endif %} diff --git a/region/templates/region/blocks/call_to_action_button_block.html b/region/templates/region/blocks/call_to_action_button_block.html deleted file mode 100644 index e5cdc9ac7389fa26175b5217097bc6534e6db57e..0000000000000000000000000000000000000000 --- a/region/templates/region/blocks/call_to_action_button_block.html +++ /dev/null @@ -1,6 +0,0 @@ -<a - href="{{ self.button_link }}" - class="btn btn--white btn--hoveractive btn--fullwidth md:btn--autowidth text-lg" -> - <div class="btn__body ">{{ self.button_text }}</div> -</a> diff --git a/region/templates/region/blocks/candidate_list_block.html b/region/templates/region/blocks/candidate_list_block.html deleted file mode 100644 index 06df7bad3368e2eb5fd3e1121541c3071ffff77c..0000000000000000000000000000000000000000 --- a/region/templates/region/blocks/candidate_list_block.html +++ /dev/null @@ -1,57 +0,0 @@ -<h1 class="head-alt-md text-center py-8 lg:pt-24 lg:pb-8"> - {{ self.title }} -</h1> - -<div class="candidate-card-list grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4"> - {% for person_page in self.candidate_list %} - {% if forloop.counter <= self.candidate_list_big_count %} - {% include "shared/full_candidate_snippet.html" %} - {% endif %} - {% endfor %} - <aside class="banner bg-black text-white container-padding--zero sm:container-padding--auto"> - <i class="ico--pirati banner__icon"></i>k - <div class="banner__body"> - <h1 class="head-alt-lg banner__cta"> - {{ self.call_to_action_text }} - </h1> - {% if self.call_to_action_button_text %} - <a href="{{ self.call_to_action_link }}" class="btn btn--white btn--fullwidth mt-8"> - <div class="btn__body "> - {{ self.call_to_action_button_text}} - </div> - </a> - {% endif %} - </div> - </aside> -</div> -<div> - <ui-view-provider :initial="{fullCandidateTable: false}" v-slot="{ isCurrentView, setView }"> - <div class="candidate-table pt-8 container-padding--zero lg:container-padding--auto" - :class="{'candidate-table--fadeout': !isCurrentView('fullCandidateTable')}"> - {% for person_page in self.candidate_list %} - {# Záměrně neomezuju list přes indexy, ale ifuju, abych si držel counter pro snippet #} - {% if forloop.counter > self.candidate_list_big_count and forloop.counter <= self.candidate_list_shown_count %} - {% include "shared/compact_candidate_snippet.html" %} - {% endif %} - {% endfor %} - <template v-if="isCurrentView('fullCandidateTable')"> - {% for person_page in self.candidate_list %} - {# Záměrně neomezuju list přes indexy, ale ifuju, abych si držel counter pro snippet #} - {% if forloop.counter > self.candidate_list_shown_count %} - {% include "shared/compact_candidate_snippet.html" %} - {% endif %} - {% endfor %} - </template> - </div> - - <div class="text-center pt-8" v-if="!isCurrentView('fullCandidateTable')"> - <button class="btn btn--icon text-xl btn--black btn--hoveractive" - @click="setView('fullCandidateTable', true)"> - <div class="btn__body-wrap"> - <div class="btn__body ">Zobrazit vše</div> - <div class="btn__icon "><i class="ico--chevron-right"></i></div> - </div> - </button> - </div> - </ui-view-provider> -</div> diff --git a/region/templates/region/blocks/card_link_block.html b/region/templates/region/blocks/card_link_block.html deleted file mode 100644 index d69322e47c92c435fdba5526fc131208391baac6..0000000000000000000000000000000000000000 --- a/region/templates/region/blocks/card_link_block.html +++ /dev/null @@ -1,20 +0,0 @@ -{% load wagtailcore_tags wagtailimages_tags %} - -{% image self.image width-356 as img %} -{% firstof self.page.url self.link as target_url %} - -<article class="card"> - <a href="{{ target_url }}"> - <img src="{{ img.url }}" alt="{{ self.page.title }}" class="w-full h-48 object-cover"> - </a> - <div class="card__body p-4"> - <h1 class="card-headline mb-2"> - <a href="{{ target_url }}"> - {{ self.title }} - </a> - </h1> - <div class="card-body-text"> - {{ self.text | default_if_none:'' | richtext }} - </div> - </div> -</article> diff --git a/region/templates/region/blocks/card_link_with_headline_block.html b/region/templates/region/blocks/card_link_with_headline_block.html deleted file mode 100644 index 5ee9d5aca986d43e96a5a454e02ed57af068edba..0000000000000000000000000000000000000000 --- a/region/templates/region/blocks/card_link_with_headline_block.html +++ /dev/null @@ -1,14 +0,0 @@ -{% load wagtailcore_tags %} - -<div class="mb-8"> - {% if self.headline %} - <h1 class="head-heavy-base mb-8">{{ self.headline }}</h1> - {% endif %} - <main> - <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8"> - {% for card_block in self.card_items %} - {% include_block card_block %} - {% endfor %} - </div> - </main> -</div> diff --git a/region/templates/region/blocks/contact_block.html b/region/templates/region/blocks/contact_block.html deleted file mode 100644 index 162d56baa64a2843fc9046006f39c2acaea76d7a..0000000000000000000000000000000000000000 --- a/region/templates/region/blocks/contact_block.html +++ /dev/null @@ -1,11 +0,0 @@ -<h2 class="head-heavy-sm mb-2"> - {{ self.title }} -</h2> - -<div class="space-y-4"> - {% for contact_details in self.contact_list %} - {% with contact_details.person as person_page %} - {% include "shared/person_badge_snippet.html" with title=contact_details.position|default:person_page.job_function %} - {% endwith %} - {% endfor %} -</div> diff --git a/region/templates/region/blocks/election_header_block.html b/region/templates/region/blocks/election_header_block.html deleted file mode 100644 index 5d82240bafd1a69cdeb185daad0fe87f65f08f91..0000000000000000000000000000000000000000 --- a/region/templates/region/blocks/election_header_block.html +++ /dev/null @@ -1,35 +0,0 @@ -{% load wagtailcore_tags wagtailimages_tags %} - -{% image self.background_image width-1920 as bg_img %} -<header class="hero hero--image py-16 " style="--image-url: url({{ bg_img.url }})"> - <div class="container container--default grid lg:grid-rows-3 lg:grid-cols-7 gap-2 items-center"> - <div class="lg:row-span-2 lg:col-span-3 order-1"> - {% if self.flag_text %} - <div class="flag bg-violet-400 text-white head-alt-base mb-6"> - {{ self.flag_text }} - </div> - {% endif %} - <h1 class="head-alt-md md:head-alt-xl"> - {{ page.title }} - </h1> - {% if self.motto %} - <h2 class="head-xs md:head-base mt-2"> - {{ self.motto }} - </h2> - {% endif %} - </div> - <div class="lg:row-span-1 lg:col-span-3 order-3"> - <div class="mt-4 md:mt-8 space-y-4"> - {% for button_block in self.button_list %} - {% include_block button_block %} - {% endfor %} - </div> - </div> - <div class="lg:row-span-3 lg:col-span-4 order-2"> - {% if self.image %} - {% image self.image width-490 as img %} - <img src="{{ img.url }}" class="h-32 lg:h-80 lg:m-auto hidden md:block object-contain" alt=""> - {% endif %} - </div> - </div> -</header> diff --git a/region/templates/region/blocks/homepage_header_block.html b/region/templates/region/blocks/homepage_header_block.html deleted file mode 100644 index c759dfd0afa5059d37e1e20312ec9fbd5b54150d..0000000000000000000000000000000000000000 --- a/region/templates/region/blocks/homepage_header_block.html +++ /dev/null @@ -1,30 +0,0 @@ -{% load wagtailimages_tags %} - -<header class="hero py-8 lg:py-16"> - <div class="container container--default grid lg:grid-cols-7 lg:grid-rows-3 gap-2 items-center"> - <div class="lg:col-span-3 lg:row-span-2 order-1"> - <h1 class="head-alt-md md:head-alt-xl">{% firstof self.title page.title %}</h1> - </div> - - <div class="lg:row-span-1 lg:col-span-3 order-3"> - <div class="mt-4 md:mt-8 space-y-4 "> - {% if self.button_link and self.button_text %} - <a href="{{ self.button_link }}" - class="btn btn--icon btn--hoveractive btn--fullwidth md:btn--autowidth text-lg"> - <div class="btn__body-wrap"> - <div class="btn__body ">{{ self.button_text }}</div> - <div class="btn__icon "> - <i class="ico--chevron-right"></i> - </div> - </div> - </a> - {% endif %} - </div> - </div> - - <div class="lg:col-span-4 order-2 row-span-1 lg:row-span-3"> - {% image self.image width-495 as img %} - <img src="{{ img.url }}" alt="" class="object-contain h-32 lg:h-80 lg:m-auto hidden md:block"> - </div> - </div> -</header> diff --git a/region/templates/region/blocks/homepage_simple_header_block.html b/region/templates/region/blocks/homepage_simple_header_block.html deleted file mode 100644 index c6aed45f38f5b3ea728101a0f30f0c378972a8dc..0000000000000000000000000000000000000000 --- a/region/templates/region/blocks/homepage_simple_header_block.html +++ /dev/null @@ -1,16 +0,0 @@ -{% load wagtailimages_tags %} - -{% image self.image width-1920 as img %} -<header - class="hero hero--image py-16 " - style="--image-url: url({{ img.url }})" -> - <div class="container container--default"> - <h1 class="head-alt-md md:head-alt-lg max-w-2xl "> - {{ self.title }} - </h1> - <h2 class="head-xs mt-2 "> - {{ self.subtitle }} - </h2> - </div> -</header> diff --git a/region/templates/region/blocks/people_group_block.html b/region/templates/region/blocks/people_group_block.html deleted file mode 100644 index d6a358e4558a85842409281010dfad5b4c09f39b..0000000000000000000000000000000000000000 --- a/region/templates/region/blocks/people_group_block.html +++ /dev/null @@ -1,10 +0,0 @@ -<section> - <h2 class="head-heavy-base mb-4"> - {{ self.group_title }} - </h2> - <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 row-gap-8 col-gap-8"> - {% for person_page in self.person_list %} - {% include "shared/person_badge_snippet.html" with person_page=person_page.specific %} - {% endfor %} - </div> -</section> diff --git a/region/templates/region/blocks/program_block.html b/region/templates/region/blocks/program_block.html deleted file mode 100644 index f572fa8dfd02bab153697d7ffc08a2d0fee0f4b6..0000000000000000000000000000000000000000 --- a/region/templates/region/blocks/program_block.html +++ /dev/null @@ -1,55 +0,0 @@ -<article class="mt-8"> - <div class="lg:flex lg:space-x-16"> - <div class="lg:w-3/5"> - <h2 class="head-heavy-sm mb-2 lg:mb-4"> - {{ self.headline }} - </h2> - <div itemprop="description" class="w-full content-block"> - <p> - {{ self.perex }} - </p> - </div> - </div> - <div class="pt-8 lg:w-2/5 md:pt-0"> - <div class="card"> - <div class="card__body"> - {% include "shared/person_badge_snippet.html" with person_page=self.person %} - - <div class="content-block"> - <div class="space-y-4 mt-8"> - <div> - <a href="https://redmine.pirati.cz/issues/28177" class="contact-line icon-link content-block--nostyle"> - <i class="ico--info"></i> - <span>Plnění programu: {{ self.completion_percentage }}%</span> - </a> - </div> - </div> - </div> - </div> - </div> - </div> - </div> - - <div class="mt-4"> - <table class="table table--striped table--bordered w-full"> - <thead> - <tr> - <td>Název</td> - <td>Stav plnění</td> - </tr> - </thead> - <tbody> - {% for item in self.program_items %} - <tr> - <td> - <a href="{{ item.issue_link }}" target="_blank"> - {{ item.title }} - </a> - </td> - <td>{{ item.completion_percentage }} %</td> - </tr> - {% endfor %} - </tbody> - </table> - </div> -</article> diff --git a/region/templates/region/region_after_election_page.html b/region/templates/region/region_after_election_page.html deleted file mode 100644 index a767d7d945e49c37eed8c9cb4769775bb9f9bb27..0000000000000000000000000000000000000000 --- a/region/templates/region/region_after_election_page.html +++ /dev/null @@ -1,54 +0,0 @@ -{% extends "region/base.html" %} -{% load wagtailcore_tags wagtailimages_tags shared_filters %} - -{% block content %} - <main> - <div class="lg:flex lg:space-x-8 xl:space-x-16"> - <section class="lg:w-3/5 xl:w-2/3"> - <h1 class="head-alt-md md:head-alt-lg max-w-5xl mb-4"> - {{ page.title }} - </h1> - <div class="content-block w-full"> - {{ page.text | richtext }} - </div> - </section> - <section class="pt-8 lg:w-2/5 xl:w-1/3 lg:pt-0"> - <div class="lg:card lg:elevation-10"> - <div class="lg:card__body"> - <div class="content-block"> - <h2>Volby</h2> - <h3>Program</h3> - <ul class="unordered-list unordered-list--linked "> - {% for point_page in election_points %} - <li> - <a - href="{{ point_page.url }}" - class="{% if point_page.id == page.id %}font-bold {% endif %}content-block--nostyle" - > - {{ point_page.title }} - </a> - </li> - {% endfor %} - </ul> - <hr> - <h3>Financování kampaně</h3> - <p>Transparentní financování kampaně je pro nás samozřejmost.</p> - <a - href="https://wiki.pirati.cz/ft/start" - class="btn btn--icon btn--black btn--hoveractive btn--fullwidth md:btn--autowidth" - > - <div class="btn__body-wrap"> - <div class="btn__body ">Zjistit víc</div> - <div class="btn__icon "> - <i class="ico--chevron-right"></i> - </div> - </div> - </a> - </div> - </div> - </div> - </section> - </div> - </main> - -{% endblock content %} diff --git a/region/templates/region/region_article_page.html b/region/templates/region/region_article_page.html deleted file mode 100644 index 4cf346eca3f59b3a1771448234ee702f2dc2c092..0000000000000000000000000000000000000000 --- a/region/templates/region/region_article_page.html +++ /dev/null @@ -1,92 +0,0 @@ -{% extends "region/base.html" %} -{% load static wagtailcore_tags wagtailimages_tags %} - -{% block content %} - <article> - <link itemprop="mainEntityOfPage" href="{{ page.url }}"> - <meta itemprop="datePublished" content="{{ page.last_published_at }}"> - <meta itemprop="dateModified" content="{{ page.latest_revision_created_at }}"> - - <h1 class="head-alt-md md:head-alt-lg max-w-5xl mb-4"> - {{ page.title }} - </h1> - - <div class="flex flex-col md:flex-row md:items-center"> - <div class="inline-flex divide-x flex-grow"> - <span class="pr-2">{{ page.date|date:"DATE_FORMAT" }}</span> - <span class="pl-2" itemprop="author" itemtype="http://schema.org/Person" itemscope=""> - {% if page.author_page %} - <a href="{{ page.author_page.url }}" itemprop="name">{{ page.author }}</a> - {% else %} - <span itemprop="name">{{ page.author }}</span> - {% endif %} - </span> - </div> - <div class="my-4"> - {% for tag in page.tags.all %} - <a href="{{ page.root_page.tags_page.url }}?tag={{ tag.slug }}" class="btn btn--grey-125 btn--condensed"> - <div class="btn__body ">{{ tag }}</div> - </a> - {% endfor %} - </div> - </div> - <figure class="figure"> - {% image page.image width-2000 as img %} - <img src="{{ img.url }}" alt="{{ page.title }}" /> - </figure> - - <div class="lg:flex mt-8 lg:space-x-16"> - <div class="lg:w-2/3"> - <div itemprop="description" class="content-block w-full"> - {% for block in page.content %} - {% include_block block %} - {% endfor %} - - {% if page.author_page %} - {% include "shared/person_badge_snippet.html" with person_page=page.author_page title="Autor" %} - {% endif %} - </div> - - </div> - <div class="pt-8 lg:w-1/3 md:pt-0"> - <div class="sharebox md:card md:elevation-10 "> - <div class="md:card__body"> - <span class="head-alt-base md:head-alt-md">Sdílení je aktem lásky</span> - <div class="flex w-full space-x-4 pt-4 md:pt-8 text-center text-white"> - <a - href="https://www.facebook.com/sharer/sharer.php?u={{ page.full_url|urlencode }}" - onclick="window.open(this.href, 'pop-up', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;" - class="bg-brands-facebook px-8 py-3 text-2xl w-full" - ><i class="ico--facebook"></i></a> - <a - href="https://twitter.com/intent/tweet?text={{ page.title|urlencode }}&url={{ page.full_url|urlencode }}" - onclick="window.open(this.href, 'pop-up', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;" - class="bg-brands-twitter px-8 py-3 text-2xl w-full" - ><i class="ico--twitter"></i></a> - </div> - </div> - <div class="h-52 overflow-hidden hidden md:block"> - <img src="{% static "shared/img/flag.png" %}" alt="Pirátská strana" class="w-80 object-cover m-auto"/> - </div> - </div> - </div> - </div> - </article> - - {% if related_articles|length %} - <section class="mt-16 md:mt-24"> - <h1 class="head-alt-base md:head-alt-md pb-4"> - Další podobné články - </h1> - - <div class="article-card-list grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 lg:gap-8"> - {% for article in related_articles %} - {% include "shared/article_preview.html" %} - {% endfor %} - </div> - - {% include "shared/more_articles_snippet.html" %} - </section> - {% endif %} - -{% endblock %} diff --git a/region/templates/region/region_articles_page.html b/region/templates/region/region_articles_page.html deleted file mode 100644 index 8f3d7c2c44eb6ad8e1d58d4ea7f44674b981c728..0000000000000000000000000000000000000000 --- a/region/templates/region/region_articles_page.html +++ /dev/null @@ -1,15 +0,0 @@ -{% extends "region/base.html" %} - -{% block content %} - <header> - <h1 itemprop="headline" class="head-alt-md md:head-alt-lg max-w-5xl mb-8">{{ page.title }}</h1> - </header> - - <div class="article-card-list grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 lg:gap-8"> - {% for a in articles %} - {% include "shared/article_preview.html" with article=a %} - {% endfor %} - </div> - - {% include 'styleguide/2.3.x/pagination.html' with paginator=articles %} -{% endblock %} diff --git a/region/templates/region/region_center_page.html b/region/templates/region/region_center_page.html deleted file mode 100644 index 1daddb93a61d54280165ba80356457bf0f89c7c2..0000000000000000000000000000000000000000 --- a/region/templates/region/region_center_page.html +++ /dev/null @@ -1,56 +0,0 @@ -{% extends "region/base.html" %} -{% load wagtailcore_tags wagtailimages_tags shared_filters %} - -{% block subheader %} - {% image page.get_background_photo width-1920 as bg_img %} - <header class="hero hero--image py-16 " style="--image-url: url({{ bg_img.url }})"> - <div class="container container--default"> - <h1 class="head-alt-md md:head-alt-lg max-w-2xl"> - {{ page.title }} - </h1> - <h2 class="head-xs mt-2"> - {{ page.perex }} - </h2> - </div> - </header> -{% endblock %} - -{% block container_spacing %}pt-8 lg:pb-16{% endblock %} - -{% block content %} - <article> - <div class="lg:flex lg:space-x-8 xl:space-x-16"> - <div class="lg:w-3/5 xl:w-2/3"> - <div class="content-block"> - {{ page.text | richtext }} - - {% for block in page.content %} - {% include_block block %} - {% endfor %} - </div> - - {% if page.has_calendar %} - {% include "shared/small_calendar_snippet.html" with events=page.calendar.current_events %} - {% endif %} - </div> - - <div class="pt-8 lg:w-2/5 xl:w-1/3 lg:pt-0 space-y-4"> - <div class="lg:card lg:elevation-10"> - <div class="lg:card__body"> - <div class="content-block"> - {% for block in page.sidebar_content %} - {% include_block block %} - - {% if not forloop.last %} - <hr> - {% endif %} - {% endfor %} - </div> - </div> - </div> - - {% include "shared/followus_snippet_column.html" %} - </div> - </div> - </article> -{% endblock %} diff --git a/region/templates/region/region_contact_page.html b/region/templates/region/region_contact_page.html deleted file mode 100644 index 1bde159feabd7349afdf33407fb61fb8e7a8cf0f..0000000000000000000000000000000000000000 --- a/region/templates/region/region_contact_page.html +++ /dev/null @@ -1,90 +0,0 @@ -{% extends "region/base.html" %} -{% load wagtailcore_tags wagtailimages_tags shared_filters %} - -{% block container_spacing %}pt-8 pb-0 lg:py-16{% endblock %} - -{% block content %} - <div class="lg:flex space-y-8 lg:space-y-0 lg:space-x-8 xl:space-x-16 mb-8 lg:mb-16"> - <section class="lg:w-3/5 xl:w-2/3"> - <header> - <h1 itemprop="headline" class="head-alt-md md:head-alt-lg max-w-5xl mb-8">{{ page.title }}</h1> - </header> - - <div class="space-y-8"> - <div class="content-block"> - {{ page.text | richtext }} - </div> - - {% for item in page.contact_people %} - <div> - <h2 class="head-heavy-sm mb-2 lg:mb-4"> - {{ item.value.name }} - </h2> - <div class="card elevation-3"> - <div class="card__body"> - {% include "shared/person_badge_wide_snippet.html" with person_page=item.value.person %} - </div> - </div> - </div> - {% endfor %} - </div> - </section> - - <section class="lg:w-2/5 xl:w-1/3"> - <div class="lg:card lg:elevation-10"> - <div class="lg:card__body content-block"> - - <h2>Základní údaje</h2> - - <div class="space-y-4"> - {% if page.root_page.contact_email %} - <div> - <h4>Emailová adresa</h4> - <a href="mailto:{{ page.root_page.contact_email }}" class="contact-line icon-link content-block--nostyle "> - <i class="ico--envelope"></i><span>{{ page.root_page.contact_email }}</span> - </a> - </div> - {% endif %} - - {% if page.root_page.contact_email %} - <div> - <h4>Telefonický kontakt</h4> - <a href="tel:{{ page.root_page.contact_phone }}" class="contact-line icon-link content-block--nostyle "> - <i class="ico--phone"></i><span>{{ page.root_page.contact_phone }}</span> - </a> - </div> - {% endif %} - - <div> - <h4>Transparentní účty</h4> - 2100048174/2010 a <a href="https://wiki.pirati.cz/fo/seznam_uctu">další účty</a> - </div> - - <div> - <h4>Datová schránka</h4> - <span class="contact-line icon-link content-block--nostyle "> - <i class="ico--drawer"></i><span>b2i4r6j</span></span> - </div> - - <div> - <h4>Celostátní web</h4> - <a href="https://lide.pirati.cz" class="contact-line icon-link content-block--nostyle "> - <i class="ico--pirati"></i><span>lide.pirati.cz</span> - </a> - </div> - - <p>Každý člen strany má email ve tvaru: <tt>jmeno.prijmeni@pirati.cz</tt></p> - </div> - - {% comment %} <hr class="hr"> {% endcomment %} -{##} -{# <h2>Sídlo a kontaktní centrum</h2> FIXME #} -{# <strong>Piráti Zlínský kraj</strong>#} - - </div> - </div> - </section> - </div> - - {% include "shared/followus_snippet.html" %} -{% endblock %} diff --git a/region/templates/region/region_crossroad_page.html b/region/templates/region/region_crossroad_page.html deleted file mode 100644 index e93f7b410ebb5b5e14e1851aa2b17fa2a418f03d..0000000000000000000000000000000000000000 --- a/region/templates/region/region_crossroad_page.html +++ /dev/null @@ -1,24 +0,0 @@ -{% extends "region/base.html" %} -{% load wagtailcore_tags %} - -{% block container_spacing %}pt-8 pb-0 lg:py-16{% endblock %} - -{% block content %} - <div class="mb-8 lg:mb-16"> - <header> - <h1 itemprop="headline" class="head-alt-md md:head-alt-lg max-w-5xl mb-8">{{ page.title }}</h1> - </header> - - {% for card_block in page.cards_content %} - {% include_block card_block %} - {% endfor %} - - {% for block in page.content %} - <div class="content-block mb-8"> - {% include_block block %} - </div> - {% endfor %} - </div> - - {% include "shared/followus_snippet.html" %} -{% endblock %} diff --git a/region/templates/region/region_custom_page.html b/region/templates/region/region_custom_page.html deleted file mode 100644 index b5b740ca05fad60a0fd9300e9145a5031ab3db6c..0000000000000000000000000000000000000000 --- a/region/templates/region/region_custom_page.html +++ /dev/null @@ -1,51 +0,0 @@ -{% extends "region/base.html" %} -{% load static wagtailcore_tags %} - -{% block content %} - <article> - <header> - <h1 itemprop="headline" class="head-alt-md md:head-alt-lg max-w-5xl mb-4"> - {{ page.title }} - </h1> - </header> - - <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 "> - </div> - - <div class="lg:flex mt-8 lg:space-x-16"> - <div class="lg:w-2/3"> - {% for block in page.content %} - <div class="content-block mb-8"> - {% include_block block %} - </div> - {% endfor %} - </div> - - <div class="pt-8 lg:w-1/3 md:pt-0"> - <div class="space-y-8"> - <div class="sharebox md:card md:elevation-10 "> - <div class="md:card__body"> - <span class="head-alt-base md:head-alt-md">Sdílení je aktem lásky</span> - <div class="flex w-full space-x-4 pt-4 md:pt-8 text-center text-white"> - <a - href="https://www.facebook.com/sharer/sharer.php?u={{ page.full_url|urlencode }}" - onclick="window.open(this.href, 'pop-up', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;" - class="bg-brands-facebook px-8 py-3 text-2xl w-full" - ><i class="ico--facebook"></i></a> - <a - href="https://twitter.com/intent/tweet?text={{ page.title|urlencode }}&url={{ page.full_url|urlencode }}" - onclick="window.open(this.href, 'pop-up', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;" - class="bg-brands-twitter px-8 py-3 text-2xl w-full" - ><i class="ico--twitter"></i></a> - </div> - </div> - <div class="h-52 overflow-hidden hidden md:block"> - <img src="{% static "shared/img/flag.png" %}" alt="Pirátská strana" class="w-80 object-cover m-auto"/> - </div> - </div> - </div> - </div> - - </div> - </article> -{% endblock %} diff --git a/region/templates/region/region_election_page.html b/region/templates/region/region_election_page.html deleted file mode 100644 index 4c491a08488b65f63232f600c41becf95cf3d36e..0000000000000000000000000000000000000000 --- a/region/templates/region/region_election_page.html +++ /dev/null @@ -1,77 +0,0 @@ -{% extends "region/base.html" %} -{% load wagtailcore_tags wagtailimages_tags shared_filters %} - -{% block subheader %} - {% for block in self.header %} - {% include_block block %} - {% endfor %} -{% endblock subheader %} - -{% block content %} - <div class="__js-root"> - <ui-view-provider - :initial="{candidates: true, program: false}" :sync-location="true" v-slot="{ isCurrentView, toggleView }" - > - <main> - <div class="container container--default pt-8 lg:py-24"> - <div class="text-center"> - <div class="switch"> - <a - @click="toggleView('candidates')" - class="switch__item" - :class="{'switch__item--active': isCurrentView('candidates')}" - > - Kandidáti - </a> - <a - @click="toggleView('program')" - class="switch__item" - :class="{'switch__item--active': isCurrentView('program')}" - > - Program - </a> - </div> - </div> - - <template v-if="isCurrentView('candidates')"> - {% for block in self.content %} - {% include_block block %} - {% endfor %} - </template> - - <template v-if="isCurrentView('program')"> - <h1 class="head-alt-md text-center py-8 lg:pt-24 lg:pb-8"> - Volební program - </h1> - - <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8"> - {% for election_point_page in election_points %} - {% include "shared/election_point_card_snippet.html" %} - {% endfor %} - </div> - </template> - - <div class="flex flex-col pt-8 lg:pt-24 lg:flex-row lg:space-x-8"> - {% if page.strategy_page %} - <a - href="{{ page.strategy_page.url }}" - class="super-button bg-grey-125 text-black lg:w-full container-padding--zero lg:container-padding--auto" - > - <span class="super-button__body">Povolební strategie</span> - <i class="super-button__icon ico--strategy"></i> - </a> - {% endif %} - <a - href="https://wiki.pirati.cz/ft/start" - class="super-button bg-black text-white lg:w-full container-padding--zero lg:container-padding--auto" - > - <span class="super-button__body">Financování kampaně</span> - <i class="super-button__icon ico--calculator"></i> - </a> - </div> - </div> - </main> - </ui-view-provider> - </div> - -{% endblock content %} diff --git a/region/templates/region/region_election_point_page.html b/region/templates/region/region_election_point_page.html deleted file mode 100644 index 1fcc925c9103ca50922f85afdbbe3b47d331593c..0000000000000000000000000000000000000000 --- a/region/templates/region/region_election_point_page.html +++ /dev/null @@ -1,79 +0,0 @@ -{% extends "region/base.html" %} -{% load wagtailcore_tags wagtailimages_tags shared_filters %} - -{% block content %} - <main> - <div class="lg:flex lg:space-x-8 xl:space-x-16"> - <section class="lg:w-3/5 xl:w-2/3"> - <h1 class="head-alt-md md:head-alt-lg max-w-5xl mb-4"> - {{ page.title }} - </h1> - <p class="font-bold text-lg leading-normal mb-8"> - {{ page.perex }} - </p> - <div class="content-block w-full"> - {{ page.text | richtext }} - - {% include "shared/person_badge_wide_snippet.html" with person_page=page.guarantor title="Garant" %} - </div> - - </section> - <section class="pt-8 lg:w-2/5 xl:w-1/3 lg:pt-0"> - <div class="lg:card lg:elevation-10"> - <div class="lg:card__body"> - {% include "shared/person_badge_snippet.html" with person_page=page.guarantor title="Garant" %} - - <hr> - <div class="content-block"> - <h2>Volby</h2> - <h3>Program</h3> - <ul class="unordered-list unordered-list--linked "> - {% for point_page in election_points %} - <li> - <a - href="{{ point_page.url }}" - class="{% if point_page.id == page.id %}font-bold {% endif %}content-block--nostyle" - > - {{ point_page.title }} - </a> - </li> - {% endfor %} - </ul> - - <hr> - <h3>Povolební strategie</h3> - <p>Přečtěte si, jak se zachováme po volbách. Nemusíte volit zajíce v pytli.</p> - <a - href="{{ strategy_page.url }}" - class="btn btn--icon btn--black btn--hoveractive btn--fullwidth md:btn--autowidth" - > - <div class="btn__body-wrap"> - <div class="btn__body ">Zjistit víc</div> - <div class="btn__icon "> - <i class="ico--chevron-right"></i> - </div> - </div> - </a> - - <hr> - <h3>Financování kampaně</h3> - <p>Transparentní financování kampaně je pro nás samozřejmost.</p> - <a - href="https://wiki.pirati.cz/ft/start" - class="btn btn--icon btn--black btn--hoveractive btn--fullwidth md:btn--autowidth" - > - <div class="btn__body-wrap"> - <div class="btn__body ">Zjistit víc</div> - <div class="btn__icon "> - <i class="ico--chevron-right"></i> - </div> - </div> - </a> - </div> - </div> - </div> - </section> - </div> - </main> - -{% endblock content %} diff --git a/region/templates/region/region_home_page.html b/region/templates/region/region_home_page.html deleted file mode 100644 index 315cddb7b5685bbbdcf43f032cefc27f91e80696..0000000000000000000000000000000000000000 --- a/region/templates/region/region_home_page.html +++ /dev/null @@ -1,40 +0,0 @@ -{% extends "district/base.html" %} -{% load wagtailcore_tags %} - -{% block subheader %} - {% for block in page.subheader %} - {% include_block block %} - {% endfor %} -{% endblock subheader %} - -{% block container_spacing %}pt-8 lg:py-16{% endblock %} - -{% block content %} - <h2 class="head-alt-md md:head-alt-lg pb-4 lg:pb-8"> - {{ page.articles_title }} - </h2> - <!-- list of articles --> - <div class="article-card-list grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 lg:gap-8"> - {% for a in page.articles %} - {% include "shared/article_preview.html" with article=a %} - {% endfor %} - </div> - - <div class="mb-8 lg:mb-16"> - {% include "shared/more_articles_snippet.html" %} - </div> - - {% if page.election_countdown_datetime %} - <section class="my-8 lg:my-16 container-padding--zero lg:container-padding--auto"> - {% include "shared/election_countdown_snippet.html" %} - </section> - {% endif %} - - {% if page.show_calendar_on_hp %} - <section class="my-8 lg:my-16 container-padding--zero lg:container-padding--auto"> - {% include "shared/calendar_current_events_snippet.html" %} - </section> - {% endif %} - - {% include "shared/followus_snippet.html" %} -{% endblock %} diff --git a/region/templates/region/region_people_page.html b/region/templates/region/region_people_page.html deleted file mode 100644 index cb715a944056994b0896077d5c45e1a0ca952212..0000000000000000000000000000000000000000 --- a/region/templates/region/region_people_page.html +++ /dev/null @@ -1,17 +0,0 @@ -{% extends "region/base.html" %} -{% load wagtailcore_tags wagtailimages_tags shared_filters %} - -{% block content %} - <header> - <h1 itemprop="headline" class="head-alt-md md:head-alt-lg max-w-5xl mb-8"> - {{ page.title }} - </h1> - </header> - - {% for block in page.content %} - {% include_block block %} - {% if not forloop.last %} - <hr class="hr--big"> - {% endif %} - {% endfor %} -{% endblock %} diff --git a/region/templates/region/region_person_page.html b/region/templates/region/region_person_page.html deleted file mode 100644 index 0dca815c2e29232173c34c4bae062397f5bc6484..0000000000000000000000000000000000000000 --- a/region/templates/region/region_person_page.html +++ /dev/null @@ -1,164 +0,0 @@ -{% extends "region/base.html" %} -{% load static wagtailcore_tags wagtailimages_tags shared_filters %} - -{% block subheader %} - {% image page.get_background_photo width-1920 as bg_img %} - <header class="hero hero--image pt-16 pb-24 lg:pt-32 pb-24 candidate-detail__hero" - style="--image-url: url({{ bg_img.url }})" - > - <div class="container container--default text-center lg:text-left"> - <h1 class="head-alt-md md:head-alt-xl max-w-2xl"> - {{ page.title }} - </h1> - <h2 class="head-xs mt-2 max-w-xl"> - {{ page.job | default_if_none:"" }} - </h2> - </div> - </header> -{% endblock %} - -{% block container_spacing %}py-8 lg:pb-24{% endblock %} - -{% block content %} - <main> - <div class="flex flex-col lg:flex-row lg:space-x-8 xl:space-x-16"> - <section class="lg:w-3/5 xl:w-2/3"> - <div class="content-block w-full"> - {{ page.text|richtext }} - </div> - - </section> - <section class="lg:w-2/5 xl:w-1/3 pt-8 lg:pt-0 order-first lg:order-last candidate-detail__sidebar"> - <div class="container-padding--zero lg:card lg:elevation-10 lg:container-padding--auto"> - <div class="card__body p-4 lg:p-8"> - <div class="text-center mb-8"> - <div class="avatar avatar--2xl lg:avatar--3xl avatar--bordered candidate-detail__avatar"> - {% image page.profile_photo max-208x208 as profile_img %} - <img src="{{ profile_img.url }}" alt="Avatar"> - </div> - - </div> - {% if page.facebook_url or page.instagram_url or page.twitter_url or page.youtube_url or page.flickr_url or page.custom_web_url or page.other_urls %} - <div class="social-icon-group space-x-2 text-lg"> - {% if page.facebook_url %} - <a href="{{ page.facebook_url }}" target="_blank" class="social-icon" rel="noreferrer noopener"> - <i class="ico--facebook"></i> - </a> - {% endif %} - {% if page.instagram_url %} - <a href="{{ page.instagram_url }}" target="_blank" class="social-icon" rel="noreferrer noopener"> - <i class="ico--instagram"></i></a> - {% endif %} - {% if page.twitter_url %} - <a href="{{ page.twitter_url }}" target="_blank" class="social-icon" rel="noreferrer noopener"> - <i class="ico--twitter"></i> - </a> - {% endif %} - {% if page.youtube_url %} - <a href="{{ page.youtube_url }}" target="_blank" class="social-icon" rel="noreferrer noopener"> - <i class="ico--youtube"></i> - </a> - {% endif %} - {% if page.flickr_url %} - <a href="{{ page.flickr_url }}" target="_blank" class="social-icon" rel="noreferrer noopener"> - <i class="ico--flickr"></i> - </a> - {% endif %} - {% if page.custom_web_url %} - <a href="{{ page.custom_web_url }}" target="_blank" class="social-icon" rel="noreferrer noopener"> - <i class="ico--globe"></i> - </a> - {% endif %} - {% for person_link_block in page.other_urls %} - <a - href="{{ person_link_block.value.url }}" - target="_blank" - class="social-icon" - rel="noreferrer noopener" - title="{{ person_link_block.value.title }}" - > - <i class="{% firstof person_link_block.value.custom_icon 'ico--globe' %}"></i> - </a> - {% endfor %} - {% endif %} - </div> - - {% if page.is_pirate %} - <hr> - <div class="flex items-center"> - <div class="avatar w-6 mr-2"> - <img src="{% static "elections2021/images/logo-pirati-21px.svg" %}"> - </div> - <span class="font-bold font-condensed">Pirátská strana</span> - </div> - {% endif %} - - {% if page.phone or page.email and page.show_email %} - <hr> - <div class="content-block"> - <div class="space-y-4"> - {% if page.phone %} - <div> - <h4>Telefon</h4> - <a href="tel:{{ page.phone }}" class="contact-line icon-link content-block--nostyle"> - <i class="ico--phone"></i><span>{{ page.phone }}</span> - </a> - </div> - {% endif %} - - {% if page.email and page.show_email %} - <div> - <h4>Email</h4> - <a href="mailto:{{ page.email }}" class="contact-line icon-link content-block--nostyle"> - <i class="ico--envelope"></i><span>{{ page.email }}</span> - </a> - </div> - {% endif %} - </div> - </div> - {% endif %} - - {% if random_people %} - <hr> - <div class="content-block"> - <h2>Lidé</h2> - - <div class="space-y-4 mt-4"> - {% for person in random_people %} - {% include "shared/person_badge_snippet.html" with person_page=person skipcontacts=1 %} - {% endfor %} - </div> - - <a href="{{ page.root_page.people_page.url }}" - class="btn btn--icon btn--violet-500 btn--fullwidth btn--hoveractive pt-4"> - <div class="btn__body-wrap"> - <div class="btn__body ">Poznejte celý náš tým</div> - <div class="btn__icon "> - <i class="ico--chevron-right"></i> - </div> - </div> - </a> - </div> - {% endif %} - {% comment %} <hr> {% endcomment %} - {# <h2>Kancelář</h2>#} - {# <h4>Poslanecká sněmovna</h4>#} - {# <p>#} - {# Jiřího náměstí 39, 290 33 Poděbrady#} - {# </p>#} - {# <iframe#} - {# src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d82007.99920528589!2d15.688131074078123!3d50.034780639742856!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x470dc94b239307b5%3A0x12d59894ccf624ae!2sPardubice!5e0!3m2!1scs!2scz!4v1589382658695!5m2!1scs!2scz"#} - {# width="100%" height="300" id="mapa-mobile" frameborder="0" style="border:0;" allowfullscreen=""#} - {# aria-hidden="false" tabindex="0"></iframe>#} - {# <h4>Otevírací doba</h4>#} - {# <p>Pondělí 14:00 - 18:00 objednat se přes: kancelář-podebrady@pirati.cz nebo 778 111 462.</p>#} - - <!-- Mobile divider --> - <hr class="block lg:hidden"> - </div> - </div> - </section> - </div> - </main> - -{% endblock %} diff --git a/region/templates/region/region_program_page.html b/region/templates/region/region_program_page.html deleted file mode 100644 index 1a6709d8bd934bc44c060ea406be841484a62eb3..0000000000000000000000000000000000000000 --- a/region/templates/region/region_program_page.html +++ /dev/null @@ -1,23 +0,0 @@ -{% extends "region/base.html" %} -{% load wagtailcore_tags wagtailimages_tags shared_filters %} - -{% block content %} - - <div class="lg:flex lg:mt-8 space-y-16 lg:space-y-0 lg:space-x-8 xl:space-x-16 mb-5"> - <section> - <header> - <h1 itemprop="headline" class="head-alt-md md:head-alt-lg max-w-5xl mb-8"> - {{ page.title }} - </h1> - </header> - - <p> - {{ page.perex }} - </p> - - {% for block in page.content %} - {% include_block block %} - {% endfor %} - </section> - </div> -{% endblock %} diff --git a/region/templates/region/region_tags_page.html b/region/templates/region/region_tags_page.html deleted file mode 100644 index d34fffb349d4b23cdc4d77024b54ad6dfc6df19b..0000000000000000000000000000000000000000 --- a/region/templates/region/region_tags_page.html +++ /dev/null @@ -1,32 +0,0 @@ -{% extends "region/base.html" %} - -{% block content %} - <h1 class="head-alt-md md:head-alt-lg max-w-5xl mb-4"> - {% if tag %}{{ page.title }} "{{ tag.name }}"{% else %}Výběr z článků{% endif %} - </h1> - - <div class="space-y-8"> - <div class="article-card-list grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 lg:gap-8"> - {% for a in article_page_list %} - {% include "shared/article_preview.html" with article=a %} - {% endfor %} - </div> - - {% include 'styleguide/2.3.x/pagination.html' with paginator=article_page_list %} - - <div> - <h2 class="head-heavy-base mb-4">Další štítky</h2> - - <nav class="inline-block-nogap"> - {% for tag in tag_list %} - <a - href="{{ page.url }}?tag={{ tag.slug }}" - class="btn btn--condensed font-light text-sm btn--grey-{% if tag.slug == request.GET.tag %}500{% else %}125{% endif %} btn--hoveractive mr-1 mb-1 inline-block" - > - <div class="btn__body ">{{ tag.name }} ({{ tag.count }})</div> - </a> - {% endfor %} - </nav> - </div> - </div> -{% endblock %}