feat: add and remove students and courses from class

This commit is contained in:
Jannat Patel
2022-11-14 16:20:13 +05:30
parent 7ac3f6d8ef
commit 3e1f29af48
17 changed files with 478 additions and 40 deletions

View File

@@ -17,6 +17,14 @@ frappe.ready(() => {
save_chapter(e);
});
$(".nav-link").click((e) => {
change_hash(e);
});
if (window.location.hash) {
open_tab();
}
if (window.location.pathname == "/statistics") {
generate_graph("New Signups", "#new-signups");
generate_graph("Course Enrollments", "#course-enrollments");
@@ -197,6 +205,7 @@ const render_chart = (data, chart_name, element, type) => {
});
};
const generate_course_completion_graph = () => {
frappe.call({
method: "lms.lms.utils.get_course_completion_data",
@@ -210,3 +219,13 @@ const generate_course_completion_graph = () => {
},
});
};
const change_hash = (e) => {
window.location.hash = $(e.currentTarget).attr("href");
};
const open_tab = () => {
$(`a[href="${window.location.hash}"]`).click();
};