From a00070e5c594baa9660f364a4db5d8f57c2f0e6e Mon Sep 17 00:00:00 2001 From: Michael Q Larson Date: Tue, 30 Dec 2014 22:03:03 -0800 Subject: [PATCH] fix a strange bug caused by an apparent clash in variables introduced this morning by my menu refactor --- controllers/user.js | 4 ++-- views/account/profile.jade | 10 +++++----- views/partials/navbar.jade | 4 ++-- views/resources/stats.jade | 10 ++-------- 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/controllers/user.js b/controllers/user.js index db9791d7a3a..a713e420792 100644 --- a/controllers/user.js +++ b/controllers/user.js @@ -141,8 +141,8 @@ exports.getAccount = function(req, res) { } res.render('account/profile', { title: 'Manage your Free Code Camp Account', - c: c, - cc: req.user.challengesHash, + challenges: c, + ch: req.user.challengesHash, moment: moment }); }); diff --git a/views/account/profile.jade b/views/account/profile.jade index d1f93bafb19..6e8685d3ee5 100644 --- a/views/account/profile.jade +++ b/views/account/profile.jade @@ -71,7 +71,7 @@ block content i.fa.fa-twitter | Link Twitter with your account br - - if (cc[0] > 0) + - if (ch[0] > 0) .panel .container h1 Completed Challenges @@ -81,11 +81,11 @@ block content tr th Challenge th Date Finished - for challenge in c - if cc[challenge.challengeNumber] > 0 + for challenge in challenges + if ch[challenge.challengeNumber] > 0 tr - td= c[challenge.challengeNumber].name - td= moment(cc[challenge.challengeNumber], 'X').format("MMM DD, YYYY") + td= challenges[challenge.challengeNumber].name + td= moment(ch[challenge.challengeNumber], 'X').format("MMM DD, YYYY") br .panel .container diff --git a/views/partials/navbar.jade b/views/partials/navbar.jade index 4b25791991d..2006b415dd5 100644 --- a/views/partials/navbar.jade +++ b/views/partials/navbar.jade @@ -12,13 +12,13 @@ nav.navbar.navbar-default.navbar-fixed-top.nav-height ul.nav.navbar-nav.navbar-right li a(href='/') Challenges - - if (!cc || (cc && cc[1]) < 1) + - if (!cc || (cc && cc[1] < 1)) li a(href='/challenges/1') Chat - else li a(href='http://chat.freecodecamp.com' target='_blank') Chat - - if (!cc || (cc && cc[2]) < 1) + - if (!cc || (cc && cc[2] < 1)) li a(href='/challenges/2') Forum - else diff --git a/views/resources/stats.jade b/views/resources/stats.jade index 7e33e36a8b6..4a679dd1640 100644 --- a/views/resources/stats.jade +++ b/views/resources/stats.jade @@ -62,13 +62,7 @@ block content = c39 .row .col-xs-6.text-right - h2 49 Points: + h2 All 54 Points: .col-xs-6.text-left h2 - = c49 - .row - .col-xs-6.text-right - h2 All 60 Points: - .col-xs-6.text-left - h2 - = c59 \ No newline at end of file + = all \ No newline at end of file