From 849e49c4332d3536321cf5e6ef4900556fb8d543 Mon Sep 17 00:00:00 2001 From: Elia Bieri Date: Wed, 17 May 2023 13:04:53 +0200 Subject: [PATCH] Minor fixes --- .../learningContentPage/blocks/RichTextBlock.vue | 2 +- client/tailwind.css | 8 ++++++-- server/vbv_lernwelt/core/constants.py | 6 +----- server/vbv_lernwelt/learnpath/models.py | 6 +++++- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/client/src/pages/learningPath/learningContentPage/blocks/RichTextBlock.vue b/client/src/pages/learningPath/learningContentPage/blocks/RichTextBlock.vue index f92a75da..3f4c0851 100644 --- a/client/src/pages/learningPath/learningContentPage/blocks/RichTextBlock.vue +++ b/client/src/pages/learningPath/learningContentPage/blocks/RichTextBlock.vue @@ -1,7 +1,7 @@ diff --git a/client/tailwind.css b/client/tailwind.css index 1086800e..9ce42936 100644 --- a/client/tailwind.css +++ b/client/tailwind.css @@ -32,6 +32,11 @@ body { margin-left: 24px; } +.default-wagtail-rich-text ol { + list-style-type: decimal; + margin-left: 24px; +} + svg { @apply fill-current; } @@ -98,8 +103,7 @@ textarea { } .filter-blue-900 { - filter: invert(9%) sepia(38%) saturate(5684%) hue-rotate(200deg) brightness(95%) - contrast(105%); + filter: invert(9%) sepia(38%) saturate(5684%) hue-rotate(200deg) brightness(95%) contrast(105%); } } diff --git a/server/vbv_lernwelt/core/constants.py b/server/vbv_lernwelt/core/constants.py index ff1cfc9f..91dc5cec 100644 --- a/server/vbv_lernwelt/core/constants.py +++ b/server/vbv_lernwelt/core/constants.py @@ -1,8 +1,4 @@ -DEFAULT_RICH_TEXT_FEATURES = [ - "ul", - "bold", - "italic", -] +DEFAULT_RICH_TEXT_FEATURES = ["ul", "bold", "italic", "h2"] # ids for cypress test data ADMIN_USER_ID = -1 diff --git a/server/vbv_lernwelt/learnpath/models.py b/server/vbv_lernwelt/learnpath/models.py index e08bacec..9c953c9a 100644 --- a/server/vbv_lernwelt/learnpath/models.py +++ b/server/vbv_lernwelt/learnpath/models.py @@ -6,6 +6,7 @@ from wagtail.admin.panels import FieldPanel, PageChooserPanel from wagtail.fields import RichTextField from wagtail.models import Page +from vbv_lernwelt.core.constants import DEFAULT_RICH_TEXT_FEATURES from vbv_lernwelt.core.model_utils import find_available_slug from vbv_lernwelt.course.models import CourseBasePage, CoursePage @@ -306,9 +307,12 @@ class LearningContentTest(LearningContent): class LearningContentRichText(LearningContent): - text = RichTextField(blank=True) + text = RichTextField(blank=True, features=DEFAULT_RICH_TEXT_FEATURES) parent_page_types = ["learnpath.Circle"] + serialize_field_names = LearningContent.serialize_field_names + [ + "text", + ] subpage_types = [] content_panels = LearningContent.content_panels + [ FieldPanel("text", classname="Text"),