Skip to content
Snippets Groups Projects
Commit 8a79a444 authored by Tomáš Valenta's avatar Tomáš Valenta Committed by josef.bouse
Browse files

wip - homepage template

parent ee47bba4
Branches
No related tags found
2 merge requests!861Release: New homepage design,!841Feat/new homepage
Showing
with 173 additions and 28 deletions
...@@ -110,8 +110,7 @@ class BoxesBlock(StructBlock): ...@@ -110,8 +110,7 @@ class BoxesBlock(StructBlock):
label = "Skupina boxů" label = "Skupina boxů"
class HomePageCarouselSlideBlock(CTAMixin, StructBlock): class HomePageCarouseSlideBlock(StructBlock):
image = ImageChooserBlock(label="Hlavní obrázek")
line_1 = TextBlock(label="První řádek") line_1 = TextBlock(label="První řádek")
line_2 = TextBlock(label="Druhý řádek") line_2 = TextBlock(label="Druhý řádek")
...@@ -274,9 +273,7 @@ class PersonContactBoxBlock(CTAMixin, StructBlock): ...@@ -274,9 +273,7 @@ class PersonContactBoxBlock(CTAMixin, StructBlock):
# Footer # Footer
class LinkBlock(StructBlock): class LinkBlock(StructBlock):
text = CharBlock( text = CharBlock(label="Název")
label="Titulek odkazu (text, který se zobrazí místo dlouhého odkazu)"
)
link = URLBlock(label="Odkaz") link = URLBlock(label="Odkaz")
class Meta: class Meta:
......
from django.db import models
from wagtail.fields import StreamField from wagtail.fields import StreamField
from shared.blocks import MenuItemBlock as MenuItemBlockBase from shared.blocks import MenuItemBlock as MenuItemBlockBase
from shared.models import MenuMixin as MenuMixinBase from shared.models import MenuMixin as MenuMixinBase
from wagtail.admin.panels import FieldPanel, MultiFieldPanel
from wagtail import blocks
from wagtail.models import Page
class MenuItemBlock(MenuItemBlockBase): class MenuItemBlock(MenuItemBlockBase):
title = blocks.CharBlock(
label="Titulek",
help_text="Pokud není odkazovaná stránka na Majáku, použij možnost zadání samotné adresy níže.",
required=True
)
class Meta: class Meta:
label = "Položka v menu" label = "Položka v menu"
template = "main/includes/menu_item.html"
# #
...@@ -19,12 +28,52 @@ class MenuItemBlock(MenuItemBlockBase): ...@@ -19,12 +28,52 @@ class MenuItemBlock(MenuItemBlockBase):
class MenuMixin(MenuMixinBase): class MenuMixin(MenuMixinBase):
important_item_name = models.CharField(
verbose_name="Jméno",
help_text="Pokud není odkazovaná stránka na Majáku, použij možnost zadání samotné adresy níže.",
max_length=16,
blank=True,
null=True
)
important_item_page = models.ForeignKey(
Page,
verbose_name="Stránka",
null=True,
blank=True,
related_name="+",
on_delete=models.PROTECT,
)
important_item_url = models.URLField(
verbose_name="Adresa",
blank=True,
null=True,
)
menu = StreamField( menu = StreamField(
[("menu_item", MenuItemBlock())], # , ("menu_parent", MenuParentBlock()) [("menu_item", MenuItemBlock())], # , ("menu_parent", MenuParentBlock())
verbose_name="Menu", verbose_name="Položky",
blank=True, blank=True,
use_json_field=True, use_json_field=True,
) )
menu_panels = [
MultiFieldPanel(
[
FieldPanel("important_item_name"),
FieldPanel("important_item_page"),
FieldPanel("important_item_url"),
],
heading="Důležitá položka menu",
),
MultiFieldPanel(
[
FieldPanel("menu"),
],
heading="Další obsah menu",
),
]
class Meta: class Meta:
abstract = True abstract = True
# Generated by Django 4.1.10 on 2023-12-12 09:31
from django.db import migrations
import main.blocks
import wagtail.blocks
import wagtail.fields
import wagtail.images.blocks
class Migration(migrations.Migration):
dependencies = [
('main', '0062_alter_mainpersonpage_calendar_url'),
]
operations = [
migrations.AlterField(
model_name='mainhomepage',
name='content',
field=wagtail.fields.StreamField([('carousel', wagtail.blocks.StructBlock([('button_link', wagtail.blocks.URLBlock(label='Odkaz tlačítka')), ('button_text', wagtail.blocks.CharBlock(label='Text tlačítka')), ('image', wagtail.images.blocks.ImageChooserBlock(label='Hlavní obrázek')), ('line_1', wagtail.blocks.TextBlock(label='První řádek')), ('line_2', wagtail.blocks.TextBlock(label='Druhý řádek'))])), ('news', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(help_text='Nejnovější články se načtou automaticky', label='Titulek')), ('description', wagtail.blocks.TextBlock(label='Popis'))])), ('people', wagtail.blocks.StructBlock([('title_line_1', wagtail.blocks.CharBlock(label='První řádek titulku')), ('title_line_2', wagtail.blocks.CharBlock(label='Druhý řádek titulku')), ('description', wagtail.blocks.TextBlock(label='Popis')), ('list', wagtail.blocks.ListBlock(main.blocks.BoxBlock, label='Boxíky'))])), ('regions', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(help_text='Články pro regiony se načtou automaticky', label='Titulek'))])), ('boxes', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(label='Nadpis')), ('list', wagtail.blocks.ListBlock(main.blocks.BoxBlock, label='Boxíky')), ('image', wagtail.images.blocks.ImageChooserBlock(label='Obrázek pozadí', required=False))]))], blank=True, use_json_field=True, verbose_name='Hlavní obsah'),
),
]
# Generated by Django 4.1.10 on 2023-12-12 10:22
from django.db import migrations, models
import django.db.models.deletion
import main.blocks
import wagtail.blocks
import wagtail.fields
import wagtail.images.blocks
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0083_workflowcontenttype'),
('main', '0063_alter_mainhomepage_content'),
]
operations = [
migrations.AddField(
model_name='mainhomepage',
name='important_item_name',
field=models.CharField(blank=True, help_text='Pokud není odkazovaná stránka na Majáku, použij možnost zadání samotné adresy níže', max_length=16, null=True, verbose_name='Jméno'),
),
migrations.AddField(
model_name='mainhomepage',
name='important_item_page',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='wagtailcore.page', verbose_name='Stránka'),
),
migrations.AddField(
model_name='mainhomepage',
name='important_item_url',
field=models.URLField(blank=True, null=True, verbose_name='Adresa'),
),
migrations.AlterField(
model_name='mainhomepage',
name='content',
field=wagtail.fields.StreamField([('carousel', wagtail.blocks.StructBlock([('line_1', wagtail.blocks.TextBlock(label='První řádek')), ('line_2', wagtail.blocks.TextBlock(label='Druhý řádek'))])), ('news', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(help_text='Nejnovější články se načtou automaticky', label='Titulek')), ('description', wagtail.blocks.TextBlock(label='Popis'))])), ('people', wagtail.blocks.StructBlock([('title_line_1', wagtail.blocks.CharBlock(label='První řádek titulku')), ('title_line_2', wagtail.blocks.CharBlock(label='Druhý řádek titulku')), ('description', wagtail.blocks.TextBlock(label='Popis')), ('list', wagtail.blocks.ListBlock(main.blocks.BoxBlock, label='Boxíky'))])), ('regions', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(help_text='Články pro regiony se načtou automaticky', label='Titulek'))])), ('boxes', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(label='Nadpis')), ('list', wagtail.blocks.ListBlock(main.blocks.BoxBlock, label='Boxíky')), ('image', wagtail.images.blocks.ImageChooserBlock(label='Obrázek pozadí', required=False))]))], blank=True, use_json_field=True, verbose_name='Hlavní obsah'),
),
]
# Generated by Django 4.1.10 on 2023-12-12 10:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0064_mainhomepage_important_item_name_and_more'),
]
operations = [
migrations.AlterField(
model_name='mainhomepage',
name='important_item_name',
field=models.CharField(blank=True, help_text='Pokud není odkazovaná stránka na Majáku, použij možnost zadání samotné adresy níže.', max_length=16, null=True, verbose_name='Jméno'),
),
]
# Generated by Django 4.1.10 on 2023-12-12 10:43
from django.db import migrations
import wagtail.blocks
import wagtail.fields
class Migration(migrations.Migration):
dependencies = [
('main', '0065_alter_mainhomepage_important_item_name'),
]
operations = [
migrations.AlterField(
model_name='mainhomepage',
name='menu',
field=wagtail.fields.StreamField([('menu_item', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(help_text='Pokud není odkazovaná stránka na Majáku, použij možnost zadání samotné adresy níže.', label='Titulek', required=True)), ('page', wagtail.blocks.PageChooserBlock(label='Stránka', required=False)), ('link', wagtail.blocks.URLBlock(label='Odkaz', required=False))]))], blank=True, use_json_field=True, verbose_name='Menu'),
),
]
...@@ -91,7 +91,7 @@ class MainHomePage( ...@@ -91,7 +91,7 @@ class MainHomePage(
# content # content
content = StreamField( content = StreamField(
[ [
("carousel", blocks.HomePageCarouselSlideBlock()), ("carousel", blocks.HomePageCarouseSlideBlock()),
("news", blocks.NewsBlock()), ("news", blocks.NewsBlock()),
("people", blocks.PeopleOverviewBlock()), ("people", blocks.PeopleOverviewBlock()),
("regions", blocks.RegionsBlock()), ("regions", blocks.RegionsBlock()),
...@@ -137,7 +137,7 @@ class MainHomePage( ...@@ -137,7 +137,7 @@ class MainHomePage(
[ [
("social_links", blocks.SocialLinkBlock()), ("social_links", blocks.SocialLinkBlock()),
], ],
verbose_name="Odkazy na sociální sítě v zápatí webu", verbose_name="Odkazy na sociální sítě",
blank=True, blank=True,
use_json_field=True, use_json_field=True,
) )
......
...@@ -18,5 +18,5 @@ ...@@ -18,5 +18,5 @@
" "
> >
<span class="group-hover:-translate-x-2 duration-200">{{ button_text }}</span> <span class="group-hover:-translate-x-2 duration-200">{{ button_text }}</span>
<span class="opacity-0 group-hover:opacity-100 duration-200">{% include 'patterns/atoms/icons/arrow.html' %}</span> <span class="opacity-0 group-hover:opacity-100 duration-200">{% include 'main/includes/atoms/icons/arrow.html' %}</span>
</a> </a>
<div class="checkbox form-field__control flex items-center {{ classes }}"> <div class="checkbox form-field__control flex items-center {{ classes }}">
<input type="checkbox" id="checkbox_1"> <input type="checkbox" id="{{ name }}" name="{{ name }}" required>
<label for="checkbox_1">{{ label }}</label> <label for="{{ name }}">{{ label }}</label>
</div> </div>
<input <input
type="text" type="text"
class="text-input bg-white form-field__control border-none {{ classes }}" class="text-input bg-white form-field__control border-none {{ classes }}"
id="{{ name }}"
name="{{ name }}"
value="" value=""
placeholder="{{ form_placeholder }}" placeholder="{{ placeholder }}"
/> />
<div class="prose"> <div class="prose">
{% include 'patterns/atoms/text/paragraph.html' with text=text %} {% include 'main/includes/atoms/text/paragraph.html' with text=text %}
</div> </div>
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</a> </a>
<div class="mb-6"> <div class="mb-6">
{% include 'patterns/molecules/tags/inline_tags.html' %} {% include 'main/includes/molecules/tags/inline_tags.html' %}
</div> </div>
<p class="mb-8"> <p class="mb-8">
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</p> </p>
<div class="flex justify-end"> <div class="flex justify-end">
{% include 'patterns/atoms/buttons/round_button.html' with button_text='Zjisti více' %} {% include 'main/includes/atoms/buttons/round_button.html' with button_text='Zjisti více' %}
</div> </div>
</div> </div>
</div> </div>
...@@ -12,6 +12,6 @@ ...@@ -12,6 +12,6 @@
</h4> </h4>
</div> </div>
{% include 'patterns/atoms/buttons/round_button_small.html' with button_text='Číst dále' %} {% include 'main/includes/atoms/buttons/round_button_small.html' with button_text='Číst dále' %}
</div> </div>
</div> </div>
...@@ -21,6 +21,6 @@ ...@@ -21,6 +21,6 @@
</div> </div>
<div class="flex flex-col justify-center items-start"> <div class="flex flex-col justify-center items-start">
{% include 'patterns/atoms/buttons/round_button.html' with button_text='Stáhnout' %} {% include 'main/includes/atoms/buttons/round_button.html' with button_text='Stáhnout' %}
</div> </div>
</div> </div>
...@@ -6,5 +6,5 @@ ...@@ -6,5 +6,5 @@
placeholder="{{ placeholder }}" placeholder="{{ placeholder }}"
aria-label="Vyhledávací box" aria-label="Vyhledávací box"
> >
{% include 'patterns/atoms/buttons/search_button.html' %} {% include 'main/includes/atoms/buttons/search_button.html' %}
</div> </div>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</div> </div>
<div class="flex justify-center"> <div class="flex justify-center">
{% include 'patterns/atoms/buttons/round_button.html' with button_text="Zjisti více" %} {% include 'main/includes/atoms/buttons/round_button.html' with button_text="Zjisti více" %}
</div> </div>
</div> </div>
</article> </article>
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
> >
<div class="text-center mt-6 mb-4"> <div class="text-center mt-6 mb-4">
<h2 class="head-6xl">{{ desc_text }}</h2> <h2 class="head-6xl">{{ title }}</h2>
</div> </div>
<div class="text-center flex justify-center"> <div class="text-center flex justify-center">
{% include 'patterns/atoms/buttons/round_button.html' with url=url classes='bg-white text-black' button_text=button_text %} {% include 'main/includes/atoms/buttons/round_button.html' with url=url classes='bg-white text-black' button_text=button_text %}
</div> </div>
</div> </div>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
>{{ mail }}</a> >{{ mail }}</a>
<div class="flex mt-5"> <div class="flex mt-5">
{% include 'patterns/atoms/buttons/round_button_small.html' with button_text='Zjisti více' %} {% include 'main/includes/atoms/buttons/round_button_small.html' with button_text='Zjisti více' %}
</div> </div>
</div> </div>
</div> </div>
......
{% load wagtailimages_tags %} {% load static %}
<div> <div>
<div class="header-carousel"> <div class="header-carousel">
<div class="h-[700px] xl:h-screen relative"> <div class="h-[700px] xl:h-screen relative">
{% image self.image fill-1920x1020 as carousel_img %}
<img <img
src="{{ carousel_img.url }}" src="{% static 'main/images/background-images/bg-flag.webp' %}"
draggable="false" draggable="false"
> >
......
<div class="flex gap-3 flex-wrap {{ classes }}"> <div class="flex gap-3 flex-wrap {{ classes }}">
{% for tag in tags %} {% for tag in tags %}
{% include 'patterns/atoms/tags/tag.html' with text=tag %} {% include 'main/includes/atoms/tags/tag.html' with text=tag %}
{% 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