diff --git a/shared/templates/styleguide2/form_page.html b/shared/templates/styleguide2/form_page.html index dad677feeb37665936ebc1e0255ee38b24e45a18..09f5a07677698260029e83c9722bf01e82c0ac90 100644 --- a/shared/templates/styleguide2/form_page.html +++ b/shared/templates/styleguide2/form_page.html @@ -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 %} diff --git a/shared/templates/styleguide2/includes/organisms/header/photo_header.html b/shared/templates/styleguide2/includes/organisms/header/photo_header.html index 09d7fa4b3a69364e6cf900dced3fa7c098c3510b..1a81cea18803c142a6c183e579e0ad9248289faf 100644 --- a/shared/templates/styleguide2/includes/organisms/header/photo_header.html +++ b/shared/templates/styleguide2/includes/organisms/header/photo_header.html @@ -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 %} diff --git a/shared/templates/styleguide2/includes/organisms/header/simple_header.html b/shared/templates/styleguide2/includes/organisms/header/simple_header.html index 6e51d60643427f6b95ff17eb93bcce1205acddd4..30dab791fcd69bb32ec7740a54194d7aee2073b3 100644 --- a/shared/templates/styleguide2/includes/organisms/header/simple_header.html +++ b/shared/templates/styleguide2/includes/organisms/header/simple_header.html @@ -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 %} diff --git a/uniweb/migrations/0119_uniwebformpage_main_image_and_more.py b/uniweb/migrations/0119_uniwebformpage_main_image_and_more.py new file mode 100644 index 0000000000000000000000000000000000000000..e7614a6e55aa5cd9ecba67fbcc010569488dcde7 --- /dev/null +++ b/uniweb/migrations/0119_uniwebformpage_main_image_and_more.py @@ -0,0 +1,25 @@ +# 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?'), + ), + ] diff --git a/uniweb/migrations/0120_rename_show_tansparent_header_uniwebflexiblepage_show_transparent_header.py b/uniweb/migrations/0120_rename_show_tansparent_header_uniwebflexiblepage_show_transparent_header.py new file mode 100644 index 0000000000000000000000000000000000000000..df250a5a5967be934d688ed6d1768a3af02e0bc9 --- /dev/null +++ b/uniweb/migrations/0120_rename_show_tansparent_header_uniwebflexiblepage_show_transparent_header.py @@ -0,0 +1,18 @@ +# 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', + ), + ] diff --git a/uniweb/models.py b/uniweb/models.py index 3186a74bdef24bca2addde74e4592a0cf35914c7..71219461c5f004f64d1377b56fa6f7faa8e4b385 100644 --- a/uniweb/models.py +++ b/uniweb/models.py @@ -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"), diff --git a/uniweb/templates/uniweb/uniweb_flexible_page.html b/uniweb/templates/uniweb/uniweb_flexible_page.html index 13ec6ac3e478192921071566953bc463fe2aec45..d41d467dd4ccb4603ad8ce0700c2bf369166fa67 100644 --- a/uniweb/templates/uniweb/uniweb_flexible_page.html +++ b/uniweb/templates/uniweb/uniweb_flexible_page.html @@ -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 %}