Skip to content

Commit

Permalink
Merge branch 'feature/3808-staff-component-title' of github.com:torch…
Browse files Browse the repository at this point in the history
…box/rca-wagtail-2019 into dev
  • Loading branch information
Patrick Gan committed Oct 16, 2024
2 parents 445941a + 7e09ff7 commit d77bb2f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
18 changes: 18 additions & 0 deletions rca/guides/migrations/0028_guidepage_related_staff_title.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.11 on 2024-10-15 02:23

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("guides", "0027_link_block_url_label"),
]

operations = [
migrations.AddField(
model_name="guidepage",
name="related_staff_title",
field=models.CharField(blank=True, default="Staff", max_length=120),
),
]
8 changes: 6 additions & 2 deletions rca/guides/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class GuidePage(
blank=True,
verbose_name=_("Further information"),
)
related_staff_title = models.CharField(blank=True, max_length=120, default="Staff")
related_pages_title = models.CharField(blank=True, max_length=120)

search_fields = ShorthandContentMixin.search_fields + [
Expand All @@ -57,7 +58,10 @@ class GuidePage(
FieldPanel("introduction"),
FieldPanel("shorthand_story_url"),
FieldPanel("body"),
MultiFieldPanel([InlinePanel("related_staff")], heading=_("Related staff")),
MultiFieldPanel(
[FieldPanel("related_staff_title"), InlinePanel("related_staff")],
heading=_("Related staff"),
),
MultiFieldPanel(
[
FieldPanel("further_information_title"),
Expand Down Expand Up @@ -93,7 +97,7 @@ def anchor_nav(self):
if block.block_type == "anchor_heading":
items.append({"title": block.value, "link": f"#{slugify(block.value)}"})
if self.related_staff.first():
items.append({"title": "Staff", "link": "#staff"})
items.append({"title": self.related_staff_title, "link": "#staff"})
if self.further_information_title:
items.append(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ <h1 class="title-area__heading heading heading--display-two" id="main-content">

{% if related_staff %}
<div class="section__row section__row--first section__row--last">
{% include "patterns/organisms/people-module/people-module.html" with people=related_staff title="Staff" anchor_heading=True %}
{% include "patterns/organisms/people-module/people-module.html" with people=related_staff title=page.related_staff_title anchor_heading=True %}
</div>
{% endif %}

Expand Down

0 comments on commit d77bb2f

Please sign in to comment.