feat: certificates, landing pages, ai tutor, website update, compliance
This commit is contained in:
@@ -22,8 +22,6 @@
|
||||
|
||||
const certificateTheme = $derived(courseApi.course?.certificate?.theme ?? '');
|
||||
|
||||
const currentCertificateState = $derived.by(() => getCertificateStateSnapshot(courseApi.course));
|
||||
|
||||
const userRole = $derived.by(() => {
|
||||
const user = courseApi.group.people.find((person) => person.profileId === $profile.id);
|
||||
return user ? Number(user.roleId) : null;
|
||||
@@ -40,7 +38,8 @@
|
||||
description: course.description ?? '',
|
||||
certificate: {
|
||||
isDownloadable: course.certificate?.isDownloadable ?? false,
|
||||
theme: parseCertificateThemeId(course.certificate?.theme) ?? 'professional',
|
||||
theme: parseCertificateThemeId(course.certificate?.theme),
|
||||
design: course.certificate?.design ?? null,
|
||||
deadline: course.certificate?.deadline ?? null,
|
||||
threshold: typeof course.certificate?.threshold === 'number' ? course.certificate.threshold : 100,
|
||||
requiredExerciseId: course.certificate?.requiredExerciseId ?? null,
|
||||
@@ -92,7 +91,8 @@
|
||||
description: courseApi.course.description ?? '',
|
||||
certificate: {
|
||||
isDownloadable: courseApi.course.certificate?.isDownloadable ?? false,
|
||||
theme: certificateTheme || 'professional',
|
||||
theme: certificateTheme || 'classique',
|
||||
design: courseApi.course.certificate?.design,
|
||||
deadline: courseApi.course.certificate?.deadline ?? null,
|
||||
threshold:
|
||||
typeof courseApi.course.certificate?.threshold === 'number' ? courseApi.course.certificate.threshold : 100,
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<script lang="ts">
|
||||
let { children }: { children?: import('svelte').Snippet } = $props();
|
||||
</script>
|
||||
|
||||
{@render children?.()}
|
||||
@@ -0,0 +1,31 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/state';
|
||||
import { Spinner } from '@cio/ui/base/spinner';
|
||||
import { t } from '$lib/utils/functions/translations';
|
||||
import { courseApi } from '$features/course/api';
|
||||
import { profile } from '$lib/utils/store/user';
|
||||
import CertificateEditor from '$features/course/components/ceritficate/editor/certificate-editor.svelte';
|
||||
|
||||
const courseId = $derived(page.params.id ?? '');
|
||||
|
||||
$effect(() => {
|
||||
if (!courseId || !$profile.id) return;
|
||||
courseApi.ensureCourse(courseId, $profile.id);
|
||||
});
|
||||
|
||||
const isReady = $derived(courseApi.course?.id === courseId);
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>{courseApi.course?.title ?? $t('course.navItem.certificates.editor.title')}</title>
|
||||
</svelte:head>
|
||||
|
||||
<div class="ui:bg-background min-h-screen w-full">
|
||||
{#if isReady}
|
||||
<CertificateEditor {courseId} />
|
||||
{:else}
|
||||
<div class="flex min-h-[60vh] items-center justify-center">
|
||||
<Spinner class="size-8!" />
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
Reference in New Issue
Block a user