diff --git a/frontend/src/components/BatchStudents.vue b/frontend/src/components/BatchStudents.vue index 8ef76282..70ed5e1b 100644 --- a/frontend/src/components/BatchStudents.vue +++ b/frontend/src/components/BatchStudents.vue @@ -145,9 +145,9 @@ const removeStudent = createResource({ const removeStudents = (selections) => { selections.forEach(async (student) => { - console.log(student) removeStudent.submit({ student }) await setTimeout(1000) }) + students.reload() } diff --git a/frontend/src/components/Modals/JobApplicationModal.vue b/frontend/src/components/Modals/JobApplicationModal.vue index decaf5e7..3da02e06 100644 --- a/frontend/src/components/Modals/JobApplicationModal.vue +++ b/frontend/src/components/Modals/JobApplicationModal.vue @@ -72,6 +72,7 @@ import { createToast, getFileSize } from '@/utils/' const resume = ref(null) const show = defineModel() const user = inject('$user') +const application = defineModel('application') const props = defineProps({ job: { @@ -117,6 +118,8 @@ const submitResume = (close) => { icon: 'check', iconClasses: 'bg-green-600 text-white rounded-md p-px', }) + application.value.reload() + close() }, onError(err) { createToast({ diff --git a/frontend/src/pages/Batches.vue b/frontend/src/pages/Batches.vue index f85727dc..cf6ba1c3 100644 --- a/frontend/src/pages/Batches.vue +++ b/frontend/src/pages/Batches.vue @@ -8,12 +8,19 @@ :items="[{ label: __('All Batches'), route: { name: 'Batches' } }]" />
- + + +
@@ -73,14 +80,12 @@
- diff --git a/frontend/src/pages/CreateBatch.vue b/frontend/src/pages/CreateBatch.vue new file mode 100644 index 00000000..9011e1bf --- /dev/null +++ b/frontend/src/pages/CreateBatch.vue @@ -0,0 +1,37 @@ + + diff --git a/frontend/src/pages/CreateLesson.vue b/frontend/src/pages/CreateLesson.vue index c4d3bdc2..df4cde89 100644 --- a/frontend/src/pages/CreateLesson.vue +++ b/frontend/src/pages/CreateLesson.vue @@ -43,7 +43,7 @@ import { Button, createDocumentResource, } from 'frappe-ui' -import { computed, reactive, onMounted, onBeforeMount } from 'vue' +import { computed, reactive, onMounted, inject } from 'vue' import EditorJS from '@editorjs/editorjs' import Header from '@editorjs/header' import Paragraph from '@editorjs/paragraph' @@ -54,6 +54,7 @@ import { createToast } from '../utils' let editor let editLessonResource +const user = inject('$user') const props = defineProps({ courseName: { @@ -71,8 +72,10 @@ const props = defineProps({ }) onMounted(() => { + if (!user.data?.is_moderator || !user.data?.is_instructor) { + window.location.href = '/login' + } editor = renderEditor('content') - /* renderEditor('instructor-notes') */ }) const renderEditor = (holder) => { diff --git a/frontend/src/pages/JobDetail.vue b/frontend/src/pages/JobDetail.vue index 7904224f..b88c30df 100644 --- a/frontend/src/pages/JobDetail.vue +++ b/frontend/src/pages/JobDetail.vue @@ -83,6 +83,7 @@ @@ -112,25 +113,26 @@ const job = createResource({ }, cache: ['job', props.job], auto: true, + onSuccess: (data) => { + if (user.data?.name) { + jobApplication.submit() + } + }, }) const jobApplication = createResource({ url: 'frappe.client.get_list', - params: { - doctype: 'LMS Job Application', - filters: { - job: job.data?.name, - user: user.data?.name, - }, + makeParams(values) { + return { + doctype: 'LMS Job Application', + filters: { + job: job.data?.name, + user: user.data?.name, + }, + } }, }) -onMounted(() => { - if (user.data?.name) { - jobApplication.submit() - } -}) - const openApplicationModal = () => { showApplicationModal.value = true } diff --git a/frontend/src/router.js b/frontend/src/router.js index e86c6353..f8f4be92 100644 --- a/frontend/src/router.js +++ b/frontend/src/router.js @@ -82,6 +82,12 @@ const routes = [ component: () => import('@/pages/CreateLesson.vue'), props: true, }, + { + path: '/batches/:batchName/edit', + name: 'CreateBatch', + component: () => import('@/pages/CreateBatch.vue'), + props: true, + }, ] let router = createRouter({ diff --git a/lms/job/doctype/lms_job_application/lms_job_application.py b/lms/job/doctype/lms_job_application/lms_job_application.py index 70196243..f40a1f4d 100644 --- a/lms/job/doctype/lms_job_application/lms_job_application.py +++ b/lms/job/doctype/lms_job_application/lms_job_application.py @@ -11,7 +11,11 @@ class LMSJobApplication(Document): self.validate_duplicate() def after_insert(self): - self.send_email_to_employer() + outgoing_email_account = frappe.get_cached_value( + "Email Account", {"default_outgoing": 1, "enable_outgoing": 1}, "name" + ) + if outgoing_email_account: + self.send_email_to_employer() def validate_duplicate(self): if frappe.db.exists("LMS Job Application", {"job": self.job, "user": self.user}): diff --git a/lms/lms/utils.py b/lms/lms/utils.py index 58530db0..a3dbb753 100644 --- a/lms/lms/utils.py +++ b/lms/lms/utils.py @@ -1757,6 +1757,9 @@ def get_lesson_creation_details(course, chapter, lesson): "Lesson Reference", {"parent": chapter_name, "idx": lesson}, "lesson" ) + if lesson_name: + lesson_details = frappe.db.get_value("Course Lesson", lesson_name, [""]) + return { "course_title": frappe.db.get_value("LMS Course", course, "title"), "chapter": frappe.db.get_value(