Working on unifying coursewares view and logic

This commit is contained in:
Nathan Leniz
2015-03-21 13:42:02 +09:00
parent 6aaebbf34e
commit b35f5ca59c
4 changed files with 473 additions and 506 deletions

View File

@ -177,13 +177,13 @@ module.exports = {
req.user.save();
}
}
var date1 = new Date("10/15/2014");
var date1 = new Date('10/15/2014');
var date2 = new Date();
var progressTimestamps = req.user.progressTimestamps;
var now = Date.now() / 1000 | 0;
if (req.user.pointsNeedMigration) {
var challengesHash = req.user.challengesHash;
for(var key in challengesHash) {
for (var key in challengesHash) {
if (challengesHash[key] > 0) {
req.user.progressTimestamps.push(challengesHash[key]);
}
@ -270,6 +270,11 @@ module.exports = {
});
},
getAllCourses: function() {
"use strict";
return coursewares;
},
allCoursewareIds: function() {
return coursewares.map(function(elem) {
return {

File diff suppressed because it is too large Load Diff

View File

@ -41,7 +41,7 @@ block content
.col-xs-12.col-sm-12.col-md-3.text-center
.background-svg.img-center
.points-on-top
= "[ " + progressTimestamps.length + " ]"
= "[ " + points + " ]"
.row
@ -95,14 +95,17 @@ block content
a.btn.btn-lg.btn-block.btn-info(href=website3Link, target='_blank')
i.fa.icon-beaker
| Try it out
html.
<script type="text/javascript" src="//d3js.org/d3.v3.min.js"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/cal-heatmap/3.3.10/cal-heatmap.min.js"></script>
<link rel="stylesheet" href="//cdn.jsdelivr.net/cal-heatmap/3.3.10/cal-heatmap.css" />
//
html.
<script type="text/javascript" src="//d3js.org/d3.v3.min.js"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/cal-heatmap/3.3.10/cal-heatmap.min.js"></script>
<link rel="stylesheet" href="//cdn.jsdelivr.net/cal-heatmap/3.3.10/cal-heatmap.css" />
.col-xs-12
#cal-heatmap
script(src="//d3js.org/d3.v3.min.js")
script(src="//cdn.jsdelivr.net/cal-heatmap/3.3.10/cal-heatmap.min.js")
link(rel="stylesheet", href="//cdn.jsdelivr.net/cal-heatmap/3.3.10/cal-heatmap.css")
script.
var cal = new CalHeatMap();
var calendar = !{JSON.stringify(calender)};