Skip to content
Snippets Groups Projects
Commit 5964e6f0 authored by OndraPetrzilka's avatar OndraPetrzilka
Browse files

PeopleOverviewBlock TODO done

parent 205ecad5
No related branches found
No related tags found
3 merge requests!607Pirati.cz,!589Feature/pirati cz ondra,!575Feature/pirati cz
Pipeline #9426 passed
...@@ -18,8 +18,8 @@ class CTAMixin(StructBlock): ...@@ -18,8 +18,8 @@ class CTAMixin(StructBlock):
class BoxBlock(CTAMixin, StructBlock): class BoxBlock(CTAMixin, StructBlock):
image = ImageChooserBlock(label="Logo/obrázek")
title = CharBlock(label="Nadpis") title = CharBlock(label="Nadpis")
image = ImageChooserBlock(label="Logo/obrázek")
class BoxesBlock(StructBlock): class BoxesBlock(StructBlock):
...@@ -71,8 +71,9 @@ class PeopleGroupBlock(StructBlock): ...@@ -71,8 +71,9 @@ class PeopleGroupBlock(StructBlock):
return value return value
class PeopleOverviewBlock(StructBlock): # TODO asi jako BoxesBlock class PeopleOverviewBlock(StructBlock):
title = CharBlock(label="Titulek") title = CharBlock(label="Hlavní titulek")
list = ListBlock(BoxBlock, label="Boxíky")
class Meta: class Meta:
template = "main/blocks/people_overview_block.html" template = "main/blocks/people_overview_block.html"
......
# Generated by Django 4.0.7 on 2022-08-25 04:46
from django.db import migrations
import main.blocks
import wagtail.blocks
import wagtail.fields
class Migration(migrations.Migration):
dependencies = [
('main', '0019_alter_maincontactpage_text'),
]
operations = [
migrations.AlterField(
model_name='mainhomepage',
name='content',
field=wagtail.fields.StreamField([('carousel', wagtail.blocks.StructBlock([('slides', wagtail.blocks.ListBlock(main.blocks.HomePageCarouseSlideBlock, label='Obrázky s nadpisy - carouselu'))])), ('news', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(help_text='Nejnovější články se načtou automaticky', label='Titulek'))])), ('people', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(label='Hlavní titulek')), ('list', wagtail.blocks.ListBlock(main.blocks.BoxBlock, label='Boxíky'))])), ('regions', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(help_text='Články pro regiony se načtou automaticky', label='Titulek'))])), ('tweets', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(help_text='Tweety budou načteny pro všchny profily uvedené v nastavení webu automaticky', label='Titulek'))])), ('boxes', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(label='Nadpis')), ('list', wagtail.blocks.ListBlock(main.blocks.BoxBlock, label='Boxíky'))]))], blank=True, use_json_field=None, verbose_name='Hlavní obsah'),
),
]
{% load wagtailimages_tags %}
<div class="container--medium mb-8 lg:mb-16"> <div class="container--medium mb-8 lg:mb-16">
<h2 class="head-7xl text-center mb-6 xl:mb-28"> <h2 class="head-7xl text-center mb-6 xl:mb-28">
{{ self.title }} {{ self.title }}
</h2> </h2>
<div class="flex flex-wrap space-x-1 justify-center items-center"> <div class="flex flex-wrap space-x-1 justify-center items-center">
{% for box in '1234' %}{# TODO #} {% for box in self.list %}
{% image box.image fill-500x500 as box_image %}
<div class="w-full max-w-xs mb-1 w-80 h-80 flex flex-col items-center justify-center" <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')"> style="background-image: url('{{ box_image.url }}')">
<h5 class="head-alt-md text-white mt-24 mb-8"> <h5 class="head-alt-md text-white mt-24 mb-8">
poslanci za piráty {{ box.title }}
</h5> </h5>
{% include 'main/includes/button_animated.html' with btn_text="Poslanci" %} {% include 'main/includes/button_animated.html' with btn_text=box.button_text btn_link=box.button_link %}
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment