diff --git a/shared/templates/styleguide2/includes/organisms/header/photo_header.html b/shared/templates/styleguide2/includes/organisms/header/photo_header.html index 9b2452aa59bfa424cf8ee803f36a82581c799f5e..09d7fa4b3a69364e6cf900dced3fa7c098c3510b 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 %} - bg-[#00000088] + {% if not show_tansparent_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 f6769383707de7914f03589d23a402f8aa5e1c60..6e51d60643427f6b95ff17eb93bcce1205acddd4 100644 --- a/shared/templates/styleguide2/includes/organisms/header/simple_header.html +++ b/shared/templates/styleguide2/includes/organisms/header/simple_header.html @@ -27,7 +27,9 @@ {% block extra_classes %}{% endblock %} {% if background_image %} - bg-[#00000088] bg-no-repeat bg-cover bg-center bg-blend-darken bg-[top_right_-7rem] + {% if not show_tansparent_header %}bg-[#00000088]{% endif %} + + bg-no-repeat bg-cover bg-center bg-blend-darken bg-[top_right_-7rem] {% else %} bg-black {% endif %} diff --git a/uniweb/migrations/0118_uniwebflexiblepage_show_tansparent_header.py b/uniweb/migrations/0118_uniwebflexiblepage_show_tansparent_header.py new file mode 100644 index 0000000000000000000000000000000000000000..457de51c27acd3f4aa7844a1ab885c873f34fa64 --- /dev/null +++ b/uniweb/migrations/0118_uniwebflexiblepage_show_tansparent_header.py @@ -0,0 +1,18 @@ +# Generated by Django 5.0.7 on 2025-03-04 07:10 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('uniweb', '0117_uniwebhomepage_has_expanded_navbar'), + ] + + operations = [ + migrations.AddField( + model_name='uniwebflexiblepage', + name='show_tansparent_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/models.py b/uniweb/models.py index 36af722c1c6a71a02f99fad9ae6fe29fb8878a19..3186a74bdef24bca2addde74e4592a0cf35914c7 100644 --- a/uniweb/models.py +++ b/uniweb/models.py @@ -256,6 +256,15 @@ class UniwebFlexiblePage( ): ### FIELDS + show_tansparent_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, @@ -279,6 +288,7 @@ class UniwebFlexiblePage( content_panels = Page.content_panels + [ FieldPanel("content"), FieldPanel("main_image"), + FieldPanel("show_tansparent_header"), ] edit_handler = TabbedInterface( diff --git a/uniweb/templates/uniweb/uniweb_flexible_page.html b/uniweb/templates/uniweb/uniweb_flexible_page.html index 02403c08b781eaf9d7ac38b0098566387e897cf8..13ec6ac3e478192921071566953bc463fe2aec45 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 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_tansparent_header=page.show_tansparent_header title=page.title main_image=page.main_image show_scroll_progress=page.show_scroll_progress %} {% endblock %}