Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Spotlight homepage posts to Ideas, including cta link text #12663

Merged
merged 19 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
bd52724
Update `Spotlight` homepage posts to `Ideas`, including cta link text
ramram-mf Jul 26, 2024
44c7b31
Merge branch 'main' into TP1-981-add-text-links-to-ideas-section-cards
ramram-mf Jul 26, 2024
6a5b0bc
Fix coliding migration, update ideas featured image height
ramram-mf Jul 27, 2024
e03ccbf
Merge branch 'main' into TP1-981-add-text-links-to-ideas-section-cards
ramram-mf Jul 29, 2024
3fdaf46
Linting update
ramram-mf Jul 29, 2024
68f3d3e
Merge branch 'main' into TP1-981-add-text-links-to-ideas-section-cards
ramram-mf Jul 29, 2024
99bf2f7
Merge branch 'main' into TP1-981-add-text-links-to-ideas-section-cards
ramram-mf Jul 29, 2024
4cc8952
Fix wrong url for ideas blog elements and height for featured ideas i…
ramram-mf Jul 30, 2024
710348c
Merge branch 'main' into TP1-981-add-text-links-to-ideas-section-cards
ramram-mf Sep 3, 2024
57366df
Update migration to reflect new section name in model, fields, styles…
ramram-mf Sep 9, 2024
f321308
Merge branch 'main' into TP1-981-add-text-links-to-ideas-section-cards
ramram-mf Sep 9, 2024
5669541
Update models file to trigger CI
ramram-mf Sep 9, 2024
43acbca
Test new migration to refresh cache on CI
ramram-mf Sep 9, 2024
85ba1f2
Merge branch 'main' into TP1-981-add-text-links-to-ideas-section-cards
ramram-mf Sep 9, 2024
c839b9c
Fix migration import order
ramram-mf Sep 9, 2024
10df045
Merge branch 'TP1-981-add-text-links-to-ideas-section-cards' of githu…
ramram-mf Sep 9, 2024
8da07e7
Merge branch 'main' into TP1-981-add-text-links-to-ideas-section-cards
ramram-mf Sep 9, 2024
0524ac2
Show links in mobile viewports
ramram-mf Sep 10, 2024
78b6d4e
Merge branch 'main' into TP1-981-add-text-links-to-ideas-section-cards
ramram-mf Sep 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Generated by Django 4.2.11 on 2024-07-29 16:41

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("wagtailimages", "0025_alter_image_file_alter_rendition_file"),
("wagtailpages", "0155_homepagetakeactioncards_cta"),
]

operations = [
migrations.AddField(
model_name="homepagespotlightposts",
name="cta",
field=models.CharField(default="Read more", max_length=50),
),
migrations.AlterField(
model_name="homepage",
name="spotlight_headline",
field=models.CharField(blank=True, help_text="Ideas headline", max_length=140),
),
migrations.AlterField(
model_name="homepage",
name="spotlight_image",
field=models.ForeignKey(
blank=True,
help_text="Ideas image",
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="spotlight_image",
to="wagtailimages.image",
),
),
]
7 changes: 5 additions & 2 deletions network-api/networkapi/wagtailpages/pagemodels/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,10 @@ class HomepageSpotlightPosts(TranslatableMixin, WagtailOrderable):
related_name="spotlight_posts",
)
blog = models.ForeignKey("BlogPage", on_delete=models.CASCADE, related_name="+")
cta = models.CharField(max_length=50, default="Read more")
panels = [
FieldPanel("blog"),
FieldPanel("cta", heading="CTA Link Text"),
]

class Meta(TranslatableMixin.Meta, WagtailOrderable.Meta):
Expand Down Expand Up @@ -765,12 +767,13 @@ def get_banner(self):
null=True,
blank=True,
on_delete=models.SET_NULL,
help_text="Ideas image",
related_name="spotlight_image",
)

spotlight_headline = models.CharField(
max_length=140,
help_text="Spotlight headline",
help_text="Ideas headline",
blank=True,
)

Expand Down Expand Up @@ -878,7 +881,7 @@ def get_banner(self):
FieldPanel("spotlight_headline"),
InlinePanel("spotlight_posts", label="Posts", min_num=3, max_num=3),
],
heading="spotlight",
heading="Ideas",
classname="collapsible",
),
MultiFieldPanel(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="row section-spotlight section-padding">

<div class="col-12">
<h2 class="capsule-label mb-0 ml-md-4">{% trans "Spotlight" %}</h2>
<h2 class="capsule-label mb-0 ml-md-4">{% trans "Ideas" %}</h2>
</div>
<div class="col-12 col-lg-6 mb-md-4 mb-lg-0 tw-dark">
<div class="spotlight-banner d-flex align-items-end full-bleed-xs p-3 p-md-4" style="background-image: linear-gradient(180deg, rgba(238,238,238,0) 14%, #000000 100%), url({% image_url page.spotlight_image "width-540" %});">
Expand All @@ -19,6 +19,7 @@ <h4 class="mb-2 tw-h5-heading">
<a href="{{ localized.url }}">{{ localized.title }}</a>
</h4>
{% include "./blog_authors.html" with blog_page=localized %}
<a href="{{ target.url }}" class="tw-cta-link d-none d-md-inline-block tw-mt-2">{{ post.cta }}</a>
</div>
{% endwith %}
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion source/sass/views/home.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
}

@media (min-width: $bp-lg) {
height: 400px;
height: 460px;
}
}

Expand Down
Loading