Working on unifying coursewares view and logic
This commit is contained in:
@ -177,13 +177,13 @@ module.exports = {
|
|||||||
req.user.save();
|
req.user.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var date1 = new Date("10/15/2014");
|
var date1 = new Date('10/15/2014');
|
||||||
var date2 = new Date();
|
var date2 = new Date();
|
||||||
var progressTimestamps = req.user.progressTimestamps;
|
var progressTimestamps = req.user.progressTimestamps;
|
||||||
var now = Date.now() / 1000 | 0;
|
var now = Date.now() / 1000 | 0;
|
||||||
if (req.user.pointsNeedMigration) {
|
if (req.user.pointsNeedMigration) {
|
||||||
var challengesHash = req.user.challengesHash;
|
var challengesHash = req.user.challengesHash;
|
||||||
for(var key in challengesHash) {
|
for (var key in challengesHash) {
|
||||||
if (challengesHash[key] > 0) {
|
if (challengesHash[key] > 0) {
|
||||||
req.user.progressTimestamps.push(challengesHash[key]);
|
req.user.progressTimestamps.push(challengesHash[key]);
|
||||||
}
|
}
|
||||||
@ -270,6 +270,11 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getAllCourses: function() {
|
||||||
|
"use strict";
|
||||||
|
return coursewares;
|
||||||
|
},
|
||||||
|
|
||||||
allCoursewareIds: function() {
|
allCoursewareIds: function() {
|
||||||
return coursewares.map(function(elem) {
|
return coursewares.map(function(elem) {
|
||||||
return {
|
return {
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -41,7 +41,7 @@ block content
|
|||||||
.col-xs-12.col-sm-12.col-md-3.text-center
|
.col-xs-12.col-sm-12.col-md-3.text-center
|
||||||
.background-svg.img-center
|
.background-svg.img-center
|
||||||
.points-on-top
|
.points-on-top
|
||||||
= "[ " + progressTimestamps.length + " ]"
|
= "[ " + points + " ]"
|
||||||
|
|
||||||
|
|
||||||
.row
|
.row
|
||||||
@ -95,14 +95,17 @@ block content
|
|||||||
a.btn.btn-lg.btn-block.btn-info(href=website3Link, target='_blank')
|
a.btn.btn-lg.btn-block.btn-info(href=website3Link, target='_blank')
|
||||||
i.fa.icon-beaker
|
i.fa.icon-beaker
|
||||||
| Try it out
|
| Try it out
|
||||||
|
//
|
||||||
html.
|
html.
|
||||||
<script type="text/javascript" src="//d3js.org/d3.v3.min.js"></script>
|
<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>
|
<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" />
|
<link rel="stylesheet" href="//cdn.jsdelivr.net/cal-heatmap/3.3.10/cal-heatmap.css" />
|
||||||
|
|
||||||
.col-xs-12
|
.col-xs-12
|
||||||
#cal-heatmap
|
#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.
|
script.
|
||||||
var cal = new CalHeatMap();
|
var cal = new CalHeatMap();
|
||||||
var calendar = !{JSON.stringify(calender)};
|
var calendar = !{JSON.stringify(calender)};
|
||||||
|
Reference in New Issue
Block a user