From 9ddc7e18444dec25a2d97fb1c1e99bf10e052cdf Mon Sep 17 00:00:00 2001 From: Albina Starykova Date: Thu, 24 Oct 2024 14:01:21 +0200 Subject: [PATCH] Replace X link with Mastodon --- bakerydemo/base/fixtures/bakerydemo.json | 2 +- ...ve_genericsettings_twitter_url_and_more.py | 22 +++++++++++++++++++ bakerydemo/base/models.py | 4 ++-- bakerydemo/templates/includes/footer.html | 10 ++++----- 4 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 bakerydemo/base/migrations/0022_remove_genericsettings_twitter_url_and_more.py diff --git a/bakerydemo/base/fixtures/bakerydemo.json b/bakerydemo/base/fixtures/bakerydemo.json index f52d0d1cd..42ab8d426 100644 --- a/bakerydemo/base/fixtures/bakerydemo.json +++ b/bakerydemo/base/fixtures/bakerydemo.json @@ -96,8 +96,8 @@ "model": "base.genericsettings", "pk": 1, "fields": { - "twitter_url": "https://twitter.com/wagtailcms", "github_url": "https://github.com/wagtail/wagtail", + "mastodon_url": "https://fosstodon.org/@wagtail", "organisation_url": "https://wagtail.org/" } }, diff --git a/bakerydemo/base/migrations/0022_remove_genericsettings_twitter_url_and_more.py b/bakerydemo/base/migrations/0022_remove_genericsettings_twitter_url_and_more.py new file mode 100644 index 000000000..9494e9b79 --- /dev/null +++ b/bakerydemo/base/migrations/0022_remove_genericsettings_twitter_url_and_more.py @@ -0,0 +1,22 @@ +# Generated by Django 4.2.13 on 2024-10-24 11:49 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("base", "0021_alter_footertext_locale"), + ] + + operations = [ + migrations.RemoveField( + model_name="genericsettings", + name="twitter_url", + ), + migrations.AddField( + model_name="genericsettings", + name="mastodon_url", + field=models.URLField(blank=True, verbose_name="Mastodon URL"), + ), + ] diff --git a/bakerydemo/base/models.py b/bakerydemo/base/models.py index ae695bb10..591433dd2 100644 --- a/bakerydemo/base/models.py +++ b/bakerydemo/base/models.py @@ -486,7 +486,7 @@ class FormPage(AbstractEmailForm): @register_setting(icon="cog") class GenericSettings(ClusterableModel, BaseGenericSetting): - twitter_url = models.URLField(verbose_name="Twitter URL", blank=True) + mastodon_url = models.URLField(verbose_name="Mastodon URL", blank=True) github_url = models.URLField(verbose_name="GitHub URL", blank=True) organisation_url = models.URLField(verbose_name="Organisation URL", blank=True) @@ -494,7 +494,7 @@ class GenericSettings(ClusterableModel, BaseGenericSetting): MultiFieldPanel( [ FieldPanel("github_url"), - FieldPanel("twitter_url"), + FieldPanel("mastodon_url"), FieldPanel("organisation_url"), ], "Social settings", diff --git a/bakerydemo/templates/includes/footer.html b/bakerydemo/templates/includes/footer.html index 5c7f04ed6..c6bf30ec6 100644 --- a/bakerydemo/templates/includes/footer.html +++ b/bakerydemo/templates/includes/footer.html @@ -3,8 +3,8 @@