+
+
+
{{ learningPackage.title }}
+
{{ learningPackage.minutes }} Minuten
+
+
+
+
+
+
{{ learningUnit.title }}
+
+
+
-
-
- {{ learningUnit.title }}
diff --git a/client/src/components/icons/IconCheckboxChecked.vue b/client/src/components/icons/IconCheckboxChecked.vue
new file mode 100644
index 00000000..79718f51
--- /dev/null
+++ b/client/src/components/icons/IconCheckboxChecked.vue
@@ -0,0 +1,7 @@
+
+
+
diff --git a/client/src/components/icons/IconCheckboxUnchecked.vue b/client/src/components/icons/IconCheckboxUnchecked.vue
new file mode 100644
index 00000000..0d84821c
--- /dev/null
+++ b/client/src/components/icons/IconCheckboxUnchecked.vue
@@ -0,0 +1,5 @@
+
+
+
diff --git a/client/src/main.ts b/client/src/main.ts
index b0b3f535..3707db7e 100644
--- a/client/src/main.ts
+++ b/client/src/main.ts
@@ -5,6 +5,14 @@ import {setupI18n} from './i18n'
import App from './App.vue'
import router from './router'
+import IconLsApply from '@/components/icons/IconLsApply.vue';
+import IconLsWatch from '@/components/icons/IconLsWatch.vue';
+import IconLsTest from '@/components/icons/IconLsTest.vue';
+import IconLsPractice from '@/components/icons/IconLsPractice.vue';
+import IconLsNetwork from '@/components/icons/IconLsNetwork.vue';
+import IconLsStart from '@/components/icons/IconLsStart.vue';
+import IconLsEnd from '@/components/icons/IconLsEnd.vue';
+
import '@/assets/styles/index.scss'
const i18n = setupI18n()
@@ -18,3 +26,12 @@ app.use(router)
app.use(i18n)
app.mount('#app')
+
+// register icons globally
+app.component('IconLsApply', IconLsApply)
+app.component('IconLsWatch', IconLsWatch)
+app.component('IconLsTest', IconLsTest)
+app.component('IconLsPractice', IconLsPractice)
+app.component('IconLsNetwork', IconLsNetwork)
+app.component('IconLsStart', IconLsStart)
+app.component('IconLsEnd', IconLsEnd)
diff --git a/client/src/router/index.ts b/client/src/router/index.ts
index 047f0def..f821c851 100644
--- a/client/src/router/index.ts
+++ b/client/src/router/index.ts
@@ -28,7 +28,7 @@ const router = createRouter({
},
{
path: '/circle/:circleSlug',
- component: () => import('../views/Circle.vue'),
+ component: () => import('../views/CircleView.vue'),
props: true
},
{
diff --git a/client/src/views/Circle.vue b/client/src/views/CircleView.vue
similarity index 58%
rename from client/src/views/Circle.vue
rename to client/src/views/CircleView.vue
index a9b7f7f9..7912e36d 100644
--- a/client/src/views/Circle.vue
+++ b/client/src/views/CircleView.vue
@@ -16,7 +16,7 @@ export default {
}
},
mounted() {
- log.debug('CircleAnalyseExampleView mounted', this.circleSlug);
+ log.debug('CircleView mounted', this.circleSlug);
axios({
method: 'get',
url: `/learnpath/api/circle/${this.circleSlug}/`,
@@ -24,17 +24,47 @@ export default {
log.debug(response.data);
this.circleData = response.data;
- let learningSequence = { learningUnits: [] };
+ // aggregate wagtail data into LearningSequence > LearningPackages > LearningUnit hierarchy
+ let learningSequence = null;
+ let learningPackageIndex = 0;
this.circleData.children.forEach((child) => {
if (child.type === 'learnpath.LearningSequence') {
- if (learningSequence.learningUnits.length) {
+ if (learningSequence) {
this.learningSequences.push(learningSequence);
}
- learningSequence = Object.assign(child, { learningUnits: [] });
+ learningSequence = Object.assign(child, { learningPackages: [] });
+ learningPackageIndex = 0;
} else {
- learningSequence.learningUnits.push(child);
+ if (learningSequence.learningPackages.length === 0) {
+ learningSequence.learningPackages.push({
+ title: child.package,
+ learningUnits: [],
+ })
+ }
+ if (learningSequence.learningPackages[learningPackageIndex].title !== child.package) {
+ learningPackageIndex += 1;
+ learningSequence.learningPackages.push({
+ title: child.package,
+ learningUnits: [],
+ })
+ }
+ learningSequence.learningPackages[learningPackageIndex].learningUnits.push(child);
}
});
+ this.learningSequences.push(learningSequence);
+
+ // sum minutes
+ this.learningSequences.forEach((learningSequence) => {
+ learningSequence.minutes = 0;
+ learningSequence.learningPackages.forEach((learningPackage) => {
+ learningPackage.minutes = 0;
+ learningPackage.learningUnits.forEach((learningUnit) => {
+ learningPackage.minutes += learningUnit.minutes;
+ });
+ learningSequence.minutes += learningPackage.minutes;
+ });
+ });
+
log.debug(this.learningSequences);
});
}
@@ -74,7 +104,7 @@ export default {