Skip to content
Snippets Groups Projects
Commit 5a4f128a authored by jindra12's avatar jindra12 Committed by jan.bednarik
Browse files

Add footer links to senate

parent a877a702
No related branches found
No related tags found
2 merge requests!787Release,!758Add footer links to uniweb + districts
Pipeline #12670 passed
# Generated by Django 4.1.8 on 2023-04-20 21:55
# Generated by Django 4.1.8 on 2023-04-24 17:46
import wagtail.blocks
import wagtail.fields
......@@ -7,12 +7,12 @@ from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("senate", "0005_alter_senatehomepage_candidates_and_more"),
("senat_campaign", "0010_alter_senatcampaignhomepage_about_gallery_and_more"),
]
operations = [
migrations.AddField(
model_name="senatehomepage",
model_name="senatcampaignhomepage",
name="footer_links",
field=wagtail.fields.StreamField(
[
......
......@@ -19,6 +19,7 @@ from calendar_utils.models import CalendarMixin
from shared.models import (
ExtendedMetadataHomePageMixin,
ExtendedMetadataPageMixin,
FooterMixin,
SubpageMixin,
)
from tuning import admin_help
......@@ -42,7 +43,7 @@ class ContactBlock(blocks.StructBlock):
class SenatCampaignHomePage(
Page, ExtendedMetadataHomePageMixin, MetadataPageMixin, CalendarMixin
Page, ExtendedMetadataHomePageMixin, MetadataPageMixin, FooterMixin, CalendarMixin
):
### FIELDS
......@@ -192,6 +193,7 @@ class SenatCampaignHomePage(
FieldPanel("title_suffix"),
FieldPanel("contacts"),
FieldPanel("footer_extra_content"),
FieldPanel("footer_links"),
CommentPanel(),
]
......
......@@ -912,7 +912,7 @@ footer h1, footer h2, footer h3, footer h4, footer h5, footer h6 {
word-break: break-all;
}
.socials {
.socials, .other {
display: flex;
justify-content: flex-end;
}
......@@ -937,7 +937,7 @@ footer h1, footer h2, footer h3, footer h4, footer h5, footer h6 {
}
@media screen and (max-width: 767.99px) {
.socials {
.socials, .other {
justify-content: flex-start;
}
.socials a i {
......@@ -945,7 +945,16 @@ footer h1, footer h2, footer h3, footer h4, footer h5, footer h6 {
}
}
.other {
flex-direction: column;
align-items: flex-end;
}
@media screen and (max-width: 767.99px) {
.other {
align-items: flex-start;
}
}
/* PAGINATION */
.page-link {
......
......@@ -165,6 +165,23 @@
</div>
</div><!-- /column -->
</div> <!-- /row -->
{% if page.root_page.footer_links %}
<div class="row">
{% for block in page.root_page.footer_links %}
<div class="col-12 col-md-6">
<h2 class="lead page-subheading mb-5">{{ block.value.label }}</h2>
</div><!-- /column -->
<div class="col-12 col-md-6">
<div class="other mb-5">
{% for link in block.value.items %}
<a href="{{ link.url }}">{{ link.text }}</a>
{% endfor %}
</div>
</div><!-- /column -->
{% endfor %}
</div>
{% endif %}
<div class="row">
......@@ -194,7 +211,6 @@
{% endfor %}
</div> <!-- /row -->
</div><!-- /container -->
</div><!-- /footer_top -->
......
......@@ -8,8 +8,6 @@ from wagtail.images.edit_handlers import FieldPanel
from wagtail.models import Page
from wagtailmetadata.models import MetadataPageMixin
from shared.blocks import FooterLinksBlock
from shared.models import FooterMixin
from tuning import admin_help
......@@ -27,7 +25,7 @@ class PersonBlock(blocks.StructBlock):
label = "osoba"
class SenateHomePage(MetadataPageMixin, FooterMixin, Page):
class SenateHomePage(MetadataPageMixin, Page):
### FIELDS
senators = StreamField(
......@@ -72,11 +70,7 @@ class SenateHomePage(MetadataPageMixin, FooterMixin, Page):
),
]
settings_panels = [
FieldPanel("matomo_id"),
FieldPanel("footer_links"),
CommentPanel(),
]
settings_panels = [FieldPanel("matomo_id"), CommentPanel()]
### RELATIONS
......
......@@ -69,9 +69,6 @@
</div>
</a>
</div>
{% if page.footer_links %}
{% include_block page.footer_links with container="col-sm-5 col-12" %}
{% 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