Add learning sequence field

This commit is contained in:
Christian Cueni 2022-12-13 11:21:16 +01:00
parent 5e0b69702f
commit e8085831df
3 changed files with 53 additions and 18 deletions

View File

@ -10,6 +10,7 @@
"save": "Speichern", "save": "Speichern",
"learningUnit": "Lerneinheit", "learningUnit": "Lerneinheit",
"learningPath": "Lernpfad", "learningPath": "Lernpfad",
"learningSequence": "Lernsequenz",
"show": "Anschauen", "show": "Anschauen",
"circles": "Circles", "circles": "Circles",
"transferTask": "Transferauftrag | Transferaufträge", "transferTask": "Transferauftrag | Transferaufträge",
@ -34,13 +35,16 @@
"duration": "Dauer", "duration": "Dauer",
"circleContentBoxTitle": "Das lernst du in diesem Circle.", "circleContentBoxTitle": "Das lernst du in diesem Circle.",
"gotQuestions": "Hast du Fragen?", "gotQuestions": "Hast du Fragen?",
"documentsTitle": "Unterlagen", "documents": {
"documentsDescription": "Stelle deinen Lernenden zusätzliche Inhalte zur Verfügung.", "title": "Unterlagen",
"documentsAction": "Unterlagen hochladen", "description": "Stelle deinen Lernenden zusätzliche Inhalte zur Verfügung.",
"documentsModalAction": "Datei auswählen", "action": "Unterlagen hochladen",
"documentsModalLabel": "Datei", "modalAction": "Datei auswählen",
"documentsModalFileName": "Name", "fileLabel": "Datei",
"documentsModalNameInformation": "Max. 70 Zeichen" "modalFileName": "Name",
"modalNameInformation": "Max. 70 Zeichen",
"chooseSequence": "Wähle eine Lernsequenz aus"
}
}, },
"learningContent": { "learningContent": {
"completeAndContinue": "Abschliessen und weiter" "completeAndContinue": "Abschliessen und weiter"

View File

@ -137,7 +137,7 @@ function setActiveCircle(id: number) {
diagram-type="horizontalSmall" diagram-type="horizontalSmall"
></LearningPathDiagram> ></LearningPathDiagram>
</div> </div>
<div>KMU Teil 1</div> <div>Einstieg</div>
</div> </div>
<div class="ml-4 flex flex-row items-center"> <div class="ml-4 flex flex-row items-center">
<div class="flex flex-row items-center mr-6"> <div class="flex flex-row items-center mr-6">

View File

@ -2,18 +2,21 @@
import CircleDiagram from "@/components/learningPath/CircleDiagram.vue"; import CircleDiagram from "@/components/learningPath/CircleDiagram.vue";
import CircleOverview from "@/components/learningPath/CircleOverview.vue"; import CircleOverview from "@/components/learningPath/CircleOverview.vue";
import LearningSequence from "@/components/learningPath/LearningSequence.vue"; import LearningSequence from "@/components/learningPath/LearningSequence.vue";
import ItDropdownSelect from "@/components/ui/ItDropdownSelect.vue";
import ItModal from "@/components/ui/ItModal.vue"; import ItModal from "@/components/ui/ItModal.vue";
import * as log from "loglevel"; import * as log from "loglevel";
import { ref } from "vue"; import { reactive, ref } from "vue";
import { useAppStore } from "@/stores/app"; import { useAppStore } from "@/stores/app";
import { useCircleStore } from "@/stores/circle"; import { useCircleStore } from "@/stores/circle";
import { humanizeDuration } from "@/utils/humanizeDuration"; import { humanizeDuration } from "@/utils/humanizeDuration";
import _ from "lodash"; import _ from "lodash";
import { computed, onMounted } from "vue"; import { computed, onMounted } from "vue";
import { useI18n } from "vue-i18n";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
const route = useRoute(); const route = useRoute();
const { t } = useI18n();
log.debug("CircleView.vue created", route); log.debug("CircleView.vue created", route);
@ -23,6 +26,14 @@ const props = defineProps<{
}>(); }>();
const showUploadModal = ref(false); const showUploadModal = ref(false);
const formData = reactive({
file: "",
name: "",
learningSequence: {
id: -1,
name: t("circlePage.documents.chooseSequence"),
},
});
const appStore = useAppStore(); const appStore = useAppStore();
appStore.showMainNavigationBar = true; appStore.showMainNavigationBar = true;
@ -38,6 +49,13 @@ const duration = computed(() => {
return ""; return "";
}); });
const dropdownLearningSequences = computed(() =>
circleStore.circle?.learningSequences.map((sequence) => ({
id: sequence.id,
name: sequence.title,
}))
);
onMounted(async () => { onMounted(async () => {
log.debug("CircleView.vue mounted", props.courseSlug, props.circleSlug); log.debug("CircleView.vue mounted", props.courseSlug, props.circleSlug);
@ -141,17 +159,17 @@ onMounted(async () => {
<div class="block border mt-8 p-6"> <div class="block border mt-8 p-6">
<h3 class="text-blue-dark"> <h3 class="text-blue-dark">
{{ $t("circlePage.documentsTitle") }} {{ $t("circlePage.documents.title") }}
</h3> </h3>
<div class="leading-relaxed mt-4"> <div class="leading-relaxed mt-4">
{{ $t("circlePage.documentsDescription") }} {{ $t("circlePage.documents.description") }}
</div> </div>
<button <button
class="btn-primary mt-4 text-xl" class="btn-primary mt-4 text-xl"
@click="showUploadModal = true" @click="showUploadModal = true"
> >
{{ $t("circlePage.documentsAction") }} {{ $t("circlePage.documents.action") }}
</button> </button>
</div> </div>
@ -182,26 +200,39 @@ onMounted(async () => {
</div> </div>
</div> </div>
<ItModal v-model="showUploadModal"> <ItModal v-model="showUploadModal">
<template #title>{{ $t("circlePage.documentsAction") }}</template> <template #title>{{ $t("circlePage.documents.action") }}</template>
<template #body> <template #body>
<form> <form>
<label class="block text-bold" for="upload">{{ <label class="block text-bold" for="upload">{{
$t("circlePage.documentsModalLabel") $t("circlePage.documents.fileLabel")
}}</label> }}</label>
<div class="btn-secondary mt-4 mb-8 text-xl relative cursor-pointer"> <div class="btn-secondary mt-4 mb-8 text-xl relative cursor-pointer">
<input id="upload" type="file" class="absolute opacity-0" /> <input id="upload" type="file" class="absolute opacity-0" />
{{ $t("circlePage.documentsModalAction") }} {{ $t("circlePage.documents.modalAction") }}
</div> </div>
<!--p>{{ $t("circlePage.documentsModalInformation") }}</p--> <!--p>{{ $t("circlePage.documentsModalInformation") }}</p-->
<div class="mb-8"> <div class="mb-8">
<label class="block text-bold mb-4" for="name">{{ <label class="block text-bold mb-4" for="name">{{
$t("circlePage.documentsModalFileName") $t("circlePage.documents.modalFileName")
}}</label> }}</label>
<input type="text" id="name" class="w-1/2 mb-2" /> <input type="text" id="name" class="w-1/2 mb-2" />
<p>{{ $t("circlePage.documentsModalNameInformation") }}</p> <p>{{ $t("circlePage.documents.modalNameInformation") }}</p>
</div>
<div class="mb-8">
<label class="block text-bold mb-4" for="learningsequnce">{{
$t("general.learningSequence")
}}</label>
<ItDropdownSelect
v-model="formData.learningSequence"
class="w-full lg:w-96 mt-4 lg:mt-0"
:items="dropdownLearningSequences"
>
</ItDropdownSelect>
</div> </div>
<div class="-mx-8 px-8 pt-4 border-t"> <div class="-mx-8 px-8 pt-4 border-t">
<button class="btn-primary text-xl mb-0">{{ $t("general.save") }}</button> <button class="btn-primary text-xl mb-0">
{{ $t("general.save") }}
</button>
</div> </div>
</form> </form>
</template> </template>