From a57ef84ed8aa60c920f365d84f5f878670188442 Mon Sep 17 00:00:00 2001 From: Daniel Egger Date: Fri, 9 Sep 2022 18:06:38 +0200 Subject: [PATCH] VBV-80: Umgesetzt Circle-Ansicht "weiter gehts" --- .../components/circle/LearningSequence.vue | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/client/src/components/circle/LearningSequence.vue b/client/src/components/circle/LearningSequence.vue index 91ccf59b..4f64590e 100644 --- a/client/src/components/circle/LearningSequence.vue +++ b/client/src/components/circle/LearningSequence.vue @@ -30,6 +30,26 @@ const allFinished = computed(() => { return false }) +const continueTranslationKey = computed(() => { + if (props.learningSequence && circleStore.circle) { + const childrenReversed = [...circleStore.circle.flatLearningContents].reverse() + const lastFinished = childrenReversed.find((learningContent) => { + return learningContent.completed + }) + + if (!lastFinished) { + // must be the first + return circleStore.circle.flatLearningContents[0].translation_key + } + + if (lastFinished && lastFinished.nextLearningContent) { + return lastFinished.nextLearningContent.translation_key + } + } + + return '' +}) + const learningSequenceBorderClass = computed(() => { let result = [] if (props.learningSequence && circleStore.circle) { @@ -77,6 +97,14 @@ const learningSequenceBorderClass = computed(() => { >{{ learningContent.contents[0].type }}: {{ learningContent.title }} + +