diff --git a/client/src/components/header/MainNavigationBar.vue b/client/src/components/header/MainNavigationBar.vue index 19aef3ae..0c4997e7 100644 --- a/client/src/components/header/MainNavigationBar.vue +++ b/client/src/components/header/MainNavigationBar.vue @@ -61,7 +61,7 @@ function selectCourseSession(courseSession: CourseSession) { courseSessionsStore.switchCourseSession(courseSession); } -function popoverClick(event) { +function popoverClick(event: Event) { if (breakpoints.smaller("lg").value) { event.preventDefault(); state.showMobileProfileMenu = true; diff --git a/client/src/router/index.ts b/client/src/router/index.ts index 0fa65d18..a88f4f0a 100644 --- a/client/src/router/index.ts +++ b/client/src/router/index.ts @@ -163,6 +163,15 @@ const router = createRouter({ router.beforeEach(updateLoggedIn); router.beforeEach(redirectToLoginIfRequired); +router.beforeEach((to) => { + const appStore = useAppStore(); + if (to.params.courseSlug) { + appStore.currentCourseSlug = to.params.courseSlug as string; + } else { + appStore.currentCourseSlug = ""; + } +}); + router.afterEach(() => { const appStore = useAppStore(); appStore.routingFinished = true; diff --git a/client/src/stores/app.ts b/client/src/stores/app.ts index 46c3c911..f9f620b3 100644 --- a/client/src/stores/app.ts +++ b/client/src/stores/app.ts @@ -4,6 +4,7 @@ export type AppState = { userLoaded: boolean; routingFinished: boolean; showMainNavigationBar: boolean; + currentCourseSlug: string; }; const showMainNavigationBarInitialState = () => { @@ -31,6 +32,7 @@ export const useAppStore = defineStore({ showMainNavigationBar: showMainNavigationBarInitialState(), userLoaded: false, routingFinished: false, + currentCourseSlug: "", } as AppState), getters: {}, actions: {}, diff --git a/client/src/stores/competence.ts b/client/src/stores/competence.ts index b7b55b5f..af011541 100644 --- a/client/src/stores/competence.ts +++ b/client/src/stores/competence.ts @@ -1,5 +1,6 @@ import { itGetCached } from "@/fetchHelpers"; import { useCompletionStore } from "@/stores/completion"; +import { useCourseSessionsStore } from "@/stores/courseSessions"; import { useUserStore } from "@/stores/user"; import type { CircleLight, @@ -164,29 +165,36 @@ export const useCompetenceStore = defineStore({ const competenceProfilePage = this.competenceProfilePages.get(userId); if (competenceProfilePage) { const completionStore = useCompletionStore(); - const completionData = await completionStore.loadCompletionData( - competenceProfilePage.course.id, - userId + + const courseSessionsStore = useCourseSessionsStore(); + const courseSession = courseSessionsStore.courseSessionForCourse( + competenceProfilePage.course.slug ); + if (courseSession) { + const completionData = await completionStore.loadCompletionData( + courseSession.id, + userId + ); - if (completionData) { - competenceProfilePage.children.forEach((competence) => { - competence.children.forEach((performanceCriteria) => { - const completion = completionData.find( - (c) => c.page_key === performanceCriteria.translation_key - ); - if (completion) { - performanceCriteria.completion_status = completion.completion_status; - performanceCriteria.completion_status_updated_at = - completion.updated_at; - } else { - performanceCriteria.completion_status = "unknown"; - performanceCriteria.completion_status_updated_at = ""; - } + if (completionData) { + competenceProfilePage.children.forEach((competence) => { + competence.children.forEach((performanceCriteria) => { + const completion = completionData.find( + (c) => c.page_key === performanceCriteria.translation_key + ); + if (completion) { + performanceCriteria.completion_status = completion.completion_status; + performanceCriteria.completion_status_updated_at = + completion.updated_at; + } else { + performanceCriteria.completion_status = "unknown"; + performanceCriteria.completion_status_updated_at = ""; + } + }); }); - }); - this.competenceProfilePages.set(userId, competenceProfilePage); + this.competenceProfilePages.set(userId, competenceProfilePage); + } } } }, diff --git a/client/src/stores/completion.ts b/client/src/stores/completion.ts index 5bd9ec64..3c31138a 100644 --- a/client/src/stores/completion.ts +++ b/client/src/stores/completion.ts @@ -1,4 +1,6 @@ import { bustItGetCache, itGetCached, itPost } from "@/fetchHelpers"; +import { useAppStore } from "@/stores/app"; +import { useCourseSessionsStore } from "@/stores/courseSessions"; import { useUserStore } from "@/stores/user"; import type { BaseCourseWagtailPage, CourseCompletion } from "@/types"; import { defineStore } from "pinia"; @@ -10,37 +12,57 @@ export const useCompletionStore = defineStore({ }, getters: {}, actions: { - async loadCompletionData(courseId: number, userId: number, reload = false) { + async loadCompletionData(courseSessionId: number, userId: number, reload = false) { const userCompletionData = (await itGetCached( - `/api/course/completion/${courseId}/${userId}/`, + `/api/course/completion/${courseSessionId}/${userId}/`, { reload: reload, } )) as CourseCompletion[]; if (userCompletionData === undefined) { - throw `No completionData found with: ${courseId}, ${userId}`; + throw `No completionData found with: ${courseSessionId}, ${userId}`; } return userCompletionData || []; }, async markPage( page: BaseCourseWagtailPage, - userId: number | undefined = undefined + userId: number | undefined = undefined, + courseSessionId: number | undefined = undefined ) { - const completionData = await itPost("/api/course/completion/mark/", { - page_key: page.translation_key, - completion_status: page.completion_status, - }); - - if (completionData && completionData.length > 0) { - if (!userId) { - const userStore = useUserStore(); - userId = userStore.id; + if (!courseSessionId) { + const appStore = useAppStore(); + const courseSlug = appStore.currentCourseSlug; + if (courseSlug) { + const courseSessionsStore = useCourseSessionsStore(); + const courseSession = courseSessionsStore.courseSessionForCourse(courseSlug); + if (courseSession) { + courseSessionId = courseSession.id; + } } - bustItGetCache(`/api/course/completion/${completionData[0].course}/${userId}/`); } - return completionData as CourseCompletion[]; + if (courseSessionId) { + const completionData = await itPost("/api/course/completion/mark/", { + page_key: page.translation_key, + completion_status: page.completion_status, + course_session_id: courseSessionId, + }); + + if (completionData && completionData.length > 0) { + if (!userId) { + const userStore = useUserStore(); + userId = userStore.id; + } + bustItGetCache( + `/api/course/completion/${completionData[0].course}/${userId}/` + ); + } + + return completionData as CourseCompletion[]; + } + + return []; }, }, }); diff --git a/client/src/stores/courseSessions.ts b/client/src/stores/courseSessions.ts index 5d744e4e..0519ff4e 100644 --- a/client/src/stores/courseSessions.ts +++ b/client/src/stores/courseSessions.ts @@ -218,6 +218,7 @@ export const useCourseSessionsStore = defineStore("courseSessions", () => { courseSessions, userCourses, courseSessionForRoute, + courseSessionForCourse, courseSessionsForRoute, courseSessionsForCourse, switchCourseSession, diff --git a/client/src/stores/learningPath.ts b/client/src/stores/learningPath.ts index fcdd6e74..73bc34ce 100644 --- a/client/src/stores/learningPath.ts +++ b/client/src/stores/learningPath.ts @@ -1,7 +1,9 @@ import { itGetCached } from "@/fetchHelpers"; import { LearningPath } from "@/services/learningPath"; import { useCompletionStore } from "@/stores/completion"; +import { useCourseSessionsStore } from "@/stores/courseSessions"; import { useUserStore } from "@/stores/user"; +import type { CourseCompletion } from "@/types"; import cloneDeep from "lodash/cloneDeep"; import { defineStore } from "pinia"; @@ -65,10 +67,20 @@ export const useLearningPathStore = defineStore({ } const completionStore = useCompletionStore(); - const completionData = await completionStore.loadCompletionData( - learningPathData.course.id, - userId - ); + + let completionData: CourseCompletion[] = []; + if (userId) { + const courseSessionsStore = useCourseSessionsStore(); + const courseSession = courseSessionsStore.courseSessionForCourse( + learningPathData.course.slug + ); + if (courseSession) { + completionData = await completionStore.loadCompletionData( + courseSession.id, + userId + ); + } + } const learningPath = LearningPath.fromJson( cloneDeep(learningPathData), diff --git a/server/config/urls.py b/server/config/urls.py index 46fc8c4f..ab0e1b94 100644 --- a/server/config/urls.py +++ b/server/config/urls.py @@ -87,9 +87,9 @@ urlpatterns = [ name="course_page_api_view"), path(r"api/course/completion/mark/", mark_course_completion_view, name="mark_course_completion"), - path(r"api/course/completion//", request_course_completion, + path(r"api/course/completion//", request_course_completion, name="request_course_completion"), - path(r"api/course/completion///", + path(r"api/course/completion///", request_course_completion_for_user, name="request_course_completion_for_user"), diff --git a/server/vbv_lernwelt/competence/migrations/0001_initial.py b/server/vbv_lernwelt/competence/migrations/0001_initial.py index d0da3075..ce625f76 100644 --- a/server/vbv_lernwelt/competence/migrations/0001_initial.py +++ b/server/vbv_lernwelt/competence/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 3.2.13 on 2022-09-28 12:51 +# Generated by Django 3.2.13 on 2023-03-31 16:22 import django.db.models.deletion import wagtail.blocks @@ -7,6 +7,7 @@ from django.db import migrations, models class Migration(migrations.Migration): + initial = True dependencies = [ diff --git a/server/vbv_lernwelt/competence/migrations/0002_performancecriteria_learning_unit.py b/server/vbv_lernwelt/competence/migrations/0002_performancecriteria_learning_unit.py index f76466e7..8a7efa12 100644 --- a/server/vbv_lernwelt/competence/migrations/0002_performancecriteria_learning_unit.py +++ b/server/vbv_lernwelt/competence/migrations/0002_performancecriteria_learning_unit.py @@ -1,10 +1,11 @@ -# Generated by Django 3.2.13 on 2022-09-28 12:51 +# Generated by Django 3.2.13 on 2023-03-31 16:22 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): + initial = True dependencies = [ diff --git a/server/vbv_lernwelt/course/management/commands/create_default_courses.py b/server/vbv_lernwelt/course/management/commands/create_default_courses.py index 0a008ac6..9e411610 100644 --- a/server/vbv_lernwelt/course/management/commands/create_default_courses.py +++ b/server/vbv_lernwelt/course/management/commands/create_default_courses.py @@ -58,7 +58,9 @@ def command(course): if COURSE_UK in course: create_course_uk_de() - create_course_uk_de_completion_data() + create_course_uk_de_completion_data( + CourseSession.objects.get(title="Bern 2023 a") + ) if COURSE_UK_FR in course: create_course_uk_fr() @@ -278,7 +280,7 @@ def create_course_uk_fr(): csu.expert.add(fr_circle) -def create_course_uk_de_completion_data(): +def create_course_uk_de_completion_data(course_session): # initial completion data for slug, status, email in [ ( @@ -1045,5 +1047,6 @@ def create_course_uk_de_completion_data(): mark_course_completion( Page.objects.get(slug=slug).translation_key, User.objects.get(email=email), - status, + course_session=course_session, + completion_status=status, ) diff --git a/server/vbv_lernwelt/course/migrations/0001_initial.py b/server/vbv_lernwelt/course/migrations/0001_initial.py index 7f996217..f008f39a 100644 --- a/server/vbv_lernwelt/course/migrations/0001_initial.py +++ b/server/vbv_lernwelt/course/migrations/0001_initial.py @@ -1,19 +1,34 @@ -# Generated by Django 3.2.13 on 2022-09-28 12:51 +# Generated by Django 3.2.13 on 2023-03-31 16:22 import django.db.models.deletion -from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): + initial = True dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), ("wagtailcore", "0069_log_entry_jsonfield"), ] operations = [ + migrations.CreateModel( + name="CircleDocument", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("created_at", models.DateTimeField(auto_now_add=True)), + ("name", models.CharField(max_length=100)), + ], + ), migrations.CreateModel( name="Course", fields=[ @@ -35,36 +50,42 @@ class Migration(migrations.Migration): verbose_name="Kategorie-Name", ), ), + ( + "slug", + models.SlugField( + allow_unicode=True, + blank=True, + max_length=255, + unique=True, + verbose_name="Slug", + ), + ), ], options={ "verbose_name": "Lehrgang", }, ), migrations.CreateModel( - name="CoursePage", + name="CourseCategory", fields=[ ( - "page_ptr", - models.OneToOneField( + "id", + models.BigAutoField( auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, primary_key=True, serialize=False, - to="wagtailcore.page", + verbose_name="ID", ), ), ( - "course", - models.ForeignKey( - on_delete=django.db.models.deletion.PROTECT, to="course.course" - ), + "title", + models.CharField(blank=True, max_length=255, verbose_name="Titel"), + ), + ( + "general", + models.BooleanField(default=False, verbose_name="Allgemein"), ), ], - options={ - "verbose_name": "Lehrgang-Seite", - }, - bases=("wagtailcore.page",), ), migrations.CreateModel( name="CourseCompletion", @@ -96,23 +117,30 @@ class Migration(migrations.Migration): ), ), ("additional_json_data", models.JSONField(default=dict)), - ( - "course", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, to="course.course" - ), - ), - ( - "user", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - to=settings.AUTH_USER_MODEL, - ), - ), ], ), migrations.CreateModel( - name="CourseCategory", + name="CoursePage", + fields=[ + ( + "page_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to="wagtailcore.page", + ), + ), + ], + options={ + "verbose_name": "Lehrgang-Seite", + }, + bases=("wagtailcore.page",), + ), + migrations.CreateModel( + name="CourseSession", fields=[ ( "id", @@ -123,27 +151,47 @@ class Migration(migrations.Migration): verbose_name="ID", ), ), + ("created_at", models.DateTimeField(auto_now_add=True)), + ("updated_at", models.DateTimeField(auto_now=True)), + ("title", models.TextField()), + ("start_date", models.DateField(blank=True, null=True)), + ("end_date", models.DateField(blank=True, null=True)), + ("additional_json_data", models.JSONField(default=dict)), + ], + ), + migrations.CreateModel( + name="CourseSessionUser", + fields=[ ( - "title", - models.CharField(blank=True, max_length=255, verbose_name="Titel"), + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("created_at", models.DateTimeField(auto_now_add=True)), + ("updated_at", models.DateTimeField(auto_now=True)), + ( + "role", + models.CharField( + choices=[ + ("MEMBER", "Teilnehmer"), + ("EXPERT", "Experte/Trainer"), + ("TUTOR", "Lernbegleitung"), + ], + default="MEMBER", + max_length=255, + ), ), ( - "general", - models.BooleanField(default=False, verbose_name="Allgemein"), - ), - ( - "course", + "course_session", models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, to="course.course" + on_delete=django.db.models.deletion.CASCADE, + to="course.coursesession", ), ), ], ), - migrations.AddConstraint( - model_name="coursecompletion", - constraint=models.UniqueConstraint( - fields=("user", "page_key"), - name="course_completion_unique_user_page_key", - ), - ), ] diff --git a/server/vbv_lernwelt/course/migrations/0002_auto_20221014_0933.py b/server/vbv_lernwelt/course/migrations/0002_auto_20221014_0933.py deleted file mode 100644 index 232e3a59..00000000 --- a/server/vbv_lernwelt/course/migrations/0002_auto_20221014_0933.py +++ /dev/null @@ -1,78 +0,0 @@ -# Generated by Django 3.2.13 on 2022-10-14 07:33 - -import django.db.models.deletion -from django.conf import settings -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ("course", "0001_initial"), - ] - - operations = [ - migrations.CreateModel( - name="CourseSession", - fields=[ - ( - "id", - models.BigAutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("created_at", models.DateTimeField(auto_now_add=True)), - ("updated_at", models.DateTimeField(auto_now=True)), - ("title", models.TextField()), - ("start_date", models.DateField(blank=True, null=True)), - ("end_date", models.DateField(blank=True, null=True)), - ("additional_json_data", models.JSONField(default=dict)), - ( - "course", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, to="course.course" - ), - ), - ], - ), - migrations.CreateModel( - name="CourseSessionUser", - fields=[ - ( - "id", - models.BigAutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("created_at", models.DateTimeField(auto_now_add=True)), - ("updated_at", models.DateTimeField(auto_now=True)), - ( - "course_session", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - to="course.coursesession", - ), - ), - ( - "user", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - to=settings.AUTH_USER_MODEL, - ), - ), - ], - ), - migrations.AddConstraint( - model_name="coursesessionuser", - constraint=models.UniqueConstraint( - fields=("course_session", "user"), - name="course_session_user_unique_course_session_user", - ), - ), - ] diff --git a/server/vbv_lernwelt/course/migrations/0002_initial.py b/server/vbv_lernwelt/course/migrations/0002_initial.py new file mode 100644 index 00000000..e1e85154 --- /dev/null +++ b/server/vbv_lernwelt/course/migrations/0002_initial.py @@ -0,0 +1,105 @@ +# Generated by Django 3.2.13 on 2023-03-31 16:22 + +import django.db.models.deletion +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ("course", "0001_initial"), + ("learnpath", "0001_initial"), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ("files", "0001_initial"), + ] + + operations = [ + migrations.AddField( + model_name="coursesessionuser", + name="expert", + field=models.ManyToManyField( + blank=True, related_name="expert", to="learnpath.Circle" + ), + ), + migrations.AddField( + model_name="coursesessionuser", + name="user", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL + ), + ), + migrations.AddField( + model_name="coursesession", + name="course", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, to="course.course" + ), + ), + migrations.AddField( + model_name="coursepage", + name="course", + field=models.OneToOneField( + on_delete=django.db.models.deletion.PROTECT, to="course.course" + ), + ), + migrations.AddField( + model_name="coursecompletion", + name="course_session", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, to="course.coursesession" + ), + ), + migrations.AddField( + model_name="coursecompletion", + name="user", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL + ), + ), + migrations.AddField( + model_name="coursecategory", + name="course", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, to="course.course" + ), + ), + migrations.AddField( + model_name="circledocument", + name="course_session", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, to="course.coursesession" + ), + ), + migrations.AddField( + model_name="circledocument", + name="file", + field=models.OneToOneField( + on_delete=django.db.models.deletion.CASCADE, to="files.uploadfile" + ), + ), + migrations.AddField( + model_name="circledocument", + name="learning_sequence", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="learnpath.learningsequence", + ), + ), + migrations.AddConstraint( + model_name="coursesessionuser", + constraint=models.UniqueConstraint( + fields=("course_session", "user"), + name="course_session_user_unique_course_session_user", + ), + ), + migrations.AddConstraint( + model_name="coursecompletion", + constraint=models.UniqueConstraint( + fields=("user", "page_key", "course_session"), + name="course_completion_unique_user_page_key", + ), + ), + ] diff --git a/server/vbv_lernwelt/course/migrations/0003_alter_coursepage_course.py b/server/vbv_lernwelt/course/migrations/0003_alter_coursepage_course.py deleted file mode 100644 index 103c9bdd..00000000 --- a/server/vbv_lernwelt/course/migrations/0003_alter_coursepage_course.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 3.2.13 on 2022-11-07 13:30 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("course", "0002_auto_20221014_0933"), - ] - - operations = [ - migrations.AlterField( - model_name="coursepage", - name="course", - field=models.OneToOneField( - on_delete=django.db.models.deletion.PROTECT, to="course.course" - ), - ), - ] diff --git a/server/vbv_lernwelt/course/migrations/0004_coursesessionuser_expert.py b/server/vbv_lernwelt/course/migrations/0004_coursesessionuser_expert.py deleted file mode 100644 index c2c98511..00000000 --- a/server/vbv_lernwelt/course/migrations/0004_coursesessionuser_expert.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.13 on 2022-11-07 15:51 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("learnpath", "0008_alter_learningcontent_contents"), - ("course", "0003_alter_coursepage_course"), - ] - - operations = [ - migrations.AddField( - model_name="coursesessionuser", - name="expert", - field=models.ManyToManyField(related_name="expert", to="learnpath.Circle"), - ), - ] diff --git a/server/vbv_lernwelt/course/migrations/0005_alter_coursesessionuser_expert.py b/server/vbv_lernwelt/course/migrations/0005_alter_coursesessionuser_expert.py deleted file mode 100644 index a19722c6..00000000 --- a/server/vbv_lernwelt/course/migrations/0005_alter_coursesessionuser_expert.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 3.2.13 on 2022-11-07 15:53 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("learnpath", "0008_alter_learningcontent_contents"), - ("course", "0004_coursesessionuser_expert"), - ] - - operations = [ - migrations.AlterField( - model_name="coursesessionuser", - name="expert", - field=models.ManyToManyField( - blank=True, related_name="expert", to="learnpath.Circle" - ), - ), - ] diff --git a/server/vbv_lernwelt/course/migrations/0006_course_slug.py b/server/vbv_lernwelt/course/migrations/0006_course_slug.py deleted file mode 100644 index 0994bd4a..00000000 --- a/server/vbv_lernwelt/course/migrations/0006_course_slug.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.13 on 2022-12-02 09:40 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("course", "0005_alter_coursesessionuser_expert"), - ] - - operations = [ - migrations.AddField( - model_name="course", - name="slug", - field=models.SlugField( - allow_unicode=True, - blank=True, - max_length=255, - unique=True, - verbose_name="Slug", - ), - ), - ] diff --git a/server/vbv_lernwelt/course/migrations/0007_coursesessionuser_role.py b/server/vbv_lernwelt/course/migrations/0007_coursesessionuser_role.py deleted file mode 100644 index 7049b86d..00000000 --- a/server/vbv_lernwelt/course/migrations/0007_coursesessionuser_role.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 3.2.13 on 2022-12-02 12:53 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("course", "0006_course_slug"), - ] - - operations = [ - migrations.AddField( - model_name="coursesessionuser", - name="role", - field=models.CharField( - choices=[ - ("MEMBER", "Teilnehmer"), - ("EXPERT", "Experte/Trainer"), - ("TUTOR", "Lernbegleitung"), - ], - default="MEMBER", - max_length=255, - ), - ), - ] diff --git a/server/vbv_lernwelt/course/migrations/0008_circledocument.py b/server/vbv_lernwelt/course/migrations/0008_circledocument.py deleted file mode 100644 index ae48b055..00000000 --- a/server/vbv_lernwelt/course/migrations/0008_circledocument.py +++ /dev/null @@ -1,52 +0,0 @@ -# Generated by Django 3.2.13 on 2022-12-24 20:34 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("files", "0001_initial"), - ("learnpath", "0008_alter_learningcontent_contents"), - ("course", "0007_coursesessionuser_role"), - ] - - operations = [ - migrations.CreateModel( - name="CircleDocument", - fields=[ - ( - "id", - models.BigAutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("created_at", models.DateTimeField(auto_now_add=True)), - ("name", models.CharField(max_length=100)), - ( - "course_session", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - to="course.coursesession", - ), - ), - ( - "file", - models.OneToOneField( - on_delete=django.db.models.deletion.CASCADE, - to="files.uploadfile", - ), - ), - ( - "learning_sequence", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - to="learnpath.learningsequence", - ), - ), - ], - ), - ] diff --git a/server/vbv_lernwelt/course/models.py b/server/vbv_lernwelt/course/models.py index 94aad7b2..06d2d2c3 100644 --- a/server/vbv_lernwelt/course/models.py +++ b/server/vbv_lernwelt/course/models.py @@ -146,7 +146,7 @@ class CourseCompletion(models.Model): page_type = models.CharField(max_length=255, default="", blank=True) page_slug = models.CharField(max_length=255, default="", blank=True) - course = models.ForeignKey("course.Course", on_delete=models.CASCADE) + course_session = models.ForeignKey("course.CourseSession", on_delete=models.CASCADE) completion_status = models.CharField( max_length=255, @@ -162,10 +162,7 @@ class CourseCompletion(models.Model): class Meta: constraints = [ UniqueConstraint( - fields=[ - "user", - "page_key", - ], + fields=["user", "page_key", "course_session"], name="course_completion_unique_user_page_key", ) ] diff --git a/server/vbv_lernwelt/course/serializers.py b/server/vbv_lernwelt/course/serializers.py index a9d64805..c7b9971c 100644 --- a/server/vbv_lernwelt/course/serializers.py +++ b/server/vbv_lernwelt/course/serializers.py @@ -36,7 +36,7 @@ class CourseCompletionSerializer(serializers.ModelSerializer): "page_key", "page_type", "page_slug", - "course", + "course_session", "completion_status", "additional_json_data", ] diff --git a/server/vbv_lernwelt/course/services.py b/server/vbv_lernwelt/course/services.py index d8ef5370..9bfa561d 100644 --- a/server/vbv_lernwelt/course/services.py +++ b/server/vbv_lernwelt/course/services.py @@ -4,14 +4,14 @@ from vbv_lernwelt.course.models import CourseCompletion from vbv_lernwelt.learnpath.utils import get_wagtail_type -def mark_course_completion(page_key, user, completion_status="success"): +def mark_course_completion(page_key, user, course_session, completion_status="success"): page = Page.objects.get(translation_key=page_key, locale__language_code="de-CH") page_type = get_wagtail_type(page.specific) course = page.specific.get_course() cc, created = CourseCompletion.objects.get_or_create( user=user, page_key=page_key, - course_id=course.id, + course_session_id=course_session.id, ) cc.page_slug = page.slug cc.page_type = page_type diff --git a/server/vbv_lernwelt/course/tests/test_completion_api.py b/server/vbv_lernwelt/course/tests/test_completion_api.py index 385292af..5d2fb1d5 100644 --- a/server/vbv_lernwelt/course/tests/test_completion_api.py +++ b/server/vbv_lernwelt/course/tests/test_completion_api.py @@ -6,7 +6,11 @@ from vbv_lernwelt.core.create_default_users import create_default_users from vbv_lernwelt.core.models import User from vbv_lernwelt.course.consts import COURSE_TEST_ID from vbv_lernwelt.course.creators.test_course import create_test_course -from vbv_lernwelt.course.models import CourseCompletion +from vbv_lernwelt.course.models import ( + CourseCompletion, + CourseSession, + CourseSessionUser, +) from vbv_lernwelt.learnpath.models import LearningContent @@ -15,6 +19,14 @@ class CourseCompletionApiTestCase(APITestCase): create_default_users() create_test_course() self.user = User.objects.get(username="admin") + self.cs = CourseSession.objects.create( + course_id=COURSE_TEST_ID, + title="Test Lehrgang Session", + ) + csu = CourseSessionUser.objects.create( + course_session=self.cs, + user=self.user, + ) self.client.login(username="admin", password="test") def test_completeLearningContent_works(self): @@ -27,6 +39,7 @@ class CourseCompletionApiTestCase(APITestCase): mark_url, { "page_key": learning_content_key, + "course_session_id": self.cs.id, }, ) response_json = response.json() @@ -38,12 +51,12 @@ class CourseCompletionApiTestCase(APITestCase): self.assertEqual(response_json[0]["completion_status"], "success") db_entry = CourseCompletion.objects.get( - user=self.user, course_id=COURSE_TEST_ID, page_key=learning_content_key + user=self.user, course_session_id=self.cs.id, page_key=learning_content_key ) self.assertEqual(db_entry.completion_status, "success") # test getting the circle data - response = self.client.get(f"/api/course/completion/{COURSE_TEST_ID}/") + response = self.client.get(f"/api/course/completion/{self.cs.id}/") print(response.status_code) response_json = response.json() print(json.dumps(response.json(), indent=2)) @@ -59,6 +72,7 @@ class CourseCompletionApiTestCase(APITestCase): { "page_key": learning_content_key, "completion_status": "fail", + "course_session_id": self.cs.id, }, ) @@ -69,6 +83,6 @@ class CourseCompletionApiTestCase(APITestCase): self.assertEqual(response_json[0]["completion_status"], "fail") db_entry = CourseCompletion.objects.get( - user=self.user, course_id=COURSE_TEST_ID, page_key=learning_content_key + user=self.user, course_session_id=self.cs.id, page_key=learning_content_key ) self.assertEqual(db_entry.completion_status, "fail") diff --git a/server/vbv_lernwelt/course/views.py b/server/vbv_lernwelt/course/views.py index 0e592541..bdb0a7f2 100644 --- a/server/vbv_lernwelt/course/views.py +++ b/server/vbv_lernwelt/course/views.py @@ -8,6 +8,7 @@ from wagtail.models import Page from vbv_lernwelt.course.models import ( CircleDocument, CourseCompletion, + CourseSession, CourseSessionUser, ) from vbv_lernwelt.course.permissions import ( @@ -48,10 +49,12 @@ def course_page_api_view(request, slug): return Response({"error": str(e)}, status=404) -def _request_course_completion(course_id, user_id): +def _request_course_completion(course_session_id, user_id): try: response_data = CourseCompletionSerializer( - CourseCompletion.objects.filter(user_id=user_id, course_id=course_id), + CourseCompletion.objects.filter( + user_id=user_id, course_session_id=course_session_id + ), many=True, ).data @@ -64,16 +67,18 @@ def _request_course_completion(course_id, user_id): @api_view(["GET"]) -def request_course_completion(request, course_id): +def request_course_completion(request, course_session_id): + course_id = get_object_or_404(CourseSession, id=course_session_id).course_id if has_course_access(request.user, course_id): - return _request_course_completion(course_id, request.user.id) + return _request_course_completion(course_session_id, request.user.id) raise PermissionDenied() @api_view(["GET"]) -def request_course_completion_for_user(request, course_id, user_id): +def request_course_completion_for_user(request, course_session_id, user_id): + course_id = get_object_or_404(CourseSession, id=course_session_id).course_id if request.user.id == user_id or is_course_expert(request.user, course_id): - return _request_course_completion(course_id, user_id) + return _request_course_completion(course_session_id, user_id) raise PermissionDenied() @@ -82,6 +87,7 @@ def mark_course_completion_view(request): try: page_key = request.data.get("page_key") completion_status = request.data.get("completion_status", "success") + course_session_id = request.data.get("course_session_id") page = Page.objects.get(translation_key=page_key, locale__language_code="de-CH") if not has_course_access_by_page_request(request, page): @@ -91,11 +97,16 @@ def mark_course_completion_view(request): course = page.specific.get_course() mark_course_completion( - page_key, request.user, completion_status=completion_status + page_key, + request.user, + course_session=CourseSession.objects.get(id=course_session_id), + completion_status=completion_status, ) response_data = CourseCompletionSerializer( - CourseCompletion.objects.filter(user=request.user, course_id=course.id), + CourseCompletion.objects.filter( + user=request.user, course_session_id=course_session_id + ), many=True, ).data @@ -107,7 +118,7 @@ def mark_course_completion_view(request): page_slug=page.slug, page_title=page.title, user_id=request.user.id, - course_id=course.id, + course_session_id=course_session_id, completion_status=completion_status, ) @@ -115,7 +126,7 @@ def mark_course_completion_view(request): except PermissionDenied as e: raise e except Exception as e: - logger.error(e) + logger.error(e, exc_info=True) return Response({"error": str(e)}, status=404) diff --git a/server/vbv_lernwelt/feedback/migrations/0001_initial.py b/server/vbv_lernwelt/feedback/migrations/0001_initial.py index 6b99ddf5..c534ce23 100644 --- a/server/vbv_lernwelt/feedback/migrations/0001_initial.py +++ b/server/vbv_lernwelt/feedback/migrations/0001_initial.py @@ -1,19 +1,13 @@ -# Generated by Django 3.2.13 on 2022-12-27 14:58 +# Generated by Django 3.2.13 on 2023-03-31 16:22 -import django.core.validators -import django.db.models.deletion from django.db import migrations, models -import vbv_lernwelt.feedback.models - class Migration(migrations.Migration): + initial = True - dependencies = [ - ("learnpath", "0009_alter_learningcontent_contents"), - ("course", "0007_coursesessionuser_role"), - ] + dependencies = [] operations = [ migrations.CreateModel( @@ -28,86 +22,8 @@ class Migration(migrations.Migration): verbose_name="ID", ), ), - ( - "satisfaction", - vbv_lernwelt.feedback.models.FeedbackIntegerField( - null=True, - validators=[ - django.core.validators.MinValueValidator(1), - django.core.validators.MaxValueValidator(4), - django.core.validators.MinValueValidator(1), - django.core.validators.MaxValueValidator(4), - ], - ), - ), - ( - "goal_attainment", - vbv_lernwelt.feedback.models.FeedbackIntegerField( - null=True, - validators=[ - django.core.validators.MinValueValidator(1), - django.core.validators.MaxValueValidator(4), - django.core.validators.MinValueValidator(1), - django.core.validators.MaxValueValidator(4), - ], - ), - ), - ("proficiency", models.IntegerField(null=True)), - ("received_materials", models.BooleanField(null=True)), - ( - "materials_rating", - vbv_lernwelt.feedback.models.FeedbackIntegerField( - null=True, - validators=[ - django.core.validators.MinValueValidator(1), - django.core.validators.MaxValueValidator(4), - django.core.validators.MinValueValidator(1), - django.core.validators.MaxValueValidator(4), - ], - ), - ), - ( - "instructor_competence", - vbv_lernwelt.feedback.models.FeedbackIntegerField( - null=True, - validators=[ - django.core.validators.MinValueValidator(1), - django.core.validators.MaxValueValidator(4), - django.core.validators.MinValueValidator(1), - django.core.validators.MaxValueValidator(4), - ], - ), - ), - ( - "instructor_respect", - vbv_lernwelt.feedback.models.FeedbackIntegerField( - null=True, - validators=[ - django.core.validators.MinValueValidator(1), - django.core.validators.MaxValueValidator(4), - django.core.validators.MinValueValidator(1), - django.core.validators.MaxValueValidator(4), - ], - ), - ), - ("instructor_open_feedback", models.TextField(blank=True)), - ("would_recommend", models.BooleanField(null=True)), - ("course_positive_feedback", models.TextField(blank=True)), - ("course_negative_feedback", models.TextField(blank=True)), - ( - "circle", - models.ForeignKey( - on_delete=django.db.models.deletion.PROTECT, - to="learnpath.circle", - ), - ), - ( - "course_session", - models.ForeignKey( - on_delete=django.db.models.deletion.PROTECT, - to="course.coursesession", - ), - ), + ("data", models.JSONField(default=dict)), + ("created_at", models.DateTimeField(auto_now_add=True)), ], ), ] diff --git a/server/vbv_lernwelt/feedback/migrations/0002_auto_20230111_1044.py b/server/vbv_lernwelt/feedback/migrations/0002_auto_20230111_1044.py deleted file mode 100644 index 4a48d641..00000000 --- a/server/vbv_lernwelt/feedback/migrations/0002_auto_20230111_1044.py +++ /dev/null @@ -1,90 +0,0 @@ -# Generated by Django 3.2.13 on 2023-01-11 09:44 - -import django.core.validators -from django.db import migrations - -import vbv_lernwelt.feedback.models - - -class Migration(migrations.Migration): - dependencies = [ - ("feedback", "0001_initial"), - ] - - operations = [ - migrations.AlterField( - model_name="feedbackresponse", - name="goal_attainment", - field=vbv_lernwelt.feedback.models.FeedbackIntegerField( - null=True, - validators=[ - django.core.validators.MinValueValidator(1), - django.core.validators.MaxValueValidator(4), - django.core.validators.MinValueValidator(1), - django.core.validators.MaxValueValidator(4), - django.core.validators.MinValueValidator(1), - django.core.validators.MaxValueValidator(4), - ], - ), - ), - migrations.AlterField( - model_name="feedbackresponse", - name="instructor_competence", - field=vbv_lernwelt.feedback.models.FeedbackIntegerField( - null=True, - validators=[ - django.core.validators.MinValueValidator(1), - django.core.validators.MaxValueValidator(4), - django.core.validators.MinValueValidator(1), - django.core.validators.MaxValueValidator(4), - django.core.validators.MinValueValidator(1), - django.core.validators.MaxValueValidator(4), - ], - ), - ), - migrations.AlterField( - model_name="feedbackresponse", - name="instructor_respect", - field=vbv_lernwelt.feedback.models.FeedbackIntegerField( - null=True, - validators=[ - django.core.validators.MinValueValidator(1), - django.core.validators.MaxValueValidator(4), - django.core.validators.MinValueValidator(1), - django.core.validators.MaxValueValidator(4), - django.core.validators.MinValueValidator(1), - django.core.validators.MaxValueValidator(4), - ], - ), - ), - migrations.AlterField( - model_name="feedbackresponse", - name="materials_rating", - field=vbv_lernwelt.feedback.models.FeedbackIntegerField( - null=True, - validators=[ - django.core.validators.MinValueValidator(1), - django.core.validators.MaxValueValidator(4), - django.core.validators.MinValueValidator(1), - django.core.validators.MaxValueValidator(4), - django.core.validators.MinValueValidator(1), - django.core.validators.MaxValueValidator(4), - ], - ), - ), - migrations.AlterField( - model_name="feedbackresponse", - name="satisfaction", - field=vbv_lernwelt.feedback.models.FeedbackIntegerField( - null=True, - validators=[ - django.core.validators.MinValueValidator(1), - django.core.validators.MaxValueValidator(4), - django.core.validators.MinValueValidator(1), - django.core.validators.MaxValueValidator(4), - django.core.validators.MinValueValidator(1), - django.core.validators.MaxValueValidator(4), - ], - ), - ), - ] diff --git a/server/vbv_lernwelt/feedback/migrations/0002_initial.py b/server/vbv_lernwelt/feedback/migrations/0002_initial.py new file mode 100644 index 00000000..e6259341 --- /dev/null +++ b/server/vbv_lernwelt/feedback/migrations/0002_initial.py @@ -0,0 +1,32 @@ +# Generated by Django 3.2.13 on 2023-03-31 16:22 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ("feedback", "0001_initial"), + ("course", "0001_initial"), + ("learnpath", "0001_initial"), + ] + + operations = [ + migrations.AddField( + model_name="feedbackresponse", + name="circle", + field=models.ForeignKey( + on_delete=django.db.models.deletion.PROTECT, to="learnpath.circle" + ), + ), + migrations.AddField( + model_name="feedbackresponse", + name="course_session", + field=models.ForeignKey( + on_delete=django.db.models.deletion.PROTECT, to="course.coursesession" + ), + ), + ] diff --git a/server/vbv_lernwelt/feedback/migrations/0003_auto_20230206_1125.py b/server/vbv_lernwelt/feedback/migrations/0003_auto_20230206_1125.py deleted file mode 100644 index 541f3a40..00000000 --- a/server/vbv_lernwelt/feedback/migrations/0003_auto_20230206_1125.py +++ /dev/null @@ -1,66 +0,0 @@ -# Generated by Django 3.2.13 on 2023-02-06 10:25 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("feedback", "0002_auto_20230111_1044"), - ] - - operations = [ - migrations.RemoveField( - model_name="feedbackresponse", - name="course_negative_feedback", - ), - migrations.RemoveField( - model_name="feedbackresponse", - name="course_positive_feedback", - ), - migrations.RemoveField( - model_name="feedbackresponse", - name="goal_attainment", - ), - migrations.RemoveField( - model_name="feedbackresponse", - name="instructor_competence", - ), - migrations.RemoveField( - model_name="feedbackresponse", - name="instructor_open_feedback", - ), - migrations.RemoveField( - model_name="feedbackresponse", - name="instructor_respect", - ), - migrations.RemoveField( - model_name="feedbackresponse", - name="materials_rating", - ), - migrations.RemoveField( - model_name="feedbackresponse", - name="proficiency", - ), - migrations.RemoveField( - model_name="feedbackresponse", - name="received_materials", - ), - migrations.RemoveField( - model_name="feedbackresponse", - name="satisfaction", - ), - migrations.RemoveField( - model_name="feedbackresponse", - name="would_recommend", - ), - migrations.AddField( - model_name="feedbackresponse", - name="data", - field=models.JSONField(default=dict), - ), - migrations.AddField( - model_name="feedbackresponse", - name="created_at", - field=models.DateTimeField(auto_now_add=True), - ), - ] diff --git a/server/vbv_lernwelt/learnpath/migrations/0001_initial.py b/server/vbv_lernwelt/learnpath/migrations/0001_initial.py index 31cb123a..ebc0f2a7 100644 --- a/server/vbv_lernwelt/learnpath/migrations/0001_initial.py +++ b/server/vbv_lernwelt/learnpath/migrations/0001_initial.py @@ -1,13 +1,13 @@ -# Generated by Django 3.2.13 on 2022-09-28 12:51 +# Generated by Django 3.2.13 on 2023-03-31 16:22 import django.db.models.deletion import wagtail.blocks import wagtail.fields -import wagtail.images.blocks from django.db import migrations, models class Migration(migrations.Migration): + initial = True dependencies = [ @@ -31,49 +31,7 @@ class Migration(migrations.Migration): ), ), ("description", models.TextField(blank=True, default="")), - ( - "goals", - wagtail.fields.StreamField( - [("goal", wagtail.blocks.TextBlock())], use_json_field=True - ), - ), - ( - "job_situations", - wagtail.fields.StreamField( - [("job_situation", wagtail.blocks.CharBlock())], - use_json_field=True, - ), - ), - ( - "experts", - wagtail.fields.StreamField( - [ - ( - "person", - wagtail.blocks.StructBlock( - [ - ("first_name", wagtail.blocks.CharBlock()), - ("last_name", wagtail.blocks.CharBlock()), - ("email", wagtail.blocks.EmailBlock()), - ( - "photo", - wagtail.images.blocks.ImageChooserBlock( - required=False - ), - ), - ( - "biography", - wagtail.blocks.RichTextBlock( - required=False - ), - ), - ] - ), - ) - ], - use_json_field=True, - ), - ), + ("goals", wagtail.fields.RichTextField()), ], options={ "verbose_name": "Circle", @@ -104,7 +62,7 @@ class Migration(migrations.Migration): wagtail.blocks.StructBlock( [ ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.URLBlock()), + ("url", wagtail.blocks.TextBlock()), ] ), ), @@ -113,7 +71,13 @@ class Migration(migrations.Migration): wagtail.blocks.StructBlock( [ ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.URLBlock()), + ("url", wagtail.blocks.TextBlock()), + ( + "text", + wagtail.blocks.RichTextBlock( + required=False + ), + ), ] ), ), @@ -122,7 +86,16 @@ class Migration(migrations.Migration): wagtail.blocks.StructBlock( [ ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.URLBlock()), + ("url", wagtail.blocks.TextBlock()), + ] + ), + ), + ( + "learningmodule", + wagtail.blocks.StructBlock( + [ + ("description", wagtail.blocks.TextBlock()), + ("url", wagtail.blocks.TextBlock()), ] ), ), @@ -131,7 +104,7 @@ class Migration(migrations.Migration): wagtail.blocks.StructBlock( [ ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.URLBlock()), + ("url", wagtail.blocks.TextBlock()), ] ), ), @@ -140,7 +113,7 @@ class Migration(migrations.Migration): wagtail.blocks.StructBlock( [ ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.URLBlock()), + ("url", wagtail.blocks.TextBlock()), ] ), ), @@ -149,7 +122,7 @@ class Migration(migrations.Migration): wagtail.blocks.StructBlock( [ ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.URLBlock()), + ("url", wagtail.blocks.TextBlock()), ] ), ), @@ -158,7 +131,7 @@ class Migration(migrations.Migration): wagtail.blocks.StructBlock( [ ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.URLBlock()), + ("url", wagtail.blocks.TextBlock()), ] ), ), @@ -167,7 +140,7 @@ class Migration(migrations.Migration): wagtail.blocks.StructBlock( [ ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.URLBlock()), + ("url", wagtail.blocks.TextBlock()), ] ), ), @@ -176,10 +149,26 @@ class Migration(migrations.Migration): wagtail.blocks.StructBlock( [ ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.URLBlock()), + ("url", wagtail.blocks.TextBlock()), + ( + "text", + wagtail.blocks.RichTextBlock( + required=False + ), + ), ] ), ), + ( + "placeholder", + wagtail.blocks.StructBlock( + [ + ("description", wagtail.blocks.TextBlock()), + ("url", wagtail.blocks.TextBlock()), + ] + ), + ), + ("feedback", wagtail.blocks.StructBlock([])), ], use_json_field=None, ), diff --git a/server/vbv_lernwelt/learnpath/migrations/0002_alter_learningcontent_contents.py b/server/vbv_lernwelt/learnpath/migrations/0002_alter_learningcontent_contents.py deleted file mode 100644 index 28969106..00000000 --- a/server/vbv_lernwelt/learnpath/migrations/0002_alter_learningcontent_contents.py +++ /dev/null @@ -1,113 +0,0 @@ -# Generated by Django 3.2.13 on 2022-10-04 13:34 - -import wagtail.blocks -import wagtail.fields -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ("learnpath", "0001_initial"), - ] - - operations = [ - migrations.AlterField( - model_name="learningcontent", - name="contents", - field=wagtail.fields.StreamField( - [ - ( - "video", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.URLBlock()), - ] - ), - ), - ( - "resource", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.URLBlock()), - ] - ), - ), - ( - "exercise", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.URLBlock()), - ] - ), - ), - ( - "online_training", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.URLBlock()), - ] - ), - ), - ( - "media_library", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.URLBlock()), - ] - ), - ), - ( - "document", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.URLBlock()), - ] - ), - ), - ( - "test", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.URLBlock()), - ] - ), - ), - ( - "book", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.URLBlock()), - ] - ), - ), - ( - "assignment", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.URLBlock()), - ] - ), - ), - ( - "placeholder", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.URLBlock()), - ] - ), - ), - ], - use_json_field=None, - ), - ), - ] diff --git a/server/vbv_lernwelt/learnpath/migrations/0003_alter_learningcontent_contents.py b/server/vbv_lernwelt/learnpath/migrations/0003_alter_learningcontent_contents.py deleted file mode 100644 index ee867c0e..00000000 --- a/server/vbv_lernwelt/learnpath/migrations/0003_alter_learningcontent_contents.py +++ /dev/null @@ -1,113 +0,0 @@ -# Generated by Django 3.2.13 on 2022-10-05 10:06 - -import wagtail.blocks -import wagtail.fields -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ("learnpath", "0002_alter_learningcontent_contents"), - ] - - operations = [ - migrations.AlterField( - model_name="learningcontent", - name="contents", - field=wagtail.fields.StreamField( - [ - ( - "video", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "resource", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "exercise", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "online_training", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "media_library", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "document", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "test", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "book", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "assignment", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "placeholder", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ], - use_json_field=None, - ), - ), - ] diff --git a/server/vbv_lernwelt/learnpath/migrations/0004_circle_goal_description.py b/server/vbv_lernwelt/learnpath/migrations/0004_circle_goal_description.py deleted file mode 100644 index 5de5d0a2..00000000 --- a/server/vbv_lernwelt/learnpath/migrations/0004_circle_goal_description.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.2.13 on 2022-10-14 10:30 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("learnpath", "0003_alter_learningcontent_contents"), - ] - - operations = [ - migrations.AddField( - model_name="circle", - name="goal_description", - field=models.TextField(blank=True, default=""), - ), - ] diff --git a/server/vbv_lernwelt/learnpath/migrations/0005_circle_job_situation_description.py b/server/vbv_lernwelt/learnpath/migrations/0005_circle_job_situation_description.py deleted file mode 100644 index 8b08d521..00000000 --- a/server/vbv_lernwelt/learnpath/migrations/0005_circle_job_situation_description.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.2.13 on 2022-10-14 10:41 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("learnpath", "0004_circle_goal_description"), - ] - - operations = [ - migrations.AddField( - model_name="circle", - name="job_situation_description", - field=models.TextField(blank=True, default=""), - ), - ] diff --git a/server/vbv_lernwelt/learnpath/migrations/0006_alter_learningcontent_contents.py b/server/vbv_lernwelt/learnpath/migrations/0006_alter_learningcontent_contents.py deleted file mode 100644 index bef7a202..00000000 --- a/server/vbv_lernwelt/learnpath/migrations/0006_alter_learningcontent_contents.py +++ /dev/null @@ -1,114 +0,0 @@ -# Generated by Django 3.2.13 on 2022-10-14 12:03 - -import wagtail.blocks -import wagtail.fields -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ("learnpath", "0005_circle_job_situation_description"), - ] - - operations = [ - migrations.AlterField( - model_name="learningcontent", - name="contents", - field=wagtail.fields.StreamField( - [ - ( - "video", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "resource", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ("text", wagtail.blocks.RichTextBlock()), - ] - ), - ), - ( - "exercise", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "online_training", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "media_library", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "document", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "test", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "book", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "assignment", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "placeholder", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ], - use_json_field=None, - ), - ), - ] diff --git a/server/vbv_lernwelt/learnpath/migrations/0007_alter_learningcontent_contents.py b/server/vbv_lernwelt/learnpath/migrations/0007_alter_learningcontent_contents.py deleted file mode 100644 index 720ffba5..00000000 --- a/server/vbv_lernwelt/learnpath/migrations/0007_alter_learningcontent_contents.py +++ /dev/null @@ -1,115 +0,0 @@ -# Generated by Django 3.2.13 on 2022-10-14 16:02 - -import wagtail.blocks -import wagtail.fields -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ("learnpath", "0006_alter_learningcontent_contents"), - ] - - operations = [ - migrations.AlterField( - model_name="learningcontent", - name="contents", - field=wagtail.fields.StreamField( - [ - ( - "video", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "resource", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ("text", wagtail.blocks.RichTextBlock(required=False)), - ] - ), - ), - ( - "exercise", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "online_training", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "media_library", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "document", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "test", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "book", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "assignment", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ("text", wagtail.blocks.RichTextBlock(required=False)), - ] - ), - ), - ( - "placeholder", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ], - use_json_field=None, - ), - ), - ] diff --git a/server/vbv_lernwelt/learnpath/migrations/0008_alter_learningcontent_contents.py b/server/vbv_lernwelt/learnpath/migrations/0008_alter_learningcontent_contents.py deleted file mode 100644 index 9c7f6cb5..00000000 --- a/server/vbv_lernwelt/learnpath/migrations/0008_alter_learningcontent_contents.py +++ /dev/null @@ -1,124 +0,0 @@ -# Generated by Django 3.2.13 on 2022-11-07 13:30 - -import wagtail.blocks -import wagtail.fields -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ("learnpath", "0007_alter_learningcontent_contents"), - ] - - operations = [ - migrations.AlterField( - model_name="learningcontent", - name="contents", - field=wagtail.fields.StreamField( - [ - ( - "video", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "resource", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ("text", wagtail.blocks.RichTextBlock(required=False)), - ] - ), - ), - ( - "exercise", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "learningmodule", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "online_training", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "media_library", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "document", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "test", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "book", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "assignment", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ("text", wagtail.blocks.RichTextBlock(required=False)), - ] - ), - ), - ( - "placeholder", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ], - use_json_field=None, - ), - ), - ] diff --git a/server/vbv_lernwelt/learnpath/migrations/0009_alter_learningcontent_contents.py b/server/vbv_lernwelt/learnpath/migrations/0009_alter_learningcontent_contents.py deleted file mode 100644 index 525dca13..00000000 --- a/server/vbv_lernwelt/learnpath/migrations/0009_alter_learningcontent_contents.py +++ /dev/null @@ -1,125 +0,0 @@ -# Generated by Django 3.2.13 on 2022-12-08 09:55 - -import wagtail.blocks -import wagtail.fields -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ("learnpath", "0008_alter_learningcontent_contents"), - ] - - operations = [ - migrations.AlterField( - model_name="learningcontent", - name="contents", - field=wagtail.fields.StreamField( - [ - ( - "video", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "resource", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ("text", wagtail.blocks.RichTextBlock(required=False)), - ] - ), - ), - ( - "exercise", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "learningmodule", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "online_training", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "media_library", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "document", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "test", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "book", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "assignment", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ("text", wagtail.blocks.RichTextBlock(required=False)), - ] - ), - ), - ( - "placeholder", - wagtail.blocks.StructBlock( - [ - ("description", wagtail.blocks.TextBlock()), - ("url", wagtail.blocks.TextBlock()), - ] - ), - ), - ("feedback", wagtail.blocks.StructBlock([])), - ], - use_json_field=None, - ), - ), - ] diff --git a/server/vbv_lernwelt/learnpath/migrations/0010_remove_circle_experts.py b/server/vbv_lernwelt/learnpath/migrations/0010_remove_circle_experts.py deleted file mode 100644 index e0dd51a5..00000000 --- a/server/vbv_lernwelt/learnpath/migrations/0010_remove_circle_experts.py +++ /dev/null @@ -1,16 +0,0 @@ -# Generated by Django 3.2.13 on 2023-01-11 09:31 - -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ("learnpath", "0009_alter_learningcontent_contents"), - ] - - operations = [ - migrations.RemoveField( - model_name="circle", - name="experts", - ), - ] diff --git a/server/vbv_lernwelt/learnpath/migrations/0011_alter_circle_goals.py b/server/vbv_lernwelt/learnpath/migrations/0011_alter_circle_goals.py deleted file mode 100644 index ea30301b..00000000 --- a/server/vbv_lernwelt/learnpath/migrations/0011_alter_circle_goals.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.13 on 2023-03-08 08:21 - -import wagtail.fields -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("learnpath", "0010_remove_circle_experts"), - ] - - operations = [ - migrations.AlterField( - model_name="circle", - name="goals", - field=wagtail.fields.RichTextField(), - ), - ] diff --git a/server/vbv_lernwelt/learnpath/migrations/0012_auto_20230309_0711.py b/server/vbv_lernwelt/learnpath/migrations/0012_auto_20230309_0711.py deleted file mode 100644 index d563e2bf..00000000 --- a/server/vbv_lernwelt/learnpath/migrations/0012_auto_20230309_0711.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 3.2.13 on 2023-03-09 06:11 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("learnpath", "0011_alter_circle_goals"), - ] - - operations = [ - migrations.RemoveField( - model_name="circle", - name="goal_description", - ), - migrations.RemoveField( - model_name="circle", - name="job_situation_description", - ), - migrations.RemoveField( - model_name="circle", - name="job_situations", - ), - ] diff --git a/server/vbv_lernwelt/media_library/migrations/0001_initial.py b/server/vbv_lernwelt/media_library/migrations/0001_initial.py index 36eedc26..1c5d597b 100644 --- a/server/vbv_lernwelt/media_library/migrations/0001_initial.py +++ b/server/vbv_lernwelt/media_library/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 3.2.13 on 2022-10-03 14:18 +# Generated by Django 3.2.13 on 2023-03-31 16:22 import django.db.models.deletion import taggit.managers @@ -11,12 +11,13 @@ from django.db import migrations, models class Migration(migrations.Migration): + initial = True dependencies = [ - ("course", "0001_initial"), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ("course", "0002_initial"), ("taggit", "0004_alter_taggeditem_content_type_alter_taggeditem_tag"), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), ("wagtailcore", "0069_log_entry_jsonfield"), ] @@ -73,6 +74,10 @@ class Migration(migrations.Migration): "overview_icon", models.CharField(default="icon-hf-fahrzeug", max_length=255), ), + ( + "detail_image", + models.CharField(default="image-hf-fahrzeug", max_length=255), + ), ( "body", wagtail.fields.StreamField( @@ -82,6 +87,12 @@ class Migration(migrations.Migration): wagtail.blocks.StructBlock( [ ("title", wagtail.blocks.TextBlock()), + ( + "description", + wagtail.blocks.TextBlock( + default="", required=False + ), + ), ( "contents", wagtail.blocks.StreamBlock( @@ -92,10 +103,7 @@ class Migration(migrations.Migration): [ ( "title", - wagtail.blocks.TextBlock( - blank=False, - null=False, - ), + wagtail.blocks.TextBlock(), ), ( "description", @@ -149,10 +157,7 @@ class Migration(migrations.Migration): [ ( "title", - wagtail.blocks.TextBlock( - blank=False, - null=False, - ), + wagtail.blocks.TextBlock(), ), ( "description", @@ -206,10 +211,7 @@ class Migration(migrations.Migration): [ ( "title", - wagtail.blocks.TextBlock( - blank=False, - null=False, - ), + wagtail.blocks.TextBlock(), ), ( "description", @@ -263,10 +265,7 @@ class Migration(migrations.Migration): [ ( "title", - wagtail.blocks.TextBlock( - blank=False, - null=False, - ), + wagtail.blocks.TextBlock(), ), ( "description", diff --git a/server/vbv_lernwelt/media_library/migrations/0002_alter_mediacategorypage_body.py b/server/vbv_lernwelt/media_library/migrations/0002_alter_mediacategorypage_body.py deleted file mode 100644 index e3d2bbed..00000000 --- a/server/vbv_lernwelt/media_library/migrations/0002_alter_mediacategorypage_body.py +++ /dev/null @@ -1,261 +0,0 @@ -# Generated by Django 3.2.13 on 2022-10-05 12:18 - -import wagtail.blocks -import wagtail.fields -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ("media_library", "0001_initial"), - ] - - operations = [ - migrations.AlterField( - model_name="mediacategorypage", - name="body", - field=wagtail.fields.StreamField( - [ - ( - "content_collection", - wagtail.blocks.StructBlock( - [ - ("title", wagtail.blocks.TextBlock()), - ( - "description", - wagtail.blocks.TextBlock( - default="", required=False - ), - ), - ( - "contents", - wagtail.blocks.StreamBlock( - [ - ( - "learn_media", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.TextBlock(), - ), - ( - "description", - wagtail.blocks.TextBlock( - default="", - required=False, - ), - ), - ( - "icon_url", - wagtail.blocks.TextBlock( - default="", - required=False, - ), - ), - ( - "link_display_text", - wagtail.blocks.CharBlock( - default="Link öffnen", - max_length=255, - ), - ), - ( - "url", - wagtail.blocks.TextBlock( - default="", - required=False, - ), - ), - ( - "open_window", - wagtail.blocks.BooleanBlock( - default=False - ), - ), - ( - "page", - wagtail.blocks.PageChooserBlock( - page_type=[ - "learnpath.LearningContent" - ], - required=False, - ), - ), - ] - ), - ), - ( - "external_link", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.TextBlock(), - ), - ( - "description", - wagtail.blocks.TextBlock( - default="", - required=False, - ), - ), - ( - "icon_url", - wagtail.blocks.TextBlock( - default="", - required=False, - ), - ), - ( - "link_display_text", - wagtail.blocks.CharBlock( - default="Link öffnen", - max_length=255, - ), - ), - ( - "url", - wagtail.blocks.TextBlock( - default="", - required=False, - ), - ), - ( - "open_window", - wagtail.blocks.BooleanBlock( - default=False - ), - ), - ( - "page", - wagtail.blocks.PageChooserBlock( - page_type=[ - "learnpath.LearningContent" - ], - required=False, - ), - ), - ] - ), - ), - ( - "internal_link", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.TextBlock(), - ), - ( - "description", - wagtail.blocks.TextBlock( - default="", - required=False, - ), - ), - ( - "icon_url", - wagtail.blocks.TextBlock( - default="", - required=False, - ), - ), - ( - "link_display_text", - wagtail.blocks.CharBlock( - default="Link öffnen", - max_length=255, - ), - ), - ( - "url", - wagtail.blocks.TextBlock( - default="", - required=False, - ), - ), - ( - "open_window", - wagtail.blocks.BooleanBlock( - default=False - ), - ), - ( - "page", - wagtail.blocks.PageChooserBlock( - page_type=[ - "learnpath.LearningContent" - ], - required=False, - ), - ), - ] - ), - ), - ( - "relative_link", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.TextBlock(), - ), - ( - "description", - wagtail.blocks.TextBlock( - default="", - required=False, - ), - ), - ( - "icon_url", - wagtail.blocks.TextBlock( - default="", - required=False, - ), - ), - ( - "link_display_text", - wagtail.blocks.CharBlock( - default="Link öffnen", - max_length=255, - ), - ), - ( - "url", - wagtail.blocks.TextBlock( - default="", - required=False, - ), - ), - ( - "open_window", - wagtail.blocks.BooleanBlock( - default=False - ), - ), - ( - "page", - wagtail.blocks.PageChooserBlock( - page_type=[ - "learnpath.LearningContent" - ], - required=False, - ), - ), - ] - ), - ), - ] - ), - ), - ] - ), - ) - ], - null=True, - use_json_field=True, - ), - ), - ] diff --git a/server/vbv_lernwelt/media_library/migrations/0003_mediacategorypage_detail_image.py b/server/vbv_lernwelt/media_library/migrations/0003_mediacategorypage_detail_image.py deleted file mode 100644 index f9138ff3..00000000 --- a/server/vbv_lernwelt/media_library/migrations/0003_mediacategorypage_detail_image.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 4.0.8 on 2022-11-07 09:49 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("media_library", "0002_alter_mediacategorypage_body"), - ] - - operations = [ - migrations.AddField( - model_name="mediacategorypage", - name="detail_image", - field=models.CharField(default="image-hf-fahrzeug", max_length=255), - ), - ]