Skip to content
Snippets Groups Projects
Commit 8742fd5a authored by Tomi Valentová's avatar Tomi Valentová
Browse files

run hooks, finish(?) uniweb redesign, minor fixes

parent be35afe6
No related branches found
No related tags found
2 merge requests!1047Uniweb redesign,!1045Uniweb redesign, minor district redesign fixes
Pipeline #19007 passed
Showing
with 53276 additions and 71 deletions
# Generated by Django 5.0.6 on 2024-07-11 16:31 # Generated by Django 5.0.6 on 2024-07-11 16:31
import shared.blocks.children.misc
import wagtail.blocks import wagtail.blocks
import wagtail.blocks.static_block import wagtail.blocks.static_block
import wagtail.fields import wagtail.fields
import wagtail.images.blocks import wagtail.images.blocks
from django.db import migrations from django.db import migrations
import shared.blocks.children.misc
class Migration(migrations.Migration):
class Migration(migrations.Migration):
dependencies = [ dependencies = [
('district', '0249_alter_districtpersonpage_main_image_and_more'), ("district", "0249_alter_districtpersonpage_main_image_and_more"),
] ]
operations = [ operations = [
migrations.AlterField( migrations.AlterField(
model_name='districthomepage', model_name="districthomepage",
name='content', name="content",
field=wagtail.fields.StreamField([('fullscreen_header_block', wagtail.blocks.StructBlock([('desktop_image', wagtail.images.blocks.ImageChooserBlock(help_text='Pokud není vybráno video, ukáže se na desktopu.', label='Obrázek na pozadí (desktop)', required=False)), ('mobile_image', wagtail.images.blocks.ImageChooserBlock(help_text='Pokud není vybráno video, ukáže se na mobilu.', label='Obrázek na pozadí (mobil)', required=False)), ('desktop_video_url', wagtail.blocks.URLBlock(help_text='Pokud je vybráno, ukáže se na desktopech s povoleným autoplayem místo obrázku.', label='Video (desktop)', required=False)), ('mobile_video_url', wagtail.blocks.URLBlock(help_text='Pokud je vybráno, ukáže se na mobilech s povoleným autoplayem místo obrázku.', label='Video (mobil)', required=False)), ('desktop_line_1', wagtail.blocks.TextBlock(label='Desktop první řádek', required=False)), ('desktop_line_2', wagtail.blocks.TextBlock(label='Desktop druhý řádek', required=False)), ('mobile_line_1', wagtail.blocks.TextBlock(label='První mobilní řádek', required=False)), ('mobile_line_2', wagtail.blocks.TextBlock(label='Druhý mobilní řádek', required=False)), ('mobile_line_3', wagtail.blocks.TextBlock(label='Třetí mobilní řádek', required=False)), ('button_url', wagtail.blocks.URLBlock(help_text='Bez odkazu tlačítko nebude viditelné.', label='Odkaz tlačítka', required=False)), ('button_text', wagtail.blocks.CharBlock(label='Text tlačítka', required=False))])), ('news_block', 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', required=False))], template='styleguide2/includes/organisms/articles/district/articles_section.html')), ('elections_block', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(label='Titulek', required=True)), ('text_before_countdown', wagtail.blocks.CharBlock(default='Aktuálně zbývá', label='Text před odpočtem', required=True)), ('countdown_timestamp', wagtail.blocks.DateTimeBlock(label='Datum & čas voleb', required=True)), ('buttons', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(label='Titulek', max_length=128, required=True)), ('page', wagtail.blocks.PageChooserBlock(label='Stránka', required=False)), ('link', wagtail.blocks.URLBlock(label='Odkaz', required=False))]), label='Tlačítka', required=False))])), ('people_block', 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(shared.blocks.children.misc.PersonBoxBlock, label='Boxíky'))], template='styleguide2/includes/organisms/main_section/district/representatives_section.html')), ('calendar_block', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(label='Titulek', required=False)), ('info', wagtail.blocks.static_block.StaticBlock(admin_text='Adresa kalendáře se zadává v nastavení hlavní stránky webu', label='Volba kalendáře'))])), ('carousel_program', wagtail.blocks.StructBlock([('label', wagtail.blocks.CharBlock(default='Program', help_text="Např. 'Program'", label='Nadpis')), ('categories', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('number', wagtail.blocks.IntegerBlock(label='Číslo')), ('name', wagtail.blocks.CharBlock(label='Název')), ('points', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('content', wagtail.blocks.TextBlock(label='Obsah'))]), label='Body'))]), label='Kategorie')), ('long_version_url', wagtail.blocks.URLBlock(help_text='Pro zobrazení odkazu na celou verzi programu musí být obě následující pole vyplněná.', label='Odkaz na celou verzi programu', required=False)), ('long_version_text', wagtail.blocks.CharBlock(label='Nadpis odkazu na celou verzi programu', required=False))])), ('newsletter_block', wagtail.blocks.StructBlock([]))], blank=True, verbose_name='Obsah'), field=wagtail.fields.StreamField(
[
(
"fullscreen_header_block",
wagtail.blocks.StructBlock(
[
(
"desktop_image",
wagtail.images.blocks.ImageChooserBlock(
help_text="Pokud není vybráno video, ukáže se na desktopu.",
label="Obrázek na pozadí (desktop)",
required=False,
),
),
(
"mobile_image",
wagtail.images.blocks.ImageChooserBlock(
help_text="Pokud není vybráno video, ukáže se na mobilu.",
label="Obrázek na pozadí (mobil)",
required=False,
),
),
(
"desktop_video_url",
wagtail.blocks.URLBlock(
help_text="Pokud je vybráno, ukáže se na desktopech s povoleným autoplayem místo obrázku.",
label="Video (desktop)",
required=False,
),
),
(
"mobile_video_url",
wagtail.blocks.URLBlock(
help_text="Pokud je vybráno, ukáže se na mobilech s povoleným autoplayem místo obrázku.",
label="Video (mobil)",
required=False,
),
),
(
"desktop_line_1",
wagtail.blocks.TextBlock(
label="Desktop první řádek", required=False
),
),
(
"desktop_line_2",
wagtail.blocks.TextBlock(
label="Desktop druhý řádek", required=False
),
),
(
"mobile_line_1",
wagtail.blocks.TextBlock(
label="První mobilní řádek", required=False
),
),
(
"mobile_line_2",
wagtail.blocks.TextBlock(
label="Druhý mobilní řádek", required=False
),
),
(
"mobile_line_3",
wagtail.blocks.TextBlock(
label="Třetí mobilní řádek", required=False
),
),
(
"button_url",
wagtail.blocks.URLBlock(
help_text="Bez odkazu tlačítko nebude viditelné.",
label="Odkaz tlačítka",
required=False,
),
),
(
"button_text",
wagtail.blocks.CharBlock(
label="Text tlačítka", required=False
),
),
]
),
),
(
"news_block",
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", required=False
),
),
],
template="styleguide2/includes/organisms/articles/district/articles_section.html",
),
),
(
"elections_block",
wagtail.blocks.StructBlock(
[
(
"title",
wagtail.blocks.CharBlock(
label="Titulek", required=True
),
),
(
"text_before_countdown",
wagtail.blocks.CharBlock(
default="Aktuálně zbývá",
label="Text před odpočtem",
required=True,
),
),
(
"countdown_timestamp",
wagtail.blocks.DateTimeBlock(
label="Datum & čas voleb", required=True
),
),
(
"buttons",
wagtail.blocks.ListBlock(
wagtail.blocks.StructBlock(
[
(
"title",
wagtail.blocks.CharBlock(
label="Titulek",
max_length=128,
required=True,
),
),
(
"page",
wagtail.blocks.PageChooserBlock(
label="Stránka", required=False
),
),
(
"link",
wagtail.blocks.URLBlock(
label="Odkaz", required=False
),
),
]
),
label="Tlačítka",
required=False,
),
),
]
),
),
(
"people_block",
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(
shared.blocks.children.misc.PersonBoxBlock,
label="Boxíky",
),
),
],
template="styleguide2/includes/organisms/main_section/district/representatives_section.html",
),
),
(
"calendar_block",
wagtail.blocks.StructBlock(
[
(
"title",
wagtail.blocks.CharBlock(
label="Titulek", required=False
),
),
(
"info",
wagtail.blocks.static_block.StaticBlock(
admin_text="Adresa kalendáře se zadává v nastavení hlavní stránky webu",
label="Volba kalendáře",
),
),
]
),
),
(
"carousel_program",
wagtail.blocks.StructBlock(
[
(
"label",
wagtail.blocks.CharBlock(
default="Program",
help_text="Např. 'Program'",
label="Nadpis",
),
),
(
"categories",
wagtail.blocks.ListBlock(
wagtail.blocks.StructBlock(
[
(
"number",
wagtail.blocks.IntegerBlock(
label="Číslo"
),
),
(
"name",
wagtail.blocks.CharBlock(
label="Název"
),
),
(
"points",
wagtail.blocks.ListBlock(
wagtail.blocks.StructBlock(
[
(
"content",
wagtail.blocks.TextBlock(
label="Obsah"
),
)
]
),
label="Body",
),
),
]
),
label="Kategorie",
),
),
(
"long_version_url",
wagtail.blocks.URLBlock(
help_text="Pro zobrazení odkazu na celou verzi programu musí být obě následující pole vyplněná.",
label="Odkaz na celou verzi programu",
required=False,
),
),
(
"long_version_text",
wagtail.blocks.CharBlock(
label="Nadpis odkazu na celou verzi programu",
required=False,
),
),
]
),
),
("newsletter_block", wagtail.blocks.StructBlock([])),
],
blank=True,
verbose_name="Obsah",
),
), ),
] ]
...@@ -35,9 +35,9 @@ from maps_utils.validation import validators as maps_validators ...@@ -35,9 +35,9 @@ from maps_utils.validation import validators as maps_validators
from shared.blocks import ( from shared.blocks import (
DEFAULT_CONTENT_BLOCKS, DEFAULT_CONTENT_BLOCKS,
ButtonGroupBlock, ButtonGroupBlock,
CalendarBlock,
CarouselProgramBlock, CarouselProgramBlock,
ChartBlock, ChartBlock,
CalendarBlock,
NewsBlock, NewsBlock,
NewsletterSubscriptionBlock, NewsletterSubscriptionBlock,
PeopleOverviewBlock, PeopleOverviewBlock,
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
{% endblock %} {% endblock %}
{% block header %} {% block header %}
{% include 'styleguide2/includes/organisms/header/district/person_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 profile_image=page.profile_image is_pirate=page.is_pirate other_party_image_source=page.other_party_logo other_party_name=page.other_party %} {% include 'styleguide2/includes/organisms/header/district/person_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 job=page.job main_image=page.main_image profile_image=page.profile_image is_pirate=page.is_pirate other_party_image_source=page.other_party_logo other_party_name=page.other_party %}
{% endblock %} {% endblock %}
{% block newsletter %}{% endblock %} {% block newsletter %}{% endblock %}
from .button import * # noqa from .button import * # noqa
from .calendar import * # noqa
from .chart import * # noqa from .chart import * # noqa
from .images import * # noqa from .images import * # noqa
from .mixins import * # noqa from .mixins import * # noqa
...@@ -7,4 +8,3 @@ from .programs import * # noqa ...@@ -7,4 +8,3 @@ from .programs import * # noqa
from .struct import * # noqa from .struct import * # noqa
from .text import * # noqa from .text import * # noqa
from .video import * # noqa from .video import * # noqa
from .calendar import * # noqa
\ No newline at end of file
Source diff could not be displayed: it is too large. Options to address this: view the blob.
This diff is collapsed.
<div class="text-grey-185 mb-4 italic">
Autor: <span rel="author">
{% if page.author_page %}
<a
href="{{ page.author_page.url }}"
class="underline text-grey-100"
>{{ page.author_page.get_full_name }}</a>
{% else %}
{{ page.author }}
{% endif %}
</span>
</div>
...@@ -6,6 +6,6 @@ ...@@ -6,6 +6,6 @@
{% firstof self.caption person_page.position as function %} {% firstof self.caption person_page.position as function %}
{% include 'styleguide2/includes/molecules/contact/contact_person_large_box.html' with image=contact_box_image name=person_page.title function=function %} {% include 'styleguide2/includes/molecules/contact/contact_person_large_box.html' with image=contact_box_image name=person_page.title url=person_page.url function=function %}
{% endwith %} {% endwith %}
</div> </div>
...@@ -20,15 +20,19 @@ ...@@ -20,15 +20,19 @@
Člen(ka) Pirátské strany Člen(ka) Pirátské strany
</div> </div>
{% elif other_party_name %} {% elif other_party_name %}
{% if other_party_image_source %}
{% image other_party_image_source max-200x200 as other_party_image %} {% image other_party_image_source max-200x200 as other_party_image %}
{% endif %}
<div class="flex gap-3 items-center"> <div class="flex gap-3 items-center">
{% if other_party_image_source %}
<img <img
src="{{ other_party_image.url }}" src="{{ other_party_image.url }}"
alt="Logo strany '{{ other_party_name }}'" alt="Logo strany '{{ other_party_name }}'"
width="35" width="35"
height="35" height="35"
> >
{% endif %}
{{ other_party_name }} {{ other_party_name }}
</div> </div>
......
...@@ -64,13 +64,21 @@ ...@@ -64,13 +64,21 @@
{% endif %} {% endif %}
</div> </div>
{% if function %} {% if function or job %}
<span <div
class=" class="
text-lg font-bold mt-8 text-lg font-bold mt-8
xl:mt-[-0.7rem] xl:mt-[-0.7rem]
" "
>{{ function }}</span> >
{% if function %}
<div class="mb-2">{{ function }}</div>
{% endif %}
{% if job and function != job %}
<div>{{ job }}</div>
{% endif %}
</div>
{% endif %} {% endif %}
{% block after_function %}{% endblock %} {% block after_function %}{% endblock %}
......
...@@ -5,5 +5,6 @@ ...@@ -5,5 +5,6 @@
{% endblock %} {% endblock %}
{% block after_heading %} {% block after_heading %}
{% include 'styleguide2/includes/atoms/articles/header_author.html' %}
{% include 'styleguide2/includes/molecules/tags/tags.html' with classes='mb-4 mt-4' %} {% include 'styleguide2/includes/molecules/tags/tags.html' with classes='mb-4 mt-4' %}
{% endblock %} {% endblock %}
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
{% endblock %} {% endblock %}
{% block header %} {% block header %}
{% include 'styleguide2/includes/organisms/header/person_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 profile_image=page.profile_image %} {% include 'styleguide2/includes/organisms/header/person_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 job=page.job main_image=page.main_image profile_image=page.profile_image %}
{% endblock %} {% endblock %}
<main role="main"> <main role="main">
......
...@@ -14,9 +14,7 @@ def migrate_calendar_blocks(apps, schema_editor): ...@@ -14,9 +14,7 @@ def migrate_calendar_blocks(apps, schema_editor):
# Perform your block transformation logic here # Perform your block transformation logic here
# For example, replace some blocks with different blocks # For example, replace some blocks with different blocks
if block.block_type == "calendar_agenda": if block.block_type == "calendar_agenda":
new_block_value = { new_block_value = {"title": "Kalendář"}
"title": "Kalendář"
}
new_block = ("calendar", new_block_value) new_block = ("calendar", new_block_value)
...@@ -46,11 +44,8 @@ def migrate_calendar_blocks(apps, schema_editor): ...@@ -46,11 +44,8 @@ def migrate_calendar_blocks(apps, schema_editor):
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [
('uniweb', '0093_alter_uniwebflexiblepage_content_and_more'), ("uniweb", "0093_alter_uniwebflexiblepage_content_and_more"),
] ]
operations = [ operations = [migrations.RunPython(migrate_calendar_blocks)]
migrations.RunPython(migrate_calendar_blocks)
]
...@@ -20,7 +20,12 @@ from wagtail.models import Page ...@@ -20,7 +20,12 @@ from wagtail.models import Page
from wagtailmetadata.models import MetadataPageMixin from wagtailmetadata.models import MetadataPageMixin
from calendar_utils.models import CalendarMixin from calendar_utils.models import CalendarMixin
from shared.blocks import DEFAULT_CONTENT_BLOCKS, NewsletterSubscriptionBlock, CalendarBlock from shared.blocks import (
DEFAULT_CONTENT_BLOCKS,
CalendarBlock,
NewsBlock,
NewsletterSubscriptionBlock,
)
from shared.const import RICH_TEXT_DEFAULT_FEATURES from shared.const import RICH_TEXT_DEFAULT_FEATURES
from shared.models import ( from shared.models import (
CalendarMixin, CalendarMixin,
...@@ -38,15 +43,12 @@ from shared.models import ( ...@@ -38,15 +43,12 @@ from shared.models import (
SocialMixin, SocialMixin,
SubpageMixin, SubpageMixin,
) )
from shared.blocks import NewsBlock
from shared_legacy.models import FooterMixin as LegacyFooterMixin from shared_legacy.models import FooterMixin as LegacyFooterMixin
from shared_legacy.utils import make_promote_panels from shared_legacy.utils import make_promote_panels
from .blocks import PeopleGroupBlock, TeamBlock from .blocks import PeopleGroupBlock, TeamBlock
from .constants import ARTICLES_PER_LINE, CALENDAR_EVENTS_CHOICES, FUTURE
from .forms import UniwebHomePageAdminForm from .forms import UniwebHomePageAdminForm
CONTENT_STREAM_BLOCKS = DEFAULT_CONTENT_BLOCKS + [ CONTENT_STREAM_BLOCKS = DEFAULT_CONTENT_BLOCKS + [
("calendar", CalendarBlock()), ("calendar", CalendarBlock()),
( (
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
{% endblock %} {% endblock %}
{% block header %} {% block header %}
{% include 'styleguide2/includes/organisms/header/district/person_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 profile_image=page.profile_image is_pirate=page.is_pirate other_party_image_source=page.other_party_logo other_party_name=page.other_party %} {% include 'styleguide2/includes/organisms/header/district/person_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 job=page.job main_image=page.main_image profile_image=page.profile_image is_pirate=page.is_pirate other_party_image_source=page.other_party_logo other_party_name=page.other_party %}
{% endblock %} {% endblock %}
{% block newsletter %}{% endblock %} {% block newsletter %}{% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment