diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 64d7afbfcff1d074e875e801e4b1ade744390e0a..c152375762c73f05809dec49d022164e3c43fc4e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,6 +25,11 @@ repos: hooks: - id: isort + - repo: https://github.com/PyCQA/autoflake + rev: v2.2.1 + hooks: + - id: autoflake + - repo: https://github.com/psf/black rev: 23.1.0 hooks: diff --git a/elections2021/models.py b/elections2021/models.py index dc170d52e6da7aecffde474b4fef1a5b56975dc2..17f48fbebbf8033714ab434b1e91fb88ea6da029 100644 --- a/elections2021/models.py +++ b/elections2021/models.py @@ -2734,7 +2734,7 @@ class Elections2021BannerListPage( form.has_been_saved = False if form.is_valid(): - order = form.save() + form.save() form.has_been_saved = True else: form = BannerForm() diff --git a/instagram_utils/services.py b/instagram_utils/services.py index 01833acee3dd66b72cb405fe5a83995d627c4f83..9e50845b59cf30686f78d2ce2f7494d44c0defe1 100644 --- a/instagram_utils/services.py +++ b/instagram_utils/services.py @@ -1,4 +1,3 @@ -import datetime import io import logging import os diff --git a/main/blocks.py b/main/blocks.py index f257d8f14022867eee253324af950e1acf49ebd2..6e7a1325e8dc3340b7dd7c63f2159cbaca96e352 100644 --- a/main/blocks.py +++ b/main/blocks.py @@ -50,7 +50,7 @@ class CardLinkBlock(CardLinkBlockMixin): ) class Meta: - template = "main/includes/molecules/boxes/card_box_block.html" + template = "styleguide2/includes/molecules/boxes/card_box_block.html" icon = "link" label = "Karta s odkazem" @@ -98,7 +98,7 @@ class HomePageCarouseSlideBlock(StructBlock): mobile_line_3 = TextBlock(label="Třetí mobilní řádek") class Meta: - template = "main/includes/molecules/menus/carousel.html" + template = "styleguide2/includes/molecules/menus/carousel.html" icon = "form" label = "Carousel" @@ -111,14 +111,14 @@ class NewsBlock(StructBlock): description = TextBlock(label="Popis") class Meta: - template = "main/includes/organisms/articles/articles_section.html" + template = "styleguide2/includes/organisms/articles/articles_section.html" icon = "doc-full-inverse" label = "Novinky" class EuroparlNewsBlock(StructBlock): class Meta: - template = "main/includes/organisms/articles/europarl_articles_section.html" + template = "styleguide2/includes/organisms/articles/europarl_articles_section.html" icon = "doc-full-inverse" label = "Novinky z Eurovoleb" @@ -154,7 +154,7 @@ class PeopleOverviewBlock(StructBlock): list = ListBlock(BoxBlock, label="Boxíky") class Meta: - template = "main/includes/organisms/main_section/representatives_section.html" + template = "styleguide2/includes/organisms/main_section/representatives_section.html" icon = "group" label = "Skupina osob" @@ -233,21 +233,11 @@ class RegionsBlock(StructBlock): ) class Meta: - template = "main/includes/organisms/main_section/region_section.html" + template = "styleguide2/includes/organisms/main_section/region_section.html" icon = "view" label = "Články pro regiony" -class PersonContactBoxBlock(StructBlock): - title = CharBlock(label="Titulek") - image = ImageChooserBlock(label="Ikona") - subtitle = CharBlock(label="Podtitulek") - - class Meta: - icon = "mail" - label = "Kontakty" - - # ARTICLE BLOCKS class ArticleImageMixin(StructBlock): image = ImageChooserBlock(label="Obrázek") @@ -264,33 +254,24 @@ class ArticleLeftImageBlock(ArticleImageMixin): class Meta: icon = "image" label = "Text s obrázkem vlevo" - template = "main/includes/molecules/articles/article_richtext_content_with_left_image.html" + template = "styleguide2/includes/molecules/articles/article_richtext_content_with_left_image.html" class ArticleRightImageBlock(ArticleImageMixin): class Meta: icon = "image" label = "Text s obrázkem vpravo" - template = "main/includes/molecules/articles/article_richtext_content_with_right_image.html" - - -class TwoTextColumnBlock(StructBlock): - text_column_1 = RichTextBlock(label="První sloupec textu") - text_column_2 = RichTextBlock(label="Druhý sloupec textu") - - class Meta: - icon = "doc-full" - label = "Text ve dvou sloupcích" + template = "styleguide2/includes/molecules/articles/article_richtext_content_with_right_image.html" class CardLinkWithHeadlineBlock(CardLinkWithHeadlineBlockMixin): card_items = ListBlock( - CardLinkBlock(template="main/includes/molecules/boxes/card_box_block.html"), + CardLinkBlock(template="styleguide2/includes/molecules/boxes/card_box_block.html"), label="Karty s odkazy", ) class Meta: - template = "main/includes/molecules/boxes/card_box_with_headline_block.html" + template = "styleguide2/includes/molecules/boxes/card_box_with_headline_block.html" icon = "link" label = "Karty odkazů s nadpisem" diff --git a/main/migrations/0066_alter_mainarticlepage_content_and_more.py b/main/migrations/0066_alter_mainarticlepage_content_and_more.py new file mode 100644 index 0000000000000000000000000000000000000000..504abf9af2dabf68924d4b271fbe894ecbc419ca --- /dev/null +++ b/main/migrations/0066_alter_mainarticlepage_content_and_more.py @@ -0,0 +1,37 @@ +# Generated by Django 4.1.10 on 2024-01-04 10:19 + +from django.db import migrations +import wagtail.blocks +import wagtail.documents.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ('main', '0065_alter_mainhomepage_footer_other_links'), + ] + + operations = [ + migrations.AlterField( + model_name='mainarticlepage', + name='content', + field=wagtail.fields.StreamField([('text', wagtail.blocks.RichTextBlock(template='styleguide2/includes/atoms/text/prose_richtext.html')), ('quote', wagtail.blocks.StructBlock([('quote', wagtail.blocks.CharBlock(label='Citace')), ('autor_name', wagtail.blocks.CharBlock(label='Jméno autora'))])), ('download', wagtail.blocks.StructBlock([('file', wagtail.documents.blocks.DocumentChooserBlock(label='Stáhnutelný soubor'))]))], blank=True, use_json_field=True, verbose_name='Článek'), + ), + migrations.AlterField( + model_name='maincrossroadpage', + name='headlined_cards_content', + field=wagtail.fields.StreamField([('headlined_cards', wagtail.blocks.StructBlock([('headline', wagtail.blocks.CharBlock(label='Titulek bloku', required=False)), ('card_items', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock(label='Obrázek')), ('title', wagtail.blocks.CharBlock(label='Titulek', required=True)), ('text', wagtail.blocks.RichTextBlock(label='Krátký text pod nadpisem', required=False)), ('page', wagtail.blocks.PageChooserBlock(label='Stránka', page_type=['main.MainArticlesPage', 'main.MainArticlePage', 'main.MainProgramPage', 'main.MainPeoplePage', 'main.MainPersonPage', 'main.MainSimplePage', 'main.MainContactPage', 'main.MainCrossroadPage'], required=False)), ('link', wagtail.blocks.URLBlock(label='Odkaz', required=False))], template='styleguide2/includes/molecules/boxes/card_box_block.html'), label='Karty s odkazy'))]))], blank=True, use_json_field=True, verbose_name='Karty rozcestníku s nadpisem'), + ), + migrations.AlterField( + model_name='mainpeoplepage', + name='people', + field=wagtail.fields.StreamField([('people_group', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(label='Titulek')), ('slug', wagtail.blocks.CharBlock(help_text='Není třeba vyplňovat, bude automaticky vyplněno', label='Slug skupiny', required=False)), ('person_list', wagtail.blocks.ListBlock(wagtail.blocks.PageChooserBlock(label='Detail osoby', page_type=['main.MainPersonPage']), label='Skupina osob'))], label='Seznam osob')), ('team_group', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(label='Název sekce týmů')), ('slug', wagtail.blocks.CharBlock(help_text='Není třeba vyplňovat, bude automaticky vyplněno', label='Slug sekce', required=False)), ('team_list', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('headline', wagtail.blocks.CharBlock(label='Titulek bloku', required=False)), ('card_items', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock(label='Obrázek')), ('title', wagtail.blocks.CharBlock(label='Titulek', required=True)), ('text', wagtail.blocks.RichTextBlock(label='Krátký text pod nadpisem', required=False)), ('page', wagtail.blocks.PageChooserBlock(label='Stránka', page_type=['main.MainArticlesPage', 'main.MainArticlePage', 'main.MainProgramPage', 'main.MainPeoplePage', 'main.MainPersonPage', 'main.MainSimplePage', 'main.MainContactPage', 'main.MainCrossroadPage'], required=False)), ('link', wagtail.blocks.URLBlock(label='Odkaz', required=False))], template='styleguide2/includes/molecules/boxes/card_box_block.html'), label='Karty s odkazy'))], label='Karta týmu'), label='Týmy'))]))], blank=True, use_json_field=True, verbose_name='Lidé a týmy'), + ), + migrations.AlterField( + model_name='mainsimplepage', + name='content', + field=wagtail.fields.StreamField([('text', wagtail.blocks.RichTextBlock(template='styleguide2/includes/atoms/text/prose_richtext.html'))], blank=True, use_json_field=True, verbose_name='Hlavní obsah'), + ), + ] diff --git a/main/models.py b/main/models.py index 305ad9e18aa43284aa3a719aa8b517f02c80a5bd..ce9125e33dde1bf7f33181f9eb0c68484f78080a 100644 --- a/main/models.py +++ b/main/models.py @@ -1,6 +1,3 @@ -import datetime -from functools import cached_property - from dateutil.relativedelta import relativedelta from django.conf import settings from django.contrib import messages @@ -39,7 +36,10 @@ from shared.models import ( # MenuMixin, ExtendedMetadataPageMixin, MainArticlePageMixin, MainArticlesPageMixin, + MainContactPageMixin, MainHomePageMixin, + MainSearchPageMixin, + MainSimplePageMixin, SharedTaggedMainArticle, SubpageMixin, ) @@ -364,34 +364,7 @@ class MainPersonPage( ) -class MainSimplePage( - ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, PageInMenuMixin, Page -): - ### FIELDS - - # content - content = StreamField( - [ - ( - "text", - RichTextBlock(template="main/includes/atoms/text/prose_richtext.html"), - ), - ], - verbose_name="Hlavní obsah", - blank=True, - use_json_field=True, - ) - - ### PANELS - - content_panels = Page.content_panels + [FieldPanel("content")] - - promote_panels = make_promote_panels() - - settings_panels = [] - - ### RELATIONS - +class MainSimplePage(MainSimplePageMixin): parent_page_types = [ "main.MainHomePage", "main.MainSimplePage", @@ -400,57 +373,13 @@ class MainSimplePage( ] subpage_types = ["main.MainSimplePage"] - ### OTHERS - class Meta: - verbose_name = "Jednoduchá stárnka" - - -class MainContactPage( - ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, PageInMenuMixin, Page -): - ### FIELDS - - contact_people = StreamField( - [("item", shared_blocks.PersonContactBlock())], - verbose_name="Kontaktní osoby", - blank=True, - use_json_field=True, - ) - contact_boxes = StreamField( - [("item", blocks.PersonContactBoxBlock())], - verbose_name="Kontaktní boxy", - blank=True, - use_json_field=True, - ) - text = StreamField( - [("two_columns_text", blocks.TwoTextColumnBlock())], - verbose_name="Kontaktní informace", - blank=True, - use_json_field=True, - ) - - ### PANELS - - content_panels = Page.content_panels + [ - FieldPanel("text"), - FieldPanel("contact_people"), - FieldPanel("contact_boxes"), - ] - - promote_panels = make_promote_panels() - - settings_panels = [] +class MainContactPage(MainContactPageMixin): ### RELATIONS parent_page_types = ["main.MainHomePage"] subpage_types = [] - ### OTHERS - - class Meta: - verbose_name = "Kontakty" - class MainCrossroadPage( ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, PageInMenuMixin, Page @@ -530,55 +459,21 @@ class MainHoaxPage( parent_page_types = ["main.MainHomePage"] subpage_types = [] + ### OTHERS class Meta: verbose_name = "Hoaxy" -class MainSearchPage( - ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, PageInMenuMixin, Page -): +class MainSearchPage(MainSearchPageMixin): parent_page_types = ["main.MainHomePage"] subpage_types = [] - class Meta: - verbose_name = "Vyhledávací stránka" - - def get_context(self, request, *args, **kwargs): - context = super().get_context(request, args, kwargs) - - context["results"] = [] - - if request.GET.get("q", "") == "": - return context - - search_query = request.GET["q"] - context["global_search_query"] = search_query - - for model in ( - MainPersonPage, + @property + def searchable_models(self) -> list: + return [ MainArticlePage, + MainPersonPage, MainSimplePage, - ): - filter = models.Q(title__icontains=search_query) - - if hasattr(model, "perex"): - filter = filter | models.Q(perex__icontains=search_query) - - results = model.objects.filter(filter) - - if hasattr(model, "date"): - results = results.order_by("-date") - - context["results"] += list(results.all()[:15]) - - context["results"].sort( - # Put results without a date first, as they'll be person litsings etc. - key=lambda result: result.date - if hasattr(result, "date") - else datetime.date(year=9999, month=1, day=1), - reverse=True, - ) - - return context + ] diff --git a/main/static/main/images/background-images/bg-bartos.jpg b/main/static/main/images/background-images/bg-bartos.jpg deleted file mode 100644 index be147b1d6a07cbc6eb03b952e870d65c233eb2e3..0000000000000000000000000000000000000000 Binary files a/main/static/main/images/background-images/bg-bartos.jpg and /dev/null differ diff --git a/main/static/main/images/background-images/bg-migrace.png b/main/static/main/images/background-images/bg-migrace.png deleted file mode 100644 index b88fdbc3b4bb481be78f299a5cab8b32a9e86aeb..0000000000000000000000000000000000000000 Binary files a/main/static/main/images/background-images/bg-migrace.png and /dev/null differ diff --git a/main/static/main/images/ivan1.png b/main/static/main/images/ivan1.png deleted file mode 100644 index 9eb72d92455d970e30712b8a850789968eaea8a2..0000000000000000000000000000000000000000 Binary files a/main/static/main/images/ivan1.png and /dev/null differ diff --git a/main/static/main/images/ivan2.png b/main/static/main/images/ivan2.png deleted file mode 100644 index fcf3715792e18d1db695ad3fcc0d5f6c05277ae8..0000000000000000000000000000000000000000 Binary files a/main/static/main/images/ivan2.png and /dev/null differ diff --git a/main/static/main/images/person-table.png b/main/static/main/images/person-table.png deleted file mode 100644 index 0f0d42f1cd92bfefce2f60494d416e5f097186a9..0000000000000000000000000000000000000000 Binary files a/main/static/main/images/person-table.png and /dev/null differ diff --git a/main/templates/main/includes/atoms/buttons/round_button_small.html b/main/templates/main/includes/atoms/buttons/round_button_small.html deleted file mode 100644 index f0439aecc41cb3e2f10e620c5a1aad1a435a8ea6..0000000000000000000000000000000000000000 --- a/main/templates/main/includes/atoms/buttons/round_button_small.html +++ /dev/null @@ -1,3 +0,0 @@ -{% extends 'main/includes/atoms/buttons/round_button.html' %} - -{% block size_classes %}text-sm pl-7 pr-2 py-2{% endblock %} diff --git a/main/templates/main/includes/atoms/text/prose.html b/main/templates/main/includes/atoms/text/prose.html deleted file mode 100644 index a389a70e1610008cbb11139bc71b70012fe46d6c..0000000000000000000000000000000000000000 --- a/main/templates/main/includes/atoms/text/prose.html +++ /dev/null @@ -1,3 +0,0 @@ -<div class="prose"> - {% include 'main/includes/atoms/text/paragraph.html' with text=text %} -</div> diff --git a/main/templates/main/includes/molecules/boxes/card_box_block.html b/main/templates/main/includes/molecules/boxes/card_box_block.html deleted file mode 100644 index 07dc2b5e103f461e53eaad845b0c78c03902ea9c..0000000000000000000000000000000000000000 --- a/main/templates/main/includes/molecules/boxes/card_box_block.html +++ /dev/null @@ -1,6 +0,0 @@ -{% load wagtailimages_tags %} - -{% image self.image fill-512x512 as image %} -{% firstof self.page.url self.link as url %} - -{% include 'main/includes/molecules/boxes/card_box.html' with url=url image=image header=self.title content=self.text description_classes="!bg-grey-180" classes="drop-shadow" %} diff --git a/main/templates/main/includes/organisms/cards/card_list.html b/main/templates/main/includes/organisms/cards/card_list.html deleted file mode 100644 index 3a7cd73bb6b8c72dee3d70b684ef8cc720e28dde..0000000000000000000000000000000000000000 --- a/main/templates/main/includes/organisms/cards/card_list.html +++ /dev/null @@ -1,5 +0,0 @@ -<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 content-stretch gap-8"> - {% for card in cards %} - {% 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 deleted file mode 100644 index 0765f1d6e7d3ac222fe8f4bbf905a618072a96b5..0000000000000000000000000000000000000000 --- a/main/templates/main/includes/organisms/header/article_header.html +++ /dev/null @@ -1,7 +0,0 @@ -{% extends 'main/includes/organisms/header/simple_header_with_tags_and_navigation.html' %} - -{% block before_heading %} - {% include 'main/includes/atoms/header/navigation.html' with classes='mb-6' first_text=first_nav_text first_link=first_nav_link second_text=second_nav_text second_link=None %} -{% endblock %} - -{% block heading_classes %}head-8xl{% endblock %} 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 deleted file mode 100644 index 63f4c26c07a99f4ea1ac6feb2749a29509749036..0000000000000000000000000000000000000000 --- a/main/templates/main/includes/organisms/header/simple_header_with_tags.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends 'main/includes/organisms/header/simple_header.html' %} - -{% block after_heading %} - {% 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 deleted file mode 100644 index 6a544de694c645c2f2961a61a066467dc3a6b415..0000000000000000000000000000000000000000 --- a/main/templates/main/includes/organisms/header/simple_header_with_tags_and_navigation.html +++ /dev/null @@ -1,9 +0,0 @@ -{% extends 'main/includes/organisms/header/simple_header.html' %} - -{% block before_heading %} - {% include 'main/includes/atoms/header/navigation.html' with classes='mb-6' %} -{% endblock %} - -{% block after_heading %} - {% include 'main/includes/molecules/tags/tags.html' with classes='mb-4 mt-4' %} -{% endblock %} diff --git a/main/templates/main/includes/organisms/popouts/hoax_popout_list.html b/main/templates/main/includes/organisms/popouts/hoax_popout_list.html deleted file mode 100644 index 34abcf2d839773d4ae690924066e3cbbe7eec25f..0000000000000000000000000000000000000000 --- a/main/templates/main/includes/organisms/popouts/hoax_popout_list.html +++ /dev/null @@ -1,6 +0,0 @@ -<ul class="flex flex-col"> - <li class="grow">{% include "main/includes/molecules/popouts/hoax_popout_point.html" %}</li> - <li class="grow">{% include "main/includes/molecules/popouts/hoax_popout_point.html" %}</li> - <li class="grow">{% include "main/includes/molecules/popouts/hoax_popout_point.html" %}</li> - <li class="grow">{% include "main/includes/molecules/popouts/hoax_popout_point.html" %}</li> -</ul> diff --git a/main/templates/main/includes/organisms/search/search_results.html b/main/templates/main/includes/organisms/search/search_results.html deleted file mode 100644 index 8d3aff97164847733815f8612267e1fca319ed14..0000000000000000000000000000000000000000 --- a/main/templates/main/includes/organisms/search/search_results.html +++ /dev/null @@ -1,9 +0,0 @@ -<div class="flex flex-col"> - <div class="pb-2"> - {{ results|length }} výsledků - </div> - - {% for result in results %} - {% include "main/includes/molecules/search/universal_search_result.html" with url=result.url title=result.title date=result.date perex=result.perex %} - {% endfor %} -</div> diff --git a/main/templates/main/main_article_page.html b/main/templates/main/main_article_page.html index 3ab853851cec7d2e1c9b919bda37663010b4f4b1..c43dc3736130fcb86ae32958c9c7604117a56949 100644 --- a/main/templates/main/main_article_page.html +++ b/main/templates/main/main_article_page.html @@ -1,32 +1 @@ -{% extends "main/base.html" %} -{% load wagtailcore_tags %} - -{% block content %} - -{% include 'main/includes/organisms/layout/navbar.html' with selected_item=page.root_page.articles_page.get_menu_title %} -{% include 'main/includes/organisms/header/article_header.html' with title=page.title description=page.perex tags=page.tags.names first_nav_text=page.root_page.articles_page.title first_nav_link=page.root_page.articles_page.url second_nav_text=page.date %} - -<main role="main" class="mb-10 xl:mb-32"> - <div class="container--wide flex flex-col"> - {% if page.shared_from %} - <p> - <em> - Tento článek byl sdílen z jiného webu. - Originál si můžete přečíst <a href="{{ page.get_original_url }}">zde</a>. - </em> - </p> - {% endif %} - - {% for block in page.content %} - {% include_block block %} - {% endfor %} - - <div class="flex justify-start"> - {% include 'main/includes/atoms/buttons/round_button.html' with url=page.root_page.articles_page.url button_text='Zpět na aktuality' %} - </div> - </div> -</main> - -{% include 'main/includes/organisms/main_section/newsletter_section.html' %} - -{% endblock %} +{% extends "styleguide2/article_page.html" %} diff --git a/main/templates/main/main_articles_page.html b/main/templates/main/main_articles_page.html index 9462970468ef66e9ad26ee04ad2f4ac0f0f178f1..b3d0fdeff1316d87dfe2338e644a4f9c042b4a0d 100644 --- a/main/templates/main/main_articles_page.html +++ b/main/templates/main/main_articles_page.html @@ -1,15 +1 @@ -{% extends "main/base.html" %} -{% load wagtailcore_tags %} - -{% block content %} - -{% include 'main/includes/organisms/layout/navbar.html' with selected_item=page.get_menu_title %} -{% include 'main/includes/organisms/header/articles_header.html' with title=page.title tags=tags %} - -<main role="main"> - {% include 'main/includes/organisms/articles/main_articles_timeline.html' with article_timeline_list=article_timeline_list %} -</main> - -{% include 'main/includes/organisms/main_section/newsletter_section.html' %} - -{% endblock %} +{% extends "styleguide2/articles_page.html" %} diff --git a/main/templates/main/main_contact_page.html b/main/templates/main/main_contact_page.html index 2a508871aeac06c2c4278a477011cf6a32ef7f4f..268e3bed634ec25ae6d78857681ff41bc9776c3a 100644 --- a/main/templates/main/main_contact_page.html +++ b/main/templates/main/main_contact_page.html @@ -1,80 +1 @@ -{% extends "main/base.html" %} -{% load wagtailcore_tags wagtailimages_tags shared_filters %} - -{% block content %} - {% include 'main/includes/organisms/layout/navbar.html' with selected_item=page.get_menu_title %} - {% include 'main/includes/organisms/header/simple_header.html' with title=page.title %} - - <main role="main"> - <section class="container--wide mb-4 xl:mb-20"> - <div class="flex flex-col flex-wrap mb-10 xl:mb-20"> - <div - class=" - flex gap-10 flex-wrap - lg:flex-nowrap - " - > - <div class="w-full max-w-4xl"> - <h2 class="head-6xl mb-5"> - {{ page.title }} - </h2> - <div class="flex flex-wrap justify-between"> - {% for text_block in page.text %} - <div class="leading-5 w-5/6 sm:w-6/12"> - {{ text_block.value.text_column_1|richtext }} - </div> - <div class="leading-5 w-5/6 sm:w-6/12"> - {{ text_block.value.text_column_2|richtext }} - </div> - {% endfor %} - </div> - </div> - - <div class="w-full max-w-2xl"> - <h2 class="head-6xl mb-5"> - Regionální kontakty - </h2> - - <div class="__js-root w-full flex max-w-2xl items-center"> - <ui-region-map class="w-full"></ui-region-map> - </div> - </div> - </div> - </div> - - {% if page.contact_people %} - <h2 class="head-6xl mb-5 xl:mb-8"> - Kontakty pro média - </h2> - - <div class="grid grid-cols-1 xl:grid-cols-2 gap-4 mb-16"> - {% for contact_person in page.contact_people %} - {% if contact_person.value.person.profile_image %} - {% image contact_person.value.person.profile_image fill-256x256 as contact_box_image %} - {% endif %} - - {% firstof contact_person.value.position conact_person.value.person.position as contact_position %} - - {% include 'main/includes/molecules/contact/contact_person_large_box.html' with image=contact_box_image name=contact_person.value.person.title function=contact_position telephone=contact_person.value.person.phone mail=contact_person.value.person.email url=contact_person.value.person.url %} - {% endfor %} - </div> - {% endif %} - - {% if page.contact_boxes %} - <h2 class="head-6xl mb-5 xl:mb-8"> - Další kontakty - </h2> - - <div class="grid grid-cols-1 xl:grid-cols-2 gap-4"> - {% for contact_block in page.contact_boxes %} - {% image contact_block.value.image fill-256x256 as contact_box_image %} - - {% include 'main/includes/molecules/contact/contact_person_large_box.html' with image=contact_box_image name=contact_block.value.title function=contact_block.value.subtitle %} - {% endfor %} - </div> - {% endif %} - </section> - </main> - - {% include 'main/includes/organisms/main_section/newsletter_section.html' %} -{% endblock %} +{% extends "styleguide2/contact_page.html" %} diff --git a/main/templates/main/main_crossroad_page.html b/main/templates/main/main_crossroad_page.html index be40644e827fdd8263449345650683982c8d8911..9c79906fc25e133f6336e10fa5209705e79bcd4d 100644 --- a/main/templates/main/main_crossroad_page.html +++ b/main/templates/main/main_crossroad_page.html @@ -1,9 +1,9 @@ -{% extends "main/base.html" %} +{% extends "styleguide2/base.html" %} {% load wagtailcore_tags %} {% block content %} - {% include 'main/includes/organisms/layout/navbar.html' with selected_item=page.get_menu_title %} - {% include 'main/includes/organisms/header/simple_header.html' with title=page.title %} + {% include 'styleguide2/includes/organisms/layout/navbar.html' with selected_item=page.get_menu_title %} + {% include 'styleguide2/includes/organisms/header/simple_header.html' with title=page.title %} <main role="main" class="mb-10 xl:mb-32"> <div class="mb-2 lg:mb-12 container--wide"> diff --git a/main/templates/main/main_hoax_page.html b/main/templates/main/main_hoax_page.html index 91bdcc5ac34929dcd9e98f8b57f700294b8ab40e..40ac75ecfdf14d5bdec8078c503b056987472971 100644 --- a/main/templates/main/main_hoax_page.html +++ b/main/templates/main/main_hoax_page.html @@ -1,8 +1,8 @@ -{% extends "main/base.html" %} +{% extends "styleguide2/base.html" %} {% load wagtailcore_tags %} {% block content %} - {% include 'main/includes/layout/simple_page_header.html' %} + {% include 'styleguide2/includes/layout/simple_page_header.html' %} <main role="main" class="mb-10 xl:mb-32 __js-root"> {% if page.description %} <div class="grid-container mb-2 lg:mb-12"> diff --git a/main/templates/main/main_home_page.html b/main/templates/main/main_home_page.html index 5ea5ef635be12f4c520e2560439596fa9d108f87..1db4c8fcc262573d017b1d5b96c6912fef311394 100644 --- a/main/templates/main/main_home_page.html +++ b/main/templates/main/main_home_page.html @@ -1,16 +1 @@ -{% extends "main/base.html" %} -{% load wagtailcore_tags %} - -{% block content %} - -{% include 'main/includes/organisms/layout/navbar.html' with is_transparent=True %} - -<main role="main"> - {% for block in page.content %} - {% include_block block %} - {% endfor %} - - {% include "main/includes/organisms/main_section/newsletter_section.html" %} -</main> - -{% endblock %} +{% extends "styleguide2/home_page.html" %} diff --git a/main/templates/main/main_people_page.html b/main/templates/main/main_people_page.html index 16c757a40ddc7a4228e2821e7c3fe0793e8b4475..a407a5c3596c37a27d5c7e39d9968394ae141f1c 100644 --- a/main/templates/main/main_people_page.html +++ b/main/templates/main/main_people_page.html @@ -1,8 +1,8 @@ -{% extends "main/base.html" %} +{% extends "styleguide2/base.html" %} {% load wagtailcore_tags wagtailimages_tags shared_filters %} {% block content %} -{% include 'main/includes/organisms/layout/navbar.html' with selected_item=page.get_menu_title %} +{% include 'styleguide2/includes/organisms/layout/navbar.html' with selected_item=page.get_menu_title %} <div class="__js-root"> <ui-view-provider @@ -10,7 +10,7 @@ :sync-location="true" v-slot="{ isCurrentView, toggleView }" > - {% include 'main/includes/organisms/header/people_header.html' with people=page.people title=page.title description_column_1=page.perex_col_1 description_column_2=page.perex_col_2 %} + {% include 'styleguide2/includes/organisms/header/people_header.html' with people=page.people title=page.title description_column_1=page.perex_col_1 description_column_2=page.perex_col_2 %} <main role="main" class="mb-20"> <div class="container--wide"> @@ -27,7 +27,7 @@ {% for person_page in block.value.person_list %} {% image person_page.profile_image fill-480x480 as profile_image %} - {% include 'main/includes/molecules/contact/contact_person_large_box.html' with image=profile_image name=person_page.title function=person_page.position telephone=person_page.phone mail=person_page.email url=person_page.url %} + {% include 'styleguide2/includes/molecules/contact/contact_person_large_box.html' with image=profile_image name=person_page.title function=person_page.position telephone=person_page.phone mail=person_page.email url=person_page.url %} {% endfor %} </template> {% endif %} @@ -48,7 +48,7 @@ {% image card.image max-512x512 as card_image %} {% firstof card.page.url card.link as card_url %} - {% include 'main/includes/molecules/boxes/card_box.html' with image=card_image header=card.title content=card.text url=card_url description_classes='!bg-grey-180' %} + {% include 'styleguide2/includes/molecules/boxes/card_box.html' with image=card_image header=card.title content=card.text url=card_url description_classes='!bg-grey-180' %} {% endfor %} </ul> {% endfor %} @@ -61,6 +61,6 @@ </ui-view-provider> </div> -{% include 'main/includes/organisms/main_section/newsletter_section.html' %} +{% include 'styleguide2/includes/organisms/main_section/newsletter_section.html' %} {% endblock content %} diff --git a/main/templates/main/main_person_page.html b/main/templates/main/main_person_page.html index d14e7ab2e0a5dcd12d21c5ea737ad862fe864350..cfa848c464bced19af5e45dfa2a8cf7257e7c3fa 100644 --- a/main/templates/main/main_person_page.html +++ b/main/templates/main/main_person_page.html @@ -1,9 +1,9 @@ -{% extends "main/base.html" %} +{% extends "styleguide2/base.html" %} {% load wagtailcore_tags wagtailimages_tags shared_filters perex %} {% block content %} - {% include 'main/includes/organisms/layout/navbar.html' with selected_item=page.root_page.people_page.get_menu_title is_transparent=True is_on_dark_background=True %} - {% include 'main/includes/organisms/header/photo_header.html' with first_nav_text=page.root_page.people_page.title first_nav_link=page.root_page.people_page.url second_nav_text=page.primary_group degree_before=page.before_name name=page.title degree_after=page.after_name function=page.position main_image=page.main_image %} + {% include 'styleguide2/includes/organisms/layout/navbar.html' with selected_item=page.root_page.people_page.get_menu_title is_transparent=True is_on_dark_background=True %} + {% include 'styleguide2/includes/organisms/header/photo_header.html' with first_nav_text=page.root_page.people_page.title first_nav_link=page.root_page.people_page.url second_nav_text=page.primary_group degree_before=page.before_name name=page.title degree_after=page.after_name function=page.position main_image=page.main_image %} <main role="main"> <div class="container--wide w-full"> @@ -75,7 +75,7 @@ <div class="grid-container person-grid-container !ml-0"> <div class="grid-left-side-with-content"> <div> - {% include 'main/includes/atoms/calendar/calendar.html' with calendar_data=page.get_fullcalendar_data %} + {% include 'styleguide2/includes/atoms/calendar/calendar.html' with calendar_data=page.get_fullcalendar_data %} </div> </div> </div> @@ -99,7 +99,7 @@ {% image related_article.image fill-500x500 as article_image %} - {% include 'main/includes/molecules/boxes/card_box.html' with url=related_article.url image=article_image header=related_article.title content=related_article.perex|shorten_perex description_classes='!bg-grey-180' date=related_article.date %} + {% include 'styleguide2/includes/molecules/boxes/card_box.html' with url=related_article.url image=article_image header=related_article.title content=related_article.perex|shorten_perex description_classes='!bg-grey-180' date=related_article.date %} {% endfor %} </div> </div> @@ -124,7 +124,7 @@ {% with person.value as person %} {% image person.profile_image fill-500x500 as profile_image %} - {% include 'main/includes/molecules/boxes/card_box.html' with image=profile_image url=person.url header=person.title content=person.position description_classes='!bg-grey-180' %} + {% include 'styleguide2/includes/molecules/boxes/card_box.html' with image=profile_image url=person.url header=person.title content=person.position description_classes='!bg-grey-180' %} {% endwith %} {% endfor %} </div> @@ -133,6 +133,6 @@ </section> {% endif %} - {% include 'main/includes/organisms/main_section/newsletter_section.html' %} + {% include 'styleguide2/includes/organisms/main_section/newsletter_section.html' %} </main> {% endblock content %} diff --git a/main/templates/main/main_program_page.html b/main/templates/main/main_program_page.html index a88f811c2af4b970babe66dadaf1b4de34967156..67b22811127a911b5e26bbad1ce02ce77e1f20d6 100644 --- a/main/templates/main/main_program_page.html +++ b/main/templates/main/main_program_page.html @@ -1,8 +1,8 @@ -{% extends "main/base.html" %} +{% extends "styleguide2/base.html" %} {% load wagtailcore_tags wagtailimages_tags shared_filters %} {% block content %} - {% include 'main/includes/organisms/layout/navbar.html' with selected_item=page.get_menu_title %} + {% include 'styleguide2/includes/organisms/layout/navbar.html' with selected_item=page.get_menu_title %} <div class="__js-root"> <ui-view-provider @@ -10,7 +10,7 @@ :sync-location="true" v-slot="{ isCurrentView, toggleView }" > - {% include 'main/includes/organisms/header/simple_header_with_ui_switch.html' with title=page.title ui_switch_iterable=page.program %} + {% include 'styleguide2/includes/organisms/header/simple_header_with_ui_switch.html' with title=page.title ui_switch_iterable=page.program %} <main role="main" class="mb-4 xl:mb-20"> <div class="container--wide flex flex-col"> @@ -31,12 +31,12 @@ {% image point.icon max-150x150 as point_icon %} {% endif %} - {% include 'main/includes/molecules/blocks/icon_title_text_block.html' with icon=point_icon url=point.url title=point.title text=point.text %} + {% include 'styleguide2/includes/molecules/blocks/icon_title_text_block.html' with icon=point_icon url=point.url title=point.title text=point.text %} {% endfor %} </div> {% elif program.block_type == 'program_group_popout' %} <div class="mb-12"> - {% include 'main/includes/organisms/popouts/popout_list.html' with categories=program.value.categories %} + {% include 'styleguide2/includes/organisms/popouts/popout_list.html' with categories=program.value.categories %} </div> {% elif program.block_type == 'program_group_crossroad' %} <div class="mb-12"> @@ -44,7 +44,7 @@ {% for point in program.value.point_list %} {% image point.image fill-512x512 as point_image %} - {% include 'main/includes/molecules/boxes/card_box.html' with url=point.page.url image=point_image header=point.title content=point.text date=point.page.date description_classes="!bg-grey-180" classes="drop-shadow" %} + {% include 'styleguide2/includes/molecules/boxes/card_box.html' with url=point.page.url image=point_image header=point.title content=point.text date=point.page.date description_classes="!bg-grey-180" classes="drop-shadow" %} {% endfor %} </div> </div> @@ -56,5 +56,5 @@ </ui-view-provider> </div> - {% include 'main/includes/organisms/main_section/newsletter_section.html' %} + {% include 'styleguide2/includes/organisms/main_section/newsletter_section.html' %} {% endblock %} diff --git a/main/templates/main/main_search_page.html b/main/templates/main/main_search_page.html index 04656b8c7736cde9f402eb84692f4305e4b760ad..6c87d8cf34986526acfe03f2402a8cd1b56260c8 100644 --- a/main/templates/main/main_search_page.html +++ b/main/templates/main/main_search_page.html @@ -1,15 +1 @@ -{% extends "main/base.html" %} -{% load wagtailcore_tags %} - -{% block content %} - -{% include 'main/includes/organisms/layout/navbar.html' %} -{% include 'main/includes/organisms/header/simple_header.html' with title=page.title %} - -<main role="main" class="mb-10 xl:mb-32"> - <div class="container--wide mb-2 lg:mb-12"> - {% include 'main/includes/organisms/search/search_results.html' %} - </div> -</main> - -{% endblock %} +{% extends "styleguide2/search_page.html" %} diff --git a/main/templates/main/main_simple_page.html b/main/templates/main/main_simple_page.html index 3ef9bd6138005a22e2724a02854cc4a99647976a..39f76d90ce23b71f22725741928c0cf58074b7bc 100644 --- a/main/templates/main/main_simple_page.html +++ b/main/templates/main/main_simple_page.html @@ -1,13 +1 @@ -{% extends "main/base.html" %} -{% load wagtailcore_tags %} - -{% block content %} - {% include 'main/includes/organisms/layout/navbar.html' with selected_item=page.get_menu_title %} - {% include 'main/includes/organisms/header/simple_header.html' with title=page.title %} - - <main class="container--wide mb-2 lg:mb-12"> - {% for block in page.content %} - {% include_block block %} - {% endfor %} - </main> -{% endblock %} +{% extends "styleguide2/simple_page.html" %} diff --git a/majak/settings/base.py b/majak/settings/base.py index d42dcacce345fc8c624d5c17fbf4516e7d364acf..606304f218a6b3102f3302b5c4baf96c090f38c4 100644 --- a/majak/settings/base.py +++ b/majak/settings/base.py @@ -1,4 +1,3 @@ -import json from os.path import join from pathlib import Path diff --git a/majak/settings/dev.py b/majak/settings/dev.py index a58152a442a061e82da626cfb4b48206bc16561a..2669685af293a1ccc8f15fa1c66623cdf7813388 100644 --- a/majak/settings/dev.py +++ b/majak/settings/dev.py @@ -1,5 +1,6 @@ -from .base import * -from .base import env +from .base import * # noqa +from .base import env # noqa + # GENERAL # ------------------------------------------------------------------------------ diff --git a/majak/settings/production.py b/majak/settings/production.py index 33c990f1392a335cfba723961c64b16a85d55eca..54fe387fdf9b64b91fc903ef7d9ff5b3ba1452bf 100644 --- a/majak/settings/production.py +++ b/majak/settings/production.py @@ -1,5 +1,5 @@ -from .base import * -from .base import env +from .base import * # noqa +from .base import env # noqa # DATABASES # ------------------------------------------------------------------------------ diff --git a/majak/settings/test.py b/majak/settings/test.py index c31108db00533b2b0d2a895b68179982b7827e0d..9ed852c19f9eee4427699cb5eaa7b27b448c0ee8 100644 --- a/majak/settings/test.py +++ b/majak/settings/test.py @@ -1,3 +1,3 @@ -from .dev import * +from .dev import * # noqa INSTALLED_APPS += ["tests"] diff --git a/maps_utils/blocks.py b/maps_utils/blocks.py index 9ecb0416f1ab512770530a5bab7dea4ef2d3b37b..ba478faedabfaa1718c6c9cc9a86ed15788d85c0 100644 --- a/maps_utils/blocks.py +++ b/maps_utils/blocks.py @@ -1,5 +1,4 @@ import json -from typing import Mapping, Optional from uuid import uuid4 from django.forms.utils import ErrorList diff --git a/shared/blocks/main.py b/shared/blocks/main.py index 43eefe90a93af654ad0983b7509132f3553aed3b..60483e8e5fef38c3f7513a5b1469584808251bb7 100644 --- a/shared/blocks/main.py +++ b/shared/blocks/main.py @@ -8,6 +8,7 @@ from wagtail.blocks import ( URLBlock, ) from wagtail.documents.blocks import DocumentChooserBlock +from wagtail.images.blocks import ImageChooserBlock from .base import MenuItemBlock as MenuItemBlockBase @@ -49,7 +50,7 @@ class MainMenuItemBlock(MenuItemBlockBase): class NavbarMenuItemBlock(CTAMixin): class Meta: label = "Tlačítko" - template = "main/includes/molecules/navbar/additional_button.html" + template = "styleguide2/includes/molecules/navbar/additional_button.html" class SocialLinkBlock(LinkBlock): @@ -74,7 +75,7 @@ class ArticleQuoteBlock(StructBlock): class Meta: icon = "user" label = "Blok citace" - template = "main/includes/legacy/article_quote_block.html" + template = "styleguide2/includes/legacy/article_quote_block.html" class ArticleDownloadBlock(StructBlock): @@ -83,12 +84,31 @@ class ArticleDownloadBlock(StructBlock): class Meta: icon = "user" label = "Blok stáhnutelného dokumentu" - template = "main/includes/molecules/blocks/article_download_block.html" + template = "styleguide2/includes/molecules/blocks/article_download_block.html" # People +class TwoTextColumnBlock(StructBlock): + text_column_1 = RichTextBlock(label="První sloupec textu") + text_column_2 = RichTextBlock(label="Druhý sloupec textu") + + class Meta: + icon = "doc-full" + label = "Text ve dvou sloupcích" + + +class PersonContactBoxBlock(StructBlock): + title = CharBlock(label="Titulek") + image = ImageChooserBlock(label="Ikona") + subtitle = CharBlock(label="Podtitulek") + + class Meta: + icon = "mail" + label = "Kontakty" + + class PersonContactBlock(StructBlock): position = CharBlock(label="Název pozice", required=False) # email, phone? diff --git a/shared/feeds.py b/shared/feeds.py index 7165433b7f8928db4f0d509d34f3bc6778ad3d77..01b9821262b07eeba42e9ce38085b7cedd070bbb 100644 --- a/shared/feeds.py +++ b/shared/feeds.py @@ -37,7 +37,7 @@ class LatestArticlesFeed(Feed): def item_description(self, item) -> str: return render_to_string( - "main/feed_item_description.html", + "styleguide2/feed_item_description.html", {"item": item}, ) diff --git a/shared/jekyll_import.py b/shared/jekyll_import.py index 4ac041566f35e4bfbc1e750a83647dea42f089cc..2d84fb62f1f01ed7208270cb2780ffa66488a6a5 100644 --- a/shared/jekyll_import.py +++ b/shared/jekyll_import.py @@ -550,7 +550,7 @@ class JekyllArticleImporter: except ValueError: try: article.tags.add(str(tag_name)) - except Exception as E: + except Exception: msg = "Nelze importovat tag" logger.warning(msg, extra={"tag": tag_name}) self.page_log += "{} - {}\n".format(msg, tag_name) diff --git a/shared/models/main.py b/shared/models/main.py index 29823a91023df5e5de48f5a51ba737771fb0dedc..45b567e77265e7aace8bb5c3ec92dbfd353bff34 100644 --- a/shared/models/main.py +++ b/shared/models/main.py @@ -36,7 +36,9 @@ from shared.blocks import ( NavbarMenuItemBlock, OtherLinksBlock, PersonContactBlock, + PersonContactBoxBlock, SocialLinkBlock, + TwoTextColumnBlock, ) from shared.const import MONTH_NAMES from shared.forms import JekyllImportForm, SubscribeForm @@ -256,7 +258,7 @@ class MainHomePageMixin( @staticmethod def get_404_response(request): - return render(request, "main/404.html", status=404) + return render(request, "styleguide2/404.html", status=404) def get_context(self, request, *args, **kwargs): context = super().get_context(request, args, kwargs) @@ -288,7 +290,7 @@ class MainHomePageMixin( data = { "html": render( - request, "main/includes/small_article_preview.html", context + request, "styleguide2/includes/small_article_preview.html", context ).content.decode("utf-8") } @@ -585,7 +587,7 @@ class MainArticlesPageMixin( data = { "html": render( request, - "main/includes/organisms/articles/articles_timeline_list.html", + "styleguide2/includes/organisms/articles/articles_timeline_list.html", context, ).content.decode("utf-8"), "has_next": ( @@ -640,7 +642,7 @@ class MainArticlePageMixin( [ ( "text", - RichTextBlock(template="main/includes/atoms/text/prose_richtext.html"), + RichTextBlock(template="styleguide2/includes/atoms/text/prose_richtext.html"), ), ("quote", ArticleQuoteBlock()), ("download", ArticleDownloadBlock()), @@ -689,3 +691,138 @@ class MainArticlePageMixin( class Meta: verbose_name = "Aktualita" abstract = True + + +class MainContactPageMixin( + ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, PageInMenuMixin, Page +): + ### FIELDS + + contact_people = StreamField( + [("item", PersonContactBlock())], + verbose_name="Kontaktní osoby", + blank=True, + use_json_field=True, + ) + contact_boxes = StreamField( + [("item", PersonContactBoxBlock())], + verbose_name="Kontaktní boxy", + blank=True, + use_json_field=True, + ) + text = StreamField( + [("two_columns_text", TwoTextColumnBlock())], + verbose_name="Kontaktní informace", + blank=True, + use_json_field=True, + ) + + ### PANELS + + content_panels = Page.content_panels + [ + FieldPanel("text"), + FieldPanel("contact_people"), + FieldPanel("contact_boxes"), + ] + + promote_panels = make_promote_panels() + + settings_panels = [] + + ### RELATIONS + + parent_page_types = [] # NOTE: Must be implemented + subpage_types = [] # NOTE: Must be implemented + + ### OTHERS + + class Meta: + verbose_name = "Kontakty" + abstract = True + + +class MainSearchPageMixin( + ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, PageInMenuMixin, Page +): + parent_page_types = [] # NOTE: Must be implemented + subpage_types = [] # NOTE: Must be implemented + + class Meta: + verbose_name = "Vyhledávací stránka" + abstract = True + + @property + def searchable_models(self) -> list: + # NOTE: Must be implemented + return [] + + def get_context(self, request, *args, **kwargs): + context = super().get_context(request, args, kwargs) + + context["results"] = [] + + if request.GET.get("q", "") == "": + return context + + search_query = request.GET["q"] + context["global_search_query"] = search_query + + for model in self.searchable_models: + filter = models.Q(title__icontains=search_query) + + if hasattr(model, "perex"): + filter = filter | models.Q(perex__icontains=search_query) + + results = model.objects.filter(filter) + + if hasattr(model, "date"): + results = results.order_by("-date") + + context["results"] += list(results.all()[:15]) + + context["results"].sort( + # Put results without a date first, as they'll be person litsings etc. + key=lambda result: result.date + if hasattr(result, "date") + else datetime.date(year=9999, month=1, day=1), + reverse=True, + ) + + return context + + +class MainSimplePageMixin( + ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, PageInMenuMixin, Page +): + ### FIELDS + + # content + content = StreamField( + [ + ( + "text", + RichTextBlock(template="styleguide2/includes/atoms/text/prose_richtext.html"), + ), + ], + verbose_name="Hlavní obsah", + blank=True, + use_json_field=True, + ) + + ### PANELS + + content_panels = Page.content_panels + [FieldPanel("content")] + + promote_panels = make_promote_panels() + + settings_panels = [] + + ### RELATIONS + + parent_page_types = [] # NOTE: Must be implemented + subpage_types = [] # NOTE: Must be implemented + + ### OTHERS + class Meta: + verbose_name = "Jednoduchá stárnka" + abstract = True diff --git a/main/static/main/images/background-images/bg-flag-mobile.gif b/shared/static/styleguide2/images/background-images/bg-flag-mobile.gif similarity index 100% rename from main/static/main/images/background-images/bg-flag-mobile.gif rename to shared/static/styleguide2/images/background-images/bg-flag-mobile.gif diff --git a/main/static/main/images/background-images/bg-flag.webp b/shared/static/styleguide2/images/background-images/bg-flag.webp similarity index 100% rename from main/static/main/images/background-images/bg-flag.webp rename to shared/static/styleguide2/images/background-images/bg-flag.webp diff --git a/main/static/main/images/background-images/bg-newsletter.webp b/shared/static/styleguide2/images/background-images/bg-newsletter.webp similarity index 100% rename from main/static/main/images/background-images/bg-newsletter.webp rename to shared/static/styleguide2/images/background-images/bg-newsletter.webp diff --git a/main/static/main/images/favicons/apple-touch-icon-114x114.png b/shared/static/styleguide2/images/favicons/apple-touch-icon-114x114.png similarity index 100% rename from main/static/main/images/favicons/apple-touch-icon-114x114.png rename to shared/static/styleguide2/images/favicons/apple-touch-icon-114x114.png diff --git a/main/static/main/images/favicons/apple-touch-icon-120x120.png b/shared/static/styleguide2/images/favicons/apple-touch-icon-120x120.png similarity index 100% rename from main/static/main/images/favicons/apple-touch-icon-120x120.png rename to shared/static/styleguide2/images/favicons/apple-touch-icon-120x120.png diff --git a/main/static/main/images/favicons/apple-touch-icon-144x144.png b/shared/static/styleguide2/images/favicons/apple-touch-icon-144x144.png similarity index 100% rename from main/static/main/images/favicons/apple-touch-icon-144x144.png rename to shared/static/styleguide2/images/favicons/apple-touch-icon-144x144.png diff --git a/main/static/main/images/favicons/apple-touch-icon-152x152.png b/shared/static/styleguide2/images/favicons/apple-touch-icon-152x152.png similarity index 100% rename from main/static/main/images/favicons/apple-touch-icon-152x152.png rename to shared/static/styleguide2/images/favicons/apple-touch-icon-152x152.png diff --git a/main/static/main/images/favicons/apple-touch-icon-57x57.png b/shared/static/styleguide2/images/favicons/apple-touch-icon-57x57.png similarity index 100% rename from main/static/main/images/favicons/apple-touch-icon-57x57.png rename to shared/static/styleguide2/images/favicons/apple-touch-icon-57x57.png diff --git a/main/static/main/images/favicons/apple-touch-icon-60x60.png b/shared/static/styleguide2/images/favicons/apple-touch-icon-60x60.png similarity index 100% rename from main/static/main/images/favicons/apple-touch-icon-60x60.png rename to shared/static/styleguide2/images/favicons/apple-touch-icon-60x60.png diff --git a/main/static/main/images/favicons/apple-touch-icon-72x72.png b/shared/static/styleguide2/images/favicons/apple-touch-icon-72x72.png similarity index 100% rename from main/static/main/images/favicons/apple-touch-icon-72x72.png rename to shared/static/styleguide2/images/favicons/apple-touch-icon-72x72.png diff --git a/main/static/main/images/favicons/apple-touch-icon-76x76.png b/shared/static/styleguide2/images/favicons/apple-touch-icon-76x76.png similarity index 100% rename from main/static/main/images/favicons/apple-touch-icon-76x76.png rename to shared/static/styleguide2/images/favicons/apple-touch-icon-76x76.png diff --git a/main/static/main/images/favicons/favicon-128x128.png b/shared/static/styleguide2/images/favicons/favicon-128x128.png similarity index 100% rename from main/static/main/images/favicons/favicon-128x128.png rename to shared/static/styleguide2/images/favicons/favicon-128x128.png diff --git a/main/static/main/images/favicons/favicon-16x16.png b/shared/static/styleguide2/images/favicons/favicon-16x16.png similarity index 100% rename from main/static/main/images/favicons/favicon-16x16.png rename to shared/static/styleguide2/images/favicons/favicon-16x16.png diff --git a/main/static/main/images/favicons/favicon-196x196.png b/shared/static/styleguide2/images/favicons/favicon-196x196.png similarity index 100% rename from main/static/main/images/favicons/favicon-196x196.png rename to shared/static/styleguide2/images/favicons/favicon-196x196.png diff --git a/main/static/main/images/favicons/favicon-32x32.png b/shared/static/styleguide2/images/favicons/favicon-32x32.png similarity index 100% rename from main/static/main/images/favicons/favicon-32x32.png rename to shared/static/styleguide2/images/favicons/favicon-32x32.png diff --git a/main/static/main/images/favicons/favicon-96x96.png b/shared/static/styleguide2/images/favicons/favicon-96x96.png similarity index 100% rename from main/static/main/images/favicons/favicon-96x96.png rename to shared/static/styleguide2/images/favicons/favicon-96x96.png diff --git a/main/static/main/images/favicons/favicon.ico b/shared/static/styleguide2/images/favicons/favicon.ico similarity index 100% rename from main/static/main/images/favicons/favicon.ico rename to shared/static/styleguide2/images/favicons/favicon.ico diff --git a/main/static/main/images/favicons/mstile-144x144.png b/shared/static/styleguide2/images/favicons/mstile-144x144.png similarity index 100% rename from main/static/main/images/favicons/mstile-144x144.png rename to shared/static/styleguide2/images/favicons/mstile-144x144.png diff --git a/main/static/main/images/favicons/mstile-150x150.png b/shared/static/styleguide2/images/favicons/mstile-150x150.png similarity index 100% rename from main/static/main/images/favicons/mstile-150x150.png rename to shared/static/styleguide2/images/favicons/mstile-150x150.png diff --git a/main/static/main/images/favicons/mstile-310x150.png b/shared/static/styleguide2/images/favicons/mstile-310x150.png similarity index 100% rename from main/static/main/images/favicons/mstile-310x150.png rename to shared/static/styleguide2/images/favicons/mstile-310x150.png diff --git a/main/static/main/images/favicons/mstile-310x310.png b/shared/static/styleguide2/images/favicons/mstile-310x310.png similarity index 100% rename from main/static/main/images/favicons/mstile-310x310.png rename to shared/static/styleguide2/images/favicons/mstile-310x310.png diff --git a/main/static/main/images/favicons/mstile-70x70.png b/shared/static/styleguide2/images/favicons/mstile-70x70.png similarity index 100% rename from main/static/main/images/favicons/mstile-70x70.png rename to shared/static/styleguide2/images/favicons/mstile-70x70.png diff --git a/main/static/main/images/logo-full-black.svg b/shared/static/styleguide2/images/logo-full-black.svg similarity index 100% rename from main/static/main/images/logo-full-black.svg rename to shared/static/styleguide2/images/logo-full-black.svg diff --git a/main/static/main/images/logo-full-white.svg b/shared/static/styleguide2/images/logo-full-white.svg similarity index 100% rename from main/static/main/images/logo-full-white.svg rename to shared/static/styleguide2/images/logo-full-white.svg diff --git a/main/static/main/images/logo-round-black.svg b/shared/static/styleguide2/images/logo-round-black.svg similarity index 100% rename from main/static/main/images/logo-round-black.svg rename to shared/static/styleguide2/images/logo-round-black.svg diff --git a/main/static/main/images/logo-round-white.svg b/shared/static/styleguide2/images/logo-round-white.svg similarity index 100% rename from main/static/main/images/logo-round-white.svg rename to shared/static/styleguide2/images/logo-round-white.svg diff --git a/main/static/main/main.css b/shared/static/styleguide2/main.css similarity index 100% rename from main/static/main/main.css rename to shared/static/styleguide2/main.css diff --git a/main/static/main/main.js b/shared/static/styleguide2/main.js similarity index 100% rename from main/static/main/main.js rename to shared/static/styleguide2/main.js diff --git a/main/static/main/pirati-ui.eot b/shared/static/styleguide2/pirati-ui.eot similarity index 100% rename from main/static/main/pirati-ui.eot rename to shared/static/styleguide2/pirati-ui.eot diff --git a/main/static/main/pirati-ui.svg b/shared/static/styleguide2/pirati-ui.svg similarity index 100% rename from main/static/main/pirati-ui.svg rename to shared/static/styleguide2/pirati-ui.svg diff --git a/main/static/main/pirati-ui.ttf b/shared/static/styleguide2/pirati-ui.ttf similarity index 100% rename from main/static/main/pirati-ui.ttf rename to shared/static/styleguide2/pirati-ui.ttf diff --git a/main/static/main/pirati-ui.woff b/shared/static/styleguide2/pirati-ui.woff similarity index 100% rename from main/static/main/pirati-ui.woff rename to shared/static/styleguide2/pirati-ui.woff diff --git a/main/templates/main/404.html b/shared/templates/styleguide2/404.html similarity index 100% rename from main/templates/main/404.html rename to shared/templates/styleguide2/404.html diff --git a/shared/templates/styleguide2/article_page.html b/shared/templates/styleguide2/article_page.html new file mode 100644 index 0000000000000000000000000000000000000000..822c24fd0c34109dcc89f7bbb06a1526f3243ac1 --- /dev/null +++ b/shared/templates/styleguide2/article_page.html @@ -0,0 +1,32 @@ +{% extends "styleguide2/base.html" %} +{% load wagtailcore_tags %} + +{% block content %} + +{% include 'styleguide2/includes/organisms/layout/navbar.html' with selected_item=page.root_page.articles_page.get_menu_title %} +{% include 'styleguide2/includes/organisms/header/article_header.html' with title=page.title description=page.perex tags=page.tags.names first_nav_text=page.root_page.articles_page.title first_nav_link=page.root_page.articles_page.url second_nav_text=page.date %} + +<main role="main" class="mb-10 xl:mb-32"> + <div class="container--wide flex flex-col"> + {% if page.shared_from %} + <p> + <em> + Tento článek byl sdílen z jiného webu. + Originál si můžete přečíst <a href="{{ page.get_original_url }}">zde</a>. + </em> + </p> + {% endif %} + + {% for block in page.content %} + {% include_block block %} + {% endfor %} + + <div class="flex justify-start"> + {% include 'styleguide2/includes/atoms/buttons/round_button.html' with url=page.root_page.articles_page.url button_text='Zpět na aktuality' %} + </div> + </div> +</main> + +{% include 'styleguide2/includes/organisms/main_section/newsletter_section.html' %} + +{% endblock %} diff --git a/shared/templates/styleguide2/articles_page.html b/shared/templates/styleguide2/articles_page.html new file mode 100644 index 0000000000000000000000000000000000000000..5b02e7c0db4ff7cb814817477287d136fd4045cd --- /dev/null +++ b/shared/templates/styleguide2/articles_page.html @@ -0,0 +1,15 @@ +{% extends "styleguide2/base.html" %} +{% load wagtailcore_tags %} + +{% block content %} + +{% include 'styleguide2/includes/organisms/layout/navbar.html' with selected_item=page.get_menu_title %} +{% include 'styleguide2/includes/organisms/header/articles_header.html' with title=page.title tags=tags %} + +<main role="main"> + {% include 'styleguide2/includes/organisms/articles/main_articles_timeline.html' with article_timeline_list=article_timeline_list %} +</main> + +{% include 'styleguide2/includes/organisms/main_section/newsletter_section.html' %} + +{% endblock %} diff --git a/main/templates/main/base.html b/shared/templates/styleguide2/base.html similarity index 75% rename from main/templates/main/base.html rename to shared/templates/styleguide2/base.html index 64c7cdc4ad6ba52ae847b7c1ce30df3363798f8f..b99c1e3417e4cf6c99b57a5b4fed1dd15cee9b4f 100644 --- a/main/templates/main/base.html +++ b/shared/templates/styleguide2/base.html @@ -21,7 +21,7 @@ {% include "shared/favicon_snippet.html" %} <!-- Styles --> - <link rel="stylesheet" href="{% static 'main/main.css' %}"> + <link rel="stylesheet" href="{% static 'styleguide2/main.css' %}"> {% block styles %}{% endblock styles %} @@ -31,13 +31,13 @@ </head> <body> - {% include 'main/includes/organisms/layout/messages.html' %} + {% include 'styleguide2/includes/organisms/layout/messages.html' %} {% block content %}{% endblock content %} - {% include 'main/includes/organisms/layout/footer.html' %} + {% include 'styleguide2/includes/organisms/layout/footer.html' %} - <script src="{% static 'main/main.js' %}"></script> + <script src="{% static 'styleguide2/main.js' %}"></script> {% block scripts %}{% endblock scripts %} </body> diff --git a/shared/templates/styleguide2/contact_page.html b/shared/templates/styleguide2/contact_page.html new file mode 100644 index 0000000000000000000000000000000000000000..dd8ecadaca3997da0bf390da5fc7ec552a64ecdb --- /dev/null +++ b/shared/templates/styleguide2/contact_page.html @@ -0,0 +1,80 @@ +{% extends "styleguide2/base.html" %} +{% load wagtailcore_tags wagtailimages_tags shared_filters %} + +{% block content %} + {% include 'styleguide2/includes/organisms/layout/navbar.html' with selected_item=page.get_menu_title %} + {% include 'styleguide2/includes/organisms/header/simple_header.html' with title=page.title %} + + <main role="main"> + <section class="container--wide mb-4 xl:mb-20"> + <div class="flex flex-col flex-wrap mb-10 xl:mb-20"> + <div + class=" + flex gap-10 flex-wrap + lg:flex-nowrap + " + > + <div class="w-full max-w-4xl"> + <h2 class="head-6xl mb-5"> + {{ page.title }} + </h2> + <div class="flex flex-wrap justify-between"> + {% for text_block in page.text %} + <div class="leading-5 w-5/6 sm:w-6/12"> + {{ text_block.value.text_column_1|richtext }} + </div> + <div class="leading-5 w-5/6 sm:w-6/12"> + {{ text_block.value.text_column_2|richtext }} + </div> + {% endfor %} + </div> + </div> + + <div class="w-full max-w-2xl"> + <h2 class="head-6xl mb-5"> + Regionální kontakty + </h2> + + <div class="__js-root w-full flex max-w-2xl items-center"> + <ui-region-map class="w-full"></ui-region-map> + </div> + </div> + </div> + </div> + + {% if page.contact_people %} + <h2 class="head-6xl mb-5 xl:mb-8"> + Kontakty pro média + </h2> + + <div class="grid grid-cols-1 xl:grid-cols-2 gap-4 mb-16"> + {% for contact_person in page.contact_people %} + {% if contact_person.value.person.profile_image %} + {% image contact_person.value.person.profile_image fill-256x256 as contact_box_image %} + {% endif %} + + {% firstof contact_person.value.position conact_person.value.person.position as contact_position %} + + {% include 'styleguide2/includes/molecules/contact/contact_person_large_box.html' with image=contact_box_image name=contact_person.value.person.title function=contact_position telephone=contact_person.value.person.phone mail=contact_person.value.person.email url=contact_person.value.person.url %} + {% endfor %} + </div> + {% endif %} + + {% if page.contact_boxes %} + <h2 class="head-6xl mb-5 xl:mb-8"> + Další kontakty + </h2> + + <div class="grid grid-cols-1 xl:grid-cols-2 gap-4"> + {% for contact_block in page.contact_boxes %} + {% image contact_block.value.image fill-256x256 as contact_box_image %} + + {% include 'styleguide2/includes/molecules/contact/contact_person_large_box.html' with image=contact_box_image name=contact_block.value.title function=contact_block.value.subtitle %} + {% endfor %} + </div> + {% endif %} + </section> + </main> + + {% include 'styleguide2/includes/organisms/main_section/newsletter_section.html' %} +{% endblock %} diff --git a/main/templates/main/feed_item_description.html b/shared/templates/styleguide2/feed_item_description.html similarity index 100% rename from main/templates/main/feed_item_description.html rename to shared/templates/styleguide2/feed_item_description.html diff --git a/shared/templates/styleguide2/home_page.html b/shared/templates/styleguide2/home_page.html new file mode 100644 index 0000000000000000000000000000000000000000..a75e32207692b457a3e5e997883fad8b2ef7018f --- /dev/null +++ b/shared/templates/styleguide2/home_page.html @@ -0,0 +1,16 @@ +{% extends "styleguide2/base.html" %} +{% load wagtailcore_tags %} + +{% block content %} + +{% include 'styleguide2/includes/organisms/layout/navbar.html' with is_transparent=True %} + +<main role="main"> + {% for block in page.content %} + {% include_block block %} + {% endfor %} + + {% include "styleguide2/includes/organisms/main_section/newsletter_section.html" %} +</main> + +{% endblock %} diff --git a/main/templates/main/includes/atoms/articles/side_image.html b/shared/templates/styleguide2/includes/atoms/articles/side_image.html similarity index 100% rename from main/templates/main/includes/atoms/articles/side_image.html rename to shared/templates/styleguide2/includes/atoms/articles/side_image.html diff --git a/main/templates/main/includes/atoms/buttons/round_button.html b/shared/templates/styleguide2/includes/atoms/buttons/round_button.html similarity index 89% rename from main/templates/main/includes/atoms/buttons/round_button.html rename to shared/templates/styleguide2/includes/atoms/buttons/round_button.html index 23edf156b440b3a164a0f7078d58c0f92b6ae60e..3568303e354a9e95661df80d71794e869405e5a9 100644 --- a/main/templates/main/includes/atoms/buttons/round_button.html +++ b/shared/templates/styleguide2/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 mb-[0.03rem]">{% include 'main/includes/atoms/icons/arrow.html' %}</span> + <span class="opacity-0 group-hover:opacity-100 duration-200 mb-[0.03rem]">{% include 'styleguide2/includes/atoms/icons/arrow.html' %}</span> </{% block element_closer %}a{% endblock %}> diff --git a/main/templates/main/includes/atoms/buttons/round_button_form.html b/shared/templates/styleguide2/includes/atoms/buttons/round_button_form.html similarity index 64% rename from main/templates/main/includes/atoms/buttons/round_button_form.html rename to shared/templates/styleguide2/includes/atoms/buttons/round_button_form.html index b53507bcd8af3e9388fc3620db8d4ed6a9568edf..beb97f9a851d6365d5156f936e714fa34199c779 100644 --- a/main/templates/main/includes/atoms/buttons/round_button_form.html +++ b/shared/templates/styleguide2/includes/atoms/buttons/round_button_form.html @@ -1,4 +1,4 @@ -{% extends 'main/includes/atoms/buttons/round_button.html' %} +{% extends 'styleguide2/includes/atoms/buttons/round_button.html' %} {% block element_opener %}button{% endblock %} {% block element_closer %}button{% endblock %} diff --git a/shared/templates/styleguide2/includes/atoms/buttons/round_button_small.html b/shared/templates/styleguide2/includes/atoms/buttons/round_button_small.html new file mode 100644 index 0000000000000000000000000000000000000000..9570967a84816d86711bc5ce2c68b74f941599f7 --- /dev/null +++ b/shared/templates/styleguide2/includes/atoms/buttons/round_button_small.html @@ -0,0 +1,3 @@ +{% extends 'styleguide2/includes/atoms/buttons/round_button.html' %} + +{% block size_classes %}text-sm pl-7 pr-2 py-2{% endblock %} diff --git a/main/templates/main/includes/atoms/buttons/search_button.html b/shared/templates/styleguide2/includes/atoms/buttons/search_button.html similarity index 100% rename from main/templates/main/includes/atoms/buttons/search_button.html rename to shared/templates/styleguide2/includes/atoms/buttons/search_button.html diff --git a/main/templates/main/includes/atoms/calendar/calendar.html b/shared/templates/styleguide2/includes/atoms/calendar/calendar.html similarity index 100% rename from main/templates/main/includes/atoms/calendar/calendar.html rename to shared/templates/styleguide2/includes/atoms/calendar/calendar.html diff --git a/main/templates/main/includes/atoms/containers/container__medium.html b/shared/templates/styleguide2/includes/atoms/containers/container__medium.html similarity index 100% rename from main/templates/main/includes/atoms/containers/container__medium.html rename to shared/templates/styleguide2/includes/atoms/containers/container__medium.html diff --git a/main/templates/main/includes/atoms/containers/container__narrow.html b/shared/templates/styleguide2/includes/atoms/containers/container__narrow.html similarity index 100% rename from main/templates/main/includes/atoms/containers/container__narrow.html rename to shared/templates/styleguide2/includes/atoms/containers/container__narrow.html diff --git a/main/templates/main/includes/atoms/containers/container__wide.html b/shared/templates/styleguide2/includes/atoms/containers/container__wide.html similarity index 100% rename from main/templates/main/includes/atoms/containers/container__wide.html rename to shared/templates/styleguide2/includes/atoms/containers/container__wide.html diff --git a/main/templates/main/includes/atoms/form_fields/form_checkbox.html b/shared/templates/styleguide2/includes/atoms/form_fields/form_checkbox.html similarity index 100% rename from main/templates/main/includes/atoms/form_fields/form_checkbox.html rename to shared/templates/styleguide2/includes/atoms/form_fields/form_checkbox.html diff --git a/main/templates/main/includes/atoms/form_fields/form_input.html b/shared/templates/styleguide2/includes/atoms/form_fields/form_input.html similarity index 100% rename from main/templates/main/includes/atoms/form_fields/form_input.html rename to shared/templates/styleguide2/includes/atoms/form_fields/form_input.html diff --git a/main/templates/main/includes/atoms/form_fields/form_select.html b/shared/templates/styleguide2/includes/atoms/form_fields/form_select.html similarity index 100% rename from main/templates/main/includes/atoms/form_fields/form_select.html rename to shared/templates/styleguide2/includes/atoms/form_fields/form_select.html diff --git a/main/templates/main/includes/atoms/grids/grids.html b/shared/templates/styleguide2/includes/atoms/grids/grids.html similarity index 100% rename from main/templates/main/includes/atoms/grids/grids.html rename to shared/templates/styleguide2/includes/atoms/grids/grids.html diff --git a/main/templates/main/includes/atoms/header/navigation.html b/shared/templates/styleguide2/includes/atoms/header/navigation.html similarity index 100% rename from main/templates/main/includes/atoms/header/navigation.html rename to shared/templates/styleguide2/includes/atoms/header/navigation.html diff --git a/main/templates/main/includes/atoms/icons/arrow.html b/shared/templates/styleguide2/includes/atoms/icons/arrow.html similarity index 100% rename from main/templates/main/includes/atoms/icons/arrow.html rename to shared/templates/styleguide2/includes/atoms/icons/arrow.html diff --git a/main/templates/main/includes/atoms/tags/tag.html b/shared/templates/styleguide2/includes/atoms/tags/tag.html similarity index 100% rename from main/templates/main/includes/atoms/tags/tag.html rename to shared/templates/styleguide2/includes/atoms/tags/tag.html diff --git a/main/templates/main/includes/atoms/text/font_sizes.html b/shared/templates/styleguide2/includes/atoms/text/font_sizes.html similarity index 100% rename from main/templates/main/includes/atoms/text/font_sizes.html rename to shared/templates/styleguide2/includes/atoms/text/font_sizes.html diff --git a/main/templates/main/includes/atoms/text/headings.html b/shared/templates/styleguide2/includes/atoms/text/headings.html similarity index 100% rename from main/templates/main/includes/atoms/text/headings.html rename to shared/templates/styleguide2/includes/atoms/text/headings.html diff --git a/main/templates/main/includes/atoms/text/paragraph.html b/shared/templates/styleguide2/includes/atoms/text/paragraph.html similarity index 100% rename from main/templates/main/includes/atoms/text/paragraph.html rename to shared/templates/styleguide2/includes/atoms/text/paragraph.html diff --git a/shared/templates/styleguide2/includes/atoms/text/prose.html b/shared/templates/styleguide2/includes/atoms/text/prose.html new file mode 100644 index 0000000000000000000000000000000000000000..02ba28ac2469e1bd85f03c3c789c0241f3d35274 --- /dev/null +++ b/shared/templates/styleguide2/includes/atoms/text/prose.html @@ -0,0 +1,3 @@ +<div class="prose"> + {% include 'styleguide2/includes/atoms/text/paragraph.html' with text=text %} +</div> diff --git a/main/templates/main/includes/atoms/text/prose_richtext.html b/shared/templates/styleguide2/includes/atoms/text/prose_richtext.html similarity index 100% rename from main/templates/main/includes/atoms/text/prose_richtext.html rename to shared/templates/styleguide2/includes/atoms/text/prose_richtext.html diff --git a/main/templates/main/includes/atoms/text/richtext.html b/shared/templates/styleguide2/includes/atoms/text/richtext.html similarity index 100% rename from main/templates/main/includes/atoms/text/richtext.html rename to shared/templates/styleguide2/includes/atoms/text/richtext.html diff --git a/main/templates/main/includes/legacy/article_quote_block.html b/shared/templates/styleguide2/includes/legacy/article_quote_block.html similarity index 100% rename from main/templates/main/includes/legacy/article_quote_block.html rename to shared/templates/styleguide2/includes/legacy/article_quote_block.html diff --git a/main/templates/main/includes/molecules/articles/article_timeline_preview.html b/shared/templates/styleguide2/includes/molecules/articles/article_timeline_preview.html similarity index 78% rename from main/templates/main/includes/molecules/articles/article_timeline_preview.html rename to shared/templates/styleguide2/includes/molecules/articles/article_timeline_preview.html index 5b150bd6776065ed5cada760b68a92a7e7777d89..0af8f0835eb176ce4c553722d794d9bfd7e3face 100644 --- a/main/templates/main/includes/molecules/articles/article_timeline_preview.html +++ b/shared/templates/styleguide2/includes/molecules/articles/article_timeline_preview.html @@ -26,7 +26,7 @@ </a> <div class="mb-6"> - {% include 'main/includes/molecules/tags/inline_tags.html' with tags=article.get_tags %} + {% include 'styleguide2/includes/molecules/tags/inline_tags.html' with tags=article.get_tags %} </div> <div class="flex flex-col justify-between h-full"> @@ -35,7 +35,7 @@ </p> <div class="flex justify-end"> - {% include 'main/includes/atoms/buttons/round_button.html' with url=article.url button_text='Číst dále' %} + {% include 'styleguide2/includes/atoms/buttons/round_button.html' with url=article.url button_text='Číst dále' %} </div> </div> </div> diff --git a/main/templates/main/includes/molecules/articles/small_article_preview.html b/shared/templates/styleguide2/includes/molecules/articles/small_article_preview.html similarity index 77% rename from main/templates/main/includes/molecules/articles/small_article_preview.html rename to shared/templates/styleguide2/includes/molecules/articles/small_article_preview.html index eb127dc3844f0ac9142dd977e3c1a483be3d4306..403b0d46f7a92e4ff342724a7e43b1d28ca54d27 100644 --- a/main/templates/main/includes/molecules/articles/small_article_preview.html +++ b/shared/templates/styleguide2/includes/molecules/articles/small_article_preview.html @@ -12,6 +12,6 @@ </h4> </div> - {% include 'main/includes/atoms/buttons/round_button_small.html' with button_text='Číst dále' %} + {% include 'styleguide2/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/shared/templates/styleguide2/includes/molecules/blocks/download_block.html similarity index 82% rename from main/templates/main/includes/molecules/blocks/download_block.html rename to shared/templates/styleguide2/includes/molecules/blocks/download_block.html index 1a3a3c46f9989045e7fd0bd3ea9445d356c1d5ef..4b0c38a60b3021b0a9ce416ec1af4fad40e5c478 100644 --- a/main/templates/main/includes/molecules/blocks/download_block.html +++ b/shared/templates/styleguide2/includes/molecules/blocks/download_block.html @@ -21,6 +21,6 @@ </div> <div class="flex flex-col justify-center items-start"> - {% include 'main/includes/atoms/buttons/round_button.html' with url=self.file.url button_text='Stáhnout' %} + {% include 'styleguide2/includes/atoms/buttons/round_button.html' with url=self.file.url button_text='Stáhnout' %} </div> </div> diff --git a/main/templates/main/includes/molecules/blocks/icon_title_text_block.html b/shared/templates/styleguide2/includes/molecules/blocks/icon_title_text_block.html similarity index 100% rename from main/templates/main/includes/molecules/blocks/icon_title_text_block.html rename to shared/templates/styleguide2/includes/molecules/blocks/icon_title_text_block.html diff --git a/main/templates/main/includes/molecules/blocks/message_block.html b/shared/templates/styleguide2/includes/molecules/blocks/message_block.html similarity index 100% rename from main/templates/main/includes/molecules/blocks/message_block.html rename to shared/templates/styleguide2/includes/molecules/blocks/message_block.html diff --git a/main/templates/main/includes/molecules/blocks/search_block.html b/shared/templates/styleguide2/includes/molecules/blocks/search_block.html similarity index 75% rename from main/templates/main/includes/molecules/blocks/search_block.html rename to shared/templates/styleguide2/includes/molecules/blocks/search_block.html index fc621eb5f5d297a1832aeb35f39e2cfe3bcb5934..837acfe86642c6bc0c50680ca006f0fee08e9344 100644 --- a/main/templates/main/includes/molecules/blocks/search_block.html +++ b/shared/templates/styleguide2/includes/molecules/blocks/search_block.html @@ -6,5 +6,5 @@ placeholder="{{ placeholder }}" aria-label="Vyhledávací box" > - {% include 'main/includes/atoms/buttons/search_button.html' %} + {% include 'styleguide2/includes/atoms/buttons/search_button.html' %} </div> diff --git a/main/templates/main/includes/molecules/boxes/card_box.html b/shared/templates/styleguide2/includes/molecules/boxes/card_box.html similarity index 87% rename from main/templates/main/includes/molecules/boxes/card_box.html rename to shared/templates/styleguide2/includes/molecules/boxes/card_box.html index 5964f0330430bb754dd031d9ac66f3f1ba4995b5..a0a00ddebd10fe8f3a468d933f68eacfd7fb7a54 100644 --- a/main/templates/main/includes/molecules/boxes/card_box.html +++ b/shared/templates/styleguide2/includes/molecules/boxes/card_box.html @@ -30,7 +30,7 @@ </div> <div class="flex justify-center"> - {% include 'main/includes/atoms/buttons/round_button.html' with url=url button_text="Zjisti více" classes=None %} + {% include 'styleguide2/includes/atoms/buttons/round_button.html' with url=url button_text="Zjisti více" classes=None %} </div> </div> </article> diff --git a/shared/templates/styleguide2/includes/molecules/boxes/card_box_block.html b/shared/templates/styleguide2/includes/molecules/boxes/card_box_block.html new file mode 100644 index 0000000000000000000000000000000000000000..bc08c098098dcd09795077cb05e420de01b424dd --- /dev/null +++ b/shared/templates/styleguide2/includes/molecules/boxes/card_box_block.html @@ -0,0 +1,6 @@ +{% load wagtailimages_tags %} + +{% image self.image fill-512x512 as image %} +{% firstof self.page.url self.link as url %} + +{% include 'styleguide2/includes/molecules/boxes/card_box.html' with url=url image=image header=self.title content=self.text description_classes="!bg-grey-180" classes="drop-shadow" %} diff --git a/main/templates/main/includes/molecules/boxes/card_box_with_headline_block.html b/shared/templates/styleguide2/includes/molecules/boxes/card_box_with_headline_block.html similarity index 100% rename from main/templates/main/includes/molecules/boxes/card_box_with_headline_block.html rename to shared/templates/styleguide2/includes/molecules/boxes/card_box_with_headline_block.html diff --git a/main/templates/main/includes/molecules/boxes/image_with_button_box.html b/shared/templates/styleguide2/includes/molecules/boxes/image_with_button_box.html similarity index 70% rename from main/templates/main/includes/molecules/boxes/image_with_button_box.html rename to shared/templates/styleguide2/includes/molecules/boxes/image_with_button_box.html index 05aa838631671706db095f71f6ddd2cd93b2e866..01056d8deac8ad3fd5779aa1f7b50198d0d34007 100644 --- a/main/templates/main/includes/molecules/boxes/image_with_button_box.html +++ b/shared/templates/styleguide2/includes/molecules/boxes/image_with_button_box.html @@ -9,6 +9,6 @@ </div> <div class="text-center flex justify-center"> - {% include 'main/includes/atoms/buttons/round_button.html' with url=url classes='bg-white text-black' button_text=button_text %} + {% include 'styleguide2/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_footer_box.html b/shared/templates/styleguide2/includes/molecules/contact/contact_footer_box.html similarity index 100% rename from main/templates/main/includes/molecules/contact/contact_footer_box.html rename to shared/templates/styleguide2/includes/molecules/contact/contact_footer_box.html diff --git a/main/templates/main/includes/molecules/contact/contact_person_large_box.html b/shared/templates/styleguide2/includes/molecules/contact/contact_person_large_box.html similarity index 91% rename from main/templates/main/includes/molecules/contact/contact_person_large_box.html rename to shared/templates/styleguide2/includes/molecules/contact/contact_person_large_box.html index 457027762a7baeb09829e1c295409fb536970d04..db261d905ed8db13d94503f3e21f64ec17284249 100644 --- a/main/templates/main/includes/molecules/contact/contact_person_large_box.html +++ b/shared/templates/styleguide2/includes/molecules/contact/contact_person_large_box.html @@ -56,7 +56,7 @@ {% if url %} <div class="flex mt-5"> - {% include 'main/includes/atoms/buttons/round_button_small.html' with url=url button_text='Detail osoby' %} + {% include 'styleguide2/includes/atoms/buttons/round_button_small.html' with url=url button_text='Detail osoby' %} </div> {% endif %} </div> diff --git a/main/templates/main/includes/molecules/menus/carousel.html b/shared/templates/styleguide2/includes/molecules/menus/carousel.html similarity index 86% rename from main/templates/main/includes/molecules/menus/carousel.html rename to shared/templates/styleguide2/includes/molecules/menus/carousel.html index 6402a089e481db3bc6eb04ac39bea763d756387b..1eb148e079ee2b4dcd5bc56fe4798c3e312ab152 100644 --- a/main/templates/main/includes/molecules/menus/carousel.html +++ b/shared/templates/styleguide2/includes/molecules/menus/carousel.html @@ -8,7 +8,7 @@ header-carousel--image lg:hidden " - src="{% static 'main/images/background-images/bg-flag-mobile.gif' %}" + src="{% static 'styleguide2/images/background-images/bg-flag-mobile.gif' %}" draggable="false" > @@ -17,7 +17,7 @@ header-carousel--image hidden lg:block " - src="{% static 'main/images/background-images/bg-flag.webp' %}" + src="{% static 'styleguide2/images/background-images/bg-flag.webp' %}" draggable="false" > diff --git a/main/templates/main/includes/molecules/navbar/additional_button.html b/shared/templates/styleguide2/includes/molecules/navbar/additional_button.html similarity index 100% rename from main/templates/main/includes/molecules/navbar/additional_button.html rename to shared/templates/styleguide2/includes/molecules/navbar/additional_button.html diff --git a/main/templates/main/includes/molecules/navbar/additional_button.yaml b/shared/templates/styleguide2/includes/molecules/navbar/additional_button.yaml similarity index 100% rename from main/templates/main/includes/molecules/navbar/additional_button.yaml rename to shared/templates/styleguide2/includes/molecules/navbar/additional_button.yaml diff --git a/main/templates/main/includes/molecules/popouts/hoax_popout_point.html b/shared/templates/styleguide2/includes/molecules/popouts/hoax_popout_point.html similarity index 81% rename from main/templates/main/includes/molecules/popouts/hoax_popout_point.html rename to shared/templates/styleguide2/includes/molecules/popouts/hoax_popout_point.html index 0ceaa6076eb59c1dbb4137f644e585371f332729..7b125f3e7cbc9ba9c1f8a27266e3345dc8f7495c 100644 --- a/main/templates/main/includes/molecules/popouts/hoax_popout_point.html +++ b/shared/templates/styleguide2/includes/molecules/popouts/hoax_popout_point.html @@ -8,14 +8,14 @@ <ui-popout-content> <div class="flex flex-wrap gap-4 lg:flex-nowrap"> <div class="grow lg:grow-0 lg:basis-2/3 prose max-w-screen-lg"> - {% include "main/includes/atoms/text/paragraph.html" with text=hoax %} + {% include "styleguide2/includes/atoms/text/paragraph.html" with text=hoax %} <img class="mt-10" src="{% static "images/hoax.webp" %}" alt="Hoax" > <h3 class="head-4xl mt-10">Jak to je?</h3> - {% include "main/includes/atoms/text/paragraph.html" with text=reality %} + {% include "styleguide2/includes/atoms/text/paragraph.html" with text=reality %} </div> <div class="lg:basis-1/3"> <img diff --git a/main/templates/main/includes/molecules/popouts/popout_point.html b/shared/templates/styleguide2/includes/molecules/popouts/popout_point.html similarity index 100% rename from main/templates/main/includes/molecules/popouts/popout_point.html rename to shared/templates/styleguide2/includes/molecules/popouts/popout_point.html diff --git a/main/templates/main/includes/molecules/search/universal_search_result.html b/shared/templates/styleguide2/includes/molecules/search/universal_search_result.html similarity index 100% rename from main/templates/main/includes/molecules/search/universal_search_result.html rename to shared/templates/styleguide2/includes/molecules/search/universal_search_result.html diff --git a/main/templates/main/includes/molecules/search/universal_search_result.yaml b/shared/templates/styleguide2/includes/molecules/search/universal_search_result.yaml similarity index 100% rename from main/templates/main/includes/molecules/search/universal_search_result.yaml rename to shared/templates/styleguide2/includes/molecules/search/universal_search_result.yaml diff --git a/main/templates/main/includes/molecules/tags/inline_tags.html b/shared/templates/styleguide2/includes/molecules/tags/inline_tags.html similarity index 55% rename from main/templates/main/includes/molecules/tags/inline_tags.html rename to shared/templates/styleguide2/includes/molecules/tags/inline_tags.html index 48904e2188386ed7e94e59c625e514aeaa8461d6..8e0e850c00f4d40808f9350c76e2cbf4bbf9a3ac 100644 --- a/main/templates/main/includes/molecules/tags/inline_tags.html +++ b/shared/templates/styleguide2/includes/molecules/tags/inline_tags.html @@ -1,5 +1,5 @@ <div class="flex gap-3 flex-wrap {{ classes }}"> {% for tag in tags %} - {% include 'main/includes/atoms/tags/tag.html' with text=tag %} + {% include 'styleguide2/includes/atoms/tags/tag.html' with text=tag %} {% endfor %} </div> diff --git a/main/templates/main/includes/molecules/tags/tags.html b/shared/templates/styleguide2/includes/molecules/tags/tags.html similarity index 73% rename from main/templates/main/includes/molecules/tags/tags.html rename to shared/templates/styleguide2/includes/molecules/tags/tags.html index 8013de6f81dd89cef5ae51d6f011e1e658c97ebc..ab2fc6080d8123518690caf6489314f598040bf6 100644 --- a/main/templates/main/includes/molecules/tags/tags.html +++ b/shared/templates/styleguide2/includes/molecules/tags/tags.html @@ -1,6 +1,6 @@ <div class="flex gap-2 flex-wrap max-w-[550px] {{ classes }}"> {% for tag in tags %} - {% include 'main/includes/atoms/tags/tag.html' with text=tag id=tag.id %} + {% include 'styleguide2/includes/atoms/tags/tag.html' with text=tag id=tag.id %} {% endfor %} </div> diff --git a/main/templates/main/includes/organisms/articles/articles_section.html b/shared/templates/styleguide2/includes/organisms/articles/articles_section.html similarity index 70% rename from main/templates/main/includes/organisms/articles/articles_section.html rename to shared/templates/styleguide2/includes/organisms/articles/articles_section.html index fa46373d9714109dafaf3b5ca3a71055df38d36b..448447c8d9c205dd99463723f2fc08cda46502b4 100644 --- a/main/templates/main/includes/organisms/articles/articles_section.html +++ b/shared/templates/styleguide2/includes/organisms/articles/articles_section.html @@ -27,7 +27,7 @@ {% for article in article_data_list %} {% image article.image fill-500x500 as article_image %} - {% include 'main/includes/molecules/boxes/card_box.html' with url=article.url image=article_image date=article.date header=article.title content=article.perex|shorten_perex %} + {% include 'styleguide2/includes/molecules/boxes/card_box.html' with url=article.url image=article_image date=article.date header=article.title content=article.perex|shorten_perex %} {% endfor %} </ui-horizontal-scrollable> @@ -38,7 +38,7 @@ xl:py-24 " > - {% include "main/includes/atoms/buttons/round_button.html" with button_text="Více článků" classes="bg-white text-black" url=page.root_page.articles_page.url %} + {% include "styleguide2/includes/atoms/buttons/round_button.html" with button_text="Více článků" classes="bg-white text-black" url=page.root_page.articles_page.url %} </div> </div> </div> diff --git a/main/templates/main/includes/organisms/articles/articles_timeline_list.html b/shared/templates/styleguide2/includes/organisms/articles/articles_timeline_list.html similarity index 82% rename from main/templates/main/includes/organisms/articles/articles_timeline_list.html rename to shared/templates/styleguide2/includes/organisms/articles/articles_timeline_list.html index 7b10b4ba954efddfb5ad81648e2fd134bfb84b3e..6de7445075e029612d21c8cb7105fdecfce4bc40 100644 --- a/main/templates/main/includes/organisms/articles/articles_timeline_list.html +++ b/shared/templates/styleguide2/includes/organisms/articles/articles_timeline_list.html @@ -7,7 +7,7 @@ class="grid grid-cols-1 md:grid-cols-2 gap-12" > {% for article in timeline_item.articles %} - {% include 'main/includes/molecules/articles/article_timeline_preview.html' %} + {% include 'styleguide2/includes/molecules/articles/article_timeline_preview.html' %} {% endfor %} </div> {% endfor %} diff --git a/main/templates/main/includes/organisms/articles/europarl_articles_section.html b/shared/templates/styleguide2/includes/organisms/articles/europarl_articles_section.html similarity index 77% rename from main/templates/main/includes/organisms/articles/europarl_articles_section.html rename to shared/templates/styleguide2/includes/organisms/articles/europarl_articles_section.html index 04661f26606337d7051ae9bf05dc1a4ff2ba8500..6f6cd410a8030a0480cd1c7847ce30e676038a1e 100644 --- a/main/templates/main/includes/organisms/articles/europarl_articles_section.html +++ b/shared/templates/styleguide2/includes/organisms/articles/europarl_articles_section.html @@ -34,9 +34,9 @@ " scroller-classes="!text-black" > - {% include 'main/includes/molecules/boxes/card_box.html' %} - {% include 'main/includes/molecules/boxes/card_box.html' %} - {% include 'main/includes/molecules/boxes/card_box.html' %} + {% include 'styleguide2/includes/molecules/boxes/card_box.html' %} + {% include 'styleguide2/includes/molecules/boxes/card_box.html' %} + {% include 'styleguide2/includes/molecules/boxes/card_box.html' %} </ui-horizontal-scrollable> <div @@ -45,7 +45,7 @@ xl:py-24 " > - {% include "main/includes/atoms/buttons/round_button.html" with button_text=button_text %} + {% include "styleguide2/includes/atoms/buttons/round_button.html" with button_text=button_text %} </div> </div> </div> diff --git a/main/templates/main/includes/organisms/articles/main_articles_timeline.html b/shared/templates/styleguide2/includes/organisms/articles/main_articles_timeline.html similarity index 82% rename from main/templates/main/includes/organisms/articles/main_articles_timeline.html rename to shared/templates/styleguide2/includes/organisms/articles/main_articles_timeline.html index f92bc247df6c2ef8751ffa1a510417e872a778bf..42742c7c5cb51eb6db8e86353639dcfff1d8fd38 100644 --- a/main/templates/main/includes/organisms/articles/main_articles_timeline.html +++ b/shared/templates/styleguide2/includes/organisms/articles/main_articles_timeline.html @@ -4,7 +4,7 @@ class="flex flex-col gap-8 mb-16" id="showMoreTimelineResultsWrapper" > - {% include 'main/includes/organisms/articles/articles_timeline_list.html' with article_timeline_list=article_timeline_list %} + {% include 'styleguide2/includes/organisms/articles/articles_timeline_list.html' with article_timeline_list=article_timeline_list %} </div> {% if show_next_timeline_articles %} @@ -14,7 +14,7 @@ data-url="{{ page_url }}{% if filtered_tag %}?tag_id={{ filtered_tag.id }}&{% else %}?{% endif %}months=" data-months="2" > - {% include 'main/includes/atoms/buttons/round_button.html' with button_text='Další články' %} + {% include 'styleguide2/includes/atoms/buttons/round_button.html' with button_text='Další články' %} </div> </div> {% endif %} diff --git a/shared/templates/styleguide2/includes/organisms/cards/card_list.html b/shared/templates/styleguide2/includes/organisms/cards/card_list.html new file mode 100644 index 0000000000000000000000000000000000000000..82eec493824be1c20439fb160673b333187d1a10 --- /dev/null +++ b/shared/templates/styleguide2/includes/organisms/cards/card_list.html @@ -0,0 +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 'styleguide2/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/shared/templates/styleguide2/includes/organisms/header/article_header.html b/shared/templates/styleguide2/includes/organisms/header/article_header.html new file mode 100644 index 0000000000000000000000000000000000000000..5b3bb655e08b92a2d4f75c03b42ce1b120e7a429 --- /dev/null +++ b/shared/templates/styleguide2/includes/organisms/header/article_header.html @@ -0,0 +1,7 @@ +{% extends 'styleguide2/includes/organisms/header/simple_header_with_tags_and_navigation.html' %} + +{% block before_heading %} + {% include 'styleguide2/includes/atoms/header/navigation.html' with classes='mb-6' first_text=first_nav_text first_link=first_nav_link second_text=second_nav_text second_link=None %} +{% endblock %} + +{% block heading_classes %}head-8xl{% endblock %} diff --git a/main/templates/main/includes/organisms/header/articles_header.html b/shared/templates/styleguide2/includes/organisms/header/articles_header.html similarity index 71% rename from main/templates/main/includes/organisms/header/articles_header.html rename to shared/templates/styleguide2/includes/organisms/header/articles_header.html index 6c8609ac955201f9c41b291e5573f1c700c9b95c..d9f9c11eff7ff646ac3d6a6eaa0ed632f2bd3e3d 100644 --- a/main/templates/main/includes/organisms/header/articles_header.html +++ b/shared/templates/styleguide2/includes/organisms/header/articles_header.html @@ -1,4 +1,4 @@ -{% extends 'main/includes/organisms/header/simple_header_with_tags.html' %} +{% extends 'styleguide2/includes/organisms/header/simple_header_with_tags.html' %} {% block classes %} bg-black flex items-center w-full mb-12 pt-28 pb-8 @@ -9,7 +9,7 @@ {% endblock %} {% block after_heading %} - {% include 'main/includes/molecules/tags/tags.html' with classes='mb-4' tags_are_selectable=True %} + {% include 'styleguide2/includes/molecules/tags/tags.html' with classes='mb-4' tags_are_selectable=True %} <form class="flex justify-start" diff --git a/main/templates/main/includes/organisms/header/people_header.html b/shared/templates/styleguide2/includes/organisms/header/people_header.html similarity index 90% rename from main/templates/main/includes/organisms/header/people_header.html rename to shared/templates/styleguide2/includes/organisms/header/people_header.html index a8b7c8428e71afc6a16e69b747f94d28fe87921a..2d1b374f5363f1e23a4b1c011893350f47dbe017 100644 --- a/main/templates/main/includes/organisms/header/people_header.html +++ b/shared/templates/styleguide2/includes/organisms/header/people_header.html @@ -1,4 +1,4 @@ -{% extends 'main/includes/organisms/header/simple_header_with_ui_switch.html' %} +{% extends 'styleguide2/includes/organisms/header/simple_header_with_ui_switch.html' %} {% block classes %} bg-black flex items-center w-full mb-20 pt-28 pb-8 diff --git a/main/templates/main/includes/organisms/header/photo_header.html b/shared/templates/styleguide2/includes/organisms/header/photo_header.html similarity index 88% rename from main/templates/main/includes/organisms/header/photo_header.html rename to shared/templates/styleguide2/includes/organisms/header/photo_header.html index 2ba0c3b3f3d6cd91190c577517ab112843d135c9..7d1192b1814ae6a9ec93a58eedca21cf2a842bc2 100644 --- a/main/templates/main/includes/organisms/header/photo_header.html +++ b/shared/templates/styleguide2/includes/organisms/header/photo_header.html @@ -24,7 +24,7 @@ <h1 class="text-white flex flex-col"> {% firstof second_nav_text 'Osoby' as actual_second_nav_text %} - {% include 'main/includes/atoms/header/navigation.html' with classes='mb-10' first_text=first_nav_text second_text=actual_second_nav_text first_link=first_nav_link %} + {% include 'styleguide2/includes/atoms/header/navigation.html' with classes='mb-10' first_text=first_nav_text second_text=actual_second_nav_text first_link=first_nav_link %} {% if degree_before %} <span diff --git a/main/templates/main/includes/organisms/header/simple_header.html b/shared/templates/styleguide2/includes/organisms/header/simple_header.html similarity index 100% rename from main/templates/main/includes/organisms/header/simple_header.html rename to shared/templates/styleguide2/includes/organisms/header/simple_header.html diff --git a/shared/templates/styleguide2/includes/organisms/header/simple_header_with_tags.html b/shared/templates/styleguide2/includes/organisms/header/simple_header_with_tags.html new file mode 100644 index 0000000000000000000000000000000000000000..dd2e289d2555945d2a25df0e7b380c60ee177f02 --- /dev/null +++ b/shared/templates/styleguide2/includes/organisms/header/simple_header_with_tags.html @@ -0,0 +1,5 @@ +{% extends 'styleguide2/includes/organisms/header/simple_header.html' %} + +{% block after_heading %} + {% include 'styleguide2/includes/molecules/tags/tags.html' with classes='mb-4' %} +{% endblock %} diff --git a/shared/templates/styleguide2/includes/organisms/header/simple_header_with_tags_and_navigation.html b/shared/templates/styleguide2/includes/organisms/header/simple_header_with_tags_and_navigation.html new file mode 100644 index 0000000000000000000000000000000000000000..b87891d25b1b2246f245814798085e00532a724a --- /dev/null +++ b/shared/templates/styleguide2/includes/organisms/header/simple_header_with_tags_and_navigation.html @@ -0,0 +1,9 @@ +{% extends 'styleguide2/includes/organisms/header/simple_header.html' %} + +{% block before_heading %} + {% include 'styleguide2/includes/atoms/header/navigation.html' with classes='mb-6' %} +{% endblock %} + +{% block after_heading %} + {% include 'styleguide2/includes/molecules/tags/tags.html' with classes='mb-4 mt-4' %} +{% endblock %} diff --git a/main/templates/main/includes/organisms/header/simple_header_with_ui_switch.html b/shared/templates/styleguide2/includes/organisms/header/simple_header_with_ui_switch.html similarity index 90% rename from main/templates/main/includes/organisms/header/simple_header_with_ui_switch.html rename to shared/templates/styleguide2/includes/organisms/header/simple_header_with_ui_switch.html index 0692ea10034af8c75438bbd78f73f3e64e624ced..313eb6c0fe4dfb07e0b0d4c0b577c65462a31921 100644 --- a/main/templates/main/includes/organisms/header/simple_header_with_ui_switch.html +++ b/shared/templates/styleguide2/includes/organisms/header/simple_header_with_ui_switch.html @@ -1,4 +1,4 @@ -{% extends 'main/includes/organisms/header/simple_header.html' %} +{% extends 'styleguide2/includes/organisms/header/simple_header.html' %} {% block after_description %} <div diff --git a/main/templates/main/includes/organisms/layout/footer.html b/shared/templates/styleguide2/includes/organisms/layout/footer.html similarity index 90% rename from main/templates/main/includes/organisms/layout/footer.html rename to shared/templates/styleguide2/includes/organisms/layout/footer.html index 68bed00102bd4fca8038bbc41e2aacf862b58bb1..b7f1c28067b03fe75d3fdfc7774819e38574eda9 100644 --- a/main/templates/main/includes/organisms/layout/footer.html +++ b/shared/templates/styleguide2/includes/organisms/layout/footer.html @@ -38,7 +38,7 @@ {% firstof person.value.position person.value.person.position as position %} - {% include 'main/includes/molecules/contact/contact_footer_box.html' with image=person_profile_image url=person.value.person.url name=person.value.person.title function=position telephone=person.value.person.phone mail=person.value.person.email %} + {% include 'styleguide2/includes/molecules/contact/contact_footer_box.html' with image=person_profile_image url=person.value.person.url name=person.value.person.title function=position telephone=person.value.person.phone mail=person.value.person.email %} {% endfor %} {% endif %} </div> diff --git a/main/templates/main/includes/organisms/layout/messages.html b/shared/templates/styleguide2/includes/organisms/layout/messages.html similarity index 57% rename from main/templates/main/includes/organisms/layout/messages.html rename to shared/templates/styleguide2/includes/organisms/layout/messages.html index 496ac48d7390c7fffe25d630fcbd096ea0a19672..b422fc81425bc906607c865a0c77c1d31332cf96 100644 --- a/main/templates/main/includes/organisms/layout/messages.html +++ b/shared/templates/styleguide2/includes/organisms/layout/messages.html @@ -4,7 +4,7 @@ {% comment %} <li> - {% include "main/includes/molecules/blocks/message_block.html" with type=message.type content=message.content is_last_child=forloop.last %} + {% include "styleguide2/includes/molecules/blocks/message_block.html" with type=message.type content=message.content is_last_child=forloop.last %} </li> {% endcomment %} {% endfor %} diff --git a/main/templates/main/includes/organisms/layout/navbar.html b/shared/templates/styleguide2/includes/organisms/layout/navbar.html similarity index 91% rename from main/templates/main/includes/organisms/layout/navbar.html rename to shared/templates/styleguide2/includes/organisms/layout/navbar.html index bdfe11c21e288204516d45f3e4921ff4d6720bff..1752901486306a159b6fc487382638278a662bdb 100644 --- a/main/templates/main/includes/organisms/layout/navbar.html +++ b/shared/templates/styleguide2/includes/organisms/layout/navbar.html @@ -16,8 +16,8 @@ <div class="flex items-center xl:items-start"> <!-- BEGIN Logo--> <a href="{{ page.root_page.url }}" class="z-20 xl:mt-2"> - <img class="navbar__logo--white w-[150px] lg:w-[180px]" src="{% static 'main/images/logo-full-white.svg' %}" alt=""> - <img class="navbar__logo--black w-[150px] lg:w-[180px]" src="{% static 'main/images/logo-full-black.svg' %}" alt=""> + <img class="navbar__logo--white w-[150px] lg:w-[180px]" src="{% static 'styleguide2/images/logo-full-white.svg' %}" alt=""> + <img class="navbar__logo--black w-[150px] lg:w-[180px]" src="{% static 'styleguide2/images/logo-full-black.svg' %}" alt=""> </a> <!-- END Logo --> </div> @@ -35,7 +35,7 @@ </div> <form method="GET" action="{{ page.root_page.search_page.url }}"> - {% include 'main/includes/atoms/form_fields/form_input.html' with placeholder='Hledej' classes='text-black px-2 py-1 w-80' name='q' value=global_search_query %} + {% include 'styleguide2/includes/atoms/form_fields/form_input.html' with placeholder='Hledej' classes='text-black px-2 py-1 w-80' name='q' value=global_search_query %} </form> </div> <!-- END Social media --> @@ -53,7 +53,7 @@ > <div class="mb-1"> {% if not is_transparent %} - {% include 'main/includes/atoms/icons/arrow.html' with width='27' height='28.35' fill='#fff' %} + {% include 'styleguide2/includes/atoms/icons/arrow.html' with width='27' height='28.35' fill='#fff' %} {% else %} <ui-animated-arrow mobile-width="38.1" @@ -142,7 +142,7 @@ <div class="grid-left-side"> <img class="w-[150px] mt-3" - src="{% static 'main/images/logo-full-black.svg' %}" + src="{% static 'styleguide2/images/logo-full-black.svg' %}" alt="" > </div> @@ -162,7 +162,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 'main/includes/atoms/icons/arrow.html' with width='27' height='28.35' %} + {% include 'styleguide2/includes/atoms/icons/arrow.html' with width='27' height='28.35' %} {% else %} <ui-animated-arrow></ui-animated-arrow> {% endif %} diff --git a/main/templates/main/includes/organisms/main_section/newsletter_section.html b/shared/templates/styleguide2/includes/organisms/main_section/newsletter_section.html similarity index 70% rename from main/templates/main/includes/organisms/main_section/newsletter_section.html rename to shared/templates/styleguide2/includes/organisms/main_section/newsletter_section.html index d128d90b6d16c66cafbf5bced9a4c525b2e7f246..ea36d331c5f4e6d7a3bc1eed1faabd307451c239 100644 --- a/main/templates/main/includes/organisms/main_section/newsletter_section.html +++ b/shared/templates/styleguide2/includes/organisms/main_section/newsletter_section.html @@ -2,7 +2,7 @@ <div class="newsletter-section" - style="background-image:url('{% static 'main/images/background-images/bg-newsletter.webp' %}')" + style="background-image:url('{% static 'styleguide2/images/background-images/bg-newsletter.webp' %}')" > <div class="container--medium pt-32 pb-24"> <h2 class="head-14xl"> @@ -22,7 +22,7 @@ <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' %} + {% include 'styleguide2/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 flex items-center mb-3"> <input type="checkbox" id="confirmed" name="confirmed" required> @@ -31,7 +31,7 @@ </label> </div> - {% include 'main/includes/atoms/buttons/round_button_form.html' with button_text='Odebírat' %} + {% include 'styleguide2/includes/atoms/buttons/round_button_form.html' with button_text='Odebírat' %} </form> </div> </div> diff --git a/main/templates/main/includes/organisms/main_section/region_section.html b/shared/templates/styleguide2/includes/organisms/main_section/region_section.html similarity index 63% rename from main/templates/main/includes/organisms/main_section/region_section.html rename to shared/templates/styleguide2/includes/organisms/main_section/region_section.html index 7c071c751862fdc7b8c645731c432e12b4a78443..380dd9228c980dc56adcc5cd743cbe3a7f490c2a 100644 --- a/main/templates/main/includes/organisms/main_section/region_section.html +++ b/shared/templates/styleguide2/includes/organisms/main_section/region_section.html @@ -11,12 +11,12 @@ {% comment %} <div class="w-12/12 lg:w-5/12"> <div class="flex flex-col gap-5 justify-center"> - {% include 'main/includes/atoms/form_fields/form_select.html' %} + {% include 'styleguide2/includes/atoms/form_fields/form_select.html' %} <div class="flex flex-col gap-4"> - {% 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' %} + {% include 'styleguide2/includes/molecules/articles/small_article_preview.html' %} + {% include 'styleguide2/includes/molecules/articles/small_article_preview.html' %} + {% include 'styleguide2/includes/molecules/articles/small_article_preview.html' %} </div> </div> </div> diff --git a/main/templates/main/includes/organisms/main_section/representatives_section.html b/shared/templates/styleguide2/includes/organisms/main_section/representatives_section.html similarity index 78% rename from main/templates/main/includes/organisms/main_section/representatives_section.html rename to shared/templates/styleguide2/includes/organisms/main_section/representatives_section.html index 511241f6a9db6f265e99f244ca60327c020b67e9..41fb7967a68787d4ac5863454d8713ff698c0a04 100644 --- a/main/templates/main/includes/organisms/main_section/representatives_section.html +++ b/shared/templates/styleguide2/includes/organisms/main_section/representatives_section.html @@ -44,7 +44,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=box_image button_text=box.button_text url=box.button_link title=box.title %} + {% include 'styleguide2/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 %} </ui-horizontal-scrollable> @@ -54,7 +54,7 @@ xl:py-24 " > - {% include 'main/includes/atoms/buttons/round_button.html' with url=page.root_page.people_page.url classes='inline-block bg-white text-black' button_text="Další lidé" %} + {% include 'styleguide2/includes/atoms/buttons/round_button.html' with url=page.root_page.people_page.url classes='inline-block bg-white text-black' button_text="Další lidé" %} </div> </div> </div> diff --git a/shared/templates/styleguide2/includes/organisms/popouts/hoax_popout_list.html b/shared/templates/styleguide2/includes/organisms/popouts/hoax_popout_list.html new file mode 100644 index 0000000000000000000000000000000000000000..1a583ef5080f6b762b3242c911737cc0bf16e9bd --- /dev/null +++ b/shared/templates/styleguide2/includes/organisms/popouts/hoax_popout_list.html @@ -0,0 +1,6 @@ +<ul class="flex flex-col"> + <li class="grow">{% include "styleguide2/includes/molecules/popouts/hoax_popout_point.html" %}</li> + <li class="grow">{% include "styleguide2/includes/molecules/popouts/hoax_popout_point.html" %}</li> + <li class="grow">{% include "styleguide2/includes/molecules/popouts/hoax_popout_point.html" %}</li> + <li class="grow">{% include "styleguide2/includes/molecules/popouts/hoax_popout_point.html" %}</li> +</ul> diff --git a/main/templates/main/includes/organisms/popouts/popout_list.html b/shared/templates/styleguide2/includes/organisms/popouts/popout_list.html similarity index 80% rename from main/templates/main/includes/organisms/popouts/popout_list.html rename to shared/templates/styleguide2/includes/organisms/popouts/popout_list.html index 722a79d41a0610a3cbe221e44085081764c98699..3875519ddc729adfef4d7654b616e3d086521909 100644 --- a/main/templates/main/includes/organisms/popouts/popout_list.html +++ b/shared/templates/styleguide2/includes/organisms/popouts/popout_list.html @@ -16,7 +16,7 @@ </div> {% for point in category.point_list %} - {% include 'main/includes/molecules/popouts/popout_point.html' with name=point.title content=point.content %} + {% include 'styleguide2/includes/molecules/popouts/popout_point.html' with name=point.title content=point.content %} {% endfor %} </li> {% endfor %} diff --git a/shared/templates/styleguide2/includes/organisms/search/search_results.html b/shared/templates/styleguide2/includes/organisms/search/search_results.html new file mode 100644 index 0000000000000000000000000000000000000000..07fde2e97421886e2de41a47f21d729d8be306bf --- /dev/null +++ b/shared/templates/styleguide2/includes/organisms/search/search_results.html @@ -0,0 +1,9 @@ +<div class="flex flex-col"> + <div class="pb-2"> + {{ results|length }} výsledků + </div> + + {% for result in results %} + {% include "styleguide2/includes/molecules/search/universal_search_result.html" with url=result.url title=result.title date=result.date perex=result.perex %} + {% endfor %} +</div> diff --git a/shared/templates/styleguide2/search_page.html b/shared/templates/styleguide2/search_page.html new file mode 100644 index 0000000000000000000000000000000000000000..64dbea984c6cfffc82e880aa4bc298845e7e0bc6 --- /dev/null +++ b/shared/templates/styleguide2/search_page.html @@ -0,0 +1,15 @@ +{% extends "styleguide2/base.html" %} +{% load wagtailcore_tags %} + +{% block content %} + +{% include 'styleguide2/includes/organisms/layout/navbar.html' %} +{% include 'styleguide2/includes/organisms/header/simple_header.html' with title=page.title %} + +<main role="main" class="mb-10 xl:mb-32"> + <div class="container--wide mb-2 lg:mb-12"> + {% include 'styleguide2/includes/organisms/search/search_results.html' %} + </div> +</main> + +{% endblock %} diff --git a/shared/templates/styleguide2/simple_page.html b/shared/templates/styleguide2/simple_page.html new file mode 100644 index 0000000000000000000000000000000000000000..c1647c4c3905d10ab1479bce33962e2c31365162 --- /dev/null +++ b/shared/templates/styleguide2/simple_page.html @@ -0,0 +1,13 @@ +{% extends "styleguide2/base.html" %} +{% load wagtailcore_tags %} + +{% block content %} + {% include 'styleguide2/includes/organisms/layout/navbar.html' with selected_item=page.get_menu_title %} + {% include 'styleguide2/includes/organisms/header/simple_header.html' with title=page.title %} + + <main class="container--wide mb-2 lg:mb-12"> + {% for block in page.content %} + {% include_block block %} + {% endfor %} + </main> +{% endblock %}