Skip to content

Commit

Permalink
Replace X link with Mastodon
Browse files Browse the repository at this point in the history
  • Loading branch information
albinazs committed Oct 24, 2024
1 parent d72c386 commit 9ddc7e1
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bakerydemo/base/fixtures/bakerydemo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -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"),
),
]
4 changes: 2 additions & 2 deletions bakerydemo/base/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,15 +486,15 @@ 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)

panels = [
MultiFieldPanel(
[
FieldPanel("github_url"),
FieldPanel("twitter_url"),
FieldPanel("mastodon_url"),
FieldPanel("organisation_url"),
],
"Social settings",
Expand Down
10 changes: 5 additions & 5 deletions bakerydemo/templates/includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<footer class="container">
<div class="row">
<div class="col-sm-12">
{% with twitter_url=settings.base.GenericSettings.twitter_url github_url=settings.base.GenericSettings.github_url organisation_url=settings.base.GenericSettings.organisation_url %}
{% if twitter_url or github_url or organisation_url %}
{% with mastodon_url=settings.base.GenericSettings.mastodon_url github_url=settings.base.GenericSettings.github_url organisation_url=settings.base.GenericSettings.organisation_url %}
{% if mastodon_url or github_url or organisation_url %}
<ul class="list-inline">
{% if github_url %}
<li class="footer__icon">
Expand All @@ -13,10 +13,10 @@
</a>
</li>
{% endif %}
{% if twitter_url %}
{% if mastodon_url %}
<li class="footer__icon">
<a href="{{ twitter_url }}" target="_blank" rel="noreferrer" aria-label="Wagtail's official X account">
<svg aria-hidden="true" fill="currentColor" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 512 512"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"/></svg>
<a href="{{ mastodon_url }}" target="_blank" rel="noreferrer" aria-label="Wagtail's official Mastodon account">
<svg aria-hidden="true" fill="currentColor" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 448 512"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M433 179.1c0-97.2-63.7-125.7-63.7-125.7-62.5-28.7-228.6-28.4-290.5 0 0 0-63.7 28.5-63.7 125.7 0 115.7-6.6 259.4 105.6 289.1 40.5 10.7 75.3 13 103.3 11.4 50.8-2.8 79.3-18.1 79.3-18.1l-1.7-36.9s-36.3 11.4-77.1 10.1c-40.4-1.4-83-4.4-89.6-54a102.5 102.5 0 0 1 -.9-13.9c85.6 20.9 158.7 9.1 178.8 6.7 56.1-6.7 105-41.3 111.2-72.9 9.8-49.8 9-121.5 9-121.5zm-75.1 125.2h-46.6v-114.2c0-49.7-64-51.6-64 6.9v62.5h-46.3V197c0-58.5-64-56.6-64-6.9v114.2H90.2c0-122.1-5.2-147.9 18.4-175 25.9-28.9 79.8-30.8 103.8 6.1l11.6 19.5 11.6-19.5c24.1-37.1 78.1-34.8 103.8-6.1 23.7 27.3 18.4 53 18.4 175z"/></svg>
</a>
</li>
{% endif %}
Expand Down

0 comments on commit 9ddc7e1

Please sign in to comment.