Merge branch 'main' into translations

This commit is contained in:
Jannat Patel
2022-06-07 11:28:42 +05:30
committed by GitHub
24 changed files with 184 additions and 81 deletions

View File

@@ -27,12 +27,6 @@ def get_context(context):
context.custom_certificate_template = frappe.db.get_value("Web Template", template_name, "template")
context.custom_template = render_template(context.custom_certificate_template, context)
context.metatags = {
"title": f"{member.full_name} - {course.title}",
"image": course.image,
"keywords": course.title, member.full_name
}
def redirect_to_course_list():
frappe.local.flags.redirect_location = "/courses"
raise frappe.Redirect

View File

@@ -161,22 +161,27 @@ const element_not_in_viewport = (el) => {
};
const submit_for_review = (e) => {
let course = $(e.currentTarget).data("course");
frappe.call({
method: "lms.lms.doctype.lms_course.lms_course.submit_for_review",
args: {
"course": course
},
callback: (data) => {
if (data.message == "No Chp") {
frappe.msgprint(__(`There are no chapters in this course.
Please add chapters and lessons to your course before you submit it for review.`));
} else if (data.message == "OK") {
frappe.msgprint(__("Your course has been submitted for review."))
window.location.reload();
}
}
})
let course = $(e.currentTarget).data("course");
frappe.call({
method: "lms.lms.doctype.lms_course.lms_course.submit_for_review",
args: {
"course": course
},
callback: (data) => {
if (data.message == "No Chp") {
frappe.msgprint(__(`There are no chapters in this course.
Please add chapters and lessons to your course before you submit it for review.`));
} else if (data.message == "OK") {
frappe.show_alert({
message: __("Your course has been submitted for review."),
indicator:'green'
}, 3);
setTimeout(() => {
window.location.reload();
}, 3000);
}
}
});
};
const apply_cetificate = (e) => {
@@ -199,10 +204,13 @@ const submit_slot = (e) => {
},
callback: (data) => {
$("#slot-modal").modal("hide");
frappe.msgprint(__("Your slot has been booked. Prepare well for the evaluations."));
frappe.show_alert({
message: __("Your slot has been booked. Prepare well for the evaluations."),
indicator:'green'
}, 3);
setTimeout(() => {
window.location.reload();
}, 2000);
}, 3000);
}
});
};