diff --git a/client/.prettierrc b/client/.prettierrc index cce623d3..8258aa33 100644 --- a/client/.prettierrc +++ b/client/.prettierrc @@ -3,5 +3,6 @@ "singleQuote": false, "tabWidth": 2, "printWidth": 88, - "organizeImportsSkipDestructiveCodeActions": true + "organizeImportsSkipDestructiveCodeActions": true, + "htmlWhitespaceSensitivity": "ignore" } diff --git a/client/src/components/MainNavigationBar.vue b/client/src/components/MainNavigationBar.vue index 236bbd2f..cebab77f 100644 --- a/client/src/components/MainNavigationBar.vue +++ b/client/src/components/MainNavigationBar.vue @@ -204,8 +204,9 @@ const profileDropdownData: DropdownListItem[] = [ class="nav-item" target="_blank" href="https://bildung.vbv.ch/ilp/pages/catalogsearch.jsf" - >Shop + Shop + { @click="clickLink('/profile')" > - {{ $t("mainNavigation.settings") }} + {{ $t("mainNavigation.settings") }} @@ -72,8 +72,9 @@ const clickLink = (to: string | undefined) => { class="nav-item" target="_blank" href="https://bildung.vbv.ch/ilp/pages/catalogsearch.jsf" - >Shop + Shop +
  • diff --git a/client/src/pages/learningPath/CirclePage.vue b/client/src/pages/learningPath/CirclePage.vue index 036d4bf7..f99ad302 100644 --- a/client/src/pages/learningPath/CirclePage.vue +++ b/client/src/pages/learningPath/CirclePage.vue @@ -5,14 +5,14 @@ import LearningSequence from "@/components/learningPath/LearningSequence.vue"; import ItDropdownSelect from "@/components/ui/ItDropdownSelect.vue"; import ItModal from "@/components/ui/ItModal.vue"; import * as log from "loglevel"; -import { reactive, ref } from "vue"; +import { computed, onMounted, reactive, ref } from "vue"; import { useAppStore } from "@/stores/app"; import { useCircleStore } from "@/stores/circle"; import { useCourseSessionsStore } from "@/stores/courseSessions"; +import type { CourseSessionUser } from "@/types"; import { humanizeDuration } from "@/utils/humanizeDuration"; import _ from "lodash"; -import { computed, onMounted } from "vue"; import { useI18n } from "vue-i18n"; import { useRoute } from "vue-router"; @@ -20,12 +20,19 @@ const route = useRoute(); const { t } = useI18n(); const courseSessionsStore = useCourseSessionsStore(); -log.debug("CircleView.vue created", route); - -const props = defineProps<{ +interface Props { courseSlug: string; circleSlug: string; -}>(); + profileUser?: CourseSessionUser; + readonly?: boolean; +} + +const props = withDefaults(defineProps(), { + readonly: false, + profileUser: undefined, +}); + +log.debug("CirclePage created", props.readonly, props.profileUser); const showUploadModal = ref(false); const formData = reactive({ @@ -59,10 +66,23 @@ const dropdownLearningSequences = computed(() => ); onMounted(async () => { - log.debug("CircleView.vue mounted", props.courseSlug, props.circleSlug); + log.debug( + "CirclePage mounted", + props.courseSlug, + props.circleSlug, + props.profileUser + ); try { - await circleStore.loadCircle(props.courseSlug, props.circleSlug); + if (props.profileUser) { + await circleStore.loadCircle( + props.courseSlug, + props.circleSlug, + props.profileUser.user_id + ); + } else { + await circleStore.loadCircle(props.courseSlug, props.circleSlug); + } if (route.hash.startsWith("#ls-") || route.hash.startsWith("#lu-")) { const slugEnd = route.hash.replace("#", ""); @@ -107,9 +127,33 @@ onMounted(async () => {
    +
    {
    -
    +
    { {{ $t("circlePage.circleContentBoxTitle") }}
    -
    +
    Fachexpertin kontaktieren
    @@ -159,7 +203,7 @@ onMounted(async () => {
    -
    +

    {{ $t("circlePage.documents.title") }}

    @@ -176,7 +220,7 @@ onMounted(async () => {
    -
    +

    {{ $t("circlePage.gotQuestions") }}

    Tausche dich mit der Fachexpertin aus für den Circle Analyse aus. @@ -196,6 +240,7 @@ onMounted(async () => { >
  • @@ -206,31 +251,30 @@ onMounted(async () => { diff --git a/client/src/pages/mediaLibrary/MLMediaListPage.vue b/client/src/pages/mediaLibrary/MLMediaListPage.vue index 848ccf06..5c64cb91 100644 --- a/client/src/pages/mediaLibrary/MLMediaListPage.vue +++ b/client/src/pages/mediaLibrary/MLMediaListPage.vue @@ -74,7 +74,8 @@ const mediaList = computed(() => { :to="item.value.url" :blank="item.value.open_window" class="link" - >{{ item.value.link_display_text }} + > + {{ item.value.link_display_text }} diff --git a/client/src/router/index.ts b/client/src/router/index.ts index 3b5b4a41..89f19128 100644 --- a/client/src/router/index.ts +++ b/client/src/router/index.ts @@ -114,6 +114,11 @@ const router = createRouter({ component: () => import("@/pages/cockpit/CockpitUserProfilePage.vue"), props: true, }, + { + path: "profile/:userId/:circleSlug", + component: () => import("@/pages/cockpit/CockpitUserCirclePage.vue"), + props: true, + }, ], }, { diff --git a/server/vbv_lernwelt/course/models.py b/server/vbv_lernwelt/course/models.py index 3edd406a..f730e8d9 100644 --- a/server/vbv_lernwelt/course/models.py +++ b/server/vbv_lernwelt/course/models.py @@ -227,6 +227,7 @@ class CourseSessionUser(models.Model): def to_dict(self): return { + "session_id": self.course_session.id, "session_title": self.course_session.title, "user_id": self.user.id, "first_name": self.user.first_name, diff --git a/server/vbv_lernwelt/course/views.py b/server/vbv_lernwelt/course/views.py index a5cc4558..7cf09496 100644 --- a/server/vbv_lernwelt/course/views.py +++ b/server/vbv_lernwelt/course/views.py @@ -138,7 +138,11 @@ def get_course_session_users(request, course_slug): data = { "cockpit_user": cockpit_user_csu[0].to_dict() - | {"circles": cockpit_user_csu[0].expert.all().values("id", "title")}, + | { + "circles": cockpit_user_csu[0] + .expert.all() + .values("id", "title", "slug", "translation_key") + }, "users": user_data, }