diff --git a/main/blocks.py b/main/blocks.py index 09df2b2b756b86f4d504847a4b78b7ad1f4af6da..3cbd4362dd9ed282560bd8e183e97ba4a5f1b4aa 100644 --- a/main/blocks.py +++ b/main/blocks.py @@ -40,6 +40,16 @@ class HomePageCarouselBlock(StructBlock): template = "main/blocks/homepage_carousel_block.html" +class NewsBlock(StructBlock): + title = CharBlock( + label="Titulek", + help_text="Nejnovější články se načtou automaticky", + ) + + class Meta: + template = "main/blocks/news_block.html" + + class PeopleGroupBlock(StructBlock): title = CharBlock(label="Titulek") person_list = ListBlock( @@ -48,6 +58,13 @@ class PeopleGroupBlock(StructBlock): ) +class PeopleOverviewBlock(StructBlock): # TODO asi jako BoxesBlock + title = CharBlock(label="Titulek") + + class Meta: + template = "main/blocks/people_overview_block.html" + + class ProgramBlock(StructBlock): icon = ImageChooserBlock(label="Ikona") title = CharBlock(label="Titulek článku programu") @@ -59,6 +76,16 @@ class ProgramGroupBlock(StructBlock): point_list = ListBlock(ProgramBlock(), label="Jednotlivé články programu") +class RegionsBlock(StructBlock): + title = CharBlock( + label="Titulek", + help_text="Články pro regiony se načtou automaticky", + ) + + class Meta: + template = "main/blocks/regions_block.html" + + class TweetsBlock(StructBlock): title = CharBlock( label="Titulek", @@ -69,11 +96,6 @@ class TweetsBlock(StructBlock): template = "main/blocks/twitter_block.html" -# NewsBlock - zatím asi hardcoded -# PeopleOverviewBlock - zatím asi hardcoded -# RegionOverviewBlock - zatím asi hardcoded - - class PersonContactBlock(StructBlock): position = CharBlock(label="Název pozice", required=False) # email, phone? diff --git a/main/models.py b/main/models.py index 56c5eabdc308eee5bf21c2dc7116286334f7ed05..b695f57bb339d463f9d90bfa1263e09558e0843a 100644 --- a/main/models.py +++ b/main/models.py @@ -56,6 +56,9 @@ class MainHomePage(MenuMixin, ExtendedMetadataHomePageMixin, MetadataPageMixin, content = StreamField( [ ("carousel", blocks.HomePageCarouselBlock()), + ("news", blocks.NewsBlock()), + ("people", blocks.PeopleOverviewBlock()), + ("regions", blocks.RegionsBlock()), ("tweets", blocks.TweetsBlock()), ("boxes", blocks.BoxesBlock()), ], diff --git a/main/templates/main/blocks/news_block.html b/main/templates/main/blocks/news_block.html new file mode 100644 index 0000000000000000000000000000000000000000..d0776c2818ccca2c0e5a2fb01bb4a78ad9079956 --- /dev/null +++ b/main/templates/main/blocks/news_block.html @@ -0,0 +1,32 @@ +<div class="bg-cover bg-no-repeat section-clip mb-8 py-16 lg:py-36 lg:mb-16" + style="background-image: url('https://i.picsum.photos/id/630/1980/1400.jpg?hmac=WjDo021fzd9SaIlmsi9LtZJApZ02RMzdG0bYLx8iXOo')"> + <div class="container--medium mx-auto px-4"> + <h2 class="head-7xl text-center mb-6 xl:mb-28"> + {{ self.title }} + </h2> + + <div class="flex flex-wrap mb-5 lg:mb-10"> + <img src="https://i.picsum.photos/id/361/576/576.jpg?hmac=kb62KiZkyDuigb46DUJQd7QvQM6LfYFolTdIMwEqei4" alt="" + class="lg:max-w-lg lg:mr-11"> + <div class="flex flex-col max-w-xl items-start"> + <span class="text-green-500 head-3xl mt-10 mb-4 lg:mb-8">2.3.2022</span> + <h5 class="head-4xl mb-5 lg:mb-10">Senátoři vyzvali k ukončení veřejné podpory firmám z Ruska + a Běloruska, vkteré neodsoudí akt vojenské agrese na Ukrajině</h5> + <p class="leading-6 mb-4 lg:mb-8"> + Senát chce v souvislosti s ruskou agresí zabránit některým firmám z Ruska a Běloruska čerpat dotace z + prostředků rozpočtu České republiky. + Plénum Senátu PČR dnes schválilo usnesení Stálé komise Senátu pro dohled nad poskytováním veřejných + prostředků k urychlené tvorbě zákona, + který zamezí poskytování dotací, pobídek, úvěrů a veřejných zakázek z rozpočtu ČR firmám a občanům Ruské + federace a Běloruska, + kteří neodsoudí akt vojenské agrese vůči Ukrajině. + </p> + {% include 'main/includes/button_animated.html' with btn_link=article_page.url btn_text="Číst dále" %} + </div> + </div> + + <div class="__js-root"> + <ui-article-carousel></ui-article-carousel> + </div> + </div> +</div> diff --git a/main/templates/main/blocks/people_overview_block.html b/main/templates/main/blocks/people_overview_block.html new file mode 100644 index 0000000000000000000000000000000000000000..57ed0ac08e4a3edfa36ceb529e840ea87b657f86 --- /dev/null +++ b/main/templates/main/blocks/people_overview_block.html @@ -0,0 +1,16 @@ +<div class="container--medium mb-8 lg:mb-16"> + <h2 class="head-7xl text-center mb-6 xl:mb-28"> + {{ self.title }} + </h2> + <div class="flex flex-wrap space-x-1 justify-center items-center"> + {% for box in '1234' %}{# TODO #} + <div class="w-full max-w-xs mb-1 w-80 h-80 flex flex-col items-center justify-center" + style="background-image: url('https://i.picsum.photos/id/261/350/350.jpg?hmac=GOGR4Va2TTfzr3sxRHwTlAxqhpu4M_pl_oKex2O7fcQ')"> + <h5 class="head-alt-md text-white mt-24 mb-8"> + poslanci za piráty + </h5> + {% include 'main/includes/button_animated.html' with btn_text="Poslanci" %} + </div> + {% endfor %} + </div> +</div> diff --git a/main/templates/main/blocks/regions_block.html b/main/templates/main/blocks/regions_block.html new file mode 100644 index 0000000000000000000000000000000000000000..0b50ce791ea0a7b1fff93d318d40a92bb020e751 --- /dev/null +++ b/main/templates/main/blocks/regions_block.html @@ -0,0 +1,32 @@ +<div class="bg-cover bg-no-repeat section-clip py-16 lg:py-36" + style="background-image: url('https://i.picsum.photos/id/630/1980/1400.jpg?hmac=WjDo021fzd9SaIlmsi9LtZJApZ02RMzdG0bYLx8iXOo')"> + <div class="container--medium mx-auto px-4 "> + <h2 class="head-7xl text-center mb-6 xl:mb-28"> + {{ self.title }} + </h2> + <div class="flex flex-wrap"> + <div class="__js-root flex items-center justify-center h-full mb-4 w-full w-12/12 lg:w-7/12"> + <ui-region-map class="w-full"></ui-region-map> + </div> + <div class="w-12/12 lg:w-5/12"> + <div class="flex flex-col justify-center"> + <div class="select"> + <select class="select__control form-field__control" value=""> + <option>Všechny kraje</option> + <option>Option 2</option>{# TODO REGION choices from models #} + <option>Option 3</option> + <option>Option 4</option> + </select> + </div> + + {% for article_page in region_article_list %} + <div class="mb-3"> + {% include 'main/includes/small_article_preview.html' %} + </div> + {% endfor %} + </div> + </div> + </div> + <div></div> + </div> +</div> diff --git a/main/templates/main/includes/small_article_preview.html b/main/templates/main/includes/small_article_preview.html new file mode 100644 index 0000000000000000000000000000000000000000..7e74731aba65e47f1dbaabfd2099fd9e4fbf52d3 --- /dev/null +++ b/main/templates/main/includes/small_article_preview.html @@ -0,0 +1,16 @@ +<div class="flex"> + <img + src="https://i.picsum.photos/id/523/132/132.jpg?hmac=XjW7KxLZNbta7gMDNvldHNGwA9XyxpjBFUGkJqrMR4o" + alt="" + class="mr-4 h-32 w-32" + > + <div class="flex flex-col justify-between items-start"> + <span class="text-sm text-green-500 lg:text-base"> + {{ article_page.date | date }} + </span> + <h4 class="text-sm uppercase lg:text-base"> + {{ article_page.title }} + </h4> + {% include 'main/includes/button_animated.html' with btn_link=article_page.url btn_text="Číst dále" %} + </div> +</div>