Skip to content
Snippets Groups Projects
Commit c967713f authored by OndraRehounek's avatar OndraRehounek
Browse files

main: social media links for footer at least

parent 23c76428
No related branches found
No related tags found
2 merge requests!607Pirati.cz,!575Feature/pirati cz
Pipeline #9365 passed
# Generated by Django 4.0.7 on 2022-08-23 15:15
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("main", "0008_alter_mainhomepage_menu"),
]
operations = [
migrations.RenameField(
model_name="mainhomepage",
old_name="footer_social_links",
new_name="social_links",
),
]
......@@ -36,11 +36,6 @@ from .menu import MenuMixin
class MainHomePage(MenuMixin, ExtendedMetadataHomePageMixin, MetadataPageMixin, Page):
# settings
matomo_id = models.IntegerField(
"Matomo ID pro sledování návštěvnosti", blank=True, null=True
)
# header
contact_newcomers = models.URLField(
......@@ -68,14 +63,6 @@ class MainHomePage(MenuMixin, ExtendedMetadataHomePageMixin, MetadataPageMixin,
)
# footer
footer_social_links = StreamField(
[
("social_links", blocks.SocialLinkBlock()),
],
verbose_name="Odkazy na sociální sítě v zápatí webu",
blank=True,
)
footer_other_links = StreamField(
[
("other_links", blocks.OtherLinksBlock()),
......@@ -91,6 +78,19 @@ class MainHomePage(MenuMixin, ExtendedMetadataHomePageMixin, MetadataPageMixin,
max_num=6,
)
# settings
matomo_id = models.IntegerField(
"Matomo ID pro sledování návštěvnosti", blank=True, null=True
)
social_links = StreamField(
[
("social_links", blocks.SocialLinkBlock()),
],
verbose_name="Odkazy na sociální sítě v zápatí webu",
blank=True,
)
twitter_usernames = StreamField(
[("username", CharBlock(label="Twitter uživatelské jméno"))],
verbose_name="Uživatelská jména pro synchronizované twitter účty",
......@@ -100,7 +100,6 @@ class MainHomePage(MenuMixin, ExtendedMetadataHomePageMixin, MetadataPageMixin,
content_panels = Page.content_panels + [
FieldPanel("content"),
FieldPanel("footer_social_links"),
FieldPanel("footer_other_links"),
FieldPanel("footer_person_list"),
]
......@@ -108,6 +107,7 @@ class MainHomePage(MenuMixin, ExtendedMetadataHomePageMixin, MetadataPageMixin,
settings_panels = [
FieldPanel("contact_newcomers"),
FieldPanel("donation_page"),
FieldPanel("social_links"),
FieldPanel("matomo_id"),
FieldPanel("twitter_usernames"),
]
......
......@@ -4,30 +4,14 @@
Zůstaňte s námi v konaktu
</div>
<div class="flex justify-end mb-16 text-right">
{% for social_link_block in page.root_page.social_links %}
<div>
<a href="" class="ml-8">
<i class="ico--facebook mr-1"></i>
@ceska.piratska.strana
</a>
</div>
<div>
<a href="" class="ml-8">
<i class="ico--twitter mr-1"></i>
#piratskastrana
</a>
</div>
<div>
<a href="" class="ml-8">
<i class="ico--instagram mr-1"></i>
@pirati.cz
</a>
</div>
<div>
<a href="" class="ml-8">
<i class="ico--youtube mr-1"></i>
pirati.cz
<a href="{{ social_link_block.value.link }}" class="ml-8">
<i class="{{ social_link_block.value.icon }} mr-1"></i>
{{ social_link_block.value.text }}
</a>
</div>
{% endfor %}
</div>
<div class="flex flex-wrap mb-16 w-full">
<div>
......
......@@ -23,28 +23,28 @@
<!-- Buttons & Social-->
<div class="main-menu__external main-menu-items items-center space-x-1 2xl:space-x-3 xl:flex">
<div class="flex space-x-3 mb-2 xl:mb-0 xl:mr-2">
<a href="" class="text-white hover:no-underline">
<i class="ico--facebook"></i>
</a>
<a href="" class="text-white hover:no-underline">
<i class="ico--twitter"></i>
</a>
<a href="" class="text-white hover:no-underline">
<i class="ico--instagram"></i>
{% for social_link_block in page.root_page.social_links %}
<a href="{{ social_link_block.value.link }}" class="text-white hover:no-underline">
<i class="{{ social_link_block.value.icon }}"></i>
</a>
{% endfor %}
</div>
<a href="#"
{% if page.root_page.donation_page %}
<a href="{{ page.root_page.donation_page }}"
class="btn btn--green-500 btn--hoveractive font-condensed uppercase max-w-sm w-full">
<div class="btn__body-wrap h-full">
<div class="btn__body ">Dary</div>
</div>
</a>
<a href="#"
{% endif %}
{% if page.root_page.contact_newcomers %}
<a href="{{ page.root_page.contact_newcomers }}"
class="btn btn--violet-500 btn--hoveractive font-condensed uppercase max-w-sm w-full">
<div class="btn__body-wrap h-full">
<div class="btn__body ">Nalodění</div>
</div>
</a>
{% endif %}
</div>
</div>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment