Able to show and hide null-courses
This commit is contained in:
@@ -13,13 +13,15 @@ table.table.table-bordered.table-striped.table-hover
|
||||
td #{course[type]}
|
||||
td #{course.totalTdEquivalent}
|
||||
tr#extend
|
||||
td
|
||||
a(href="#") ...
|
||||
each type in types
|
||||
td
|
||||
a(href="#") ...
|
||||
td
|
||||
a(href="#") ...
|
||||
td(colspan=2+types.length)
|
||||
a#extendText(href="#") ...
|
||||
|
||||
each course in noCourses
|
||||
tr.no-courses
|
||||
td #{course.name}
|
||||
each type in types
|
||||
td #{course[type]}
|
||||
td #{course.totalTdEquivalent}
|
||||
|
||||
tr.table-active
|
||||
td
|
||||
|
||||
@@ -119,7 +119,17 @@ module.exports.totalTableByCourse = function(req, res, render, next) {
|
||||
for (let type in cal.Type) {
|
||||
res.locals.types.push(type);
|
||||
}
|
||||
res.locals.courses = result.courses;
|
||||
res.locals.courses = [];
|
||||
res.locals.noCourses = [];
|
||||
|
||||
for (let course of result.courses) {
|
||||
if (course.totalTdEquivalent > 0) {
|
||||
res.locals.courses.push(course);
|
||||
} else {
|
||||
res.locals.noCourses.push(course);
|
||||
}
|
||||
}
|
||||
|
||||
res.locals.total = result.total;
|
||||
render('totalTableByCourse.pug');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user