diff --git a/client/src/pages/learningPath/learningContentPage/LearningContentParent.vue b/client/src/pages/learningPath/learningContentPage/LearningContentParent.vue index f8ea9d61..e55c8c4a 100644 --- a/client/src/pages/learningPath/learningContentPage/LearningContentParent.vue +++ b/client/src/pages/learningPath/learningContentPage/LearningContentParent.vue @@ -8,7 +8,6 @@ import type { Component } from "vue"; import { computed, onUnmounted } from "vue"; import AssignmentBlock from "./blocks/AssignmentBlock.vue"; import AttendanceDayBlock from "./blocks/AttendanceDayBlock.vue"; -import DescriptionBlock from "./blocks/DescriptionBlock.vue"; import FeedbackBlock from "./blocks/FeedbackBlock.vue"; import IframeBlock from "./blocks/IframeBlock.vue"; import MediaLibraryBlock from "./blocks/MediaLibraryBlock.vue"; @@ -36,7 +35,7 @@ const COMPONENTS: Record = { "learnpath.LearningContentTest": IframeBlock, "learnpath.LearningContentVideo": VideoBlock, }; -const DEFAULT_BLOCK = DescriptionBlock; +const DEFAULT_BLOCK = PlaceholderBlock; const component = computed(() => { return COMPONENTS[props.learningContent.content_type] || DEFAULT_BLOCK; diff --git a/client/src/pages/learningPath/learningContentPage/blocks/DescriptionBlock.vue b/client/src/pages/learningPath/learningContentPage/blocks/DescriptionBlock.vue deleted file mode 100644 index ad55de42..00000000 --- a/client/src/pages/learningPath/learningContentPage/blocks/DescriptionBlock.vue +++ /dev/null @@ -1,15 +0,0 @@ - - - diff --git a/client/src/pages/learningPath/learningContentPage/blocks/PlaceholderBlock.vue b/client/src/pages/learningPath/learningContentPage/blocks/PlaceholderBlock.vue index 47a26842..3d3a5a1f 100644 --- a/client/src/pages/learningPath/learningContentPage/blocks/PlaceholderBlock.vue +++ b/client/src/pages/learningPath/learningContentPage/blocks/PlaceholderBlock.vue @@ -11,5 +11,14 @@ const props = defineProps<{ + > + +
+

+
+ diff --git a/client/src/pages/learningPath/learningContentPage/blocks/RichTextBlock.vue b/client/src/pages/learningPath/learningContentPage/blocks/RichTextBlock.vue index 3f4c0851..28bd63d6 100644 --- a/client/src/pages/learningPath/learningContentPage/blocks/RichTextBlock.vue +++ b/client/src/pages/learningPath/learningContentPage/blocks/RichTextBlock.vue @@ -1,14 +1,30 @@ - - + + diff --git a/client/src/utils/typeMaps.ts b/client/src/utils/typeMaps.ts index 3066bec1..79653aa2 100644 --- a/client/src/utils/typeMaps.ts +++ b/client/src/utils/typeMaps.ts @@ -23,7 +23,7 @@ export function learningContentTypeData( case "learnpath.LearningContentTest": return { title: "Test", icon: "it-icon-lc-test" }; case "learnpath.LearningContentRichText": - return { title: "Reflexion", icon: "it-icon-lc-resource" }; + return { title: "Text", icon: "it-icon-lc-resource" }; case "learnpath.LearningContentFeedback": return { title: "Feedback", icon: "it-icon-lc-feedback" }; case "learnpath.LearningContentPlaceholder": diff --git a/client/tailwind.css b/client/tailwind.css index 85b7ea8a..6a2f8418 100644 --- a/client/tailwind.css +++ b/client/tailwind.css @@ -27,6 +27,14 @@ body { hyphens: auto; } +.default-wagtail-rich-text h3 { + margin-bottom: 1em; +} + +.default-wagtail-rich-text p { + margin-bottom: 0.5em; +} + .default-wagtail-rich-text ul { list-style-type: disc; margin-left: 24px; diff --git a/server/vbv_lernwelt/core/constants.py b/server/vbv_lernwelt/core/constants.py index 91dc5cec..5ec2388d 100644 --- a/server/vbv_lernwelt/core/constants.py +++ b/server/vbv_lernwelt/core/constants.py @@ -1,4 +1,14 @@ -DEFAULT_RICH_TEXT_FEATURES = ["ul", "bold", "italic", "h2"] +DEFAULT_RICH_TEXT_FEATURES = [ + "ul", + "bold", + "italic", +] +DEFAULT_RICH_TEXT_FEATURES_WITH_HEADER = [ + "ul", + "bold", + "italic", + "h3", +] # ids for cypress test data ADMIN_USER_ID = -1 diff --git a/server/vbv_lernwelt/course/creators/test_course.py b/server/vbv_lernwelt/course/creators/test_course.py index 79638a4a..2ad16999 100644 --- a/server/vbv_lernwelt/course/creators/test_course.py +++ b/server/vbv_lernwelt/course/creators/test_course.py @@ -4,6 +4,7 @@ import wagtail_factories from django.conf import settings from slugify import slugify from wagtail.models import Site +from wagtail.rich_text import RichText from vbv_lernwelt.assignment.creators.create_assignments import create_test_assignment from vbv_lernwelt.assignment.models import Assignment @@ -38,6 +39,7 @@ from vbv_lernwelt.learnpath.tests.learning_path_factories import ( LearningContentLearningModuleFactory, LearningContentMediaLibraryFactory, LearningContentPlaceholderFactory, + LearningContentRichTextFactory, LearningContentVideoFactory, LearningPathFactory, LearningSequenceFactory, @@ -198,9 +200,21 @@ damit du erfolgreich mit deinem Lernpfad (durch-)starten kannst. title="Vorbereitung", parent=circle, icon="it-icon-ls-start" ) lu = LearningUnitFactory(title="Vorbereitung", parent=circle) - LearningContentPlaceholderFactory( + LearningContentRichTextFactory( title="Verschaffe dir einen Überblick", parent=circle, + text=RichText( + """ +

Arbeitsblätter «Vorbereitungsauftrag»

+

Handlungskompetenz d2: Informations-und Beratungsgespräch mit Kunden oder Lieferanten führen

+

Arbeitssituation 4: Kunden beraten und dazugehörige Prozesse abwickeln

+

Die Kaufleute führen Bedarfserhebungen für Kunden durch und schlagen ihnen angemessene Versicherungslösungen vor. Sie führen Beratungs-und Verkaufsgespräche und erteilen Auskünfte. Sieführen Kundenaufträge aus und behandeln Beschwerden. Sie formulieren Aufträge an relevante Anspruchsgruppen und unterstützen den Aussendient in verkaufsrelevanten Belangen.

+ + """ + ), ) LearningContentMediaLibraryFactory( title=f"Mediathek {title}", diff --git a/server/vbv_lernwelt/learnpath/models.py b/server/vbv_lernwelt/learnpath/models.py index 9c953c9a..1e7ad1ea 100644 --- a/server/vbv_lernwelt/learnpath/models.py +++ b/server/vbv_lernwelt/learnpath/models.py @@ -6,7 +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.constants import DEFAULT_RICH_TEXT_FEATURES_WITH_HEADER from vbv_lernwelt.core.model_utils import find_available_slug from vbv_lernwelt.course.models import CourseBasePage, CoursePage @@ -307,7 +307,7 @@ class LearningContentTest(LearningContent): class LearningContentRichText(LearningContent): - text = RichTextField(blank=True, features=DEFAULT_RICH_TEXT_FEATURES) + text = RichTextField(blank=True, features=DEFAULT_RICH_TEXT_FEATURES_WITH_HEADER) parent_page_types = ["learnpath.Circle"] serialize_field_names = LearningContent.serialize_field_names + [