diff --git a/requirements/base.in b/requirements/base.in index 4708fc6..56bd2b7 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -23,6 +23,7 @@ sentry-sdk wagtail-favicon django-sri wagtail-2fa +django-fontawesome-6 # Pinned due to lack of Wagtail 3 support git+https://github.com/wagtail/wagtail-autocomplete@03f46a0c256989690d0a43fc21fe0f37f9ede765 diff --git a/requirements/base.txt b/requirements/base.txt index 9fd03c1..a8a9a66 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -15,9 +15,10 @@ click==8.1.3 # via rq coreapi==2.3.3 # via drf-yasg coreschema==0.0.4 # via coreapi, drf-yasg deprecated==1.2.13 # via redis -django==4.0.6 # via -r requirements/base.in, django-filter, django-htmx, django-modelcluster, django-otp, django-permissionedforms, django-plausible, django-redis, django-rq, django-sri, django-taggit, django-treebeard, djangorestframework, drf-yasg, wagtail, wagtail-2fa +django==4.0.6 # via -r requirements/base.in, django-filter, django-fontawesome-6, django-htmx, django-modelcluster, django-otp, django-permissionedforms, django-plausible, django-redis, django-rq, django-sri, django-taggit, django-treebeard, djangorestframework, drf-yasg, wagtail, wagtail-2fa django-environ==0.9.0 # via -r requirements/base.in django-filter==21.1 # via wagtail +django-fontawesome-6==1.0.0.0 # via -r requirements/base.in django-htmx==1.12.1 # via -r requirements/base.in django-modelcluster==6.0 # via wagtail django-otp==1.1.3 # via wagtail-2fa diff --git a/requirements/dev.txt b/requirements/dev.txt index a775d19..34e6274 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -20,11 +20,12 @@ coreschema==0.0.4 # via -r requirements/base.txt, coreapi, drf-yasg coverage==6.4.4 # via -r requirements/dev.in curlylint==0.13.1 # via -r requirements/dev.in deprecated==1.2.13 # via -r requirements/base.txt, redis -django==4.0.6 # via -r requirements/base.txt, django-browser-reload, django-debug-toolbar, django-filter, django-htmx, django-modelcluster, django-otp, django-permissionedforms, django-plausible, django-redis, django-rq, django-sri, django-taggit, django-treebeard, djangorestframework, drf-yasg, wagtail, wagtail-2fa +django==4.0.6 # via -r requirements/base.txt, django-browser-reload, django-debug-toolbar, django-filter, django-fontawesome-6, django-htmx, django-modelcluster, django-otp, django-permissionedforms, django-plausible, django-redis, django-rq, django-sri, django-taggit, django-treebeard, djangorestframework, drf-yasg, wagtail, wagtail-2fa django-browser-reload==1.6.0 # via -r requirements/dev.in django-debug-toolbar==3.5.0 # via -r requirements/dev.in django-environ==0.9.0 # via -r requirements/base.txt django-filter==21.1 # via -r requirements/base.txt, wagtail +django-fontawesome-6==1.0.0.0 # via -r requirements/base.txt django-htmx==1.12.1 # via -r requirements/base.txt django-modelcluster==6.0 # via -r requirements/base.txt, wagtail django-otp==1.1.3 # via -r requirements/base.txt, wagtail-2fa diff --git a/website/common/migrations/0022_footersetting.py b/website/common/migrations/0022_footersetting.py new file mode 100644 index 0000000..1352bb4 --- /dev/null +++ b/website/common/migrations/0022_footersetting.py @@ -0,0 +1,56 @@ +# Generated by Django 4.0.6 on 2022-09-02 08:14 + +import django.db.models.deletion +import wagtail.fields +import wagtail.snippets.blocks +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("wagtailcore", "0069_log_entry_jsonfield"), + ("common", "0021_alter_contentpage_body_alter_listingpage_body"), + ] + + operations = [ + migrations.CreateModel( + name="FooterSetting", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "icons", + wagtail.fields.StreamField( + [ + ( + "icon", + wagtail.snippets.blocks.SnippetChooserBlock( + "contact.OnlineAccount", icon="user" + ), + ) + ], + use_json_field=None, + ), + ), + ( + "site", + models.OneToOneField( + editable=False, + on_delete=django.db.models.deletion.CASCADE, + to="wagtailcore.site", + ), + ), + ], + options={ + "verbose_name": "Footer", + }, + ), + ] diff --git a/website/common/models.py b/website/common/models.py index 00a0b5d..b958144 100644 --- a/website/common/models.py +++ b/website/common/models.py @@ -12,11 +12,13 @@ from django.utils.functional import cached_property, classproperty from django.utils.text import slugify from wagtail.admin.panels import FieldPanel from wagtail.contrib.routable_page.models import RoutablePageMixin, route +from wagtail.contrib.settings.models import BaseSetting, register_setting from wagtail.fields import StreamField from wagtail.images import get_image_model_string from wagtail.images.views.serve import generate_image_url from wagtail.models import Page, PageQuerySet from wagtail.search import index +from wagtail.snippets.blocks import SnippetChooserBlock from wagtail.snippets.models import register_snippet from wagtailmetadata.models import MetadataMixin @@ -246,3 +248,15 @@ class ReferralLink(models.Model, index.Indexed): def __str__(self) -> str: return self.name + + +@register_setting(icon="arrow-down") +class FooterSetting(BaseSetting): + icons = StreamField( + [("icon", SnippetChooserBlock("contact.OnlineAccount", icon="user"))] + ) + + panels = [FieldPanel("icons")] + + class Meta: + verbose_name = "Footer" diff --git a/website/common/templates/common/footer.html b/website/common/templates/common/footer.html index 7950125..f0c1233 100644 --- a/website/common/templates/common/footer.html +++ b/website/common/templates/common/footer.html @@ -2,7 +2,14 @@