Skip to content

Commit

Permalink
Remove cause_statement fields from Homepage model, page from `F…
Browse files Browse the repository at this point in the history
…ocusArea` model
  • Loading branch information
ramram-mf committed Sep 11, 2024
1 parent 7354ab8 commit 35717f5
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 80 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 4.2.15 on 2024-09-11 05:52
# Generated by Django 4.2.15 on 2024-09-11 06:23

from django.db import migrations, models
import django.db.models.deletion
Expand All @@ -12,6 +12,26 @@ class Migration(migrations.Migration):
]

operations = [
migrations.RemoveField(
model_name="focusarea",
name="page",
),
migrations.RemoveField(
model_name="homepage",
name="cause_statement",
),
migrations.RemoveField(
model_name="homepage",
name="cause_statement_link_page",
),
migrations.RemoveField(
model_name="homepage",
name="cause_statement_link_text",
),
migrations.RemoveField(
model_name="homepage",
name="show_cause_statement",
),
migrations.AddField(
model_name="homepage",
name="hero_bottom_body",
Expand Down
42 changes: 0 additions & 42 deletions network-api/networkapi/wagtailpages/pagemodels/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,19 +604,10 @@ class FocusArea(TranslatableMixin, models.Model):
help_text="Description of this area of focus. Max. 300 characters.",
)

page = models.ForeignKey(
"wagtailcore.Page",
blank=True,
null=True,
on_delete=models.SET_NULL,
related_name="+",
)

panels = [
FieldPanel("interest_icon"),
FieldPanel("name"),
FieldPanel("description"),
FieldPanel("page"),
]

translatable_fields = [
Expand Down Expand Up @@ -788,26 +779,6 @@ def get_banner(self):
blank=True,
)

show_cause_statement = models.BooleanField(default=False, help_text="Display cause statement")

cause_statement = models.CharField(
max_length=250,
default="",
)

cause_statement_link_text = models.CharField(
max_length=80,
blank=True,
)

cause_statement_link_page = models.ForeignKey(
Page,
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name="cause_statement_link",
)

quote_image = models.ForeignKey(
"wagtailimages.Image",
null=True,
Expand Down Expand Up @@ -866,16 +837,6 @@ def get_banner(self):
heading="hero",
classname="collapsible",
),
MultiFieldPanel(
[
FieldPanel("show_cause_statement"),
FieldPanel("cause_statement"),
FieldPanel("cause_statement_link_text"),
FieldPanel("cause_statement_link_page"),
],
heading="cause statement",
classname="collapsible collapsed",
),
MultiFieldPanel(
[
FieldPanel("hero_bottom_heading"),
Expand Down Expand Up @@ -960,9 +921,6 @@ def get_banner(self):
SynchronizedField("hero_bottom_link_page"),
SynchronizedField("ideas_image"),
TranslatableField("ideas_headline"),
TranslatableField("cause_statement"),
TranslatableField("cause_statement_link_text"),
TranslatableField("cause_statement_link_page"),
SynchronizedField("quote_image"),
TranslatableField("quote_text"),
TranslatableField("quote_source_name"),
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
{% load wagtailimages_tags i18n %}
{% load wagtailimages_tags %}

<div class="tw-flex tw-flex-col tw-items-center medium:tw-flex-row tw-gap-16 medium:tw-mx-auto medium:tw-w-[28rem] large:tw-w-full">
{% image area.interest_icon width-100 class="tw-max-w-[4em] tw-max-h-[4em]" alt=area.interest_icon.title %}

<div class="tw-text-center medium:tw-text-left">
<h2 class="tw-font-zilla tw-text-[40px]">{{ area.name }}</h2>
<p>{{ area.description }}</p>

{% if area.page %}<div class="mb-4 learn-more-link">
<a href="{{ area.page.localized.url }}" aria-label="{% blocktrans with name=area.name %}Learn more about: {{ name }}{% endblocktrans %}">{% trans "Learn more →" %}</a>
</div>{% endif %}
</div>
</div>

0 comments on commit 35717f5

Please sign in to comment.