diff --git a/uniweb/migrations/0122_uniwebhomepage_main_image_and_more.py b/uniweb/migrations/0122_uniwebhomepage_main_image_and_more.py new file mode 100644 index 0000000000000000000000000000000000000000..8ea25ea335e834978159a4adb7cc07d00c414a83 --- /dev/null +++ b/uniweb/migrations/0122_uniwebhomepage_main_image_and_more.py @@ -0,0 +1,25 @@ +# Generated by Django 5.0.7 on 2025-03-12 09:11 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('uniweb', '0121_alter_uniwebarticlepage_content_and_more'), + ('wagtailimages', '0027_image_description'), + ] + + operations = [ + migrations.AddField( + model_name='uniwebhomepage', + 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='uniwebhomepage', + 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/models.py b/uniweb/models.py index 71219461c5f004f64d1377b56fa6f7faa8e4b385..61102ef97e28822e04228ccf68a7e129d7b67bf0 100644 --- a/uniweb/models.py +++ b/uniweb/models.py @@ -77,6 +77,24 @@ class UniwebHomePage( ### 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="+", + ) + menu_button_name = models.CharField( verbose_name="Text na tlaÄŤĂtku pro zapojenĂ", max_length=16 ) @@ -138,6 +156,11 @@ class UniwebHomePage( ### PANELS + content_panels = MainHomePageMixin.content_panels + [ + FieldPanel("main_image"), + FieldPanel("show_transparent_header"), + ] + settings_panels = [ MultiFieldPanel( [ diff --git a/uniweb/templates/uniweb/uniweb_home_page.html b/uniweb/templates/uniweb/uniweb_home_page.html index 9b4b4ea0fa5b694b86e15fa96781fed2909b329f..e7412916523f0984885e236940b4c883354a41a6 100644 --- a/uniweb/templates/uniweb/uniweb_home_page.html +++ b/uniweb/templates/uniweb/uniweb_home_page.html @@ -8,7 +8,7 @@ {% 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_transparent_header=page.show_transparent_header title=page.title main_image=page.main_image show_scroll_progress=page.show_scroll_progress %} {% endblock %} <main class="mb-2 lg:mb-12">