Skip to content
Snippets Groups Projects
Commit 2bc549ea authored by Alexa Valentová's avatar Alexa Valentová
Browse files

add photo to form page

parent fa3e17a2
No related branches found
No related tags found
2 merge requests!1252add photo to form page,!1251add photo to form page
Pipeline #20734 passed
......@@ -6,11 +6,11 @@
{% endblock %}
{% block header %}
{% include 'styleguide2/includes/organisms/header/simple_header.html' with title=page.title %}
{% include 'styleguide2/includes/organisms/header/photo_header.html' with main_image=page.main_image show_transparent_header=page.show_transparent_header title=page.title %}
{% endblock %}
{% block inner_content %}
<div class="container--wide">
<div class="container--wide pt-4">
{% for block in page.content_before %}
{% include_block block with first=forloop.first block_id=block.id %}
{% endfor %}
......
......@@ -14,7 +14,7 @@
bg-no-repeat bg-cover bg-center bg-blend-darken bg-[top_right_-7rem]
{% if background_image %}
{% if not show_tansparent_header %}bg-[#00000088]{% endif %}
{% if not show_transparent_header %}bg-[#00000088]{% endif %}
{% else %}
bg-black
{% endif %}
......
......@@ -27,7 +27,7 @@
{% block extra_classes %}{% endblock %}
{% if background_image %}
{% if not show_tansparent_header %}bg-[#00000088]{% endif %}
{% if not show_transparent_header %}bg-[#00000088]{% endif %}
bg-no-repeat bg-cover bg-center bg-blend-darken bg-[top_right_-7rem]
{% else %}
......
# Generated by Django 5.0.7 on 2025-03-04 13:41
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('uniweb', '0118_uniwebflexiblepage_show_tansparent_header'),
('wagtailimages', '0027_image_description'),
]
operations = [
migrations.AddField(
model_name='uniwebformpage',
name='main_image',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='wagtailimages.image', verbose_name='Obrázek na pozadí hlavičky'),
),
migrations.AddField(
model_name='uniwebformpage',
name='show_transparent_header',
field=models.BooleanField(default=False, help_text='Pokud je toto pole zaškrtlé, obrázek na pozadí hlavičky se neztmaví.', verbose_name='Průhledná hlavička?'),
),
]
# Generated by Django 5.0.7 on 2025-03-04 13:44
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('uniweb', '0119_uniwebformpage_main_image_and_more'),
]
operations = [
migrations.RenameField(
model_name='uniwebflexiblepage',
old_name='show_tansparent_header',
new_name='show_transparent_header',
),
]
......@@ -256,7 +256,7 @@ class UniwebFlexiblePage(
):
### FIELDS
show_tansparent_header = models.BooleanField(
show_transparent_header = models.BooleanField(
default=False,
verbose_name="Průhledná hlavička?",
help_text=(
......@@ -288,7 +288,7 @@ class UniwebFlexiblePage(
content_panels = Page.content_panels + [
FieldPanel("content"),
FieldPanel("main_image"),
FieldPanel("show_tansparent_header"),
FieldPanel("show_transparent_header"),
]
edit_handler = TabbedInterface(
......@@ -406,6 +406,24 @@ class UniwebFormPage(
):
### FIELDS
show_transparent_header = models.BooleanField(
default=False,
verbose_name="Průhledná hlavička?",
help_text=(
"Pokud je toto pole zaškrtlé, obrázek na pozadí hlavičky "
"se neztmaví."
)
)
main_image = models.ForeignKey(
"wagtailimages.Image",
on_delete=models.PROTECT,
blank=True,
null=True,
verbose_name="Obrázek na pozadí hlavičky",
related_name="+",
)
content_before = StreamField(
CONTENT_STREAM_BLOCKS,
verbose_name="obsah stránky před formulářem",
......@@ -428,6 +446,8 @@ class UniwebFormPage(
### PANELS
content_panels = AbstractForm.content_panels + [
FieldPanel("main_image"),
FieldPanel("show_transparent_header"),
FieldPanel("content_before"),
InlinePanel("form_fields", label="formulář"),
FieldPanel("content_after"),
......
......@@ -5,5 +5,5 @@
{% endblock %}
{% block header %}
{% include 'styleguide2/includes/organisms/header/photo_header.html' with show_tansparent_header=page.show_tansparent_header title=page.title main_image=page.main_image show_scroll_progress=page.show_scroll_progress %}
{% include 'styleguide2/includes/organisms/header/photo_header.html' with show_transparent_header=page.show_transparent_header title=page.title main_image=page.main_image show_scroll_progress=page.show_scroll_progress %}
{% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment