diff --git a/lms/lms/widgets/CourseOutline.html b/lms/lms/widgets/CourseOutline.html index 2f9dec80..43350d50 100644 --- a/lms/lms/widgets/CourseOutline.html +++ b/lms/lms/widgets/CourseOutline.html @@ -74,24 +74,36 @@ @@ -180,8 +180,7 @@ {% elif course.upcoming and not is_user_interested %} -
+
{{ _("Notify me when available") }}
diff --git a/lms/www/courses/course.js b/lms/www/courses/course.js index dd6b102b..cb194253 100644 --- a/lms/www/courses/course.js +++ b/lms/www/courses/course.js @@ -6,10 +6,6 @@ frappe.ready(() => { cancel_mentor_request(e); }); - $(".join-batch").click((e) => { - join_course(e); - }); - $(".view-all-mentors").click((e) => { view_all_mentors(e); }); @@ -24,11 +20,7 @@ frappe.ready(() => { $("#submit-review").click((e) => { submit_review(e); - }) - - $("#notify-me").click((e) => { - notify_user(e); - }) + }); $("#certification").click((e) => { create_certificate(e); @@ -101,36 +93,6 @@ var cancel_mentor_request = (e) => { }) } -const join_course = (e) => { - e.preventDefault(); - let course = $(e.currentTarget).attr("data-course"); - if (frappe.session.user == "Guest") { - window.location.href = `/login?redirect-to=/courses/${course}`; - return; - } - - let batch = $(e.currentTarget).attr("data-batch"); - batch = batch ? decodeURIComponent(batch) : ""; - frappe.call({ - "method": "lms.lms.doctype.lms_batch_membership.lms_batch_membership.create_membership", - "args": { - "batch": batch ? batch : "", - "course": course - }, - "callback": (data) => { - if (data.message == "OK") { - frappe.msgprint({ - "title": __("Successfully Enrolled"), - "message": __("You are now a student of this course.") - }); - setTimeout(function () { - window.location.href = `/courses/${course}/learn/1.1`; - }, 2000); - } - } - }) -}; - var view_all_mentors = (e) => { $(".wrapped").each((i, element) => { $(element).slideToggle("slow"); @@ -185,26 +147,6 @@ var submit_review = (e) => { }) }; -var notify_user = (e) => { - e.preventDefault(); - var course = decodeURIComponent($(e.currentTarget).attr("data-course")); - if (frappe.session.user == "Guest") { - window.location.href = `/login?redirect-to=/courses/${course}`; - return; - } - - frappe.call({ - method: "lms.lms.doctype.lms_course_interest.lms_course_interest.capture_interest", - args: { - "course": course - }, - callback: (data) => { - $("#interest-alert").removeClass("hide"); - $("#notify-me").addClass("hide"); - } - }) -}; - const create_certificate = (e) => { e.preventDefault(); course = $(e.currentTarget).attr("data-course"); @@ -219,7 +161,6 @@ const create_certificate = (e) => { }) }; - const element_not_in_viewport = (el) => { const rect = el.getBoundingClientRect(); return rect.bottom < 0 || rect.right < 0 || rect.left > window.innerWidth || rect.top > window.innerHeight;