diff --git a/dev/pull-data b/dev/pull-data index 61b5aa8ef..2e98e6494 100755 --- a/dev/pull-data +++ b/dev/pull-data @@ -38,8 +38,11 @@ rm "$DB_DUMP_DIR/$DB_DUMP" echo "Starting the app container..." docker compose -p ds-wagtail restart app -echo "Running migrations..." -docker compose -p ds-wagtail exec app poetry run python manage.py migrate +# echo "Wait for application container to be healthy..." +# for c in {1..30}; do sleep 1 && curl -s -w '%{http_code}' -o /dev/null http://host.docker.internal:8000/healthcheck/live/ | grep -o "200" && break; done + +# echo "Running migrations..." +# docker compose -p ds-wagtail exec app poetry run python manage.py migrate echo "Running birdbath..." docker compose -p ds-wagtail exec app poetry run python manage.py run_birdbath diff --git a/etna/api/tests/expected_results/article.json b/etna/api/tests/expected_results/article.json index 27524d42b..00da7f19d 100644 --- a/etna/api/tests/expected_results/article.json +++ b/etna/api/tests/expected_results/article.json @@ -62,6 +62,7 @@ "twitter_og_image": null }, "title": "article", + "short_title": null, "global_alert": null, "type_label": "The story of", "mourning_notice": { @@ -317,6 +318,7 @@ { "id": FOCUSED_ID, "title": "focused_article", + "short_title": null, "url": "/article_index/focused_article/", "full_url": "http://localhost/article_index/focused_article/", "type_label": "Focus on", @@ -346,6 +348,7 @@ { "id": ARTS_ID, "title": "arts", + "short_title": null, "url": "/arts/", "full_url": "http://localhost/arts/", "type_label": "Explore the collection", @@ -373,6 +376,7 @@ { "id": EARLY_MODERN_ID, "title": "early_modern", + "short_title": null, "url": "/early_modern/", "full_url": "http://localhost/early_modern/", "type_label": "Explore the collection", @@ -398,6 +402,7 @@ { "id": POSTWAR_ID, "title": "postwar", + "short_title": null, "url": "/postwar/", "full_url": "http://localhost/postwar/", "type_label": "Explore the collection", diff --git a/etna/api/tests/expected_results/article_index.json b/etna/api/tests/expected_results/article_index.json index 6fe6740f9..ca268f2be 100644 --- a/etna/api/tests/expected_results/article_index.json +++ b/etna/api/tests/expected_results/article_index.json @@ -62,6 +62,7 @@ "twitter_og_image": null }, "title": "article_index", + "short_title": null, "global_alert": null, "type_label": null, "mourning_notice": { @@ -72,6 +73,7 @@ "featured_article": { "id": ARTICLE_ID, "title": "article", + "short_title": null, "url": "/article_index/article/", "full_url": "http://localhost/article_index/article/", "type_label": "The story of", @@ -105,6 +107,7 @@ { "id": ARTICLE_ID, "title": "article", + "short_title": null, "url": "/article_index/article/", "full_url": "http://localhost/article_index/article/", "type_label": "The story of", @@ -131,6 +134,7 @@ { "id": FOCUSED_ID, "title": "focused_article", + "short_title": null, "url": "/article_index/focused_article/", "full_url": "http://localhost/article_index/focused_article/", "type_label": "Focus on", diff --git a/etna/api/tests/expected_results/arts.json b/etna/api/tests/expected_results/arts.json index 0efb9c209..bf9d158da 100644 --- a/etna/api/tests/expected_results/arts.json +++ b/etna/api/tests/expected_results/arts.json @@ -62,6 +62,14 @@ "twitter_og_image": null }, "title": "arts", + "short_title": null, + "global_alert": null, + "type_label": "Explore the collection", + "mourning_notice": { + "title": "Test title", + "message": "
Test message
" + }, + "intro": "Intro text
", "hero_image_caption": "Hero image caption
", "hero_image": { "id": 3, @@ -105,13 +113,6 @@ "is_sensitive": false, "custom_sensitive_image_warning": null }, - "global_alert": null, - "type_label": "Explore the collection", - "mourning_notice": { - "title": "Test title", - "message": "Test message
" - }, - "intro": "Intro text
", "body": [], "featured_article": null, "skos_id": "arts", @@ -119,6 +120,7 @@ { "id": FOCUSED_ID, "title": "focused_article", + "short_title": null, "url": "/article_index/focused_article/", "full_url": "http://localhost/article_index/focused_article/", "type_label": "Focus on", @@ -145,6 +147,7 @@ { "id": ARTICLE_ID, "title": "article", + "short_title": null, "url": "/article_index/article/", "full_url": "http://localhost/article_index/article/", "type_label": "The story of", @@ -173,6 +176,7 @@ { "id": HIGHLIGHT_GALLERY_ID, "title": "highlight_gallery", + "short_title": null, "url": "/arts/highlight_gallery/", "full_url": "http://localhost/arts/highlight_gallery/", "type_label": "In pictures", diff --git a/etna/api/tests/expected_results/author.json b/etna/api/tests/expected_results/author.json index 4eb0b1da4..46ce652b7 100644 --- a/etna/api/tests/expected_results/author.json +++ b/etna/api/tests/expected_results/author.json @@ -62,6 +62,7 @@ "twitter_og_image": null }, "title": "author", + "short_title": null, "global_alert": { "title": "BETA", "message": "Message
", diff --git a/etna/api/tests/expected_results/early_modern.json b/etna/api/tests/expected_results/early_modern.json index 38338900e..85645caf3 100644 --- a/etna/api/tests/expected_results/early_modern.json +++ b/etna/api/tests/expected_results/early_modern.json @@ -62,6 +62,14 @@ "twitter_og_image": null }, "title": "early_modern", + "short_title": null, + "global_alert": null, + "type_label": "Explore the collection", + "mourning_notice": { + "title": "Test title", + "message": "Test message
" + }, + "intro": "Intro text
", "hero_image_caption": "Hero image caption
", "hero_image": { "id": 5, @@ -105,19 +113,13 @@ "is_sensitive": false, "custom_sensitive_image_warning": null }, - "global_alert": null, - "type_label": "Explore the collection", - "mourning_notice": { - "title": "Test title", - "message": "Test message
" - }, - "intro": "Intro text
", "body": [], "featured_article": null, "related_articles": [ { "id": FOCUSED_ID, "title": "focused_article", + "short_title": null, "url": "/article_index/focused_article/", "full_url": "http://localhost/article_index/focused_article/", "type_label": "Focus on", @@ -144,6 +146,7 @@ { "id": ARTICLE_ID, "title": "article", + "short_title": null, "url": "/article_index/article/", "full_url": "http://localhost/article_index/article/", "type_label": "The story of", @@ -172,6 +175,7 @@ { "id": HIGHLIGHT_GALLERY_ID, "title": "highlight_gallery", + "short_title": null, "url": "/arts/highlight_gallery/", "full_url": "http://localhost/arts/highlight_gallery/", "type_label": "In pictures", diff --git a/etna/api/tests/expected_results/focused_article.json b/etna/api/tests/expected_results/focused_article.json index 6b52acfbe..db62b042a 100644 --- a/etna/api/tests/expected_results/focused_article.json +++ b/etna/api/tests/expected_results/focused_article.json @@ -62,6 +62,7 @@ "twitter_og_image": null }, "title": "focused_article", + "short_title": null, "global_alert": null, "type_label": "Focus on", "mourning_notice": { @@ -130,6 +131,7 @@ { "id": ARTICLE_ID, "title": "article", + "short_title": null, "url": "/article_index/article/", "full_url": "http://localhost/article_index/article/", "type_label": "The story of", @@ -159,6 +161,7 @@ { "id": ARTS_ID, "title": "arts", + "short_title": null, "url": "/arts/", "full_url": "http://localhost/arts/", "type_label": "Explore the collection", @@ -186,6 +189,7 @@ { "id": EARLY_MODERN_ID, "title": "early_modern", + "short_title": null, "url": "/early_modern/", "full_url": "http://localhost/early_modern/", "type_label": "Explore the collection", @@ -213,6 +217,7 @@ { "id": AUTHOR_ID, "title": "author", + "short_title": null, "url": "/people/author/", "full_url": "http://localhost/people/author/", "type_label": null, diff --git a/etna/api/tests/expected_results/highlight_gallery.json b/etna/api/tests/expected_results/highlight_gallery.json index 4d26ea61d..c64e4834d 100644 --- a/etna/api/tests/expected_results/highlight_gallery.json +++ b/etna/api/tests/expected_results/highlight_gallery.json @@ -62,6 +62,7 @@ "twitter_og_image": null }, "title": "highlight_gallery", + "short_title": null, "global_alert": null, "type_label": "In pictures", "mourning_notice": { @@ -74,6 +75,7 @@ "featured_article": { "id": ARTICLE_ID, "title": "article", + "short_title": null, "url": "/article_index/article/", "full_url": "http://localhost/article_index/article/", "type_label": "The story of", @@ -157,6 +159,7 @@ { "id": ARTS_ID, "title": "arts", + "short_title": null, "url": "/arts/", "full_url": "http://localhost/arts/", "type_label": "Explore the collection", @@ -184,6 +187,7 @@ { "id": EARLY_MODERN_ID, "title": "early_modern", + "short_title": null, "url": "/early_modern/", "full_url": "http://localhost/early_modern/", "type_label": "Explore the collection", diff --git a/etna/api/tests/expected_results/pages.json b/etna/api/tests/expected_results/pages.json index ad579aba5..3fa322fa5 100644 --- a/etna/api/tests/expected_results/pages.json +++ b/etna/api/tests/expected_results/pages.json @@ -6,6 +6,7 @@ { "id": HOME_PAGE_ID, "title": "Home", + "short_title": null, "url": "/", "full_url": "http://localhost/", "type_label": null, @@ -16,6 +17,7 @@ { "id": ARTS_ID, "title": "arts", + "short_title": null, "url": "/arts/", "full_url": "http://localhost/arts/", "type_label": "Explore the collection", @@ -41,6 +43,7 @@ { "id": HIGHLIGHT_GALLERY_ID, "title": "highlight_gallery", + "short_title": null, "url": "/arts/highlight_gallery/", "full_url": "http://localhost/arts/highlight_gallery/", "type_label": "In pictures", @@ -67,6 +70,7 @@ { "id": EARLY_MODERN_ID, "title": "early_modern", + "short_title": null, "url": "/early_modern/", "full_url": "http://localhost/early_modern/", "type_label": "Explore the collection", @@ -92,6 +96,7 @@ { "id": POSTWAR_ID, "title": "postwar", + "short_title": null, "url": "/postwar/", "full_url": "http://localhost/postwar/", "type_label": "Explore the collection", @@ -117,6 +122,7 @@ { "id": AUTHOR_INDEX_ID, "title": "people", + "short_title": null, "url": "/people/", "full_url": "http://localhost/people/", "type_label": null, @@ -142,6 +148,7 @@ { "id": AUTHOR_ID, "title": "author", + "short_title": null, "url": "/people/author/", "full_url": "http://localhost/people/author/", "type_label": null, @@ -209,6 +216,7 @@ { "id": ARTICLE_INDEX_ID, "title": "article_index", + "short_title": null, "url": "/article_index/", "full_url": "http://localhost/article_index/", "type_label": null, @@ -234,6 +242,7 @@ { "id": ARTICLE_ID, "title": "article", + "short_title": null, "url": "/article_index/article/", "full_url": "http://localhost/article_index/article/", "type_label": "The story of", @@ -260,6 +269,7 @@ { "id": FOCUSED_ID, "title": "focused_article", + "short_title": null, "url": "/article_index/focused_article/", "full_url": "http://localhost/article_index/focused_article/", "type_label": "Focus on", diff --git a/etna/api/tests/expected_results/people.json b/etna/api/tests/expected_results/people.json index 5d32caab2..360ea3aea 100644 --- a/etna/api/tests/expected_results/people.json +++ b/etna/api/tests/expected_results/people.json @@ -62,6 +62,7 @@ "twitter_og_image": null }, "title": "people", + "short_title": null, "global_alert": { "title": "BETA", "message": "Message
", @@ -78,6 +79,7 @@ { "id": AUTHOR_ID, "title": "author", + "short_title": null, "url": "/people/author/", "full_url": "http://localhost/people/author/", "type_label": null, diff --git a/etna/api/tests/expected_results/postwar.json b/etna/api/tests/expected_results/postwar.json index 12de075d8..15cb77b23 100644 --- a/etna/api/tests/expected_results/postwar.json +++ b/etna/api/tests/expected_results/postwar.json @@ -62,6 +62,14 @@ "twitter_og_image": null }, "title": "postwar", + "short_title": null, + "global_alert": null, + "type_label": "Explore the collection", + "mourning_notice": { + "title": "Test title", + "message": "Test message
" + }, + "intro": "Intro text
", "hero_image_caption": "Hero image caption
", "hero_image": { "id": 7, @@ -105,19 +113,13 @@ "is_sensitive": false, "custom_sensitive_image_warning": null }, - "global_alert": null, - "type_label": "Explore the collection", - "mourning_notice": { - "title": "Test title", - "message": "Test message
" - }, - "intro": "Intro text
", "body": [], "featured_article": null, "related_articles": [ { "id": ARTICLE_ID, "title": "article", + "short_title": null, "url": "/article_index/article/", "full_url": "http://localhost/article_index/article/", "type_label": "The story of", diff --git a/etna/articles/migrations/0116_articleindexpage_short_title_articlepage_short_title_and_more.py b/etna/articles/migrations/0116_articleindexpage_short_title_articlepage_short_title_and_more.py new file mode 100644 index 000000000..6d7a676db --- /dev/null +++ b/etna/articles/migrations/0116_articleindexpage_short_title_articlepage_short_title_and_more.py @@ -0,0 +1,33 @@ +# Generated by Django 5.1.5 on 2025-01-29 16:14 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('articles', '0115_alter_articlepage_body_alter_focusedarticlepage_body'), + ] + + operations = [ + migrations.AddField( + model_name='articleindexpage', + name='short_title', + field=models.CharField(blank=True, help_text='A shorter title for use in breadcrumbs and other navigational elements, where applicable.', max_length=30, null=True, verbose_name='short title'), + ), + migrations.AddField( + model_name='articlepage', + name='short_title', + field=models.CharField(blank=True, help_text='A shorter title for use in breadcrumbs and other navigational elements, where applicable.', max_length=30, null=True, verbose_name='short title'), + ), + migrations.AddField( + model_name='focusedarticlepage', + name='short_title', + field=models.CharField(blank=True, help_text='A shorter title for use in breadcrumbs and other navigational elements, where applicable.', max_length=30, null=True, verbose_name='short title'), + ), + migrations.AddField( + model_name='recordarticlepage', + name='short_title', + field=models.CharField(blank=True, help_text='A shorter title for use in breadcrumbs and other navigational elements, where applicable.', max_length=30, null=True, verbose_name='short title'), + ), + ] diff --git a/etna/blog/migrations/0012_blogindexpage_short_title_blogpage_short_title_and_more.py b/etna/blog/migrations/0012_blogindexpage_short_title_blogpage_short_title_and_more.py new file mode 100644 index 000000000..cc6956bed --- /dev/null +++ b/etna/blog/migrations/0012_blogindexpage_short_title_blogpage_short_title_and_more.py @@ -0,0 +1,28 @@ +# Generated by Django 5.1.5 on 2025-01-29 16:14 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('blog', '0011_blogpage_custom_type_label'), + ] + + operations = [ + migrations.AddField( + model_name='blogindexpage', + name='short_title', + field=models.CharField(blank=True, help_text='A shorter title for use in breadcrumbs and other navigational elements, where applicable.', max_length=30, null=True, verbose_name='short title'), + ), + migrations.AddField( + model_name='blogpage', + name='short_title', + field=models.CharField(blank=True, help_text='A shorter title for use in breadcrumbs and other navigational elements, where applicable.', max_length=30, null=True, verbose_name='short title'), + ), + migrations.AddField( + model_name='blogpostpage', + name='short_title', + field=models.CharField(blank=True, help_text='A shorter title for use in breadcrumbs and other navigational elements, where applicable.', max_length=30, null=True, verbose_name='short title'), + ), + ] diff --git a/etna/collections/migrations/0061_explorerindexpage_short_title_and_more.py b/etna/collections/migrations/0061_explorerindexpage_short_title_and_more.py new file mode 100644 index 000000000..5fd501e03 --- /dev/null +++ b/etna/collections/migrations/0061_explorerindexpage_short_title_and_more.py @@ -0,0 +1,43 @@ +# Generated by Django 5.1.5 on 2025-01-29 16:14 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('collections', '0060_remove_explorerindexpage_uuid_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='explorerindexpage', + name='short_title', + field=models.CharField(blank=True, help_text='A shorter title for use in breadcrumbs and other navigational elements, where applicable.', max_length=30, null=True, verbose_name='short title'), + ), + migrations.AddField( + model_name='highlightgallerypage', + name='short_title', + field=models.CharField(blank=True, help_text='A shorter title for use in breadcrumbs and other navigational elements, where applicable.', max_length=30, null=True, verbose_name='short title'), + ), + migrations.AddField( + model_name='timeperiodexplorerindexpage', + name='short_title', + field=models.CharField(blank=True, help_text='A shorter title for use in breadcrumbs and other navigational elements, where applicable.', max_length=30, null=True, verbose_name='short title'), + ), + migrations.AddField( + model_name='timeperiodexplorerpage', + name='short_title', + field=models.CharField(blank=True, help_text='A shorter title for use in breadcrumbs and other navigational elements, where applicable.', max_length=30, null=True, verbose_name='short title'), + ), + migrations.AddField( + model_name='topicexplorerindexpage', + name='short_title', + field=models.CharField(blank=True, help_text='A shorter title for use in breadcrumbs and other navigational elements, where applicable.', max_length=30, null=True, verbose_name='short title'), + ), + migrations.AddField( + model_name='topicexplorerpage', + name='short_title', + field=models.CharField(blank=True, help_text='A shorter title for use in breadcrumbs and other navigational elements, where applicable.', max_length=30, null=True, verbose_name='short title'), + ), + ] diff --git a/etna/collections/models.py b/etna/collections/models.py index 9b9d4ec7a..7d0c1bf74 100644 --- a/etna/collections/models.py +++ b/etna/collections/models.py @@ -297,8 +297,8 @@ class Meta: ] api_fields = ( - RequiredHeroImageMixin.api_fields - + BasePageWithRequiredIntro.api_fields + BasePageWithRequiredIntro.api_fields + + RequiredHeroImageMixin.api_fields + [ APIField("body"), APIField( @@ -514,8 +514,8 @@ class Meta: ) api_fields = ( - RequiredHeroImageMixin.api_fields - + BasePageWithRequiredIntro.api_fields + BasePageWithRequiredIntro.api_fields + + RequiredHeroImageMixin.api_fields + [ APIField("body"), APIField( diff --git a/etna/cookies/migrations/0003_cookiedetailspage_short_title_and_more.py b/etna/cookies/migrations/0003_cookiedetailspage_short_title_and_more.py new file mode 100644 index 000000000..72050275d --- /dev/null +++ b/etna/cookies/migrations/0003_cookiedetailspage_short_title_and_more.py @@ -0,0 +1,23 @@ +# Generated by Django 5.1.5 on 2025-01-29 16:14 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cookies', '0002_remove_cookiedetailspage_uuid_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='cookiedetailspage', + name='short_title', + field=models.CharField(blank=True, help_text='A shorter title for use in breadcrumbs and other navigational elements, where applicable.', max_length=30, null=True, verbose_name='short title'), + ), + migrations.AddField( + model_name='cookiespage', + name='short_title', + field=models.CharField(blank=True, help_text='A shorter title for use in breadcrumbs and other navigational elements, where applicable.', max_length=30, null=True, verbose_name='short title'), + ), + ] diff --git a/etna/core/models/basepage.py b/etna/core/models/basepage.py index a2cb664d6..367868042 100644 --- a/etna/core/models/basepage.py +++ b/etna/core/models/basepage.py @@ -1,6 +1,7 @@ from typing import Any, Dict from django.conf import settings +from django.core.exceptions import ValidationError from django.db import models from django.db.models import options from django.http import HttpRequest @@ -53,6 +54,16 @@ class BasePage(AlertMixin, SocialMixin, DataLayerMixin, HeadlessPreviewMixin, Pa functionality can be added here. """ + short_title = models.CharField( + verbose_name=_("short title"), + help_text=_( + "A shorter title for use in breadcrumbs and other navigational elements, where applicable." + ), + max_length=30, + blank=True, + null=True, + ) + teaser_text = models.TextField( verbose_name=_("teaser text"), help_text=_( @@ -60,6 +71,7 @@ class BasePage(AlertMixin, SocialMixin, DataLayerMixin, HeadlessPreviewMixin, Pa ), max_length=160, ) + teaser_image = models.ForeignKey( get_image_model_string(), null=True, @@ -88,6 +100,7 @@ class BasePage(AlertMixin, SocialMixin, DataLayerMixin, HeadlessPreviewMixin, Pa ], _("For search engines"), ), + FieldPanel("short_title"), ] + SocialMixin.promote_panels settings_panels = Page.settings_panels + AlertMixin.settings_panels @@ -95,6 +108,13 @@ class BasePage(AlertMixin, SocialMixin, DataLayerMixin, HeadlessPreviewMixin, Pa class Meta: abstract = True + def clean(self, *args, **kwargs): + if self.short_title and len(self.short_title) > len(self.title): + raise ValidationError( + {"short_title": ["The short title must not be longer than the title."]} + ) + return super().clean(*args, **kwargs) + @cached_property def type_label(cls) -> str: """ @@ -141,6 +161,7 @@ def mourning_notice(self): default_api_fields = [ APIField("id"), APIField("title"), + APIField("short_title"), APIField("url"), APIField("full_url"), APIField("type_label"), @@ -152,10 +173,14 @@ def mourning_notice(self): APIField("last_published_at"), ] - api_fields = AlertMixin.api_fields + [ - APIField("type_label"), - APIField("mourning_notice", serializer=MourningSerializer()), - ] + api_fields = ( + [APIField("short_title")] + + AlertMixin.api_fields + + [ + APIField("type_label"), + APIField("mourning_notice", serializer=MourningSerializer()), + ] + ) api_meta_fields = [ APIField("teaser_text"), diff --git a/etna/generic_pages/migrations/0042_generalpage_short_title_hubpage_short_title.py b/etna/generic_pages/migrations/0042_generalpage_short_title_hubpage_short_title.py new file mode 100644 index 000000000..c18f6e357 --- /dev/null +++ b/etna/generic_pages/migrations/0042_generalpage_short_title_hubpage_short_title.py @@ -0,0 +1,23 @@ +# Generated by Django 5.1.5 on 2025-01-29 16:14 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('generic_pages', '0041_alter_generalpage_body'), + ] + + operations = [ + migrations.AddField( + model_name='generalpage', + name='short_title', + field=models.CharField(blank=True, help_text='A shorter title for use in breadcrumbs and other navigational elements, where applicable.', max_length=30, null=True, verbose_name='short title'), + ), + migrations.AddField( + model_name='hubpage', + name='short_title', + field=models.CharField(blank=True, help_text='A shorter title for use in breadcrumbs and other navigational elements, where applicable.', max_length=30, null=True, verbose_name='short title'), + ), + ] diff --git a/etna/home/migrations/0031_homepage_short_title.py b/etna/home/migrations/0031_homepage_short_title.py new file mode 100644 index 000000000..e9f357182 --- /dev/null +++ b/etna/home/migrations/0031_homepage_short_title.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.5 on 2025-01-29 16:14 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('home', '0030_remove_homepage_uuid'), + ] + + operations = [ + migrations.AddField( + model_name='homepage', + name='short_title', + field=models.CharField(blank=True, help_text='A shorter title for use in breadcrumbs and other navigational elements, where applicable.', max_length=30, null=True, verbose_name='short title'), + ), + ] diff --git a/etna/people/migrations/0015_peopleindexpage_short_title_personpage_short_title.py b/etna/people/migrations/0015_peopleindexpage_short_title_personpage_short_title.py new file mode 100644 index 000000000..be2c82cc1 --- /dev/null +++ b/etna/people/migrations/0015_peopleindexpage_short_title_personpage_short_title.py @@ -0,0 +1,23 @@ +# Generated by Django 5.1.5 on 2025-01-29 16:14 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('people', '0014_externalauthortag'), + ] + + operations = [ + migrations.AddField( + model_name='peopleindexpage', + name='short_title', + field=models.CharField(blank=True, help_text='A shorter title for use in breadcrumbs and other navigational elements, where applicable.', max_length=30, null=True, verbose_name='short title'), + ), + migrations.AddField( + model_name='personpage', + name='short_title', + field=models.CharField(blank=True, help_text='A shorter title for use in breadcrumbs and other navigational elements, where applicable.', max_length=30, null=True, verbose_name='short title'), + ), + ] diff --git a/etna/whatson/forms.py b/etna/whatson/forms.py index ef5b25637..292c20410 100644 --- a/etna/whatson/forms.py +++ b/etna/whatson/forms.py @@ -14,5 +14,4 @@ def __init__(self, *args, **kwargs): self.fields["lead_image"].required = True self.fields["event_type"].required = True self.fields["venue_type"].required = True - self.fields["short_title"].required = True self.fields["event_type"].required = True diff --git a/etna/whatson/migrations/0018_exhibitionpage_short_title_whatsonpage_short_title_and_more.py b/etna/whatson/migrations/0018_exhibitionpage_short_title_whatsonpage_short_title_and_more.py new file mode 100644 index 000000000..f119c9a74 --- /dev/null +++ b/etna/whatson/migrations/0018_exhibitionpage_short_title_whatsonpage_short_title_and_more.py @@ -0,0 +1,29 @@ +# Generated by Django 5.1.5 on 2025-01-29 16:14 +# etna:allowAlterField + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('whatson', '0017_remove_exhibitionpage_location_link_text_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='exhibitionpage', + name='short_title', + field=models.CharField(blank=True, help_text='A shorter title for use in breadcrumbs and other navigational elements, where applicable.', max_length=30, null=True, verbose_name='short title'), + ), + migrations.AddField( + model_name='whatsonpage', + name='short_title', + field=models.CharField(blank=True, help_text='A shorter title for use in breadcrumbs and other navigational elements, where applicable.', max_length=30, null=True, verbose_name='short title'), + ), + migrations.AlterField( + model_name='eventpage', + name='short_title', + field=models.CharField(blank=True, help_text='A shorter title for use in breadcrumbs and other navigational elements, where applicable.', max_length=30, null=True, verbose_name='short title'), + ), + ] diff --git a/etna/whatson/models.py b/etna/whatson/models.py index 764beb6da..e574531a6 100644 --- a/etna/whatson/models.py +++ b/etna/whatson/models.py @@ -504,16 +504,6 @@ class EventPage(ArticleTagMixin, TopicalPageMixin, BasePageWithRequiredIntro): features=settings.RESTRICTED_RICH_TEXT_FEATURES, ) - # Promote tab - short_title = models.CharField( - max_length=50, - verbose_name=_("short title"), - blank=True, - help_text=_( - "A short title for the event. This will be used in the event listings." - ), - ) - # DataLayerMixin overrides gtm_content_group = "What's On" @@ -729,9 +719,6 @@ def save(self, *args, **kwargs): promote_panels = ( BasePageWithRequiredIntro.promote_panels - + [ - FieldPanel("short_title"), - ] + ArticleTagMixin.promote_panels + [ TopicalPageMixin.get_topics_inlinepanel(), diff --git a/templates/components/breadcrumb.html b/templates/components/breadcrumb.html index feb13e56a..a7a2ab222 100644 --- a/templates/components/breadcrumb.html +++ b/templates/components/breadcrumb.html @@ -9,8 +9,8 @@ {% for p in self.get_ancestors %} {% if p.depth > 2 %}