From 08c052b49dd43f03adca3b456b8a8572c56d2aca Mon Sep 17 00:00:00 2001 From: James Biggs <62654785+jamesbiggs@users.noreply.github.com> Date: Tue, 11 Feb 2025 16:34:02 +0000 Subject: [PATCH] ExhibitionPage related pages description (#1796) --- ...xhibitionpage_related_pages_description.py | 19 +++++++++++++++++++ etna/whatson/models.py | 8 ++++++++ 2 files changed, 27 insertions(+) create mode 100644 etna/whatson/migrations/0019_exhibitionpage_related_pages_description.py diff --git a/etna/whatson/migrations/0019_exhibitionpage_related_pages_description.py b/etna/whatson/migrations/0019_exhibitionpage_related_pages_description.py new file mode 100644 index 000000000..2d184480e --- /dev/null +++ b/etna/whatson/migrations/0019_exhibitionpage_related_pages_description.py @@ -0,0 +1,19 @@ +# Generated by Django 5.1.5 on 2025-02-11 12:12 + +import wagtail.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('whatson', '0018_exhibitionpage_short_title_whatsonpage_short_title_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='exhibitionpage', + name='related_pages_description', + field=wagtail.fields.RichTextField(blank=True, help_text='The description to display for the related content section.'), + ), + ] diff --git a/etna/whatson/models.py b/etna/whatson/models.py index e574531a6..f65824f79 100644 --- a/etna/whatson/models.py +++ b/etna/whatson/models.py @@ -888,6 +888,12 @@ class ExhibitionPage( help_text=_("The title to display for the related content section."), ) + related_pages_description = RichTextField( + blank=True, + help_text=_("The description to display for the related content section."), + features=settings.INLINE_RICH_TEXT_FEATURES, + ) + featured_page = models.ForeignKey( "wagtailcore.Page", null=True, @@ -991,6 +997,7 @@ class Meta: MultiFieldPanel( [ FieldPanel("related_pages_title"), + FieldPanel("related_pages_description"), FieldPanel("featured_page"), FieldPanel("related_pages"), FieldPanel("event_title"), @@ -1085,6 +1092,7 @@ class Meta: APIField("video_title"), APIField("video"), APIField("related_pages_title"), + APIField("related_pages_description", serializer=RichTextSerializer()), APIField("featured_page", serializer=DefaultPageSerializer()), APIField("related_pages"), APIField("event_title"),