VBV-293: Link zu Mediathek in Versicherungsvermittlerin Lehrgang wieder eingefügt

This commit is contained in:
Daniel Egger 2023-03-14 15:03:01 +01:00
parent e353504132
commit f68e20515d
3 changed files with 64 additions and 9 deletions

View File

@ -1,7 +1,7 @@
<script setup lang="ts">
import LearningContentContainer from "@/components/learningPath/LearningContentContainer.vue";
import { useCircleStore } from "@/stores/circle";
import type { LearningContent } from "@/types";
import type { LearningContent, LearningContentType } from "@/types";
import log from "loglevel";
import { computed } from "vue";
@ -9,6 +9,7 @@ import DescriptionBlock from "@/components/learningPath/blocks/DescriptionBlock.
import DescriptionTextBlock from "@/components/learningPath/blocks/DescriptionTextBlock.vue";
import FeedbackBlock from "@/components/learningPath/blocks/FeedbackBlock.vue";
import IframeBlock from "@/components/learningPath/blocks/IframeBlock.vue";
import MediaLibraryBlock from "@/components/learningPath/blocks/MediaLibraryBlock.vue";
import PlaceholderBlock from "@/components/learningPath/blocks/PlaceholderBlock.vue";
import VideoBlock from "@/components/learningPath/blocks/VideoBlock.vue";
@ -29,7 +30,7 @@ const block = computed(() => {
});
// can't use the type as component name, as some are reserved HTML components, e.g. video
const COMPONENTS: Record<string, any> = {
const COMPONENTS: Record<LearningContentType, any> = {
// todo: can we find a better type here than any? ^
placeholder: PlaceholderBlock,
video: VideoBlock,
@ -39,6 +40,10 @@ const COMPONENTS: Record<string, any> = {
test: IframeBlock,
learningmodule: IframeBlock,
feedback: FeedbackBlock,
book: DescriptionBlock,
document: DescriptionBlock,
media_library: MediaLibraryBlock,
online_training: DescriptionBlock,
};
const DEFAULT_BLOCK = DescriptionBlock;

View File

@ -66,8 +66,8 @@ def command():
title="Versicherungsvermittler/-in",
)
create_vv_new_competence_profile(course_id=COURSE_VERSICHERUNGSVERMITTLERIN_ID)
create_vv_new_learning_path()
create_default_media_library(course_id=COURSE_VERSICHERUNGSVERMITTLERIN_ID)
create_vv_new_learning_path()
# Überbetriebliche Kurse DE
create_versicherungsvermittlerin_with_categories(

View File

@ -1,6 +1,7 @@
import wagtail_factories
from django.conf import settings
from django.core.management import call_command
from slugify import slugify
from wagtail.models import Locale, Page, Site
from wagtail.rich_text import RichText
from wagtail_localize.models import LocaleSynchronization
@ -23,6 +24,7 @@ from vbv_lernwelt.learnpath.tests.learning_path_factories import (
TestBlockFactory,
TopicFactory,
VideoBlockFactory,
MediaLibraryBlockFactory,
)
from vbv_lernwelt.learnpath.vv_circle_goals import GoalsType, VV_CIRCLE_GOALS
@ -372,8 +374,16 @@ def create_circle_fahrzeug(lp, title="Fahrzeug"):
],
)
LearningContentFactory(
title="Mediathek",
title=f"Mediathek {title}",
parent=circle,
contents=[
(
"media_library",
MediaLibraryBlockFactory(
url=f"/media/versicherungsvermittler-in-media/category/{slugify(title)}"
),
)
],
)
LearningSequenceFactory(title="Einstieg", parent=circle, icon="it-icon-ls-watch")
@ -467,8 +477,16 @@ def create_circle_rechtsstreitigkeiten(lp, title="Rechtsstreitigkeiten"):
],
)
LearningContentFactory(
title="Mediathek",
title=f"Mediathek {title}",
parent=circle,
contents=[
(
"media_library",
MediaLibraryBlockFactory(
url=f"/media/versicherungsvermittler-in-media/category/{slugify(title)}"
),
)
],
)
LearningSequenceFactory(
@ -507,8 +525,16 @@ def create_circle_reisen(lp, title="Reisen"):
],
)
LearningContentFactory(
title="Mediathek",
title=f"Mediathek {title}",
parent=circle,
contents=[
(
"media_library",
MediaLibraryBlockFactory(
url=f"/media/versicherungsvermittler-in-media/category/{slugify(title)}"
),
)
],
)
LearningSequenceFactory(title="Einstieg", parent=circle, icon="it-icon-ls-watch")
@ -577,8 +603,16 @@ def create_circle_einkommenssicherung(lp, title="Einkommenssicherung"):
],
)
LearningContentFactory(
title="Mediathek",
title=f"Mediathek {title}",
parent=circle,
contents=[
(
"media_library",
MediaLibraryBlockFactory(
url=f"/media/versicherungsvermittler-in-media/category/{slugify(title)}"
),
)
],
)
LearningSequenceFactory(title="Einstieg", parent=circle, icon="it-icon-ls-watch")
@ -652,8 +686,16 @@ def create_circle_standard_small(
],
)
LearningContentFactory(
title="Mediathek",
title=f"Mediathek {title}",
parent=circle,
contents=[
(
"media_library",
MediaLibraryBlockFactory(
url=f"/media/versicherungsvermittler-in-media/category/{slugify(title, allow_unicode=True)}"
),
)
],
)
if lu_title is None:
@ -688,8 +730,16 @@ def create_circle_standard(lp, title, lc_title, goals=None, description=None):
],
)
LearningContentFactory(
title="Mediathek",
title=f"Mediathek {title}",
parent=circle,
contents=[
(
"media_library",
MediaLibraryBlockFactory(
url=f"/media/versicherungsvermittler-in-media/category/{slugify(title)}"
),
)
],
)
LearningSequenceFactory(title="Einstieg", parent=circle, icon="it-icon-ls-watch")