Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/frappe/lms into posthog
Browse files Browse the repository at this point in the history
  • Loading branch information
pateljannat committed Aug 12, 2024
2 parents a9e93a6 + d0d1fb2 commit b956c4e
Show file tree
Hide file tree
Showing 22 changed files with 2,016 additions and 3,000 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "frappe-ui"]
path = frappe-ui
url = https://github.com/pateljannat/frappe-ui
13 changes: 11 additions & 2 deletions frontend/src/components/Controls/Autocomplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
>
<li
:class="[
'flex items-center rounded px-2.5 py-1.5 text-base',
'flex items-center rounded px-2.5 py-2 text-base',
{ 'bg-gray-100': active },
]"
>
Expand All @@ -87,7 +87,16 @@
name="item-label"
v-bind="{ active, selected, option }"
>
{{ option.label }}
<div class="flex flex-col space-y-1">
<div>
{{ option.label }}
</div>
<div
v-if="option.label != option.description"
class="text-xs text-gray-700"
v-html="option.description"
></div>
</div>
</slot>
</li>
</ComboboxOption>
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/components/Controls/Link.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ const valuePropPassed = computed(() => 'value' in attrs)
const value = computed({
get: () => (valuePropPassed.value ? attrs.value : props.modelValue),
set: (val) => {
console.log(valuePropPassed.value)
return (
val?.value &&
emit(valuePropPassed.value ? 'change' : 'update:modelValue', val?.value)
Expand Down Expand Up @@ -118,6 +119,7 @@ const options = createResource({
return {
label: option.value,
value: option.value,
description: option.description,
}
})
},
Expand Down
41 changes: 27 additions & 14 deletions frontend/src/components/LessonPlugins.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="text-lg font-semibold">
{{ __('Components') }}
</div>
<div class="mt-5">
<div class="mt-5 space-y-4">
<Tooltip
:text="
__(
Expand All @@ -18,20 +18,31 @@
<Select v-model="currentEditor" :options="getEditorOptions()" />
</div>
</Tooltip>
<div class="flex mt-4">
<div class="flex">
<Link
v-model="quiz"
:value="quiz"
class="flex-1"
doctype="LMS Quiz"
:label="__('Select a Quiz')"
:label="__('Add an existing quiz')"
@change="(option) => addQuiz(option)"
/>
<Button @click="addQuiz()" class="self-end ml-2">
<template #icon>
<Plus class="h-4 w-4 stroke-1.5" />
</template>
</Button>
<router-link
:to="{
name: 'QuizCreation',
params: {
quizID: 'new',
},
}"
class="self-end ml-2"
>
<Button>
<template #icon>
<Plus class="h-4 w-4 stroke-1.5" />
</template>
</Button>
</router-link>
</div>
<div class="mt-4">
<div class="">
<div class="text-xs text-gray-600 mb-1">
{{ __('Add an image, video, pdf or audio.') }}
</div>
Expand Down Expand Up @@ -68,7 +79,7 @@
</div>
</div>
</div>
<div class="mt-4">
<div class="">
<div class="text-xs text-gray-600 mb-1">
{{
__(
Expand Down Expand Up @@ -112,11 +123,13 @@ const props = defineProps({
},
})
const addQuiz = () => {
const addQuiz = (value) => {
console.log('here')
console.log(value)
getCurrentEditor().caret.setToLastBlock('end', 0)
if (quiz.value) {
if (value) {
getCurrentEditor().blocks.insert('quiz', {
quiz: quiz.value,
quiz: value,
})
quiz.value = null
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/Modals/ChapterModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
</template>
<script setup>
import { Dialog, FormControl, createResource } from 'frappe-ui'
import { defineModel, reactive, watch, inject } from 'vue'
import { createToast, formatTime } from '@/utils/'
import { defineModel, reactive, watch } from 'vue'
import { createToast } from '@/utils/'
const show = defineModel()
const outline = defineModel('outline')
Expand Down
Loading

0 comments on commit b956c4e

Please sign in to comment.