diff --git a/server/boot/user.js b/server/boot/user.js index 1fe0df0584..1ed1381240 100644 --- a/server/boot/user.js +++ b/server/boot/user.js @@ -155,6 +155,10 @@ module.exports = function(app) { return obj.challengeType === 3 || obj.challengeType === 4; }); + const bonfires = user.completedChallenges.filter(function(obj) { + return obj.challengeType === 5 && obj.name.match(/Bonfire/g); + }); + res.render('account/show', { title: 'Camper ' + user.username + '\'s portfolio', username: user.username, @@ -171,6 +175,7 @@ module.exports = function(app) { progressTimestamps: user.progressTimestamps, calender: data, challenges: challenges, + bonfires: bonfires, moment: moment, longestStreak: user.longestStreak, currentStreak: user.currentStreak diff --git a/server/views/account/show.jade b/server/views/account/show.jade index 6ed6d91f63..4c837f828d 100644 --- a/server/views/account/show.jade +++ b/server/views/account/show.jade @@ -94,3 +94,21 @@ block content td.col-xs-2= moment(challenge.completedDate, 'x').format("MMM DD, YYYY") td.col-xs-6 a(href=challenge.solution, target='_blank') View my solution + if (user && user.username === username) + br + if (bonfires.length > 0) + .col-sm-12 + table.table.table-striped + thead + tr + th.col-xs-4 Bonfire + th.col-xs-2 Completed + th.col-xs-6 Solution + for bonfire in bonfires + tr + td.col-xs-4 + a(href='/challenges/' + bonfire.name, target='_blank')= bonfire.name + td.col-xs-2= moment(bonfire.completedDate, 'x').format("MMM DD, YYYY") + td.col-xs-6 + pre.wrappable= bonfire.solution + br