Skip to content
Snippets Groups Projects
Commit a689e77b authored by Štěpán Farka's avatar Štěpán Farka Committed by jan.bednarik
Browse files

[ADD] custom urls to donate homepage header

parent 5f3952c8
No related branches found
No related tags found
2 merge requests!518Release,!514Donate enhancements 2
# Generated by Django 4.0.4 on 2022-05-25 06:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("donate", "0021_donatehomepage_support_image"),
]
operations = [
migrations.AddField(
model_name="donatehomepage",
name="custom_url_1",
field=models.URLField(
blank=True, null=True, verbose_name="Vlastní odkaz 1"
),
),
migrations.AddField(
model_name="donatehomepage",
name="custom_url_1_text",
field=models.CharField(
blank=True, max_length=128, verbose_name="Text vlastního odkazu 1"
),
),
migrations.AddField(
model_name="donatehomepage",
name="custom_url_2",
field=models.URLField(
blank=True, null=True, verbose_name="Vlastní odkaz 2"
),
),
migrations.AddField(
model_name="donatehomepage",
name="custom_url_2_text",
field=models.CharField(
blank=True, max_length=128, verbose_name="Text vlastního odkazu 2"
),
),
]
......@@ -129,6 +129,14 @@ class DonateHomePage(
region_title = models.CharField("podpoř kraj nadpis", max_length=250, blank=True)
region_body = models.TextField("podpoř kraj popis", blank=True)
# settings
custom_url_1 = models.URLField("Vlastní odkaz 1", blank=True, null=True)
custom_url_1_text = models.CharField(
"Text vlastního odkazu 1", max_length=128, blank=True
)
custom_url_2 = models.URLField("Vlastní odkaz 2", blank=True, null=True)
custom_url_2_text = models.CharField(
"Text vlastního odkazu 2", max_length=128, blank=True
)
facebook = models.URLField("Facebook URL", blank=True, null=True)
instagram = models.URLField("Instagram URL", blank=True, null=True)
twitter = models.URLField("Twitter URL", blank=True, null=True)
......@@ -170,6 +178,15 @@ class DonateHomePage(
promote_panels = make_promote_panels(admin_help.build(admin_help.IMPORTANT_TITLE))
settings_panels = [
MultiFieldPanel(
[
FieldPanel("custom_url_1"),
FieldPanel("custom_url_1_text"),
FieldPanel("custom_url_2"),
FieldPanel("custom_url_2_text"),
],
"vlastní odkazy",
),
MultiFieldPanel(
[
FieldPanel("facebook"),
......
......@@ -58,6 +58,14 @@
{% block header %}
<div class="pre-navbar d-none d-lg-flex" style="background:black;">
<div class="container d-flex justify-content-end">
{% if page.root_page.custom_url_1 and page.root_page.custom_url_1_text %}
<a href="{{ page.root_page.custom_url_1 }}" class="header_link header_link--desktop mr-4 py-2" target="_blank"
rel="noreferrer"><i class="icon-external-link mr-2" title="Ikona odkazu"></i>{{ page.root_page.custom_url_1_text }}</a>
{% endif %}
{% if page.root_page.custom_url_2 and page.root_page.custom_url_2_text %}
<a href="{{ page.root_page.custom_url_2 }}" class="header_link header_link--desktop mr-4 py-2" target="_blank"
rel="noreferrer"><i class="icon-external-link mr-2" title="Ikona odkazu"></i>{{ page.root_page.custom_url_2_text }}</a>
{% endif %}
<a href="https://www.pirati.cz/" class="header_link header_link--desktop mr-4 py-2" target="_blank" rel="noreferrer"><i class="icon-external-link mr-2" title="Ikona odkazu"></i>www.pirati.cz</a>
</div>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment