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 isCompletedDate = Math.round(+new Date() / 1000);
|
||||||
var coursewareHash = req.body.coursewareInfo.coursewareHash;
|
var coursewareHash = req.body.coursewareInfo.coursewareHash;
|
||||||
|
|
||||||
debug('this is the coursewarehash we got', coursewareHash);
|
debug('this is the coursewarehash we got', coursewareHash);
|
||||||
|
|
||||||
req.user.completedCoursewares.push({
|
req.user.completedCoursewares.push({
|
||||||
_id: coursewareHash,
|
_id: coursewareHash,
|
||||||
completedDate: isCompletedDate
|
completedDate: isCompletedDate,
|
||||||
|
name: req.body.coursewareInfo.coursewareName
|
||||||
});
|
});
|
||||||
|
|
||||||
var index = req.user.completedCoursewares.indexOf(coursewareHash);
|
var index = req.user.completedCoursewares.indexOf(coursewareHash);
|
||||||
|
@ -294,7 +294,7 @@ exports.returnUser = function(req, res, next) {
|
|||||||
website3Link: user.portfolio.website3Link,
|
website3Link: user.portfolio.website3Link,
|
||||||
website3Title: user.portfolio.website3Title,
|
website3Title: user.portfolio.website3Title,
|
||||||
website3Image: user.portfolio.website3Image,
|
website3Image: user.portfolio.website3Image,
|
||||||
challenges: resources.getAllCourses(),
|
challenges: user.completedCoursewares,
|
||||||
ch: user.challengesHash,
|
ch: user.challengesHash,
|
||||||
calender: data,
|
calender: data,
|
||||||
moment: moment
|
moment: moment
|
||||||
|
@ -75,6 +75,7 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
$('#completed-courseware').on('click', function() {
|
$('#completed-courseware').on('click', function() {
|
||||||
|
console.log('trying to show modal');
|
||||||
$('#complete-courseware-dialog').modal('show');
|
$('#complete-courseware-dialog').modal('show');
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -111,7 +112,8 @@ $(document).ready(function() {
|
|||||||
'/completed-courseware/',
|
'/completed-courseware/',
|
||||||
{
|
{
|
||||||
coursewareInfo: {
|
coursewareInfo: {
|
||||||
coursewareHash: passedCoursewareHash
|
coursewareHash: passedCoursewareHash,
|
||||||
|
coursewareName: passedCoursewareName
|
||||||
}
|
}
|
||||||
}).success(
|
}).success(
|
||||||
function(res) {
|
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>
|
<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
|
.hidden-xs.col-sm-12
|
||||||
#cal-heatmap
|
#cal-heatmap
|
||||||
script(src="//d3js.org/d3.v3.min.js")
|
script(src="//d3js.org/d3.v3.min.js")
|
||||||
script(src="//cdn.jsdelivr.net/cal-heatmap/3.3.10/cal-heatmap.min.js")
|
script(src="//cdn.jsdelivr.net/cal-heatmap/3.3.10/cal-heatmap.min.js")
|
||||||
@ -115,6 +115,7 @@ block content
|
|||||||
subDomain: "day",
|
subDomain: "day",
|
||||||
data: calendar,
|
data: calendar,
|
||||||
cellSize: 15,
|
cellSize: 15,
|
||||||
|
align: 'center',
|
||||||
cellRadius: 3,
|
cellRadius: 3,
|
||||||
cellPadding: 2,
|
cellPadding: 2,
|
||||||
tooltip: true,
|
tooltip: true,
|
||||||
@ -124,17 +125,16 @@ block content
|
|||||||
legend: [1, 2, 3]
|
legend: [1, 2, 3]
|
||||||
});
|
});
|
||||||
|
|
||||||
- if (ch[0] > 0)
|
|
||||||
.col-sm-12
|
.col-sm-12
|
||||||
table.table.table-striped
|
table.table.table-striped
|
||||||
thead
|
thead
|
||||||
tr
|
tr
|
||||||
th Challenge
|
th Challenge
|
||||||
th Date Finished
|
th Date Finished
|
||||||
for challenge in challenges
|
for challenge in challenges
|
||||||
if ch[challenge.challengeNumber] > 0
|
tr
|
||||||
tr
|
td= challenge.name
|
||||||
td= challenges[challenge.challengeNumber].name
|
td= moment(challenge.completedDate, 'X').format("MMM DD, YYYY")
|
||||||
td= moment(ch[challenge.challengeNumber], 'X').format("MMM DD, YYYY")
|
br
|
||||||
br
|
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ block content
|
|||||||
var tests = !{JSON.stringify(tests)};
|
var tests = !{JSON.stringify(tests)};
|
||||||
var passedCoursewareHash = !{JSON.stringify(coursewareHash)};
|
var passedCoursewareHash = !{JSON.stringify(coursewareHash)};
|
||||||
var challengeName = !{JSON.stringify(name)};
|
var challengeName = !{JSON.stringify(name)};
|
||||||
|
var passedCoursewareName = challengeName;
|
||||||
var started = Math.floor(Date.now() / 1000);
|
var started = Math.floor(Date.now() / 1000);
|
||||||
#complete-courseware-dialog.modal(tabindex='-1')
|
#complete-courseware-dialog.modal(tabindex='-1')
|
||||||
.modal-dialog.animated.zoomIn.fast-animation
|
.modal-dialog.animated.zoomIn.fast-animation
|
||||||
|
Reference in New Issue
Block a user