diff --git a/controllers/courseware.js b/controllers/courseware.js
index 9c32518c80..f830358af8 100644
--- a/controllers/courseware.js
+++ b/controllers/courseware.js
@@ -216,11 +216,13 @@ exports.completedCourseware = function (req, res) {
var isCompletedDate = Math.round(+new Date() / 1000);
var coursewareHash = req.body.coursewareInfo.coursewareHash;
+
debug('this is the coursewarehash we got', coursewareHash);
req.user.completedCoursewares.push({
_id: coursewareHash,
- completedDate: isCompletedDate
+ completedDate: isCompletedDate,
+ name: req.body.coursewareInfo.coursewareName
});
var index = req.user.completedCoursewares.indexOf(coursewareHash);
@@ -238,4 +240,4 @@ exports.completedCourseware = function (req, res) {
res.send(true);
}
});
-};
\ No newline at end of file
+};
diff --git a/controllers/user.js b/controllers/user.js
index b2411c76e5..cfcd8c5430 100644
--- a/controllers/user.js
+++ b/controllers/user.js
@@ -294,7 +294,7 @@ exports.returnUser = function(req, res, next) {
website3Link: user.portfolio.website3Link,
website3Title: user.portfolio.website3Title,
website3Image: user.portfolio.website3Image,
- challenges: resources.getAllCourses(),
+ challenges: user.completedCoursewares,
ch: user.challengesHash,
calender: data,
moment: moment
diff --git a/public/js/main.js b/public/js/main.js
index 1543899859..1fe3f29747 100644
--- a/public/js/main.js
+++ b/public/js/main.js
@@ -75,6 +75,7 @@ $(document).ready(function() {
});
$('#completed-courseware').on('click', function() {
+ console.log('trying to show modal');
$('#complete-courseware-dialog').modal('show');
});
@@ -111,7 +112,8 @@ $(document).ready(function() {
'/completed-courseware/',
{
coursewareInfo: {
- coursewareHash: passedCoursewareHash
+ coursewareHash: passedCoursewareHash,
+ coursewareName: passedCoursewareName
}
}).success(
function(res) {
diff --git a/views/account/show.jade b/views/account/show.jade
index bd1d21b93b..911d316cdd 100644
--- a/views/account/show.jade
+++ b/views/account/show.jade
@@ -101,7 +101,7 @@ block content
- .col-xs-12
+ .hidden-xs.col-sm-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")
@@ -115,6 +115,7 @@ block content
subDomain: "day",
data: calendar,
cellSize: 15,
+ align: 'center',
cellRadius: 3,
cellPadding: 2,
tooltip: true,
@@ -124,17 +125,16 @@ block content
legend: [1, 2, 3]
});
- - if (ch[0] > 0)
- .col-sm-12
- table.table.table-striped
- thead
- tr
- th Challenge
- th Date Finished
- for challenge in challenges
- if ch[challenge.challengeNumber] > 0
- tr
- td= challenges[challenge.challengeNumber].name
- td= moment(ch[challenge.challengeNumber], 'X').format("MMM DD, YYYY")
- br
+
+ .col-sm-12
+ table.table.table-striped
+ thead
+ tr
+ th Challenge
+ th Date Finished
+ for challenge in challenges
+ tr
+ td= challenge.name
+ td= moment(challenge.completedDate, 'X').format("MMM DD, YYYY")
+ br
diff --git a/views/coursewares/showVideo.jade b/views/coursewares/showVideo.jade
index d55993d2b1..278a19609f 100644
--- a/views/coursewares/showVideo.jade
+++ b/views/coursewares/showVideo.jade
@@ -25,6 +25,7 @@ block content
var tests = !{JSON.stringify(tests)};
var passedCoursewareHash = !{JSON.stringify(coursewareHash)};
var challengeName = !{JSON.stringify(name)};
+ var passedCoursewareName = challengeName;
var started = Math.floor(Date.now() / 1000);
#complete-courseware-dialog.modal(tabindex='-1')
.modal-dialog.animated.zoomIn.fast-animation