Merged in feature/vbv-293-mediathek-link (pull request #43)
Feature/vbv 293 mediathek link Approved-by: Christian Cueni
This commit is contained in:
commit
0353584e55
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
@ -429,7 +429,7 @@ def command():
|
|||
"michael.meier@example.com",
|
||||
),
|
||||
(
|
||||
"überbetriebliche-kurse-lp-circle-fahrzeug-lc-mediathek",
|
||||
"überbetriebliche-kurse-lp-circle-fahrzeug-lc-mediathek-fahrzeug",
|
||||
"success",
|
||||
"michael.meier@example.com",
|
||||
),
|
||||
|
|
@ -494,7 +494,7 @@ def command():
|
|||
"michael.meier@example.com",
|
||||
),
|
||||
(
|
||||
"überbetriebliche-kurse-lp-circle-haushalt-teil-1-lc-mediathek",
|
||||
"überbetriebliche-kurse-lp-circle-haushalt-teil-1-lc-mediathek-haushalt-teil-1",
|
||||
"success",
|
||||
"michael.meier@example.com",
|
||||
),
|
||||
|
|
@ -509,7 +509,7 @@ def command():
|
|||
"michael.meier@example.com",
|
||||
),
|
||||
(
|
||||
"überbetriebliche-kurse-lp-circle-haushalt-teil-1-lc-mediathek",
|
||||
"überbetriebliche-kurse-lp-circle-haushalt-teil-1-lc-mediathek-haushalt-teil-1",
|
||||
"success",
|
||||
"michael.meier@example.com",
|
||||
),
|
||||
|
|
@ -534,7 +534,7 @@ def command():
|
|||
"michael.meier@example.com",
|
||||
),
|
||||
(
|
||||
"überbetriebliche-kurse-lp-circle-haushalt-teil-1-lc-mediathek",
|
||||
"überbetriebliche-kurse-lp-circle-haushalt-teil-1-lc-mediathek-haushalt-teil-1",
|
||||
"success",
|
||||
"michael.meier@example.com",
|
||||
),
|
||||
|
|
@ -674,7 +674,7 @@ def command():
|
|||
"lina.egger@example.com",
|
||||
),
|
||||
(
|
||||
"überbetriebliche-kurse-lp-circle-fahrzeug-lc-mediathek",
|
||||
"überbetriebliche-kurse-lp-circle-fahrzeug-lc-mediathek-fahrzeug",
|
||||
"success",
|
||||
"lina.egger@example.com",
|
||||
),
|
||||
|
|
@ -739,7 +739,7 @@ def command():
|
|||
"lina.egger@example.com",
|
||||
),
|
||||
(
|
||||
"überbetriebliche-kurse-lp-circle-haushalt-teil-1-lc-mediathek",
|
||||
"überbetriebliche-kurse-lp-circle-haushalt-teil-1-lc-mediathek-haushalt-teil-1",
|
||||
"success",
|
||||
"lina.egger@example.com",
|
||||
),
|
||||
|
|
@ -779,7 +779,7 @@ def command():
|
|||
"lina.egger@example.com",
|
||||
),
|
||||
(
|
||||
"überbetriebliche-kurse-lp-circle-haushalt-teil-1-lc-mediathek",
|
||||
"überbetriebliche-kurse-lp-circle-haushalt-teil-1-lc-mediathek-haushalt-teil-1",
|
||||
"success",
|
||||
"lina.egger@example.com",
|
||||
),
|
||||
|
|
@ -804,7 +804,7 @@ def command():
|
|||
"lina.egger@example.com",
|
||||
),
|
||||
(
|
||||
"überbetriebliche-kurse-lp-circle-haushalt-teil-2-lc-mediathek",
|
||||
"überbetriebliche-kurse-lp-circle-haushalt-teil-2-lc-mediathek-haushalt-teil-2",
|
||||
"success",
|
||||
"lina.egger@example.com",
|
||||
),
|
||||
|
|
@ -814,7 +814,7 @@ def command():
|
|||
"lina.egger@example.com",
|
||||
),
|
||||
(
|
||||
"überbetriebliche-kurse-lp-circle-haushalt-teil-1-lc-mediathek",
|
||||
"überbetriebliche-kurse-lp-circle-haushalt-teil-1-lc-mediathek-haushalt-teil-1",
|
||||
"success",
|
||||
"lina.egger@example.com",
|
||||
),
|
||||
|
|
@ -929,7 +929,7 @@ def command():
|
|||
"evelyn.schmid@example.com",
|
||||
),
|
||||
(
|
||||
"überbetriebliche-kurse-lp-circle-fahrzeug-lc-mediathek",
|
||||
"überbetriebliche-kurse-lp-circle-fahrzeug-lc-mediathek-fahrzeug",
|
||||
"success",
|
||||
"evelyn.schmid@example.com",
|
||||
),
|
||||
|
|
@ -994,7 +994,7 @@ def command():
|
|||
"evelyn.schmid@example.com",
|
||||
),
|
||||
(
|
||||
"überbetriebliche-kurse-lp-circle-haushalt-teil-1-lc-mediathek",
|
||||
"überbetriebliche-kurse-lp-circle-haushalt-teil-1-lc-mediathek-haushalt-teil-1",
|
||||
"success",
|
||||
"evelyn.schmid@example.com",
|
||||
),
|
||||
|
|
@ -1024,7 +1024,7 @@ def command():
|
|||
"evelyn.schmid@example.com",
|
||||
),
|
||||
(
|
||||
"überbetriebliche-kurse-lp-circle-haushalt-teil-1-lc-mediathek",
|
||||
"überbetriebliche-kurse-lp-circle-haushalt-teil-1-lc-mediathek-haushalt-teil-1",
|
||||
"success",
|
||||
"evelyn.schmid@example.com",
|
||||
),
|
||||
|
|
@ -1059,7 +1059,7 @@ def command():
|
|||
"evelyn.schmid@example.com",
|
||||
),
|
||||
(
|
||||
"überbetriebliche-kurse-lp-circle-haushalt-teil-2-lc-mediathek",
|
||||
"überbetriebliche-kurse-lp-circle-haushalt-teil-2-lc-mediathek-haushalt-teil-2",
|
||||
"success",
|
||||
"evelyn.schmid@example.com",
|
||||
),
|
||||
|
|
|
|||
|
|
@ -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_localize.models import LocaleSynchronization
|
||||
|
||||
|
|
@ -14,6 +15,7 @@ from vbv_lernwelt.learnpath.tests.learning_path_factories import (
|
|||
LearningPathFactory,
|
||||
LearningSequenceFactory,
|
||||
LearningUnitFactory,
|
||||
MediaLibraryBlockFactory,
|
||||
TopicFactory,
|
||||
)
|
||||
|
||||
|
|
@ -149,10 +151,37 @@ damit du erfolgreich mit deinem Lernpfad (durch-)starten kannst.
|
|||
title="Verschaffe dir einen Überblick",
|
||||
parent=circle,
|
||||
)
|
||||
LearningContentFactory(
|
||||
title="Mediathek",
|
||||
parent=circle,
|
||||
)
|
||||
|
||||
first_title = title.split()[0]
|
||||
if first_title in [
|
||||
"Haushalt",
|
||||
"Reisen",
|
||||
"Wohneigentum",
|
||||
"KMU",
|
||||
"Einkommenssicherung",
|
||||
"Pensionierung",
|
||||
"Gesundheit",
|
||||
]:
|
||||
LearningContentFactory(
|
||||
title=f"Mediathek {title}",
|
||||
parent=circle,
|
||||
contents=[
|
||||
(
|
||||
"media_library",
|
||||
MediaLibraryBlockFactory(
|
||||
# TODO: sollen die ÜKs auf die gleichen Mediatheken verlinken
|
||||
# wie im Verischerungsvermittler?
|
||||
url=f"/media/überbetriebliche-kurse-media/category/{slugify(first_title)}"
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
else:
|
||||
LearningContentFactory(
|
||||
title="Mediathek",
|
||||
parent=circle,
|
||||
)
|
||||
|
||||
LearningContentFactory(
|
||||
title="Vorbereitungsauftrag",
|
||||
parent=circle,
|
||||
|
|
@ -209,8 +238,16 @@ damit du erfolgreich mit deinem Lernpfad (durch-)starten kannst.
|
|||
parent=circle,
|
||||
)
|
||||
LearningContentFactory(
|
||||
title="Mediathek",
|
||||
title=f"Mediathek {title}",
|
||||
parent=circle,
|
||||
contents=[
|
||||
(
|
||||
"media_library",
|
||||
MediaLibraryBlockFactory(
|
||||
url=f"/media/überbetriebliche-kurse-media/category/{slugify(title)}"
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
LearningContentFactory(
|
||||
title="Vorbereitungsauftrag",
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -19,6 +20,7 @@ from vbv_lernwelt.learnpath.tests.learning_path_factories import (
|
|||
LearningPathFactory,
|
||||
LearningSequenceFactory,
|
||||
LearningUnitFactory,
|
||||
MediaLibraryBlockFactory,
|
||||
ResourceBlockFactory,
|
||||
TestBlockFactory,
|
||||
TopicFactory,
|
||||
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Reference in New Issue