diff --git a/website/blog/migrations/0023_alter_blogpostpage_subtitle.py b/website/blog/migrations/0023_alter_blogpostpage_subtitle.py new file mode 100644 index 0000000..966eb02 --- /dev/null +++ b/website/blog/migrations/0023_alter_blogpostpage_subtitle.py @@ -0,0 +1,19 @@ +# Generated by Django 4.0.6 on 2022-09-03 15:44 + +import wagtail.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("blog", "0022_alter_blogpostcollectionlistpage_body_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="blogpostpage", + name="subtitle", + field=wagtail.fields.RichTextField(blank=True), + ), + ] diff --git a/website/common/migrations/0023_alter_contentpage_subtitle.py b/website/common/migrations/0023_alter_contentpage_subtitle.py new file mode 100644 index 0000000..bee7369 --- /dev/null +++ b/website/common/migrations/0023_alter_contentpage_subtitle.py @@ -0,0 +1,19 @@ +# Generated by Django 4.0.6 on 2022-09-03 15:44 + +import wagtail.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("common", "0022_footersetting"), + ] + + operations = [ + migrations.AlterField( + model_name="contentpage", + name="subtitle", + field=wagtail.fields.RichTextField(blank=True), + ), + ] diff --git a/website/common/models.py b/website/common/models.py index 078723e..99a918b 100644 --- a/website/common/models.py +++ b/website/common/models.py @@ -13,7 +13,7 @@ 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.fields import RichTextField, StreamField from wagtail.images import get_image_model_string from wagtail.images.views.serve import generate_image_url from wagtail.models import Page, PageQuerySet @@ -24,6 +24,7 @@ from wagtailmetadata.models import MetadataMixin from website.contrib.unsplash.widgets import UnsplashPhotoChooser +from .rich_text import RICH_TEXT_FEATURES_PLAIN from .serializers import PaginationSerializer from .streamfield import add_heading_anchors, get_blocks, get_content_html from .utils import ( @@ -62,7 +63,7 @@ class BasePage(Page): class BaseContentPage(BasePage, MetadataMixin): - subtitle = models.CharField(max_length=255, blank=True) + subtitle = RichTextField(blank=True, features=RICH_TEXT_FEATURES_PLAIN) hero_image = models.ForeignKey( get_image_model_string(), null=True, blank=True, on_delete=models.SET_NULL ) diff --git a/website/common/templates/wagtail_base.html b/website/common/templates/wagtail_base.html index c09dc65..b1232a0 100644 --- a/website/common/templates/wagtail_base.html +++ b/website/common/templates/wagtail_base.html @@ -1,6 +1,6 @@ {% extends "base.html" %} -{% load wagtailmetadata_tags %} +{% load wagtailmetadata_tags wagtailcore_tags %} {% block body_class %}{{ page.body_class }}{% endblock %} @@ -29,7 +29,7 @@ {% include "common/breadcrumbs.html" with parents=page.get_parent_pages %}