diff --git a/server/boot/user.js b/server/boot/user.js index 33a80c5c62..f521404ced 100644 --- a/server/boot/user.js +++ b/server/boot/user.js @@ -68,7 +68,6 @@ module.exports = function(app) { router.post('/reset-password', postReset); router.get('/email-signup', getEmailSignup); router.get('/email-signin', getEmailSignin); - router.get('/account/api', getAccountAngular); router.post( '/account/delete', ifNoUser401, @@ -114,18 +113,7 @@ module.exports = function(app) { } function getAccount(req, res) { - if (!req.user) { - return res.redirect('/'); - } - res.render('account/account', { - title: 'Manage your Free Code Camp Account' - }); - } - - function getAccountAngular(req, res) { - res.json({ - user: req.user || {} - }); + return res.redirect('/' + user.username); } function returnUser(req, res, next) { @@ -143,14 +131,6 @@ module.exports = function(app) { }); return res.redirect('/'); } - if (!user.isGithubCool && !user.isMigrationGrandfathered) { - req.flash('errors', { - msg: ` - user ${ username } has not completed account signup - ` - }); - return res.redirect('/'); - } var cals = user .progressTimestamps diff --git a/server/views/account/account.jade b/server/views/account/account.jade index d4d00c46ce..0259b504f7 100644 --- a/server/views/account/account.jade +++ b/server/views/account/account.jade @@ -2,74 +2,4 @@ extends ../layout block content script. var challengeName = 'Account View' - .panel.panel-info - .panel-heading.text-center Manage your account here - .panel-body - .row - .col-xs-12 - if (!user.isGithubCool) - a.btn.btn-lg.btn-block.btn-github.btn-link-social(href='/link/github') - i.fa.fa-github - | Link my GitHub to unlock this profile - else - a.btn.btn-lg.btn-block.btn-github.btn-link-social(href='/link/github') - i.fa.fa-github - | Update my profile from GitHub - if (!user.twitter) - .col-xs-12 - a.btn.btn-lg.btn-block.btn-twitter.btn-link-social(href='/link/twitter') - i.fa.fa-twitter - | Add my Twitter to my profile - if (!user.facebook) - .col-xs-12 - a.btn.btn-lg.btn-block.btn-facebook.btn-link-social(href='/link/facebook') - i.fa.fa-facebook - | Add my Facebook to my profile - if (!user.linkedin) - .col-xs-12 - a.btn.btn-lg.btn-block.btn-linkedin.btn-link-social(href='/link/linkedin') - i.fa.fa-linkedin - | Add my LinkedIn to my profile - if (!user.google) - .col-xs-12 - a.btn.btn-lg.btn-block.btn-google-plus.btn-link-social(href='/link/google') - i.fa.fa-google-plus - | Add my Google+ to my profile - .big-spacer - .col-xs-12 - a.btn.btn-lg.btn-block.btn-warning.btn-link-social(href='/logout') - span.ion-android-exit - | Sign me out of Free Code Camp - .col-xs-12 - a.btn.btn-lg.btn-block.btn-primary.btn-link-social(href='mailto:team@freecodecamp.com') - span.ion-email - | Email us at team@freecodecamp.com - .col-xs-12 - a.btn.btn-lg.btn-block.btn-danger.btn-link-social.confirm-deletion - span.ion-trash-b - | Delete my Free Code Camp account - script. - $('.confirm-deletion').on("click", function() { - $('#modal-dialog').modal('show'); - }); - #modal-dialog.modal.animated.wobble - .modal-dialog - .modal-content - .modal-header - a.close(href='#', data-dismiss='modal', aria-hidden='true') × - h3 Are you really leaving us? - .modal-body - p Pro Tip: If you tweet feedback to  - a(href="https://twitter.com/intent/tweet?text=Hey%20@freecodecamp") @FreeCodeCamp - | , we'll act quickly on it! - .modal-footer - a.btn.btn-success.btn-block(href='#', data-dismiss='modal', aria-hidden='true') - span.ion-happy - | Nevermind, I'll stick around - br - form(action='/account/delete', method='POST') - input(type='hidden', name='_csrf', value=_csrf) - button.btn.btn-danger.btn-block(type='submit') - span.ion-trash-b - | Yes, delete my account diff --git a/server/views/account/show.jade b/server/views/account/show.jade index c559f84aa3..2b80bba9f2 100644 --- a/server/views/account/show.jade +++ b/server/views/account/show.jade @@ -3,11 +3,83 @@ block content script(src="/bower_components/cal-heatmap/cal-heatmap.min.js") script. var challengeName = 'Profile View'; + if (user && user.username === username) + .panel.panel-info + .panel-heading.text-center Manage your account + .panel-body + .row + .col-xs-12 + if (!user.isGithubCool) + a.btn.btn-lg.btn-block.btn-github.btn-link-social(href='/link/github') + i.fa.fa-github + | Link my GitHub to unlock this profile + else + a.btn.btn-lg.btn-block.btn-github.btn-link-social(href='/link/github') + i.fa.fa-github + | Update my profile from GitHub + if (!user.twitter) + .col-xs-12 + a.btn.btn-lg.btn-block.btn-twitter.btn-link-social(href='/link/twitter') + i.fa.fa-twitter + | Add my Twitter to my profile + if (!user.facebook) + .col-xs-12 + a.btn.btn-lg.btn-block.btn-facebook.btn-link-social(href='/link/facebook') + i.fa.fa-facebook + | Add my Facebook to my profile + if (!user.linkedin) + .col-xs-12 + a.btn.btn-lg.btn-block.btn-linkedin.btn-link-social(href='/link/linkedin') + i.fa.fa-linkedin + | Add my LinkedIn to my profile + if (!user.google) + .col-xs-12 + a.btn.btn-lg.btn-block.btn-google-plus.btn-link-social(href='/link/google') + i.fa.fa-google-plus + | Add my Google+ to my profile + .big-spacer + .col-xs-12 + a.btn.btn-lg.btn-block.btn-warning.btn-link-social(href='/logout') + span.ion-android-exit + | Sign me out of Free Code Camp + .col-xs-12 + a.btn.btn-lg.btn-block.btn-primary.btn-link-social(href='mailto:team@freecodecamp.com') + span.ion-email + | Email us at team@freecodecamp.com + .col-xs-12 + a.btn.btn-lg.btn-block.btn-danger.btn-link-social.confirm-deletion + span.ion-trash-b + | Delete my Free Code Camp account + script. + $('.confirm-deletion').on("click", function () { + $('#modal-dialog').modal('show'); + }); + #modal-dialog.modal.animated.wobble + .modal-dialog + .modal-content + .modal-header + a.close(href='#', data-dismiss='modal', aria-hidden='true') × + h3 You don't really want to delete your account, do you? + .modal-body + p This will really delete all your data, including all your progress, news stories and brownie points. + p We won't be able to recover any of it for you later, even if you change your mind. + p If there's something we could do better, send us an email instead and we'll do our best:   + a(href="mailto:team@freecodecamp.com") team@freecodecamp.com + | . + .modal-footer + a.btn.btn-success.btn-block(href='#', data-dismiss='modal', aria-hidden='true') + span.ion-happy + | Nevermind, I don't want to delete all my progress + .btn-spacer + form(action='/account/delete', method='POST') + input(type='hidden', name='_csrf', value=_csrf) + button.btn.btn-danger.btn-block(type='submit') + span.ion-trash-b + | I am 100% sure I want to delete all my progress .panel.panel-info .panel-heading.text-center h1 #{username}'s portfolio .panel-body - if (user && user.username === username) .row.text-center .col-xs-12.col-sm-10.col-sm-offset-1 a.btn.btn-big.btn-primary.btn-block(href="/account") Manage my account diff --git a/server/views/partials/navbar.jade b/server/views/partials/navbar.jade index d7861a224d..123f96391f 100644 --- a/server/views/partials/navbar.jade +++ b/server/views/partials/navbar.jade @@ -20,15 +20,8 @@ nav.navbar.navbar-default.navbar-fixed-top.nav-height li a.btn.signup-btn.signup-btn-nav(href='/login') Sign in else - if user.isGithubCool li a(href='/' + user.username) [ #{user.progressTimestamps.length} ] .hidden-xs.hidden-sm a(href='/' + user.username) img.profile-picture.float-right(src='#{user.picture}') - else - li - a(href='/account') [ #{user.progressTimestamps.length} ] - .hidden-xs.hidden-sm - a(href='/account') - img.profile-picture.float-right(src='#{user.picture}')