fix: batch lists

This commit is contained in:
Jannat Patel
2024-04-22 14:38:46 +05:30
parent f15fdcc42e
commit 4f7c3f14df
7 changed files with 34 additions and 6 deletions

View File

@@ -108,13 +108,16 @@ const getCoursesColumns = () => {
{
label: 'Title',
key: 'title',
width: 2,
},
{
label: 'Lessons',
key: 'lesson_count',
align: 'right',
},
{
label: 'Enrollments',
align: 'right',
key: 'enrollment_count',
},
]
@@ -131,7 +134,6 @@ const removeCourse = createResource({
})
const removeCourses = (selections) => {
console.log(selections)
selections.forEach(async (course) => {
removeCourse.submit({ course })
await setTimeout(1000)

View File

@@ -109,6 +109,7 @@ const getStudentColumns = () => {
{
label: 'Full Name',
key: 'full_name',
width: 2,
},
{
label: 'Courses Done',

View File

@@ -15,7 +15,14 @@
<div class="grid gap-8 mt-10">
<div v-for="(review, index) in reviews.data">
<div class="flex items-center">
<UserAvatar :user="review.owner_details" :size="'2xl'" />
<router-link
:to="{
name: 'Profile',
params: { username: review.owner_details.username },
}"
>
<UserAvatar :user="review.owner_details" :size="'2xl'" />
</router-link>
<div class="mx-4">
<router-link
:to="{

View File

@@ -14,7 +14,13 @@
}"
>
<template #body-content>
<Link doctype="LMS Course" v-model="course" />
<Link doctype="LMS Course" v-model="course" :label="__('Course')" />
<Link
doctype="Course Evaluator"
v-model="evaluator"
:label="__('Evaluator')"
class="mt-4"
/>
</template>
</Dialog>
</template>
@@ -26,6 +32,7 @@ import { showToast } from '@/utils'
const show = defineModel()
const course = ref(null)
const evaluator = ref(null)
const courses = defineModel('courses')
const props = defineProps({
@@ -45,6 +52,7 @@ const createBatchCourse = createResource({
parenttype: 'LMS Batch',
parentfield: 'courses',
course: course.value,
evaluator: evaluator.value,
},
}
},
@@ -58,6 +66,7 @@ const addCourse = (close) => {
courses.value.reload()
close()
course.value = null
evaluator.value = null
},
onError(err) {
showToast('Error', err.message[0] || err, 'x')

View File

@@ -77,7 +77,6 @@
/>
</div>
<CourseReviews
v-if="course.data.avg_rating"
:courseName="course.data.name"
:avg_rating="course.data.avg_rating"
:membership="course.data.membership"

View File

@@ -440,7 +440,7 @@ const breadcrumbs = computed(() => {
}
.ce-toolbar__actions {
right: 108%;
right: 108% !important;
}
.ce-block__content {

View File

@@ -1,3 +1,6 @@
import { Code } from "lucide-vue-next"
import { h, createApp } from "vue"
const DEFAULT_THEMES = ['light', 'dark'];
const COMMON_LANGUAGES = {
none: 'Auto-detect', apache: 'Apache', bash: 'Bash', cs: 'C#', cpp: 'C++', css: 'CSS', coffeescript: 'CoffeeScript', diff: 'Diff',
@@ -58,9 +61,16 @@ export class CodeBox {
}
static get toolbox() {
const app = createApp({
render: () => h(Code, { size: 24, strokeWidth: 2, color: 'black' }),
});
const div = document.createElement('div');
app.mount(div);
return {
title: 'CodeBox',
icon: '<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.71,6.29a1,1,0,0,0-1.42,0l-5,5a1,1,0,0,0,0,1.42l5,5a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42L5.41,12l4.3-4.29A1,1,0,0,0,9.71,6.29Zm11,5-5-5a1,1,0,0,0-1.42,1.42L18.59,12l-4.3,4.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0l5-5A1,1,0,0,0,20.71,11.29Z"/></svg>'
icon: div.innerHTML
};
}