Improve profile view on devices, store name in completedCoursewares for display in account/show
This commit is contained in:
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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) {
|
||||
|
@ -101,7 +101,7 @@ block content
|
||||
<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
|
||||
.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,7 +125,7 @@ block content
|
||||
legend: [1, 2, 3]
|
||||
});
|
||||
|
||||
- if (ch[0] > 0)
|
||||
|
||||
.col-sm-12
|
||||
table.table.table-striped
|
||||
thead
|
||||
@ -132,9 +133,8 @@ block content
|
||||
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")
|
||||
td= challenge.name
|
||||
td= moment(challenge.completedDate, 'X').format("MMM DD, YYYY")
|
||||
br
|
||||
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user