feat: request for certification
This commit is contained in:
@@ -1,62 +1,62 @@
|
||||
frappe.ready(() => {
|
||||
|
||||
hide_wrapped_mentor_cards();
|
||||
hide_wrapped_mentor_cards();
|
||||
|
||||
$("#cancel-request").click((e) => {
|
||||
cancel_mentor_request(e);
|
||||
});
|
||||
$("#cancel-request").click((e) => {
|
||||
cancel_mentor_request(e);
|
||||
});
|
||||
|
||||
$(".join-batch").click((e) => {
|
||||
join_course(e)
|
||||
});
|
||||
$(".join-batch").click((e) => {
|
||||
join_course(e)
|
||||
});
|
||||
|
||||
$(".view-all-mentors").click((e) => {
|
||||
view_all_mentors(e);
|
||||
});
|
||||
$(".view-all-mentors").click((e) => {
|
||||
view_all_mentors(e);
|
||||
});
|
||||
|
||||
$(".review-link").click((e) => {
|
||||
show_review_dialog(e);
|
||||
});
|
||||
$(".review-link").click((e) => {
|
||||
show_review_dialog(e);
|
||||
});
|
||||
|
||||
$(".icon-rating").click((e) => {
|
||||
highlight_rating(e);
|
||||
});
|
||||
$(".icon-rating").click((e) => {
|
||||
highlight_rating(e);
|
||||
});
|
||||
|
||||
$("#submit-review").click((e) => {
|
||||
submit_review(e);
|
||||
})
|
||||
$("#submit-review").click((e) => {
|
||||
submit_review(e);
|
||||
})
|
||||
|
||||
$("#notify-me").click((e) => {
|
||||
notify_user(e);
|
||||
})
|
||||
$("#notify-me").click((e) => {
|
||||
notify_user(e);
|
||||
})
|
||||
|
||||
$("#certification").click((e) => {
|
||||
create_certificate(e);
|
||||
});
|
||||
$("#certification").click((e) => {
|
||||
create_certificate(e);
|
||||
});
|
||||
|
||||
$("#submit-for-review").click((e) => {
|
||||
submit_for_review(e);
|
||||
});
|
||||
$("#submit-for-review").click((e) => {
|
||||
submit_for_review(e);
|
||||
});
|
||||
|
||||
$("#apply-certificate").click((e) => {
|
||||
apply_cetificate(e);
|
||||
});
|
||||
$("#apply-certificate").click((e) => {
|
||||
apply_cetificate(e);
|
||||
});
|
||||
|
||||
$(".slot").click((e) => {
|
||||
submit_slot(e);
|
||||
});
|
||||
$("#slot-date").on("change", (e) => {
|
||||
display_slots(e);
|
||||
});
|
||||
|
||||
$("#slot-date").on("change", (e) => {
|
||||
|
||||
});
|
||||
$(document).on("click", ".slot", (e) => {
|
||||
submit_slot(e);
|
||||
});
|
||||
|
||||
$(document).scroll(function() {
|
||||
let timer;
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(() => { handle_overlay_display.apply(this, arguments); }, 500);
|
||||
});
|
||||
$(document).scroll(function() {
|
||||
let timer;
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(() => { handle_overlay_display.apply(this, arguments); }, 500);
|
||||
});
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
var hide_wrapped_mentor_cards = () => {
|
||||
var offset_top_prev;
|
||||
@@ -259,7 +259,7 @@ const apply_cetificate = (e) => {
|
||||
callback: (data) => {
|
||||
let options = "";
|
||||
data.message.forEach((obj) => {
|
||||
options += `<button class="btn btn-sm btn-secondary mr-3 slot"
|
||||
options += `<button type="button" class="btn btn-sm btn-secondary mr-3 slot hide"
|
||||
data-course="${$(e.currentTarget).data("course")}"
|
||||
data-day="${obj.day}" data-start="${obj.start_time}" data-end="${obj.end_time}">
|
||||
${obj.day} ${obj.start_time} - ${obj.end_time}</button>`;
|
||||
@@ -272,17 +272,40 @@ const apply_cetificate = (e) => {
|
||||
};
|
||||
|
||||
const submit_slot = (e) => {
|
||||
const target = $(e.currentTarget);
|
||||
e.preventDefault();
|
||||
const slot = $(e.currentTarget);
|
||||
frappe.call({
|
||||
method: "lms.lms.doctype.lms_certificate_request.lms_certificate_request.create_certificate_request",
|
||||
args: {
|
||||
"course": target.data("course"),
|
||||
"day": target.data("day"),
|
||||
"start_time": target.data("start"),
|
||||
"end_time": target.data("end")
|
||||
"course": slot.data("course"),
|
||||
"date": $("#slot-date").val(),
|
||||
"day": slot.data("day"),
|
||||
"start_time": slot.data("start"),
|
||||
"end_time": slot.data("end")
|
||||
},
|
||||
callback: (data) => {
|
||||
|
||||
$("#slot-modal").modal("hide");
|
||||
frappe.msgprint(__("Your slot has been booked. Prepare well for the evaluations."));
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 2000);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const display_slots = (e) => {
|
||||
const weekday = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
|
||||
const day = weekday[new Date($(e.currentTarget).val()).getDay()]
|
||||
|
||||
$(".slot").addClass("hide");
|
||||
$(".slot-label").addClass("hide");
|
||||
|
||||
if ($(`[data-day='${day}']`).length) {
|
||||
$(".slot-label").removeClass("hide");
|
||||
$(`[data-day='${day}']`).removeClass("hide");
|
||||
$("#no-slots-message").addClass("hide");
|
||||
} else {
|
||||
$("#no-slots-message").removeClass("hide");
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user