From 7bfe61731b5055eba4aecd5c97ccddf9f0d76027 Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Mon, 10 Aug 2015 20:55:01 -0700 Subject: [PATCH] give a user a brownie point when they start --- common/models/user.js | 8 ++++ server/views/account/account.jade | 64 ++++++++++++------------- server/views/resources/get-started.jade | 2 +- 3 files changed, 39 insertions(+), 35 deletions(-) diff --git a/common/models/user.js b/common/models/user.js index 81078d6df0178e..8f79fe6b758328 100644 --- a/common/models/user.js +++ b/common/models/user.js @@ -51,6 +51,14 @@ module.exports = function(User) { user.email = typeof user.email === 'string' ? user.email.trim().toLowerCase() : user.email; + + if (!user.progressTimestamps) { + user.progressTimestamps = []; + } + + if (user.progressTimestamps.length === 0) { + user.progressTimestamps.push({ timestamp: Date.now() }); + } } next(); }); diff --git a/server/views/account/account.jade b/server/views/account/account.jade index db839fe21dd06f..22ad1b997510b5 100644 --- a/server/views/account/account.jade +++ b/server/views/account/account.jade @@ -5,42 +5,38 @@ block content .panel.panel-info(ng-controller="profileValidationController") .panel-heading.text-center Manage your account here .panel-body - if (!user.isGithubCool) - .row + .row .col-xs-12 - 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 - .row - .col-xs-12 - 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.isGithubCool) + a.btn.btn-lg.btn-block.btn-github.btn-link-social(href='/auth/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 - .spacer - hr - .spacer + 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 diff --git a/server/views/resources/get-started.jade b/server/views/resources/get-started.jade index 6f5d353b744d73..2ac55a009c4040 100644 --- a/server/views/resources/get-started.jade +++ b/server/views/resources/get-started.jade @@ -99,7 +99,7 @@ block content | Click the "Wiki" button in your upper right hand corner. Our community has contributed lots of useful information to this searchable wiki. .big-spacer - img.gif-block.img-center.img-responsive.thumbnail(src='http://i.imgur.com/RlEk2IF.jpg' alt='a gif showing how to install this') + img.gif-block.img-center.img-responsive.thumbnail(src='https://www.evernote.com/l/AlwO6CNq-OJJXJ3qu2nu1E7ePe72hCSW5IcB/image.png' alt='a gif showing how to install this') p.large-p.gif-caption span.text-info Try this:  | Check out your portfolio page. Click your picture your upper right hand corner. Before you can see your portfolio page, you'll need to link your GitHub account with Free Code Camp.