feat: new course modal

This commit is contained in:
Jannat Patel
2026-01-28 10:57:58 +05:30
parent 49ed082831
commit b50d584a5b
13 changed files with 1991 additions and 313 deletions

View File

@@ -19,9 +19,14 @@
showOptions = true
}
"
@click="(e) => {
showOptions = true
nextTick(() => {
setFocus()
})
}"
@focus="
() => {
showOptions = true
if (!filterOptions.data || filterOptions.data.length === 0) {
reload('')
}
@@ -115,7 +120,7 @@ import {
} from '@headlessui/vue'
import { createResource, Popover, Button } from 'frappe-ui'
import { ref, computed, nextTick, useAttrs } from 'vue'
import { watchDebounced } from '@vueuse/core'
import { set, watchDebounced } from '@vueuse/core'
import { X, Plus } from 'lucide-vue-next'
const props = defineProps({
@@ -149,7 +154,6 @@ const props = defineProps({
const values = defineModel()
const attrs = useAttrs()
const emails = ref([])
const search = ref(null)
const error = ref(null)
const query = ref('')
@@ -161,6 +165,7 @@ const selectedValue = computed({
set: (val) => {
query.value = ''
val?.value && addValue(val.value)
showOptions.value = false
},
})

View File

@@ -34,7 +34,7 @@
<img
v-if="type == 'image'"
:src="modelValue"
class="border rounded-md w-44 h-auto"
class="border rounded-md w-44 h-auto min-h-20 object-cover"
/>
<video v-else controls class="border rounded-md w-44 h-auto">
<source :src="modelValue" />

View File

@@ -88,29 +88,11 @@
</template>
{{ __('Get Certificate') }}
</Button>
<router-link
v-if="user?.data?.is_moderator || is_instructor()"
:to="{
name: 'CourseForm',
params: {
courseName: course.data.name,
},
}"
>
<Button variant="subtle" class="w-full mt-2" size="md">
<template #prefix>
<Pencil class="size-4 stroke-1.5" />
</template>
<span>
{{ __('Edit') }}
</span>
</Button>
</router-link>
</div>
<div class="space-y-4">
<div
class="font-medium text-ink-gray-9"
:class="{ 'mt-8': !readOnlyMode }"
:class="{ 'mt-8': course.data.membership && !readOnlyMode }"
>
{{ __('This course has:') }}
</div>