fix: no preview modal for upcoming courses.
This commit is contained in:
@@ -45,10 +45,6 @@ frappe.ready(() => {
|
||||
clear_work(e);
|
||||
});
|
||||
|
||||
$(".join-batch").click((e) => {
|
||||
join_course(e)
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
const save_current_lesson = () => {
|
||||
@@ -244,36 +240,6 @@ const add_to_local_storage = (quiz_name, current_index, answer, is_correct) => {
|
||||
localStorage.setItem(quiz_name, JSON.stringify(quiz_stored))
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const create_certificate = (e) => {
|
||||
e.preventDefault();
|
||||
course = $(".title").attr("data-course");
|
||||
|
||||
Reference in New Issue
Block a user