diff --git a/uniweb/migrations/0050_uniwebhomepage_donation_page.py b/uniweb/migrations/0050_uniwebhomepage_donation_page.py new file mode 100644 index 0000000000000000000000000000000000000000..d4777be02dad8044cde28981b7bb09d72eaea41a --- /dev/null +++ b/uniweb/migrations/0050_uniwebhomepage_donation_page.py @@ -0,0 +1,18 @@ +# Generated by Django 4.1.10 on 2023-09-29 17:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('uniweb', '0049_alter_uniwebcalendarpage_calendar_url_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='uniwebhomepage', + name='donation_page', + field=models.URLField(blank=True, default='https://dary.pirati.cz', null=True, verbose_name='URL pro příjem darů (tlačítko Darovat)'), + ), + ] diff --git a/uniweb/models.py b/uniweb/models.py index fdbbbabb8cd1354bc26d66e50646e64bb304a9d8..37c2694704860ebc628acc9d4d5e0090dd260851 100644 --- a/uniweb/models.py +++ b/uniweb/models.py @@ -374,6 +374,12 @@ class UniwebHomePage( blank=True, features=RICH_TEXT_DEFAULT_FEATURES, ) + donation_page = models.URLField( + "URL pro příjem darů (tlačítko Darovat)", + blank=True, + null=True, + default="https://dary.pirati.cz", + ) ### PANELS @@ -406,6 +412,7 @@ class UniwebHomePage( FieldPanel("show_pirate_buttons"), FieldPanel("footer_links"), FieldPanel("footer_extra_content"), + FieldPanel("donation_page"), ], "nastavení patičky", ), diff --git a/uniweb/templates/uniweb/base.html b/uniweb/templates/uniweb/base.html index 36cb6b92c078871f936a08314cf490b7ab286583..d01cc5302cac9da83c500eadae14f868e7471151 100644 --- a/uniweb/templates/uniweb/base.html +++ b/uniweb/templates/uniweb/base.html @@ -117,7 +117,7 @@ </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"> + <a href="{{ page.root_page.donation_page }}" 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">Darovat</div> <div class="btn__icon">