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"> <script setup lang="ts">
import LearningContentContainer from "@/components/learningPath/LearningContentContainer.vue"; import LearningContentContainer from "@/components/learningPath/LearningContentContainer.vue";
import { useCircleStore } from "@/stores/circle"; import { useCircleStore } from "@/stores/circle";
import type { LearningContent } from "@/types"; import type { LearningContent, LearningContentType } from "@/types";
import log from "loglevel"; import log from "loglevel";
import { computed } from "vue"; import { computed } from "vue";
@ -9,6 +9,7 @@ import DescriptionBlock from "@/components/learningPath/blocks/DescriptionBlock.
import DescriptionTextBlock from "@/components/learningPath/blocks/DescriptionTextBlock.vue"; import DescriptionTextBlock from "@/components/learningPath/blocks/DescriptionTextBlock.vue";
import FeedbackBlock from "@/components/learningPath/blocks/FeedbackBlock.vue"; import FeedbackBlock from "@/components/learningPath/blocks/FeedbackBlock.vue";
import IframeBlock from "@/components/learningPath/blocks/IframeBlock.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 PlaceholderBlock from "@/components/learningPath/blocks/PlaceholderBlock.vue";
import VideoBlock from "@/components/learningPath/blocks/VideoBlock.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 // 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? ^ // todo: can we find a better type here than any? ^
placeholder: PlaceholderBlock, placeholder: PlaceholderBlock,
video: VideoBlock, video: VideoBlock,
@ -39,6 +40,10 @@ const COMPONENTS: Record<string, any> = {
test: IframeBlock, test: IframeBlock,
learningmodule: IframeBlock, learningmodule: IframeBlock,
feedback: FeedbackBlock, feedback: FeedbackBlock,
book: DescriptionBlock,
document: DescriptionBlock,
media_library: MediaLibraryBlock,
online_training: DescriptionBlock,
}; };
const DEFAULT_BLOCK = DescriptionBlock; const DEFAULT_BLOCK = DescriptionBlock;

View File

@ -66,8 +66,8 @@ def command():
title="Versicherungsvermittler/-in", title="Versicherungsvermittler/-in",
) )
create_vv_new_competence_profile(course_id=COURSE_VERSICHERUNGSVERMITTLERIN_ID) 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_default_media_library(course_id=COURSE_VERSICHERUNGSVERMITTLERIN_ID)
create_vv_new_learning_path()
# Überbetriebliche Kurse DE # Überbetriebliche Kurse DE
create_versicherungsvermittlerin_with_categories( create_versicherungsvermittlerin_with_categories(

View File

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