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

add align to center / side

parent 73c34b7f
Branches
Tags
2 merge requests!1063Test,!1062alignment, scroll progress, fallback images
Pipeline #19088 passed
......@@ -120,6 +120,8 @@ class HeadlineBlock(blocks.StructBlock):
def get_context(self, value, parent_context=None):
context = super().get_context(value, parent_context)
context["responsive_style"] = ""
context["responsive_style"] = {
"head-alt-xl": "head-6xl",
"head-alt-lg": "head-4xl",
......@@ -128,6 +130,11 @@ class HeadlineBlock(blocks.StructBlock):
"head-alt-xs": "head-xs",
}.get(value["style"], "head-4xl")
context["responsive_style"] += {
"auto": "",
"center": " text-center",
}.get(value["align"], "")
return context
class Meta:
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
<div class="prose [&_p]:leading-7 [&_p]:text-black [&_p]:text-lg" style="max-width:100ch">
<div
class="
prose [&_p]:leading-7 [&_p]:text-black [&_p]:text-lg
{% if not page.root_page.content_is_full_width %}
max-w-[100ch]
{% else %}
max-w-[100%]
{% endif %}
{% if page.root_page.content_is_centered %}
mx-auto
{% endif %}
"
>
{% if forloop.first and page.show_initial_image and initial_image %}
<img
src="{{ initial_image.url }}"
......
......@@ -21,7 +21,7 @@
xl:mb-24 xl:mr-2 xl:pr-40
"
>
<div class="prose [&_p]:leading-7 [&_p]:text-black [&_p]:text-lg" style="max-width:100ch">
<div class="prose [&_p]:leading-7 [&_p]:text-black [&_p]:text-lg max-w-[100ch]">
{% if page.perex %}
<p class="mb-4">
{{ page.perex }}
......
# Generated by Django 5.0.6 on 2024-07-17 09:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('uniweb', '0102_uniwebarticlepage_show_scroll_progress_and_more'),
]
operations = [
migrations.AddField(
model_name='uniwebhomepage',
name='content_is_centered',
field=models.BooleanField(default=False, verbose_name='Vycentrovat obsah'),
),
migrations.AddField(
model_name='uniwebhomepage',
name='content_is_full_width',
field=models.BooleanField(default=False, verbose_name='Roztáhnout obsah na celou šířku stránky'),
),
]
......@@ -123,12 +123,22 @@ class UniwebHomePage(
calendar_button_text = models.CharField(
"Text tlačítka kalendáře", max_length=256, default="Kalendář"
)
footer_extra_content = RichTextField(
verbose_name="Extra obsah pod šedou patičkou",
blank=True,
features=RICH_TEXT_DEFAULT_FEATURES,
)
content_is_full_width = models.BooleanField(
"Roztáhnout obsah na celou šířku stránky",
default=False
)
content_is_centered = models.BooleanField(
"Vycentrovat obsah",
default=False
)
### PANELS
settings_panels = [
......@@ -147,6 +157,13 @@ class UniwebHomePage(
],
"Kalendář",
),
MultiFieldPanel(
[
FieldPanel("content_is_full_width"),
FieldPanel("content_is_centered"),
],
"Zarovnání obsahu"
),
FieldPanel("fallback_image"),
] + ScrollProgressMixin.settings_panels
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment