feat: certification rules, content sanitization, handle draft course updates and reset content, better redis logging

This commit is contained in:
Rotimi Best
2026-03-30 08:24:55 +01:00
parent ff2ad59377
commit 5a8f50f67b
131 changed files with 5643 additions and 2134 deletions
@@ -64,15 +64,17 @@
<span>{$t('course.navItems.nav_content')}</span>
<div class="ml-auto flex items-center gap-1">
<Plus
size={20}
class="rounded-full p-1"
onclick={(event) => {
event.preventDefault();
event.stopPropagation();
openContentModal(id);
}}
/>
{#if !isStudent}
<Plus
size={20}
class="rounded-full p-1"
onclick={(event) => {
event.preventDefault();
event.stopPropagation();
openContentModal(id);
}}
/>
{/if}
</div>
</a>
{/snippet}
@@ -85,8 +87,8 @@
{id}
{isStudent}
className="mt-1"
onOpenContentModal={(sectionId) => openContentModal(id, sectionId)}
onEditSection={(sectionId) => openSectionEditor(id, sectionId)}
onOpenContentModal={isStudent ? undefined : (sectionId) => openContentModal(id, sectionId)}
onEditSection={isStudent ? undefined : (sectionId) => openSectionEditor(id, sectionId)}
/>
</Sidebar.Group>
@@ -26,6 +26,7 @@
let { path, id, isStudent = false, className = '', onOpenContentModal }: Props = $props();
const contentData = $derived(getCourseContent(courseApi.course));
const canOpenContentModal = $derived(Boolean(onOpenContentModal) && !isStudent);
</script>
<Sidebar.MenuSub class={className}>
@@ -42,7 +43,7 @@
<span class="flex-1 truncate">{section.title}</span>
<div class="ml-auto flex items-center gap-1">
{#if onOpenContentModal}
{#if canOpenContentModal}
<IconButton
variant="ghost-outline"
size="icon-xs"
@@ -285,8 +285,8 @@
{id}
{isStudent}
className="mt-1 ml-2"
onOpenContentModal={(sectionId) => openContentModal(id, sectionId)}
onEditSection={(sectionId) => openSectionEditor(id, sectionId)}
onOpenContentModal={isStudent ? undefined : (sectionId) => openContentModal(id, sectionId)}
onEditSection={isStudent ? undefined : (sectionId) => openSectionEditor(id, sectionId)}
/>
{/if}
</Sidebar.MenuItem>