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

@@ -9,7 +9,21 @@ body {
}
input[type=checkbox] {
appearance: auto;
appearance: auto;
position: relative;
width: var(--checkbox-size)!important;
height: var(--checkbox-size);
margin-right: var(--checkbox-right-margin)!important;
background-repeat: no-repeat;
background-position: center;
border: 1px solid var(--gray-400);
box-sizing: border-box;
box-shadow: 0 1px 2px #0000001a;
border-radius: 4px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
-webkit-print-color-adjust: exact;
}
.course-image {
@@ -1747,10 +1761,6 @@ li {
padding: 0 1.5rem !important;
}
.modal-footer {
padding: 0.75rem 1.5rem !important;
}
.modal-content {
font-size: var(--text-base) !important;
}
@@ -1764,9 +1774,9 @@ li {
}
.modal-footer {
padding: 0.75rem 1.5rem !important;
border-top: none !important;
background-color: var(--gray-200) !important;
justify-content: flex-end !important;
}
.modal-header .modal-title {
@@ -1808,3 +1818,25 @@ select {
.course-list-cta {
float: right;
}
.modal-title {
font-size: var(--text-base) !important;
}
.class-form-title {
font-size: var(--text-base);
}
.remove-student {
cursor: pointer;
}
.class-course-list {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
grid-gap: 1rem;
}
.class-cours {
cursor: pointer;
}

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();
};