|
26 | 26 | v-model="quiz" |
27 | 27 | doctype="LMS Quiz" |
28 | 28 | :label="__('Select a quiz')" |
| 29 | + placeholder=" " |
29 | 30 | :onCreate="(value, close) => redirectToForm()" |
30 | 31 | /> |
31 | | - <Link |
32 | | - v-else |
33 | | - v-model="assignment" |
34 | | - doctype="LMS Assignment" |
35 | | - :label="__('Select an assignment')" |
36 | | - :onCreate="(value, close) => redirectToForm()" |
37 | | - /> |
| 32 | + <div v-else class="space-y-4"> |
| 33 | + <Link |
| 34 | + v-if="filterAssignmentsByCourse" |
| 35 | + v-model="assignment" |
| 36 | + doctype="LMS Assignment" |
| 37 | + :filters="{ |
| 38 | + course: route.params.courseName, |
| 39 | + }" |
| 40 | + placeholder=" " |
| 41 | + :label="__('Select an Assignment')" |
| 42 | + :onCreate="(value, close) => redirectToForm()" |
| 43 | + /> |
| 44 | + <Link |
| 45 | + v-else |
| 46 | + v-model="assignment" |
| 47 | + doctype="LMS Assignment" |
| 48 | + placeholder=" " |
| 49 | + :label="__('Select an Assignment')" |
| 50 | + :onCreate="(value, close) => redirectToForm()" |
| 51 | + /> |
| 52 | + <FormControl |
| 53 | + type="checkbox" |
| 54 | + :label="__('Filter assignments by course')" |
| 55 | + v-model="filterAssignmentsByCourse" |
| 56 | + /> |
| 57 | + </div> |
38 | 58 | </div> |
39 | 59 | </div> |
40 | 60 | </template> |
41 | 61 | </Dialog> |
42 | 62 | </template> |
43 | 63 | <script setup> |
44 | | -import { Dialog } from 'frappe-ui' |
45 | | -import { onMounted, ref, nextTick } from 'vue' |
46 | | -import Link from '@/components/Controls/Link.vue' |
| 64 | +import { Dialog, FormControl } from 'frappe-ui' |
| 65 | +import { nextTick, onMounted, ref } from 'vue' |
| 66 | +import { useRoute } from 'vue-router' |
| 67 | +import { Link } from 'frappe-ui/frappe' |
47 | 68 |
|
48 | 69 | const show = ref(false) |
49 | 70 | const quiz = ref(null) |
50 | 71 | const assignment = ref(null) |
| 72 | +const filterAssignmentsByCourse = ref(false) |
| 73 | +const route = useRoute() |
51 | 74 |
|
52 | 75 | const props = defineProps({ |
53 | 76 | type: { |
|
0 commit comments