summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-04-08 09:39:42 +0200
committerPeter Wu <peter@lekensteyn.nl>2015-04-08 09:39:42 +0200
commita9d88fecd3918856cc06d41c624fbb751e2c1b39 (patch)
tree928cfda884e3c955e6b01a2c3eeb30d2ed176102
parent479eb7aa8ba920038daef87f54caffd979f72767 (diff)
downloadsite-a9d88fecd3918856cc06d41c624fbb751e2c1b39.tar.gz
curriculum: display description and make menus clickable
-rw-r--r--js/courses.js7
-rw-r--r--js/curriculum.js24
-rw-r--r--pages/curriculum.html2
-rw-r--r--style/curriculum.less5
4 files changed, 35 insertions, 3 deletions
diff --git a/js/courses.js b/js/courses.js
index c973eae..0f43c4d 100644
--- a/js/courses.js
+++ b/js/courses.js
@@ -31,7 +31,7 @@ define(['assert'], function(assert) {
{ "id": "2IIC0", "name": "Business Information Systems","when": "Y3Q1" },
{ "id": "2IID0", "name": "Web Analytics", "when": "Y3Q2" },
{ "id": "2IO90", "name": "DBL Algorithms", "when": "Y3Q2" },
- { "id": "DS004", "name": "Bachelor End Project", "type": "bep", "when": "Y3Q3,Y3Q4" },
+ { "id": "DS004", "name": "Bachelor End Project", "type": "bep", "when": "Y3Q3+Y3Q4" },
];
var descriptions = {
@@ -90,9 +90,12 @@ define(['assert'], function(assert) {
assert (!(course.id in coursesById),
"Course is already known: " + course.id);
coursesById[course.id] = course;
- course.when.split(",").forEach(function(when) {
+ course.when.split('+').forEach(function(when) {
getQuartile(when).push(course);
});
+
+ // link description too.
+ course.description = descriptions[course.id];
});
// fill in the remaining time slots
diff --git a/js/curriculum.js b/js/curriculum.js
index d434c67..164ff3b 100644
--- a/js/curriculum.js
+++ b/js/curriculum.js
@@ -39,8 +39,30 @@ define(['courses'], function(courses) {
cmenu.appendChild(makeCoursesList(function(course_item, course) {
// types: bc, major, bep
course_item.dataset.type = course.type || 'major';
+ course_item.title = course.name;
- course_item.textContent = /*course.id + ' ' +*/ course.name;
+ // display link for courses which have a description block
+ if (course.id) {
+ var link = document.createElement('a');
+ link.href = '#!/curriculum/' + course.id;
+ link.textContent = course.name;
+ course_item.appendChild(link);
+ } else {
+ course_item.textContent = course.name;
+ }
}));
+
+ var citems = document.getElementById('curriculum-items');
+ courses.courses.forEach(function(course) {
+ var header = document.createElement('h2');
+ //header.id = 'course-' + course.id;
+ header.id = '!/curriculum/' + course.id;
+ header.textContent = course.name + ' (' + course.when + ')';
+ citems.appendChild(header);
+
+ var text_block = document.createElement('p');
+ text_block.textContent = course.description;
+ citems.appendChild(text_block);
+ });
};
});
diff --git a/pages/curriculum.html b/pages/curriculum.html
index e1fb565..42cf7e7 100644
--- a/pages/curriculum.html
+++ b/pages/curriculum.html
@@ -25,3 +25,5 @@ have to combine all of the skills you’ve come across in your academic career.
You can find the Data Science curriculum below, be sure to click on the courses
in order to view their content.
</p>
+
+<div id="curriculum-items"></div>
diff --git a/style/curriculum.less b/style/curriculum.less
index 7ad46b0..c909db1 100644
--- a/style/curriculum.less
+++ b/style/curriculum.less
@@ -46,6 +46,11 @@ body[data-page="curriculum"] #curriculum-menu {
&[data-type="bep"] {
background-color: @color-bep-background;
}
+
+ a {
+ width: 100%;
+ display: inline-block;
+ }
}
}
}