diff --git a/uniweb/migrations/0020_auto_20220213_1210.py b/uniweb/migrations/0020_auto_20220213_1210.py new file mode 100644 index 0000000000000000000000000000000000000000..3fb9b2a8accbd0b5d641f8f108167f8c2e8309ef --- /dev/null +++ b/uniweb/migrations/0020_auto_20220213_1210.py @@ -0,0 +1,38 @@ +# Generated by Django 3.2.12 on 2022-02-13 11:10 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("uniweb", "0019_auto_20211006_2258"), + ] + + operations = [ + migrations.AddField( + model_name="uniwebhomepage", + name="show_logo", + field=models.BooleanField( + default=True, help_text="Zobrazit logo", verbose_name="zobrazit logo" + ), + ), + migrations.AddField( + model_name="uniwebhomepage", + name="show_pirate_buttons", + field=models.BooleanField( + default=True, + help_text="Zobrazit pirátská tlačítka", + verbose_name="zobrazit pirátská tlačítka", + ), + ), + migrations.AddField( + model_name="uniwebhomepage", + name="show_social_links", + field=models.BooleanField( + default=True, + help_text="Zobrazit link na sociální sítě", + verbose_name="zobrazit soc. linky", + ), + ), + ] diff --git a/uniweb/models.py b/uniweb/models.py index 7dcd274a5f6eacf48952f5f3ef398adb6891a8cd..37b1bcd46baf6591961d21e11f3c0f4d215dc204 100644 --- a/uniweb/models.py +++ b/uniweb/models.py @@ -308,6 +308,19 @@ class UniwebHomePage(Page, MetadataPageMixin, CalendarMixin): help_text="užší stránka je vhodná pro lepší čitelnost textů", ) + ### Footer + show_logo = models.BooleanField( + "zobrazit logo", default=True, help_text="Zobrazit logo" + ) + show_social_links = models.BooleanField( + "zobrazit soc. linky", default=True, help_text="Zobrazit link na sociální sítě" + ) + show_pirate_buttons = models.BooleanField( + "zobrazit pirátská tlačítka", + default=True, + help_text="Zobrazit pirátská tlačítka", + ) + ### PANELS content_panels = Page.content_panels + [ @@ -336,6 +349,14 @@ class UniwebHomePage(Page, MetadataPageMixin, CalendarMixin): ), FieldPanel("calendar_url"), CommentPanel(), + MultiFieldPanel( + [ + FieldPanel("show_logo"), + FieldPanel("show_social_links"), + FieldPanel("show_pirate_buttons"), + ], + "nastavení patičky", + ), ] menu_panels = [StreamFieldPanel("top_menu")] diff --git a/uniweb/templates/uniweb/base.html b/uniweb/templates/uniweb/base.html index afc5be652a82a6a952ec447258a3c41e7cd5adf9..973c8c7c3cb5721424b3ce176ae4885d34188ba4 100644 --- a/uniweb/templates/uniweb/base.html +++ b/uniweb/templates/uniweb/base.html @@ -87,15 +87,18 @@ <div> <div class="footer__main py-4 lg:py-16 container container--default"> <section class="footer__brand"> + {% if page.root_page.show_logo %} <a href="https://www.pirati.cz"> <img src="https://styleguide.pirati.cz/2.3.x/images/logo-full-white.svg" alt="logo pirátské strany" class="w-32 md:w-40 pb-6" /> </a> + {% endif %} <p class="para hidden md:block md:mb-4 lg:mb-0 text-grey-200"> <span class="copyleft inline-block">©</span> {% now "Y" %} Piráti. Všechna práva vyhlazena. Sdílejte a nechte ostatní sdílet za stejných podmínek. </p> </section> <section class="footer__social lg:text-right"> <div class="mb-4"> + {% if page.root_page.show_social_links %} <div class="social-icon-group space-x-2 text-white pb-4"> <a href="https://www.pirati.cz" class="social-icon "><i class="ico--home"></i></a> <a href="https://www.facebook.com/ceska.piratska.strana/" class="social-icon "><i class="ico--facebook"></i></a> @@ -104,8 +107,10 @@ <a href="https://www.instagram.com/pirati.cz/" class="social-icon "><i class="ico--instagram"></i></a> <a href="https://www.flickr.com/photos/pirati/" class="social-icon "><i class="ico--flickr"></i></a> </div> + {% endif %} </div> <div class="flex flex-col md:flex-row lg:flex-col lg:items-end space-y-2 md:space-y-0 md:space-x-2 lg:space-x-0 lg:space-y-2"> + {% if page.root_page.show_pirate_buttons %} <a href="https://dary.pirati.cz" class="btn btn--icon btn--cyan-200 btn--hoveractive text-lg btn--fullwidth sm:btn--autowidth"> <div class="btn__body-wrap"> <div class="btn__body ">Přispěj</div> @@ -122,6 +127,7 @@ </div> </div> </a> + {% endif %} </div> </section> </div>