diff --git a/main/blocks.py b/main/blocks.py index 14fb109269d754ead2481c0a56b2b8788358efe0..13d0aecff9e52d83b01e40b1aa373df08fd34b2b 100644 --- a/main/blocks.py +++ b/main/blocks.py @@ -110,8 +110,7 @@ class BoxesBlock(StructBlock): label = "Skupina boxů" -class HomePageCarouselSlideBlock(CTAMixin, StructBlock): - image = ImageChooserBlock(label="Hlavní obrázek") +class HomePageCarouseSlideBlock(StructBlock): line_1 = TextBlock(label="První řádek") line_2 = TextBlock(label="Druhý řádek") @@ -274,9 +273,7 @@ class PersonContactBoxBlock(CTAMixin, StructBlock): # Footer class LinkBlock(StructBlock): - text = CharBlock( - label="Titulek odkazu (text, který se zobrazí místo dlouhého odkazu)" - ) + text = CharBlock(label="Název") link = URLBlock(label="Odkaz") class Meta: diff --git a/main/menu.py b/main/menu.py index 94a926e6a54795ec286c1d4f1a87814c08a462e2..2bc18a55f1c5169524b195a5c81d94bbd2cd3018 100644 --- a/main/menu.py +++ b/main/menu.py @@ -1,13 +1,22 @@ +from django.db import models from wagtail.fields import StreamField from shared.blocks import MenuItemBlock as MenuItemBlockBase from shared.models import MenuMixin as MenuMixinBase +from wagtail.admin.panels import FieldPanel, MultiFieldPanel +from wagtail import blocks +from wagtail.models import Page class MenuItemBlock(MenuItemBlockBase): + title = blocks.CharBlock( + label="Titulek", + help_text="Pokud není odkazovaná stránka na Majáku, použij možnost zadání samotné adresy níže.", + required=True + ) + class Meta: label = "Položka v menu" - template = "main/includes/menu_item.html" # @@ -19,12 +28,52 @@ class MenuItemBlock(MenuItemBlockBase): class MenuMixin(MenuMixinBase): + important_item_name = models.CharField( + verbose_name="Jméno", + help_text="Pokud není odkazovaná stránka na Majáku, použij možnost zadání samotné adresy níže.", + max_length=16, + blank=True, + null=True + ) + + important_item_page = models.ForeignKey( + Page, + verbose_name="Stránka", + null=True, + blank=True, + related_name="+", + on_delete=models.PROTECT, + ) + + important_item_url = models.URLField( + verbose_name="Adresa", + blank=True, + null=True, + ) + menu = StreamField( [("menu_item", MenuItemBlock())], # , ("menu_parent", MenuParentBlock()) - verbose_name="Menu", + verbose_name="Položky", blank=True, use_json_field=True, ) + menu_panels = [ + MultiFieldPanel( + [ + FieldPanel("important_item_name"), + FieldPanel("important_item_page"), + FieldPanel("important_item_url"), + ], + heading="Důležitá položka menu", + ), + MultiFieldPanel( + [ + FieldPanel("menu"), + ], + heading="Další obsah menu", + ), + ] + class Meta: abstract = True diff --git a/main/migrations/0063_alter_mainhomepage_content.py b/main/migrations/0063_alter_mainhomepage_content.py new file mode 100644 index 0000000000000000000000000000000000000000..98f5a0d4df5f205b42b7ce7423d91b6949fd668e --- /dev/null +++ b/main/migrations/0063_alter_mainhomepage_content.py @@ -0,0 +1,22 @@ +# Generated by Django 4.1.10 on 2023-12-12 09:31 + +from django.db import migrations +import main.blocks +import wagtail.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ('main', '0062_alter_mainpersonpage_calendar_url'), + ] + + operations = [ + migrations.AlterField( + model_name='mainhomepage', + name='content', + field=wagtail.fields.StreamField([('carousel', wagtail.blocks.StructBlock([('button_link', wagtail.blocks.URLBlock(label='Odkaz tlačítka')), ('button_text', wagtail.blocks.CharBlock(label='Text tlačítka')), ('image', wagtail.images.blocks.ImageChooserBlock(label='Hlavní obrázek')), ('line_1', wagtail.blocks.TextBlock(label='První řádek')), ('line_2', wagtail.blocks.TextBlock(label='Druhý řádek'))])), ('news', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(help_text='Nejnovější články se načtou automaticky', label='Titulek')), ('description', wagtail.blocks.TextBlock(label='Popis'))])), ('people', wagtail.blocks.StructBlock([('title_line_1', wagtail.blocks.CharBlock(label='První řádek titulku')), ('title_line_2', wagtail.blocks.CharBlock(label='Druhý řádek titulku')), ('description', wagtail.blocks.TextBlock(label='Popis')), ('list', wagtail.blocks.ListBlock(main.blocks.BoxBlock, label='Boxíky'))])), ('regions', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(help_text='Články pro regiony se načtou automaticky', label='Titulek'))])), ('boxes', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(label='Nadpis')), ('list', wagtail.blocks.ListBlock(main.blocks.BoxBlock, label='Boxíky')), ('image', wagtail.images.blocks.ImageChooserBlock(label='Obrázek pozadí', required=False))]))], blank=True, use_json_field=True, verbose_name='Hlavní obsah'), + ), + ] diff --git a/main/migrations/0064_mainhomepage_important_item_name_and_more.py b/main/migrations/0064_mainhomepage_important_item_name_and_more.py new file mode 100644 index 0000000000000000000000000000000000000000..e83b2b84e34f1aae9afd3253e270283dbcdf53dc --- /dev/null +++ b/main/migrations/0064_mainhomepage_important_item_name_and_more.py @@ -0,0 +1,39 @@ +# Generated by Django 4.1.10 on 2023-12-12 10:22 + +from django.db import migrations, models +import django.db.models.deletion +import main.blocks +import wagtail.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailcore', '0083_workflowcontenttype'), + ('main', '0063_alter_mainhomepage_content'), + ] + + operations = [ + migrations.AddField( + model_name='mainhomepage', + name='important_item_name', + field=models.CharField(blank=True, help_text='Pokud není odkazovaná stránka na Majáku, použij možnost zadání samotné adresy níže', max_length=16, null=True, verbose_name='Jméno'), + ), + migrations.AddField( + model_name='mainhomepage', + name='important_item_page', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='wagtailcore.page', verbose_name='Stránka'), + ), + migrations.AddField( + model_name='mainhomepage', + name='important_item_url', + field=models.URLField(blank=True, null=True, verbose_name='Adresa'), + ), + migrations.AlterField( + model_name='mainhomepage', + name='content', + field=wagtail.fields.StreamField([('carousel', wagtail.blocks.StructBlock([('line_1', wagtail.blocks.TextBlock(label='První řádek')), ('line_2', wagtail.blocks.TextBlock(label='Druhý řádek'))])), ('news', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(help_text='Nejnovější články se načtou automaticky', label='Titulek')), ('description', wagtail.blocks.TextBlock(label='Popis'))])), ('people', wagtail.blocks.StructBlock([('title_line_1', wagtail.blocks.CharBlock(label='První řádek titulku')), ('title_line_2', wagtail.blocks.CharBlock(label='Druhý řádek titulku')), ('description', wagtail.blocks.TextBlock(label='Popis')), ('list', wagtail.blocks.ListBlock(main.blocks.BoxBlock, label='Boxíky'))])), ('regions', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(help_text='Články pro regiony se načtou automaticky', label='Titulek'))])), ('boxes', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(label='Nadpis')), ('list', wagtail.blocks.ListBlock(main.blocks.BoxBlock, label='Boxíky')), ('image', wagtail.images.blocks.ImageChooserBlock(label='Obrázek pozadí', required=False))]))], blank=True, use_json_field=True, verbose_name='Hlavní obsah'), + ), + ] diff --git a/main/migrations/0065_alter_mainhomepage_important_item_name.py b/main/migrations/0065_alter_mainhomepage_important_item_name.py new file mode 100644 index 0000000000000000000000000000000000000000..7f67803a590ede0dbeadd0355280d124dc6ffee7 --- /dev/null +++ b/main/migrations/0065_alter_mainhomepage_important_item_name.py @@ -0,0 +1,18 @@ +# Generated by Django 4.1.10 on 2023-12-12 10:26 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('main', '0064_mainhomepage_important_item_name_and_more'), + ] + + operations = [ + migrations.AlterField( + model_name='mainhomepage', + name='important_item_name', + field=models.CharField(blank=True, help_text='Pokud není odkazovaná stránka na Majáku, použij možnost zadání samotné adresy níže.', max_length=16, null=True, verbose_name='Jméno'), + ), + ] diff --git a/main/migrations/0066_alter_mainhomepage_menu.py b/main/migrations/0066_alter_mainhomepage_menu.py new file mode 100644 index 0000000000000000000000000000000000000000..cbc8499ec86a25fa26eb3977863c20f4db5d633c --- /dev/null +++ b/main/migrations/0066_alter_mainhomepage_menu.py @@ -0,0 +1,20 @@ +# Generated by Django 4.1.10 on 2023-12-12 10:43 + +from django.db import migrations +import wagtail.blocks +import wagtail.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('main', '0065_alter_mainhomepage_important_item_name'), + ] + + operations = [ + migrations.AlterField( + model_name='mainhomepage', + name='menu', + field=wagtail.fields.StreamField([('menu_item', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(help_text='Pokud není odkazovaná stránka na Majáku, použij možnost zadání samotné adresy níže.', label='Titulek', required=True)), ('page', wagtail.blocks.PageChooserBlock(label='Stránka', required=False)), ('link', wagtail.blocks.URLBlock(label='Odkaz', required=False))]))], blank=True, use_json_field=True, verbose_name='Menu'), + ), + ] diff --git a/main/models.py b/main/models.py index b2e02228918bd4099e2f1efab5ab0db44764a992..2ebfc09487125db0e2df33a4e91bd4d8fd95f24a 100644 --- a/main/models.py +++ b/main/models.py @@ -91,7 +91,7 @@ class MainHomePage( # content content = StreamField( [ - ("carousel", blocks.HomePageCarouselSlideBlock()), + ("carousel", blocks.HomePageCarouseSlideBlock()), ("news", blocks.NewsBlock()), ("people", blocks.PeopleOverviewBlock()), ("regions", blocks.RegionsBlock()), @@ -137,7 +137,7 @@ class MainHomePage( [ ("social_links", blocks.SocialLinkBlock()), ], - verbose_name="Odkazy na sociální sítě v zápatí webu", + verbose_name="Odkazy na sociální sítě", blank=True, use_json_field=True, ) diff --git a/main/templates/main/includes/atoms/buttons/round_button.html b/main/templates/main/includes/atoms/buttons/round_button.html index 6620de50dcad71f1df7351964796822fb18fc831..c5132bab5e0f93d1da2847f70a519868cec77b0b 100644 --- a/main/templates/main/includes/atoms/buttons/round_button.html +++ b/main/templates/main/includes/atoms/buttons/round_button.html @@ -18,5 +18,5 @@ " > <span class="group-hover:-translate-x-2 duration-200">{{ button_text }}</span> - <span class="opacity-0 group-hover:opacity-100 duration-200">{% include 'patterns/atoms/icons/arrow.html' %}</span> + <span class="opacity-0 group-hover:opacity-100 duration-200">{% include 'main/includes/atoms/icons/arrow.html' %}</span> </a> diff --git a/main/templates/main/includes/atoms/form_fields/form_checkbox.html b/main/templates/main/includes/atoms/form_fields/form_checkbox.html index 3f75b1e932611e2e57489ccff88f88ebdbf7e351..76802279f60a097dc74c2bafadf95eb4fefb9f96 100644 --- a/main/templates/main/includes/atoms/form_fields/form_checkbox.html +++ b/main/templates/main/includes/atoms/form_fields/form_checkbox.html @@ -1,4 +1,4 @@ <div class="checkbox form-field__control flex items-center {{ classes }}"> - <input type="checkbox" id="checkbox_1"> - <label for="checkbox_1">{{ label }}</label> + <input type="checkbox" id="{{ name }}" name="{{ name }}" required> + <label for="{{ name }}">{{ label }}</label> </div> diff --git a/main/templates/main/includes/atoms/form_fields/form_input.html b/main/templates/main/includes/atoms/form_fields/form_input.html index ce551d5f1a70f8078fb6317c1d489dac8495f188..10fd1bef3ef2eacb252faf1155cdee82e7488979 100644 --- a/main/templates/main/includes/atoms/form_fields/form_input.html +++ b/main/templates/main/includes/atoms/form_fields/form_input.html @@ -1,6 +1,8 @@ <input type="text" class="text-input bg-white form-field__control border-none {{ classes }}" + id="{{ name }}" + name="{{ name }}" value="" - placeholder="{{ form_placeholder }}" + placeholder="{{ placeholder }}" /> diff --git a/main/templates/main/includes/atoms/text/prose.html b/main/templates/main/includes/atoms/text/prose.html index 39fe45cb3cf1dcec657c4022c053d8d960a7ce02..8a2ea0b6da6ec98e82796c0694d0449a812d1aa3 100644 --- a/main/templates/main/includes/atoms/text/prose.html +++ b/main/templates/main/includes/atoms/text/prose.html @@ -1,3 +1,3 @@ <div class="prose"> - {% include 'patterns/atoms/text/paragraph.html' with text=text %} + {% include 'main/includes/atoms/text/paragraph.html' with text=text %} </div> diff --git a/main/templates/main/includes/molecules/articles/article_timeline_preview.html b/main/templates/main/includes/molecules/articles/article_timeline_preview.html index ca5f035baf392cb4d8fa685f808a255e3adba0ae..faba273b134e0b19efccb096d964cde574e117a7 100644 --- a/main/templates/main/includes/molecules/articles/article_timeline_preview.html +++ b/main/templates/main/includes/molecules/articles/article_timeline_preview.html @@ -22,7 +22,7 @@ </a> <div class="mb-6"> - {% include 'patterns/molecules/tags/inline_tags.html' %} + {% include 'main/includes/molecules/tags/inline_tags.html' %} </div> <p class="mb-8"> @@ -30,7 +30,7 @@ </p> <div class="flex justify-end"> - {% include 'patterns/atoms/buttons/round_button.html' with button_text='Zjisti více' %} + {% include 'main/includes/atoms/buttons/round_button.html' with button_text='Zjisti více' %} </div> </div> </div> diff --git a/main/templates/main/includes/molecules/articles/small_article_preview.html b/main/templates/main/includes/molecules/articles/small_article_preview.html index 3fd79beab8b62ddaee61e9aca98fde20bbae4587..eb127dc3844f0ac9142dd977e3c1a483be3d4306 100644 --- a/main/templates/main/includes/molecules/articles/small_article_preview.html +++ b/main/templates/main/includes/molecules/articles/small_article_preview.html @@ -12,6 +12,6 @@ </h4> </div> - {% include 'patterns/atoms/buttons/round_button_small.html' with button_text='Číst dále' %} + {% include 'main/includes/atoms/buttons/round_button_small.html' with button_text='Číst dále' %} </div> </div> diff --git a/main/templates/main/includes/molecules/blocks/download_block.html b/main/templates/main/includes/molecules/blocks/download_block.html index dcdbff57981d621269d171ad843767c27d5e81d2..ab158fe455015da12a052f6e8e4916c39fc2a9f6 100644 --- a/main/templates/main/includes/molecules/blocks/download_block.html +++ b/main/templates/main/includes/molecules/blocks/download_block.html @@ -21,6 +21,6 @@ </div> <div class="flex flex-col justify-center items-start"> - {% include 'patterns/atoms/buttons/round_button.html' with button_text='Stáhnout' %} + {% include 'main/includes/atoms/buttons/round_button.html' with button_text='Stáhnout' %} </div> </div> diff --git a/main/templates/main/includes/molecules/blocks/search_block.html b/main/templates/main/includes/molecules/blocks/search_block.html index c46bfef8326678b6f8605abf915b9a7b1606e601..fc621eb5f5d297a1832aeb35f39e2cfe3bcb5934 100644 --- a/main/templates/main/includes/molecules/blocks/search_block.html +++ b/main/templates/main/includes/molecules/blocks/search_block.html @@ -6,5 +6,5 @@ placeholder="{{ placeholder }}" aria-label="Vyhledávací box" > - {% include 'patterns/atoms/buttons/search_button.html' %} + {% include 'main/includes/atoms/buttons/search_button.html' %} </div> diff --git a/main/templates/main/includes/molecules/boxes/card_box.html b/main/templates/main/includes/molecules/boxes/card_box.html index cfe711f75e72d3987d908698beb9afbcb31f811a..d0ac165fa14eaa8c3bdcf676d0f018e1a0c75d2a 100644 --- a/main/templates/main/includes/molecules/boxes/card_box.html +++ b/main/templates/main/includes/molecules/boxes/card_box.html @@ -24,7 +24,7 @@ </div> <div class="flex justify-center"> - {% include 'patterns/atoms/buttons/round_button.html' with button_text="Zjisti více" %} + {% include 'main/includes/atoms/buttons/round_button.html' with button_text="Zjisti více" %} </div> </div> </article> diff --git a/main/templates/main/includes/molecules/boxes/image_with_button_box.html b/main/templates/main/includes/molecules/boxes/image_with_button_box.html index 3318700fcddd3479efaa479f4f6f2dad9849c933..5da9434efd7ca63bb056573de125c2dc2243f531 100644 --- a/main/templates/main/includes/molecules/boxes/image_with_button_box.html +++ b/main/templates/main/includes/molecules/boxes/image_with_button_box.html @@ -5,10 +5,10 @@ > <div class="text-center mt-6 mb-4"> - <h2 class="head-6xl">{{ desc_text }}</h2> + <h2 class="head-6xl">{{ title }}</h2> </div> <div class="text-center flex justify-center"> - {% include 'patterns/atoms/buttons/round_button.html' with url=url classes='bg-white text-black' button_text=button_text %} + {% include 'main/includes/atoms/buttons/round_button.html' with url=url classes='bg-white text-black' button_text=button_text %} </div> </div> diff --git a/main/templates/main/includes/molecules/contact/contact_person_large_box.html b/main/templates/main/includes/molecules/contact/contact_person_large_box.html index 0a7824223d204afc845815e4871a2161151aefef..0ca8e64296fc609f7c635092ea49cc496230f08e 100644 --- a/main/templates/main/includes/molecules/contact/contact_person_large_box.html +++ b/main/templates/main/includes/molecules/contact/contact_person_large_box.html @@ -45,7 +45,7 @@ >{{ mail }}</a> <div class="flex mt-5"> - {% include 'patterns/atoms/buttons/round_button_small.html' with button_text='Zjisti více' %} + {% include 'main/includes/atoms/buttons/round_button_small.html' with button_text='Zjisti více' %} </div> </div> </div> diff --git a/main/templates/main/includes/molecules/menus/carousel.html b/main/templates/main/includes/molecules/menus/carousel.html index 446ad4afedef763dbb40feded881a29e4eec0773..0d6b763547f656eaa3b77d0f76acf4994bd29244 100644 --- a/main/templates/main/includes/molecules/menus/carousel.html +++ b/main/templates/main/includes/molecules/menus/carousel.html @@ -1,12 +1,10 @@ -{% load wagtailimages_tags %} +{% load static %} <div> <div class="header-carousel"> <div class="h-[700px] xl:h-screen relative"> - {% image self.image fill-1920x1020 as carousel_img %} - <img - src="{{ carousel_img.url }}" + src="{% static 'main/images/background-images/bg-flag.webp' %}" draggable="false" > diff --git a/main/templates/main/includes/molecules/tags/inline_tags.html b/main/templates/main/includes/molecules/tags/inline_tags.html index a14f1d376cfaa194f34433864271d405facec265..48904e2188386ed7e94e59c625e514aeaa8461d6 100644 --- a/main/templates/main/includes/molecules/tags/inline_tags.html +++ b/main/templates/main/includes/molecules/tags/inline_tags.html @@ -1,5 +1,5 @@ <div class="flex gap-3 flex-wrap {{ classes }}"> {% for tag in tags %} - {% include 'patterns/atoms/tags/tag.html' with text=tag %} + {% include 'main/includes/atoms/tags/tag.html' with text=tag %} {% endfor %} </div> diff --git a/main/templates/main/includes/molecules/tags/tags.html b/main/templates/main/includes/molecules/tags/tags.html index dba36464d4745b3e0557162f95d486d65e079323..0c9d54cfd09a29a22d096dd51dabe18e138a5187 100644 --- a/main/templates/main/includes/molecules/tags/tags.html +++ b/main/templates/main/includes/molecules/tags/tags.html @@ -1,5 +1,5 @@ <div class="flex gap-4 flex-wrap max-w-[550px] {{ classes }}"> {% for tag in tags %} - {% include 'patterns/atoms/tags/tag.html' with text=tag %} + {% include 'main/includes/atoms/tags/tag.html' with text=tag %} {% endfor %} </div> diff --git a/main/templates/main/includes/organisms/articles/articles_section.html b/main/templates/main/includes/organisms/articles/articles_section.html index ca7c2a41cec13d413454ca8cec4e1ae9361452d6..bfe0797d95467d19611e3943549c37865fec9140 100644 --- a/main/templates/main/includes/organisms/articles/articles_section.html +++ b/main/templates/main/includes/organisms/articles/articles_section.html @@ -19,9 +19,9 @@ <div class="grid grid-cols-1 xl:grid-cols-3 gap-8"> {% comment %} - {% include 'patterns/molecules/boxes/card_box.html' %} - {% include 'patterns/molecules/boxes/card_box.html' %} - {% include 'patterns/molecules/boxes/card_box.html' %} + {% include 'main/includes/molecules/boxes/card_box.html' %} + {% include 'main/includes/molecules/boxes/card_box.html' %} + {% include 'main/includes/molecules/boxes/card_box.html' %} {% endcomment %} </div> diff --git a/main/templates/main/includes/organisms/articles/europarl_articles_section.html b/main/templates/main/includes/organisms/articles/europarl_articles_section.html index 4673cd7d32525bc52e62a4b0022694484b1e7a3c..cfa1a8cfccf0d578aab2fbb931298acd0cc5046b 100644 --- a/main/templates/main/includes/organisms/articles/europarl_articles_section.html +++ b/main/templates/main/includes/organisms/articles/europarl_articles_section.html @@ -27,9 +27,9 @@ </div> <div class="grid grid-cols-1 xl:grid-cols-3 gap-8"> - {% include 'patterns/molecules/boxes/card_box.html' %} - {% include 'patterns/molecules/boxes/card_box.html' %} - {% include 'patterns/molecules/boxes/card_box.html' %} + {% include 'main/includes/molecules/boxes/card_box.html' %} + {% include 'main/includes/molecules/boxes/card_box.html' %} + {% include 'main/includes/molecules/boxes/card_box.html' %} </div> <div diff --git a/main/templates/main/includes/organisms/articles/main_articles_timeline.html b/main/templates/main/includes/organisms/articles/main_articles_timeline.html index f271963529f0310eff954e155b443bea8ff60b0b..0cdf57c47fe09aef9a577d963d6690c51e4cc935 100644 --- a/main/templates/main/includes/organisms/articles/main_articles_timeline.html +++ b/main/templates/main/includes/organisms/articles/main_articles_timeline.html @@ -5,14 +5,14 @@ <h2 class="head-9xl">{{ month_1 }}</h2> </div> <div class="grid grid-cols-1 md:grid-cols-2 gap-12"> - {% include 'patterns/molecules/articles/article_timeline_preview.html' %} - {% include 'patterns/molecules/articles/article_timeline_preview.html' %} - {% include 'patterns/molecules/articles/article_timeline_preview.html' %} - {% include 'patterns/molecules/articles/article_timeline_preview.html' %} + {% include 'main/includes/molecules/articles/article_timeline_preview.html' %} + {% include 'main/includes/molecules/articles/article_timeline_preview.html' %} + {% include 'main/includes/molecules/articles/article_timeline_preview.html' %} + {% include 'main/includes/molecules/articles/article_timeline_preview.html' %} </div> <div class="flex justify-center"> - {% include 'patterns/atoms/buttons/round_button.html' with button_text='Další články' %} + {% include 'main/includes/atoms/buttons/round_button.html' with button_text='Další články' %} </div> </div> </div> diff --git a/main/templates/main/includes/organisms/cards/card_list.html b/main/templates/main/includes/organisms/cards/card_list.html index 42eb7d0023c44e7ad2e2ee93d83a1d5da7ac052f..3a7cd73bb6b8c72dee3d70b684ef8cc720e28dde 100644 --- a/main/templates/main/includes/organisms/cards/card_list.html +++ b/main/templates/main/includes/organisms/cards/card_list.html @@ -1,5 +1,5 @@ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 content-stretch gap-8"> {% for card in cards %} - {% include 'patterns/molecules/boxes/card_box.html' with url=card.url image=card.image header=card.header content=card.content description_classes=description_classes classes=classes date=date %} + {% include 'main/includes/molecules/boxes/card_box.html' with url=card.url image=card.image header=card.header content=card.content description_classes=description_classes classes=classes date=date %} {% endfor %} </div> diff --git a/main/templates/main/includes/organisms/header/article_header.html b/main/templates/main/includes/organisms/header/article_header.html index 2692d4195167d0fbaca61fea0eefc1cddced31c9..0e00705aa03352523ad4092ac0f828fc967d0bf6 100644 --- a/main/templates/main/includes/organisms/header/article_header.html +++ b/main/templates/main/includes/organisms/header/article_header.html @@ -1,7 +1,7 @@ {% extends 'patterns/organisms/header/simple_header_with_tags_and_navigation.html' %} {% block before_heading %} - {% include 'patterns/atoms/header/navigation.html' with classes='mb-6' first_text=first_nav_text second_text=second_nav_text second_link=second_link %} + {% include 'main/includes/atoms/header/navigation.html' with classes='mb-6' first_text=first_nav_text second_text=second_nav_text second_link=second_link %} {% endblock %} {% block heading_classes %}head-8xl{% endblock %} diff --git a/main/templates/main/includes/organisms/header/articles_header.html b/main/templates/main/includes/organisms/header/articles_header.html index 2d603a3bd2219a4648f388f98d2c9b969163ab6f..3027bfa990d61ddd23e6f5b563cec792f9cc88c8 100644 --- a/main/templates/main/includes/organisms/header/articles_header.html +++ b/main/templates/main/includes/organisms/header/articles_header.html @@ -1,7 +1,7 @@ {% extends 'patterns/organisms/header/simple_header_with_tags.html' %} {% block after_heading %} - {% include 'patterns/molecules/tags/tags.html' with classes='mb-4' %} + {% include 'main/includes/molecules/tags/tags.html' with classes='mb-4' %} <div class="flex justify-start"> <input diff --git a/main/templates/main/includes/organisms/header/photo_header.html b/main/templates/main/includes/organisms/header/photo_header.html index c7eefcf7c2fe901aa955e3f7003a7fa6c4317385..ec595a98d5b4afa3d797a501129917dbf9b38272 100644 --- a/main/templates/main/includes/organisms/header/photo_header.html +++ b/main/templates/main/includes/organisms/header/photo_header.html @@ -4,7 +4,7 @@ > <div class="container--wide w-full"> <h1 class="text-white flex flex-col"> - {% include 'patterns/atoms/header/navigation.html' with classes='mb-10' first_text='Lidé' second_text='Sněmovna' %} + {% include 'main/includes/atoms/header/navigation.html' with classes='mb-10' first_text='Lidé' second_text='Sněmovna' %} <span class="text-xl sm:text-4xl font-alt leading-3">{{ degree_before }}</span> diff --git a/main/templates/main/includes/organisms/header/simple_header_with_tags.html b/main/templates/main/includes/organisms/header/simple_header_with_tags.html index a4734e4c99ea19021cf78c54fc1eb73ccbf44f9e..2edd55dd35fc1f022b135b4df9cb88cc3e5a4997 100644 --- a/main/templates/main/includes/organisms/header/simple_header_with_tags.html +++ b/main/templates/main/includes/organisms/header/simple_header_with_tags.html @@ -1,5 +1,5 @@ {% extends 'patterns/organisms/header/simple_header.html' %} {% block after_heading %} - {% include 'patterns/molecules/tags/tags.html' with classes='mb-4' %} + {% include 'main/includes/molecules/tags/tags.html' with classes='mb-4' %} {% endblock %} diff --git a/main/templates/main/includes/organisms/header/simple_header_with_tags_and_navigation.html b/main/templates/main/includes/organisms/header/simple_header_with_tags_and_navigation.html index fdfbed414a05a44eb2c7a91943934a3df1d5bcf1..09230694154d46a3fd35c24348bae4aa4ec597ae 100644 --- a/main/templates/main/includes/organisms/header/simple_header_with_tags_and_navigation.html +++ b/main/templates/main/includes/organisms/header/simple_header_with_tags_and_navigation.html @@ -1,9 +1,9 @@ {% extends 'patterns/organisms/header/simple_header.html' %} {% block before_heading %} - {% include 'patterns/atoms/header/navigation.html' with classes='mb-6' %} + {% include 'main/includes/atoms/header/navigation.html' with classes='mb-6' %} {% endblock %} {% block after_heading %} - {% include 'patterns/molecules/tags/tags.html' with classes='mb-4 mt-4' %} + {% include 'main/includes/molecules/tags/tags.html' with classes='mb-4 mt-4' %} {% endblock %} diff --git a/main/templates/main/includes/organisms/layout/footer.html b/main/templates/main/includes/organisms/layout/footer.html index 195285ade81f52fb8d54e5b879a387d741dd52a9..c166d6835e0ecdda1943efeeb51b75112eac46ca 100644 --- a/main/templates/main/includes/organisms/layout/footer.html +++ b/main/templates/main/includes/organisms/layout/footer.html @@ -30,8 +30,8 @@ <section class="flex flex-col xl:items-end"> <div class="flex flex-col gap-12"> - {% include 'patterns/molecules/contact/contact_footer_box.html' %} - {% include 'patterns/molecules/contact/contact_footer_box.html' %} + {% include 'main/includes/molecules/contact/contact_footer_box.html' %} + {% include 'main/includes/molecules/contact/contact_footer_box.html' %} </div> </section> </div> @@ -45,30 +45,12 @@ xl:flex-row xl:items-center xl:gap-x-8 " > - <a href="#" class="flex gap-2 items-center hover:no-underline"> - <i class="ico--facebook"></i> - <span class="text-sm">{{ facebook }}</span> - </a> - - <a href="#" class="flex gap-2 items-center hover:no-underline"> - <i class="ico--instagram text-lg"></i> - <span class="text-sm">{{ instagram }}</span> - </a> - - <a href="#" class="flex gap-2 items-center hover:no-underline"> - <i class="ico--feed text-lg"></i> - <span class="text-sm">{{ feed }}</span> - </a> - - <a href="#" class="flex gap-2 items-center hover:no-underline"> - <i class="ico--twitter text-lg"></i> - <span class="text-sm">{{ twitter }}</span> - </a> - - <a href="#" class="flex gap-2 items-center hover:no-underline"> - <i class="ico--youtube text-xl"></i> - <span class="text-sm">{{ youtube }}</span> - </a> + {% for social_link_block in page.root_page.social_links %} + <a href="{{ social_link_block.value.link }}" class="flex gap-2 items-center hover:no-underline"> + <i class="{{ social_link_block.value.icon }}"></i> + <span class="text-sm">{{ social_link_block.value.text }}</span> + </a> + {% endfor %} </div> </section> diff --git a/main/templates/main/includes/organisms/layout/navbar.html b/main/templates/main/includes/organisms/layout/navbar.html index c0dc8eba94023b925ceba7e0fac8b0ae8babd36a..bec5d7664ddb02a344aaba63aa984886137501e3 100644 --- a/main/templates/main/includes/organisms/layout/navbar.html +++ b/main/templates/main/includes/organisms/layout/navbar.html @@ -1,3 +1,5 @@ +{% load static %} + <!-- Navbar --> <nav class=" @@ -14,8 +16,8 @@ <div class="flex items-center 2xl:items-start"> <!-- BEGIN Logo--> <a href="#" class="z-20"> - <img class="navbar__logo--white w-[150px] lg:w-[unset]" src="../../../../static/images/logo-full-white.svg" alt=""> - <img class="navbar__logo--black w-[150px] lg:w-[unset]" src="../../../../static/images/logo-full-black.svg" alt=""> + <img class="navbar__logo--white w-[150px] lg:w-[unset]" src="{% static 'main/images/logo-full-white.svg' %}" alt=""> + <img class="navbar__logo--black w-[150px] lg:w-[unset]" src="{% static 'main/images/logo-full-black.svg' %}" alt=""> </a> <!-- END Logo --> </div> @@ -25,24 +27,14 @@ <!-- BEGIN Social media--> <div class="flex gap-7 justify-end items-center"> <div class="flex gap-5 text-lg"> - <a href="#" class="hover:no-underline"> - <i class="ico--facebook"></i> - </a> - <a href="#" class="hover:no-underline"> - <i class="ico--instagram"></i> - </a> - <a href="#" class="hover:no-underline"> - <i class="ico--feed"></i> - </a> - <a href="#" class="hover:no-underline"> - <i class="ico--twitter"></i> - </a> - <a href="#" class="hover:no-underline"> - <i class="ico--youtube"></i> - </a> + {% for social_link_block in page.root_page.social_links %} + <a href="{{ social_link_block.value.link }}" class="hover:no-underline"> + <i class="{{ social_link_block.value.icon }}"></i> + </a> + {% endfor %} </div> - {% include 'patterns/atoms/form_fields/form_input.html' with form_placeholder='Hledej' classes='text-black px-2 py-1 w-80' %} + {% include 'main/includes/atoms/form_fields/form_input.html' with placeholder='Hledej' classes='text-black px-2 py-1 w-80' %} </div> <!-- END Social media --> @@ -50,14 +42,16 @@ <div class="flex text-2xl gap-8 font-alt items-center justify-end" > - {% if important_item %} + {% if page.root_page.important_item_name %} + {% firstof page.root_page.important_item_page.url page.root_page.important_item_url as target %} + <a - href="#" - class="__js-root flex gap-1 items-center decoration-1 underline-offset-4 {% if selected_item == important_item %}navbar__menu-item--selected{% endif %}" + href="{{ target }}" + class="__js-root flex gap-1 items-center decoration-1 underline-offset-4 {% if selected_item == page.root_page.important_item_name %}navbar__menu-item--selected{% endif %}" > <div class="mb-1"> {% if not is_transparent %} - {% include 'patterns/atoms/icons/arrow.html' with width='27' height='28.35' fill='#fff' %} + {% include 'main/includes/atoms/icons/arrow.html' with width='27' height='28.35' fill='#fff' %} {% else %} <ui-animated-arrow mobile-width="38.1" @@ -70,35 +64,44 @@ </div> <span> - {{ important_item }} + {{ page.root_page.important_item_name }} </span> </a> {% endif %} - {% for item in menu_items %} + {% for menu_item in page.root_page.menu %} + {% firstof menu_item.value.page.url menu_item.value.link as target %} + <a - href="#" - class="decoration-1 underline-offset-4 {% if item == selected_item %}navbar__menu-item--selected{% endif %}" - >{{ item }}</a> + href="{{ target }}" + class=" + decoration-1 underline-offset-4 + {% if menu_item.value.title == selected_item %}navbar__menu-item--selected{% endif %} + " + >{{ menu_item.value.title }}</a> {% endfor %} - <a - href="#" - class="btn btn--yellow-500 btn--to-yellow-600 btn--hoveractive xl:w-auto uppercase" - > - <div class="btn__body-wrap w-42 h-11"> - <div class="btn__body w-42 h-11 xl:w-auto py-4 px-6">{{ menu_button_2 }}</div> - </div> - </a> - - <a - href="#" - class="btn btn--to-yellow--600 group btn--hoveractive uppercase" - > - <div class="btn__body-wrap w-24 h-11 min-w-[7rem]"> - <div class="navbar__border-button btn__body group group-hover:border-yellow-600 border-yellow-500 border-4 bg-transparent w-24 h-11 xl:w-auto py-4 px-6">{{ menu_button_1 }}</div> - </div> - </a> + {% if page.root_page.contact_newcomers_link and page.root_page.contact_newcomers_text %} + <a + href="{{ page.root_page.contact_newcomers_link }}" + class="btn btn--yellow-500 btn--to-yellow-600 btn--hoveractive xl:w-auto uppercase" + > + <div class="btn__body-wrap w-42 h-11"> + <div class="btn__body w-42 h-11 xl:w-auto py-4 px-6">{{ page.root_page.contact_newcomers_text }}</div> + </div> + </a> + {% endif %} + + {% if page.root_page.donation_page_link and page.root_page.donation_page_text %} + <a + href="{{ page.root_page.donation_page_link }}" + class="btn btn--to-yellow--600 group btn--hoveractive uppercase" + > + <div class="btn__body-wrap w-24 h-11 min-w-[7rem]"> + <div class="navbar__border-button btn__body group group-hover:border-yellow-600 border-yellow-500 border-4 bg-transparent w-24 h-11 xl:w-auto py-4 px-6">{{ page.root_page.donation_page_text }}</div> + </div> + </a> + {% endif %} </div> <!-- END Menu --> @@ -147,7 +150,7 @@ class="__js-root flex items-center decoration-1 underline-offset-4 {% if selected_item == important_item %}navbar__menu-item--selected{% endif %}" > {% if not is_transparent %} - {% include 'patterns/atoms/icons/arrow.html' with width='27' height='28.35' %} + {% include 'main/includes/atoms/icons/arrow.html' with width='27' height='28.35' %} {% else %} <ui-animated-arrow></ui-animated-arrow> {% endif %} @@ -156,51 +159,50 @@ </a> {% endif %} - {% for item in menu_items %} + {% for menu_item in page.root_page.menu %} + {% firstof menu_item.value.page.url menu_item.value.link as target %} + <a - href="#" - class="decoration-1 underline-offset-4 {% if item == selected_item %}navbar__menu-item--selected{% endif %}" - >{{ item }}</a> + href="{{ target }}" + class=" + decoration-1 underline-offset-4 + {% if item == selected_item %}navbar__menu-item--selected{% endif %} + " + >{{ menu_item.value.title }}</a> {% endfor %} </div> <div class="flex flex-col gap-12 md:justify-between xl:mr-16"> <div class="flex flex-col gap-4 items-start md:items-end"> - <a - href="#" - class="btn btn--yellow-500 btn--to-yellow-600 btn--hoveractive xl:w-auto uppercase" - > - <div class="btn__body-wrap w-42"> - <div class="btn__body w-42 h-11 xl:w-auto py-8 px-6">{{ menu_button_2 }}</div> - </div> - </a> - - <a - href="#" - class="btn btn--to-yellow--600 group btn--hoveractive uppercase" - > - <div class="btn__body-wrap min-w-[7rem]"> - <div class="btn__body group group-hover:border-yellow-600 border-yellow-500 text-black border-4 bg-transparent w-36 h-11 xl:w-auto py-8">{{ menu_button_1 }}</div> - </div> - </a> + {% if page.root_page.contact_newcomers_link and page.root_page.contact_newcomers_text %} + <a + href="{{ page.root_page.contact_newcomers_link }}" + class="btn btn--yellow-500 btn--to-yellow-600 btn--hoveractive xl:w-auto uppercase" + > + <div class="btn__body-wrap w-42"> + <div class="btn__body w-42 h-11 xl:w-auto py-8 px-6">{{ page.root_page.contact_newcomers_text }}</div> + </div> + </a> + {% endif %} + + {% if page.root_page.donation_page_link and page.root_page.donation_page_text %} + <a + href="{{ page.root_page.donation_page_link }}" + class="btn btn--to-yellow--600 group btn--hoveractive uppercase" + > + <div class="btn__body-wrap min-w-[7rem]"> + <div class="btn__body group group-hover:border-yellow-600 border-yellow-500 text-black border-4 bg-transparent w-36 h-11 xl:w-auto py-8">{{ page.root_page.donation_page_text }}</div> + </div> + </a> + {% endif %} </div> <div class="flex gap-5 text-lg md:justify-end"> - <a href="#" class="hover:no-underline"> - <i class="ico--facebook"></i> - </a> - <a href="#" class="hover:no-underline"> - <i class="ico--instagram"></i> - </a> - <a href="#" class="hover:no-underline"> - <i class="ico--feed"></i> - </a> - <a href="#" class="hover:no-underline"> - <i class="ico--twitter"></i> - </a> - <a href="#" class="hover:no-underline"> - <i class="ico--youtube"></i> - </a> + {% for social_link_block in page.root_page.social_links %} + <a href="{{ social_link_block.value.link }}" class="hover:no-underline"> + <i class="{{ social_link_block.value.icon }}"></i> + </a> + {% endfor %} </div> </div> </div> diff --git a/main/templates/main/includes/organisms/main_section/newsletter_section.html b/main/templates/main/includes/organisms/main_section/newsletter_section.html index 2025b524450b5bd0d3e6f71deaf44756dda76c86..334f648200d9ff79cc9d58d37246060ad4239269 100644 --- a/main/templates/main/includes/organisms/main_section/newsletter_section.html +++ b/main/templates/main/includes/organisms/main_section/newsletter_section.html @@ -1,6 +1,8 @@ +{% load static %} + <div class="newsletter-section" - style="background-image:url('../../../../static/images/background-images/bg-newsletter.webp')" # TODO + style="background-image:url('{% static 'main/images/background-images/bg-newsletter.webp' %}')" > <div class="container--medium pt-32 pb-24"> <h2 class="head-14xl"> @@ -11,10 +13,25 @@ Fake news tam nenajdeš, ale dozvíš se, co chystáme doopravdy! </p> - <div class="flex flex-col gap-2 mt-12 items-start"> - {% include 'patterns/atoms/form_fields/form_input.html' with form_placeholder='Tvůj email' classes='mb-3 w-full md:w-96' %} - {% include 'patterns/atoms/form_fields/form_checkbox.html' with label='Souhlasím se zpracováním osobních údajů' classes='mb-3' %} - {% include 'patterns/atoms/buttons/round_button.html' with button_text='Odebírat' %} - </div> + <form + class="flex flex-col gap-2 mt-12 items-start" + method="post" + action="{{ page.root_page.newsletter_subscribe_url }}" + > + {% csrf_token %} + + <input type="hidden" name="return_page_id" value="{{ page.id }}"> + + {% include 'main/includes/atoms/form_fields/form_input.html' with name="email" placeholder='Tvůj email' classes='mb-3 w-full md:w-96' %} + + <div class="checkbox form-field__control flex items-center mb-3"> + <input type="checkbox" id="confirmed" name="confirmed" required> + <label for="confirmed"> + Souhlasím se <a href="{{ page.root_page.gdpr_and_cookies_url }}" target="_blank">zpracováním osobních údajů</a> + </label> + </div> + + {% include 'main/includes/atoms/buttons/round_button.html' with button_text='Odebírat' %} + </form> </div> </div> diff --git a/main/templates/main/includes/organisms/main_section/region_section.html b/main/templates/main/includes/organisms/main_section/region_section.html index d0f83516df02243017aa964b9972a18dca026e70..6005d447407daef7e01dc37944272cef1bae79db 100644 --- a/main/templates/main/includes/organisms/main_section/region_section.html +++ b/main/templates/main/includes/organisms/main_section/region_section.html @@ -3,7 +3,7 @@ <h2 class="head-14xl xl:leading-[10.5rem] mb-20 xl:mb-32"> {{ self.title }} </h2> - <div class="flex flex-wrap"> + <div class="flex flex-wrap justify-center"> <div class="__js-root flex items-center justify-center h-full mb-4 w-full w-12/12 lg:w-7/12"> <ui-region-map class="w-full"></ui-region-map> </div> @@ -11,12 +11,12 @@ {% comment %} <div class="w-12/12 lg:w-5/12"> <div class="flex flex-col gap-5 justify-center"> - {% include 'patterns/atoms/form_fields/form_select.html' %} + {% include 'main/includes/atoms/form_fields/form_select.html' %} <div class="flex flex-col gap-4"> - {% include 'patterns/molecules/articles/small_article_preview.html' %} - {% include 'patterns/molecules/articles/small_article_preview.html' %} - {% include 'patterns/molecules/articles/small_article_preview.html' %} + {% include 'main/includes/molecules/articles/small_article_preview.html' %} + {% include 'main/includes/molecules/articles/small_article_preview.html' %} + {% include 'main/includes/molecules/articles/small_article_preview.html' %} </div> </div> </div> diff --git a/main/templates/main/includes/organisms/main_section/representatives_section.html b/main/templates/main/includes/organisms/main_section/representatives_section.html index 657d64bb687e74e9d7d01c51aa0700bbfab850be..638a2ce8970eb557beba06f6c519a42a0de8b8a4 100644 --- a/main/templates/main/includes/organisms/main_section/representatives_section.html +++ b/main/templates/main/includes/organisms/main_section/representatives_section.html @@ -30,7 +30,7 @@ {% for box in self.list %} {% image box.image fill-480x480 as box_image %} - {% include 'main/includes/molecules/boxes/image_with_button_box.html' with image=image button_text=box.button_text url=box.button_link title=box.title %} + {% include 'main/includes/molecules/boxes/image_with_button_box.html' with image=box_image button_text=box.button_text url=box.button_link title=box.title %} {% endfor %} </div> @@ -40,7 +40,7 @@ xl:py-24 " > - {% include 'patterns/atoms/buttons/round_button.html' with classes='inline-block bg-white text-black' button_text=button_text %} + {% include 'main/includes/atoms/buttons/round_button.html' with classes='inline-block bg-white text-black' button_text="Další lidé" %} </div> </div> </div> diff --git a/main/templates/main/includes/organisms/popouts/popout_list.html b/main/templates/main/includes/organisms/popouts/popout_list.html index ea878dccd6dc036cc84f34b092365271ffc18b34..acccdb72ca9166ca3a189ac42d36e9e7ef437212 100644 --- a/main/templates/main/includes/organisms/popouts/popout_list.html +++ b/main/templates/main/includes/organisms/popouts/popout_list.html @@ -6,7 +6,7 @@ <h2 class="font-alt text-2xl">{{ category.name }}</h2> </div> {% for point in category.points %} - {% include 'patterns/molecules/popouts/popout_point.html' with name=point.name %} + {% include 'main/includes/molecules/popouts/popout_point.html' with name=point.name %} {% endfor %} </li> {% endfor %} diff --git a/shared/models.py b/shared/models.py index 33b1b8798fe9baacf4577f4df3fb5ba884f2e781..6ae64de6aa0991da18d240485f379671bd6a6ef8 100644 --- a/shared/models.py +++ b/shared/models.py @@ -202,7 +202,7 @@ class MenuMixin(Page): [ FieldPanel("menu"), ], - heading="Menu Options", + heading="Nastavení menu", ), ]