flatten user object references throughout controllers and views
This commit is contained in:
@ -67,9 +67,9 @@ passport.use(new FacebookStrategy(secrets.facebook, function(req, accessToken, r
|
|||||||
if (err) { return done(err); }
|
if (err) { return done(err); }
|
||||||
user.facebook = profile.id;
|
user.facebook = profile.id;
|
||||||
user.tokens.push({ kind: 'facebook', accessToken: accessToken });
|
user.tokens.push({ kind: 'facebook', accessToken: accessToken });
|
||||||
user.profile.name = user.profile.name || profile.displayName;
|
user.name = user.name || profile.displayName;
|
||||||
user.profile.gender = user.profile.gender || profile._json.gender;
|
user.gender = user.gender || profile._json.gender;
|
||||||
user.profile.picture = user.profile.picture || 'https://s3.amazonaws.com/freecodecamp/camper-image-placeholder.png';
|
user.picture = user.picture || 'https://s3.amazonaws.com/freecodecamp/camper-image-placeholder.png';
|
||||||
user.save(function(err) {
|
user.save(function(err) {
|
||||||
if (err) { return done(err); }
|
if (err) { return done(err); }
|
||||||
req.flash('info', { msg: 'Facebook account has been linked.' });
|
req.flash('info', { msg: 'Facebook account has been linked.' });
|
||||||
@ -91,10 +91,10 @@ passport.use(new FacebookStrategy(secrets.facebook, function(req, accessToken, r
|
|||||||
user.email = profile._json.email;
|
user.email = profile._json.email;
|
||||||
user.facebook = profile.id;
|
user.facebook = profile.id;
|
||||||
user.tokens.push({ kind: 'facebook', accessToken: accessToken });
|
user.tokens.push({ kind: 'facebook', accessToken: accessToken });
|
||||||
user.profile.name = profile.displayName;
|
user.name = profile.displayName;
|
||||||
user.profile.gender = profile._json.gender;
|
user.gender = profile._json.gender;
|
||||||
user.profile.picture = 'https://graph.facebook.com/' + profile.id + '/picture?type=large';
|
user.picture = 'https://graph.facebook.com/' + profile.id + '/picture?type=large';
|
||||||
user.profile.location = (profile._json.location) ? profile._json.location.name : '';
|
user.location = (profile._json.location) ? profile._json.location.name : '';
|
||||||
user.save(function(err) {
|
user.save(function(err) {
|
||||||
done(err, user);
|
done(err, user);
|
||||||
var transporter = nodemailer.createTransport({
|
var transporter = nodemailer.createTransport({
|
||||||
@ -140,10 +140,10 @@ passport.use(new GitHubStrategy(secrets.github, function(req, accessToken, refre
|
|||||||
User.findById(req.user.id, function(err, user) {
|
User.findById(req.user.id, function(err, user) {
|
||||||
user.github = profile.id;
|
user.github = profile.id;
|
||||||
user.tokens.push({ kind: 'github', accessToken: accessToken });
|
user.tokens.push({ kind: 'github', accessToken: accessToken });
|
||||||
user.profile.name = user.profile.name || profile.displayName;
|
user.name = user.name || profile.displayName;
|
||||||
user.profile.picture = user.profile.picture || profile._json.avatar_url;
|
user.picture = user.picture || profile._json.avatar_url;
|
||||||
user.profile.location = user.profile.location || profile._json.location;
|
user.location = user.location || profile._json.location;
|
||||||
user.profile.website = user.profile.website || profile._json.blog;
|
user.website = user.website || profile._json.blog;
|
||||||
user.save(function(err) {
|
user.save(function(err) {
|
||||||
if (err) { return done(err); }
|
if (err) { return done(err); }
|
||||||
req.flash('info', { msg: 'GitHub account has been linked.' });
|
req.flash('info', { msg: 'GitHub account has been linked.' });
|
||||||
@ -166,10 +166,10 @@ passport.use(new GitHubStrategy(secrets.github, function(req, accessToken, refre
|
|||||||
user.email = profile._json.email;
|
user.email = profile._json.email;
|
||||||
user.github = profile.id;
|
user.github = profile.id;
|
||||||
user.tokens.push({ kind: 'github', accessToken: accessToken });
|
user.tokens.push({ kind: 'github', accessToken: accessToken });
|
||||||
user.profile.name = profile.displayName;
|
user.name = profile.displayName;
|
||||||
user.profile.picture = profile._json.avatar_url;
|
user.picture = profile._json.avatar_url;
|
||||||
user.profile.location = profile._json.location;
|
user.location = profile._json.location;
|
||||||
user.profile.website = profile._json.blog;
|
user.website = profile._json.blog;
|
||||||
user.save(function(err) {
|
user.save(function(err) {
|
||||||
if (err) { return done(err); }
|
if (err) { return done(err); }
|
||||||
var transporter = nodemailer.createTransport({
|
var transporter = nodemailer.createTransport({
|
||||||
@ -216,11 +216,11 @@ passport.use(new TwitterStrategy(secrets.twitter, function(req, accessToken, tok
|
|||||||
User.findById(req.user.id, function(err, user) {
|
User.findById(req.user.id, function(err, user) {
|
||||||
user.twitter = profile.id;
|
user.twitter = profile.id;
|
||||||
user.tokens.push({ kind: 'twitter', accessToken: accessToken, tokenSecret: tokenSecret });
|
user.tokens.push({ kind: 'twitter', accessToken: accessToken, tokenSecret: tokenSecret });
|
||||||
user.profile.username = user.profile.username || profile.username.toLowerCase();
|
user.username = user.username || profile.username.toLowerCase();
|
||||||
user.profile.name = user.profile.name || profile.displayName;
|
user.name = user.name || profile.displayName;
|
||||||
user.profile.location = user.profile.location || profile._json.location;
|
user.location = user.location || profile._json.location;
|
||||||
user.profile.picture = user.profile.picture || profile._json.profile_image_url_https.replace('_normal', '');
|
user.picture = user.picture || profile._json.profile_image_url_https.replace('_normal', '');
|
||||||
user.profile.twitterHandle = user.profile.twitterHandle || profile.username.toLowerCase();
|
user.twitterHandle = user.twitterHandle || profile.username.toLowerCase();
|
||||||
user.save(function(err) {
|
user.save(function(err) {
|
||||||
if (err) { return done(err); }
|
if (err) { return done(err); }
|
||||||
req.flash('info', { msg: 'Twitter account has been linked.' });
|
req.flash('info', { msg: 'Twitter account has been linked.' });
|
||||||
@ -235,13 +235,13 @@ passport.use(new TwitterStrategy(secrets.twitter, function(req, accessToken, tok
|
|||||||
if (err) { return done(err); }
|
if (err) { return done(err); }
|
||||||
if (existingUser) return done(null, existingUser);
|
if (existingUser) return done(null, existingUser);
|
||||||
var user = new User();
|
var user = new User();
|
||||||
user.profile.username = profile.username.toLowerCase();
|
user.username = profile.username.toLowerCase();
|
||||||
user.twitter = profile.id;
|
user.twitter = profile.id;
|
||||||
user.tokens.push({ kind: 'twitter', accessToken: accessToken, tokenSecret: tokenSecret });
|
user.tokens.push({ kind: 'twitter', accessToken: accessToken, tokenSecret: tokenSecret });
|
||||||
user.profile.name = profile.displayName;
|
user.name = profile.displayName;
|
||||||
user.profile.location = profile._json.location;
|
user.location = profile._json.location;
|
||||||
user.profile.picture = profile._json.profile_image_url_https.replace('_normal', '');
|
user.picture = profile._json.profile_image_url_https.replace('_normal', '');
|
||||||
user.profile.twitterHandle = user.profile.twitterHandle || profile.username.toLowerCase();
|
user.twitterHandle = user.twitterHandle || profile.username.toLowerCase();
|
||||||
user.save(function(err) {
|
user.save(function(err) {
|
||||||
if (err) { return done(err); }
|
if (err) { return done(err); }
|
||||||
done(null, user);
|
done(null, user);
|
||||||
@ -264,9 +264,9 @@ passport.use(new GoogleStrategy(secrets.google, function(req, accessToken, refre
|
|||||||
if (err) { return done(err); }
|
if (err) { return done(err); }
|
||||||
user.google = profile.id;
|
user.google = profile.id;
|
||||||
user.tokens.push({ kind: 'google', accessToken: accessToken });
|
user.tokens.push({ kind: 'google', accessToken: accessToken });
|
||||||
user.profile.name = user.profile.name || profile.displayName;
|
user.name = user.name || profile.displayName;
|
||||||
user.profile.gender = user.profile.gender || profile._json.gender;
|
user.gender = user.gender || profile._json.gender;
|
||||||
user.profile.picture = user.profile.picture || profile._json.picture;
|
user.picture = user.picture || profile._json.picture;
|
||||||
user.save(function(err) {
|
user.save(function(err) {
|
||||||
if (err) { return done(err); }
|
if (err) { return done(err); }
|
||||||
req.flash('info', { msg: 'Google account has been linked.' });
|
req.flash('info', { msg: 'Google account has been linked.' });
|
||||||
@ -289,9 +289,9 @@ passport.use(new GoogleStrategy(secrets.google, function(req, accessToken, refre
|
|||||||
user.email = profile._json.email;
|
user.email = profile._json.email;
|
||||||
user.google = profile.id;
|
user.google = profile.id;
|
||||||
user.tokens.push({ kind: 'google', accessToken: accessToken });
|
user.tokens.push({ kind: 'google', accessToken: accessToken });
|
||||||
user.profile.name = profile.displayName;
|
user.name = profile.displayName;
|
||||||
user.profile.gender = profile._json.gender;
|
user.gender = profile._json.gender;
|
||||||
user.profile.picture = profile._json.picture;
|
user.picture = profile._json.picture;
|
||||||
user.save(function(err) {
|
user.save(function(err) {
|
||||||
if (err) { return done(err); }
|
if (err) { return done(err); }
|
||||||
var transporter = nodemailer.createTransport({
|
var transporter = nodemailer.createTransport({
|
||||||
@ -339,10 +339,10 @@ passport.use(new LinkedInStrategy(secrets.linkedin, function(req, accessToken, r
|
|||||||
if (err) { return done(err); }
|
if (err) { return done(err); }
|
||||||
user.linkedin = profile.id;
|
user.linkedin = profile.id;
|
||||||
user.tokens.push({ kind: 'linkedin', accessToken: accessToken });
|
user.tokens.push({ kind: 'linkedin', accessToken: accessToken });
|
||||||
user.profile.name = user.profile.name || profile.displayName;
|
user.name = user.name || profile.displayName;
|
||||||
user.profile.location = user.profile.location || profile._json.location.name;
|
user.location = user.location || profile._json.location.name;
|
||||||
user.profile.picture = user.profile.picture || profile._json.pictureUrl;
|
user.picture = user.picture || profile._json.pictureUrl;
|
||||||
user.profile.website = user.profile.website || profile._json.publicProfileUrl;
|
user.website = user.website || profile._json.publicProfileUrl;
|
||||||
user.save(function(err) {
|
user.save(function(err) {
|
||||||
if (err) { return done(err); }
|
if (err) { return done(err); }
|
||||||
req.flash('info', { msg: 'LinkedIn account has been linked.' });
|
req.flash('info', { msg: 'LinkedIn account has been linked.' });
|
||||||
@ -364,10 +364,10 @@ passport.use(new LinkedInStrategy(secrets.linkedin, function(req, accessToken, r
|
|||||||
user.linkedin = profile.id;
|
user.linkedin = profile.id;
|
||||||
user.tokens.push({ kind: 'linkedin', accessToken: accessToken });
|
user.tokens.push({ kind: 'linkedin', accessToken: accessToken });
|
||||||
user.email = profile._json.emailAddress;
|
user.email = profile._json.emailAddress;
|
||||||
user.profile.name = profile.displayName;
|
user.name = profile.displayName;
|
||||||
user.profile.location = profile._json.location.name;
|
user.location = profile._json.location.name;
|
||||||
user.profile.picture = profile._json.pictureUrl;
|
user.picture = profile._json.pictureUrl;
|
||||||
user.profile.website = profile._json.publicProfileUrl;
|
user.website = profile._json.publicProfileUrl;
|
||||||
user.save(function(err) {
|
user.save(function(err) {
|
||||||
if (err) { return done(err); }
|
if (err) { return done(err); }
|
||||||
var transporter = nodemailer.createTransport({
|
var transporter = nodemailer.createTransport({
|
||||||
|
@ -363,11 +363,11 @@ profileValidation.controller('profileValidationController', ['$scope', '$http',
|
|||||||
function($scope, $http) {
|
function($scope, $http) {
|
||||||
$http.get('/account/api').success(function(data) {
|
$http.get('/account/api').success(function(data) {
|
||||||
$scope.user = data.user;
|
$scope.user = data.user;
|
||||||
$scope.user.profile.username = $scope.user.profile.username ? $scope.user.profile.username.toLowerCase() : undefined;
|
$scope.user.username = $scope.user.username ? $scope.user.username.toLowerCase() : undefined;
|
||||||
$scope.storedUsername = data.user.profile.username;
|
$scope.storedUsername = data.user.username;
|
||||||
$scope.storedEmail = data.user.email;
|
$scope.storedEmail = data.user.email;
|
||||||
$scope.user.email = $scope.user.email ? $scope.user.email.toLowerCase() : undefined;
|
$scope.user.email = $scope.user.email ? $scope.user.email.toLowerCase() : undefined;
|
||||||
$scope.user.profile.twitterHandle = $scope.user.profile.twitterHandle ? $scope.user.profile.twitterHandle.toLowerCase() : undefined;
|
$scope.user.twitterHandle = $scope.user.twitterHandle ? $scope.user.twitterHandle.toLowerCase() : undefined;
|
||||||
$scope.asyncComplete = true;
|
$scope.asyncComplete = true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,8 @@ module.exports = function(app) {
|
|||||||
app.use(router);
|
app.use(router);
|
||||||
|
|
||||||
function index(req, res, next) {
|
function index(req, res, next) {
|
||||||
if (req.user && !req.user.profile.picture) {
|
if (req.user && !req.user.picture) {
|
||||||
req.user.profile.picture =
|
req.user.picture =
|
||||||
'https://s3.amazonaws.com/freecodecamp/camper-image-placeholder.png';
|
'https://s3.amazonaws.com/freecodecamp/camper-image-placeholder.png';
|
||||||
|
|
||||||
req.user.save(function(err) {
|
req.user.save(function(err) {
|
||||||
|
@ -53,7 +53,7 @@ module.exports = function(app) {
|
|||||||
if (req.user.completedCoursewares.length > 63) {
|
if (req.user.completedCoursewares.length > 63) {
|
||||||
var hasShownInterest =
|
var hasShownInterest =
|
||||||
nonprofit.interestedCampers.filter(function ( obj ) {
|
nonprofit.interestedCampers.filter(function ( obj ) {
|
||||||
return obj.username === req.user.profile.username;
|
return obj.username === req.user.username;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (hasShownInterest.length === 0) {
|
if (hasShownInterest.length === 0) {
|
||||||
@ -110,8 +110,8 @@ module.exports = function(app) {
|
|||||||
function(err, nonprofit) {
|
function(err, nonprofit) {
|
||||||
if (err) { return next(err); }
|
if (err) { return next(err); }
|
||||||
nonprofit.interestedCampers.push({
|
nonprofit.interestedCampers.push({
|
||||||
username: req.user.profile.username,
|
username: req.user.username,
|
||||||
picture: req.user.profile.picture,
|
picture: req.user.picture,
|
||||||
timeOfInterest: Date.now()
|
timeOfInterest: Date.now()
|
||||||
});
|
});
|
||||||
nonprofit.save(function(err) {
|
nonprofit.save(function(err) {
|
||||||
|
@ -134,7 +134,7 @@ module.exports = function(app) {
|
|||||||
|
|
||||||
|
|
||||||
function getHelp(req, res) {
|
function getHelp(req, res) {
|
||||||
var userName = req.user.profile.username;
|
var userName = req.user.username;
|
||||||
var code = req.body.payload.code ? '\n```\n' +
|
var code = req.body.payload.code ? '\n```\n' +
|
||||||
req.body.payload.code + '\n```\n'
|
req.body.payload.code + '\n```\n'
|
||||||
: '';
|
: '';
|
||||||
@ -154,7 +154,7 @@ module.exports = function(app) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getPair(req, res) {
|
function getPair(req, res) {
|
||||||
var userName = req.user.profile.username;
|
var userName = req.user.username;
|
||||||
var challenge = req.body.payload.challenge;
|
var challenge = req.body.payload.challenge;
|
||||||
slack.send({
|
slack.send({
|
||||||
text: [
|
text: [
|
||||||
@ -201,7 +201,7 @@ module.exports = function(app) {
|
|||||||
} else {
|
} else {
|
||||||
Rx.Observable.from(users)
|
Rx.Observable.from(users)
|
||||||
.map(function(user) {
|
.map(function(user) {
|
||||||
return user.profile.username;
|
return user.username;
|
||||||
})
|
})
|
||||||
.toArray()
|
.toArray()
|
||||||
.subscribe(
|
.subscribe(
|
||||||
|
@ -247,7 +247,7 @@ module.exports = function(app) {
|
|||||||
story.upVotes.push(
|
story.upVotes.push(
|
||||||
{
|
{
|
||||||
upVotedBy: req.user._id,
|
upVotedBy: req.user._id,
|
||||||
upVotedByUsername: req.user.profile.username
|
upVotedByUsername: req.user.username
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
story.markModified('rank');
|
story.markModified('rank');
|
||||||
@ -397,12 +397,12 @@ module.exports = function(app) {
|
|||||||
rank: 1,
|
rank: 1,
|
||||||
upVotes: [({
|
upVotes: [({
|
||||||
upVotedBy: req.user._id,
|
upVotedBy: req.user._id,
|
||||||
upVotedByUsername: req.user.profile.username
|
upVotedByUsername: req.user.username
|
||||||
})],
|
})],
|
||||||
author: {
|
author: {
|
||||||
picture: req.user.profile.picture,
|
picture: req.user.picture,
|
||||||
userId: req.user._id,
|
userId: req.user._id,
|
||||||
username: req.user.profile.username,
|
username: req.user.username,
|
||||||
email: req.user.email
|
email: req.user.email
|
||||||
},
|
},
|
||||||
comments: [],
|
comments: [],
|
||||||
@ -452,9 +452,9 @@ module.exports = function(app) {
|
|||||||
rank: 0,
|
rank: 0,
|
||||||
upvotes: 0,
|
upvotes: 0,
|
||||||
author: {
|
author: {
|
||||||
picture: req.user.profile.picture,
|
picture: req.user.picture,
|
||||||
userId: req.user._id,
|
userId: req.user._id,
|
||||||
username: req.user.profile.username,
|
username: req.user.username,
|
||||||
email: req.user.email
|
email: req.user.email
|
||||||
},
|
},
|
||||||
comments: [],
|
comments: [],
|
||||||
@ -494,9 +494,9 @@ module.exports = function(app) {
|
|||||||
originalStoryLink: data.originalStoryLink,
|
originalStoryLink: data.originalStoryLink,
|
||||||
originalStoryAuthorEmail: data.originalStoryAuthorEmail,
|
originalStoryAuthorEmail: data.originalStoryAuthorEmail,
|
||||||
author: {
|
author: {
|
||||||
picture: req.user.profile.picture,
|
picture: req.user.picture,
|
||||||
userId: req.user._id,
|
userId: req.user._id,
|
||||||
username: req.user.profile.username,
|
username: req.user.username,
|
||||||
email: req.user.email
|
email: req.user.email
|
||||||
},
|
},
|
||||||
comments: [],
|
comments: [],
|
||||||
|
@ -406,27 +406,27 @@ module.exports = function(app) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
res.render('account/show', {
|
res.render('account/show', {
|
||||||
title: 'Camper ' + user.profile.username + '\'s portfolio',
|
title: 'Camper ' + user.username + '\'s portfolio',
|
||||||
username: user.profile.username,
|
username: user.username,
|
||||||
name: user.profile.name,
|
name: user.name,
|
||||||
location: user.profile.location,
|
location: user.location,
|
||||||
githubProfile: user.profile.githubProfile,
|
githubProfile: user.githubProfile,
|
||||||
linkedinProfile: user.profile.linkedinProfile,
|
linkedinProfile: user.linkedinProfile,
|
||||||
codepenProfile: user.profile.codepenProfile,
|
codepenProfile: user.codepenProfile,
|
||||||
facebookProfile: user.profile.facebookProfile,
|
facebookProfile: user.facebookProfile,
|
||||||
twitterHandle: user.profile.twitterHandle,
|
twitterHandle: user.twitterHandle,
|
||||||
bio: user.profile.bio,
|
bio: user.bio,
|
||||||
picture: user.profile.picture,
|
picture: user.picture,
|
||||||
progressTimestamps: user.progressTimestamps,
|
progressTimestamps: user.progressTimestamps,
|
||||||
website1Link: user.portfolio.website1Link,
|
website1Link: user.website1Link,
|
||||||
website1Title: user.portfolio.website1Title,
|
website1Title: user.website1Title,
|
||||||
website1Image: user.portfolio.website1Image,
|
website1Image: user.website1Image,
|
||||||
website2Link: user.portfolio.website2Link,
|
website2Link: user.website2Link,
|
||||||
website2Title: user.portfolio.website2Title,
|
website2Title: user.website2Title,
|
||||||
website2Image: user.portfolio.website2Image,
|
website2Image: user.website2Image,
|
||||||
website3Link: user.portfolio.website3Link,
|
website3Link: user.website3Link,
|
||||||
website3Title: user.portfolio.website3Title,
|
website3Title: user.website3Title,
|
||||||
website3Image: user.portfolio.website3Image,
|
website3Image: user.website3Image,
|
||||||
challenges: challenges,
|
challenges: challenges,
|
||||||
bonfires: user.completedChallenges.filter(function(challenge) {
|
bonfires: user.completedChallenges.filter(function(challenge) {
|
||||||
return challenge.challengeType === 5;
|
return challenge.challengeType === 5;
|
||||||
@ -485,7 +485,7 @@ module.exports = function(app) {
|
|||||||
var user = req.user;
|
var user = req.user;
|
||||||
if (
|
if (
|
||||||
existingUsername &&
|
existingUsername &&
|
||||||
existingUsername.profile.username !== user.profile.username
|
existingUsername.profile.username !== user.username
|
||||||
) {
|
) {
|
||||||
req.flash('errors', {
|
req.flash('errors', {
|
||||||
msg: 'An account with that username already exists.'
|
msg: 'An account with that username already exists.'
|
||||||
@ -494,32 +494,32 @@ module.exports = function(app) {
|
|||||||
}
|
}
|
||||||
var body = req.body || {};
|
var body = req.body || {};
|
||||||
user.email = body.email.trim() || '';
|
user.email = body.email.trim() || '';
|
||||||
user.profile.name = body.name.trim() || '';
|
user.name = body.name.trim() || '';
|
||||||
user.profile.username = body.username.trim() || '';
|
user.username = body.username.trim() || '';
|
||||||
user.profile.location = body.location.trim() || '';
|
user.location = body.location.trim() || '';
|
||||||
|
|
||||||
user.profile.githubProfile = body.githubProfile.trim() || '';
|
user.githubProfile = body.githubProfile.trim() || '';
|
||||||
user.profile.facebookProfile = body.facebookProfile.trim() || '';
|
user.facebookProfile = body.facebookProfile.trim() || '';
|
||||||
user.profile.linkedinProfile = body.linkedinProfile.trim() || '';
|
user.linkedinProfile = body.linkedinProfile.trim() || '';
|
||||||
|
|
||||||
user.profile.codepenProfile = body.codepenProfile.trim() || '';
|
user.codepenProfile = body.codepenProfile.trim() || '';
|
||||||
user.profile.twitterHandle = body.twitterHandle.trim() || '';
|
user.twitterHandle = body.twitterHandle.trim() || '';
|
||||||
user.profile.bio = body.bio.trim() || '';
|
user.bio = body.bio.trim() || '';
|
||||||
|
|
||||||
user.profile.picture = body.picture.trim() ||
|
user.picture = body.picture.trim() ||
|
||||||
'https://s3.amazonaws.com/freecodecamp/' +
|
'https://s3.amazonaws.com/freecodecamp/' +
|
||||||
'camper-image-placeholder.png';
|
'camper-image-placeholder.png';
|
||||||
user.portfolio.website1Title = body.website1Title.trim() || '';
|
user.website1Title = body.website1Title.trim() || '';
|
||||||
user.portfolio.website1Link = body.website1Link.trim() || '';
|
user.website1Link = body.website1Link.trim() || '';
|
||||||
user.portfolio.website1Image = body.website1Image.trim() || '';
|
user.website1Image = body.website1Image.trim() || '';
|
||||||
|
|
||||||
user.portfolio.website2Title = body.website2Title.trim() || '';
|
user.website2Title = body.website2Title.trim() || '';
|
||||||
user.portfolio.website2Link = body.website2Link.trim() || '';
|
user.website2Link = body.website2Link.trim() || '';
|
||||||
user.portfolio.website2Image = body.website2Image.trim() || '';
|
user.website2Image = body.website2Image.trim() || '';
|
||||||
|
|
||||||
user.portfolio.website3Title = body.website3Title.trim() || '';
|
user.website3Title = body.website3Title.trim() || '';
|
||||||
user.portfolio.website3Link = body.website3Link.trim() || '';
|
user.website3Link = body.website3Link.trim() || '';
|
||||||
user.portfolio.website3Image = body.website3Image.trim() || '';
|
user.website3Image = body.website3Image.trim() || '';
|
||||||
|
|
||||||
|
|
||||||
user.save(function (err) {
|
user.save(function (err) {
|
||||||
@ -528,8 +528,8 @@ module.exports = function(app) {
|
|||||||
}
|
}
|
||||||
updateUserStoryPictures(
|
updateUserStoryPictures(
|
||||||
user._id.toString(),
|
user._id.toString(),
|
||||||
user.profile.picture,
|
user.picture,
|
||||||
user.profile.username,
|
user.username,
|
||||||
function(err) {
|
function(err) {
|
||||||
if (err) { return next(err); }
|
if (err) { return next(err); }
|
||||||
req.flash('success', {
|
req.flash('success', {
|
||||||
|
@ -15,7 +15,7 @@ block content
|
|||||||
.form-group
|
.form-group
|
||||||
label.col-sm-3.col-sm-offset-2.control-label(for='name') Name *
|
label.col-sm-3.col-sm-offset-2.control-label(for='name') Name *
|
||||||
.col-sm-4
|
.col-sm-4
|
||||||
input.form-control(type='text', placeholder='Name', name='name', autocomplete="off", ng-model='user.profile.name', ng-minlength='3', ng-maxlength='50', required='required', id='name')
|
input.form-control(type='text', placeholder='Name', name='name', autocomplete="off", ng-model='user.name', ng-minlength='3', ng-maxlength='50', required='required', id='name')
|
||||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.name.$invalid && profileForm.name.$error.required")
|
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.name.$invalid && profileForm.name.$error.required")
|
||||||
alert(type='danger')
|
alert(type='danger')
|
||||||
span.ion-close-circled(id='#name-error')
|
span.ion-close-circled(id='#name-error')
|
||||||
@ -32,7 +32,7 @@ block content
|
|||||||
.form-group
|
.form-group
|
||||||
label.col-sm-3.col-sm-offset-2.control-label(for='username') Username (path to public profile) *
|
label.col-sm-3.col-sm-offset-2.control-label(for='username') Username (path to public profile) *
|
||||||
.col-sm-4
|
.col-sm-4
|
||||||
input.form-control(type='text', placeholder='username' name='username', autocomplete="off", id='username', ng-model='user.profile.username', required='required', ng-minlength='5', ng-maxlength='20', ng-keypress='', unique-username='', ng-pattern="/^[A-z0-9_]+$/")
|
input.form-control(type='text', placeholder='username' name='username', autocomplete="off", id='username', ng-model='user.username', required='required', ng-minlength='5', ng-maxlength='20', ng-keypress='', unique-username='', ng-pattern="/^[A-z0-9_]+$/")
|
||||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.username.$error.pattern")
|
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.username.$error.pattern")
|
||||||
alert(type='danger')
|
alert(type='danger')
|
||||||
span.ion-close-circled
|
span.ion-close-circled
|
||||||
@ -49,7 +49,7 @@ block content
|
|||||||
alert(type='danger')
|
alert(type='danger')
|
||||||
span.ion-close-circled
|
span.ion-close-circled
|
||||||
| Your username must be fewer than 15 characters.
|
| Your username must be fewer than 15 characters.
|
||||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.username.$error.unique && !profileForm.username.$pristine && $scope.storedUsername !== user.profile.username")
|
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.username.$error.unique && !profileForm.username.$pristine && $scope.storedUsername !== user.username")
|
||||||
alert(type='danger')
|
alert(type='danger')
|
||||||
span.ion-close-circled
|
span.ion-close-circled
|
||||||
| That username is already in use.
|
| That username is already in use.
|
||||||
@ -74,12 +74,12 @@ block content
|
|||||||
.form-group
|
.form-group
|
||||||
label.col-sm-3.col-sm-offset-2.control-label(for='location') Location
|
label.col-sm-3.col-sm-offset-2.control-label(for='location') Location
|
||||||
.col-sm-4
|
.col-sm-4
|
||||||
input.form-control(type='text', name='location', autocomplete="off", id='location', ng-model='user.profile.location')
|
input.form-control(type='text', name='location', autocomplete="off", id='location', ng-model='user.location')
|
||||||
|
|
||||||
.form-group
|
.form-group
|
||||||
label.col-sm-3.col-sm-offset-2.control-label(for='email') Link to Profile Photo (1:1 ratio)
|
label.col-sm-3.col-sm-offset-2.control-label(for='email') Link to Profile Photo (1:1 ratio)
|
||||||
.col-sm-4
|
.col-sm-4
|
||||||
input.form-control(type='url', name='picture', id='picture', ng-model='user.profile.picture', placeholder='http://www.example.com/image.jpg')
|
input.form-control(type='url', name='picture', id='picture', ng-model='user.picture', placeholder='http://www.example.com/image.jpg')
|
||||||
.col-sm-4.col-sm-offset-5(ng-show="profileForm.picture.$error.url && !profileForm.picture.$pristine")
|
.col-sm-4.col-sm-offset-5(ng-show="profileForm.picture.$error.url && !profileForm.picture.$pristine")
|
||||||
alert(type='danger')
|
alert(type='danger')
|
||||||
span.ion-close-circled
|
span.ion-close-circled
|
||||||
@ -87,7 +87,7 @@ block content
|
|||||||
.form-group
|
.form-group
|
||||||
label.col-sm-3.col-sm-offset-2.control-label(for='bio') Bio (140 characters)
|
label.col-sm-3.col-sm-offset-2.control-label(for='bio') Bio (140 characters)
|
||||||
.col-sm-4
|
.col-sm-4
|
||||||
input.form-control(type='text', name='bio', autocomplete="off", ng-model='user.profile.bio', ng-maxlength='140', id='bio')
|
input.form-control(type='text', name='bio', autocomplete="off", ng-model='user.bio', ng-maxlength='140', id='bio')
|
||||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show='profileForm.bio.$error.maxlength && !profileForm.bio.$pristine')
|
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show='profileForm.bio.$error.maxlength && !profileForm.bio.$pristine')
|
||||||
alert(type='danger')
|
alert(type='danger')
|
||||||
span.ion-close-circled
|
span.ion-close-circled
|
||||||
@ -107,7 +107,7 @@ block content
|
|||||||
.col-sm-4
|
.col-sm-4
|
||||||
.input-group.twitter-input
|
.input-group.twitter-input
|
||||||
span.input-group-addon @
|
span.input-group-addon @
|
||||||
input.form-control(type='text', name='twitterHandle', autocomplete="off", id='twitterHandle', ng-model='user.profile.twitterHandle', ng-maxlength='15', ng-pattern="/^[A-z0-9_]+$/")
|
input.form-control(type='text', name='twitterHandle', autocomplete="off", id='twitterHandle', ng-model='user.twitterHandle', ng-maxlength='15', ng-pattern="/^[A-z0-9_]+$/")
|
||||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.twitterHandle.$error.pattern")
|
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.twitterHandle.$error.pattern")
|
||||||
alert(type='danger')
|
alert(type='danger')
|
||||||
span.ion-close-circled
|
span.ion-close-circled
|
||||||
@ -119,7 +119,7 @@ block content
|
|||||||
.form-group
|
.form-group
|
||||||
label.col-sm-3.col-sm-offset-2.control-label(for='email') GitHub
|
label.col-sm-3.col-sm-offset-2.control-label(for='email') GitHub
|
||||||
.col-sm-4
|
.col-sm-4
|
||||||
input.form-control(type='url', name='githubProfile', id='githubProfile', autocomplete="off", ng-model='user.profile.githubProfile', placeholder='http://')
|
input.form-control(type='url', name='githubProfile', id='githubProfile', autocomplete="off", ng-model='user.githubProfile', placeholder='http://')
|
||||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.githubProfile.$error.url && !profileForm.githubProfile.$pristine")
|
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.githubProfile.$error.url && !profileForm.githubProfile.$pristine")
|
||||||
alert(type='danger')
|
alert(type='danger')
|
||||||
span.ion-close-circled
|
span.ion-close-circled
|
||||||
@ -128,7 +128,7 @@ block content
|
|||||||
.form-group
|
.form-group
|
||||||
label.col-sm-3.col-sm-offset-2.control-label(for='email') CodePen
|
label.col-sm-3.col-sm-offset-2.control-label(for='email') CodePen
|
||||||
.col-sm-4
|
.col-sm-4
|
||||||
input.form-control(type='url', name='codepenProfile', id='codepenProfile', autocomplete="off", ng-model='user.profile.codepenProfile', placeholder='http://')
|
input.form-control(type='url', name='codepenProfile', id='codepenProfile', autocomplete="off", ng-model='user.codepenProfile', placeholder='http://')
|
||||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.codepenProfile.$error.url && !profileForm.codepenProfile.$pristine")
|
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.codepenProfile.$error.url && !profileForm.codepenProfile.$pristine")
|
||||||
alert(type='danger')
|
alert(type='danger')
|
||||||
span.ion-close-circled
|
span.ion-close-circled
|
||||||
@ -137,7 +137,7 @@ block content
|
|||||||
.form-group
|
.form-group
|
||||||
label.col-sm-3.col-sm-offset-2.control-label(for='email') LinkedIn
|
label.col-sm-3.col-sm-offset-2.control-label(for='email') LinkedIn
|
||||||
.col-sm-4
|
.col-sm-4
|
||||||
input.form-control(type='url', name='linkedinProfile', id='linkedinProfile', autocomplete="off", ng-model='user.profile.linkedinProfile', placeholder='http://')
|
input.form-control(type='url', name='linkedinProfile', id='linkedinProfile', autocomplete="off", ng-model='user.linkedinProfile', placeholder='http://')
|
||||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.linkedinProfile.$error.url && !profileForm.linkedinProfile.$pristine")
|
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.linkedinProfile.$error.url && !profileForm.linkedinProfile.$pristine")
|
||||||
alert(type='danger')
|
alert(type='danger')
|
||||||
span.ion-close-circled
|
span.ion-close-circled
|
||||||
@ -146,7 +146,7 @@ block content
|
|||||||
.form-group
|
.form-group
|
||||||
label.col-sm-3.col-sm-offset-2.control-label(for='email') Facebook
|
label.col-sm-3.col-sm-offset-2.control-label(for='email') Facebook
|
||||||
.col-sm-4
|
.col-sm-4
|
||||||
input.form-control(type='url', name='facebookProfile', id='facebookProfile', autocomplete="off", ng-model='user.profile.facebookProfile', placeholder='http://')
|
input.form-control(type='url', name='facebookProfile', id='facebookProfile', autocomplete="off", ng-model='user.facebookProfile', placeholder='http://')
|
||||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.facebookProfile.$error.url && !profileForm.facebookProfile.$pristine")
|
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.facebookProfile.$error.url && !profileForm.facebookProfile.$pristine")
|
||||||
alert(type='danger')
|
alert(type='danger')
|
||||||
span.ion-close-circled
|
span.ion-close-circled
|
||||||
@ -167,7 +167,7 @@ block content
|
|||||||
.form-group
|
.form-group
|
||||||
label.col-sm-3.col-sm-offset-2.control-label(for='website1Title') Title
|
label.col-sm-3.col-sm-offset-2.control-label(for='website1Title') Title
|
||||||
.col-sm-4
|
.col-sm-4
|
||||||
input.form-control(type='text', name='website1Title', id='website1Title', autocomplete="off", ng-model='user.portfolio.website1Title', ng-maxlength='140')
|
input.form-control(type='text', name='website1Title', id='website1Title', autocomplete="off", ng-model='user.website1Title', ng-maxlength='140')
|
||||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.website1Title.$error.maxlength && !profileForm.website1Title.$pristine")
|
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.website1Title.$error.maxlength && !profileForm.website1Title.$pristine")
|
||||||
alert(type='danger')
|
alert(type='danger')
|
||||||
span.ion-close-circled
|
span.ion-close-circled
|
||||||
@ -176,7 +176,7 @@ block content
|
|||||||
.form-group
|
.form-group
|
||||||
label.col-sm-3.col-sm-offset-2.control-label(for='website1Link') Link
|
label.col-sm-3.col-sm-offset-2.control-label(for='website1Link') Link
|
||||||
.col-sm-4
|
.col-sm-4
|
||||||
input.form-control(type='url', name='website1Link', id='website1Link', autocomplete="off", ng-model='user.portfolio.website1Link', placeholder='http://')
|
input.form-control(type='url', name='website1Link', id='website1Link', autocomplete="off", ng-model='user.website1Link', placeholder='http://')
|
||||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.website1Link.$error.url && !profileForm.website1Link.$pristine")
|
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.website1Link.$error.url && !profileForm.website1Link.$pristine")
|
||||||
alert(type='danger')
|
alert(type='danger')
|
||||||
span.ion-close-circled
|
span.ion-close-circled
|
||||||
@ -185,7 +185,7 @@ block content
|
|||||||
.form-group
|
.form-group
|
||||||
label.col-sm-3.col-sm-offset-2.control-label(for='website1Image') Image Link (4:3 ratio)
|
label.col-sm-3.col-sm-offset-2.control-label(for='website1Image') Image Link (4:3 ratio)
|
||||||
.col-sm-4
|
.col-sm-4
|
||||||
input.form-control(type='url', name='website1Image', id='website1Image', autocomplete="off", ng-model='user.portfolio.website1Image', placeholder='http://www.example.com/image.jpg')
|
input.form-control(type='url', name='website1Image', id='website1Image', autocomplete="off", ng-model='user.website1Image', placeholder='http://www.example.com/image.jpg')
|
||||||
.col-sm-4.col-sm-offset-5(ng-show="profileForm.website1Image.$error.url && !profileForm.website1Image.$pristine")
|
.col-sm-4.col-sm-offset-5(ng-show="profileForm.website1Image.$error.url && !profileForm.website1Image.$pristine")
|
||||||
alert(type='danger')
|
alert(type='danger')
|
||||||
span.ion-close-circled
|
span.ion-close-circled
|
||||||
@ -197,7 +197,7 @@ block content
|
|||||||
.form-group
|
.form-group
|
||||||
label.col-sm-3.col-sm-offset-2.control-label(for='website2Title') Title
|
label.col-sm-3.col-sm-offset-2.control-label(for='website2Title') Title
|
||||||
.col-sm-4
|
.col-sm-4
|
||||||
input.form-control(type='text', name='website2Title', id='website2Title', autocomplete="off", ng-model='user.portfolio.website2Title', ng-maxlength='140')
|
input.form-control(type='text', name='website2Title', id='website2Title', autocomplete="off", ng-model='user.website2Title', ng-maxlength='140')
|
||||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.website2Title.$error.maxlength && !profileForm.website2Title.$pristine")
|
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.website2Title.$error.maxlength && !profileForm.website2Title.$pristine")
|
||||||
alert(type='danger')
|
alert(type='danger')
|
||||||
span.ion-close-circled
|
span.ion-close-circled
|
||||||
@ -206,7 +206,7 @@ block content
|
|||||||
.form-group
|
.form-group
|
||||||
label.col-sm-3.col-sm-offset-2.control-label(for='website2Link') Link
|
label.col-sm-3.col-sm-offset-2.control-label(for='website2Link') Link
|
||||||
.col-sm-4
|
.col-sm-4
|
||||||
input.form-control(type='url', name='website2Link', id='website2Link', autocomplete="off", ng-model='user.portfolio.website2Link', placeholder='http://')
|
input.form-control(type='url', name='website2Link', id='website2Link', autocomplete="off", ng-model='user.website2Link', placeholder='http://')
|
||||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.website2Link.$error.url && !profileForm.website2Link.$pristine")
|
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.website2Link.$error.url && !profileForm.website2Link.$pristine")
|
||||||
alert(type='danger')
|
alert(type='danger')
|
||||||
span.ion-close-circled
|
span.ion-close-circled
|
||||||
@ -214,7 +214,7 @@ block content
|
|||||||
.form-group
|
.form-group
|
||||||
label.col-sm-3.col-sm-offset-2.control-label(for='website2Image') Image Link (4:3 ratio)
|
label.col-sm-3.col-sm-offset-2.control-label(for='website2Image') Image Link (4:3 ratio)
|
||||||
.col-sm-4
|
.col-sm-4
|
||||||
input.form-control(type='url', name='website2Image', id='website2Image', autocomplete="off", ng-model='user.portfolio.website2Image', placeholder='http://www.example.com/image.jpg')
|
input.form-control(type='url', name='website2Image', id='website2Image', autocomplete="off", ng-model='user.website2Image', placeholder='http://www.example.com/image.jpg')
|
||||||
.col-sm-4.col-sm-offset-5(ng-show="profileForm.website2Image.$error.url && !profileForm.website2Image.$pristine")
|
.col-sm-4.col-sm-offset-5(ng-show="profileForm.website2Image.$error.url && !profileForm.website2Image.$pristine")
|
||||||
alert(type='danger')
|
alert(type='danger')
|
||||||
span.ion-close-circled
|
span.ion-close-circled
|
||||||
@ -226,7 +226,7 @@ block content
|
|||||||
.form-group
|
.form-group
|
||||||
label.col-sm-3.col-sm-offset-2.control-label(for='website3Title') Title
|
label.col-sm-3.col-sm-offset-2.control-label(for='website3Title') Title
|
||||||
.col-sm-4
|
.col-sm-4
|
||||||
input.form-control(type='text', name='website3Title', id='website3Title', autocomplete="off", ng-model='user.portfolio.website3Title', ng-maxlength='140')
|
input.form-control(type='text', name='website3Title', id='website3Title', autocomplete="off", ng-model='user.website3Title', ng-maxlength='140')
|
||||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.website3Title.$error.maxlength && !profileForm.website3Title.$pristine")
|
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.website3Title.$error.maxlength && !profileForm.website3Title.$pristine")
|
||||||
alert(type='danger')
|
alert(type='danger')
|
||||||
span.ion-close-circled
|
span.ion-close-circled
|
||||||
@ -235,7 +235,7 @@ block content
|
|||||||
.form-group
|
.form-group
|
||||||
label.col-sm-3.col-sm-offset-2.control-label(for='website3Link') Link
|
label.col-sm-3.col-sm-offset-2.control-label(for='website3Link') Link
|
||||||
.col-sm-4
|
.col-sm-4
|
||||||
input.form-control(type='url', name='website3Link', id='website3Link', autocomplete="off", ng-model='user.portfolio.website3Link', placeholder='http://')
|
input.form-control(type='url', name='website3Link', id='website3Link', autocomplete="off", ng-model='user.website3Link', placeholder='http://')
|
||||||
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.website3Link.$error.url && !profileForm.website3Link.$pristine")
|
.col-sm-4.col-sm-offset-5(ng-cloak, ng-show="profileForm.website3Link.$error.url && !profileForm.website3Link.$pristine")
|
||||||
alert(type='danger')
|
alert(type='danger')
|
||||||
span.ion-close-circled
|
span.ion-close-circled
|
||||||
@ -244,7 +244,7 @@ block content
|
|||||||
.form-group
|
.form-group
|
||||||
label.col-sm-3.col-sm-offset-2.control-label(for='website3Image') Image Link (4:3 ratio)
|
label.col-sm-3.col-sm-offset-2.control-label(for='website3Image') Image Link (4:3 ratio)
|
||||||
.col-sm-4
|
.col-sm-4
|
||||||
input.form-control(type='url', name='website3Image', id='website3Image', autocomplete="off", ng-model='user.portfolio.website3Image', placeholder='http://www.example.com/image.jpg', ng-pattern='/[\.](jpg|png|jpeg|gif)(\s+)?$/')
|
input.form-control(type='url', name='website3Image', id='website3Image', autocomplete="off", ng-model='user.website3Image', placeholder='http://www.example.com/image.jpg', ng-pattern='/[\.](jpg|png|jpeg|gif)(\s+)?$/')
|
||||||
.col-sm-4.col-sm-offset-5(ng-show="profileForm.website3Image.$error.url && !profileForm.website3Image.$pristine")
|
.col-sm-4.col-sm-offset-5(ng-show="profileForm.website3Image.$error.url && !profileForm.website3Image.$pristine")
|
||||||
alert(type='danger')
|
alert(type='danger')
|
||||||
span.ion-close-circled
|
span.ion-close-circled
|
||||||
|
@ -7,7 +7,7 @@ block content
|
|||||||
.panel-heading.text-center
|
.panel-heading.text-center
|
||||||
h1 #{username}'s portfolio
|
h1 #{username}'s portfolio
|
||||||
.panel-body
|
.panel-body
|
||||||
if (user && user.profile.username === username)
|
if (user && user.username === username)
|
||||||
.row.text-center
|
.row.text-center
|
||||||
.col-xs-12.col-sm-10.col-sm-offset-1
|
.col-xs-12.col-sm-10.col-sm-offset-1
|
||||||
a.btn.btn-big.btn-primary.btn-block(href="/account") Update my portfolio page or manage my account
|
a.btn.btn-big.btn-primary.btn-block(href="/account") Update my portfolio page or manage my account
|
||||||
|
@ -36,16 +36,16 @@ nav.navbar.navbar-default.navbar-fixed-top.nav-height
|
|||||||
a.btn.signup-btn.signup-btn-nav(href='/login') Sign in
|
a.btn.signup-btn.signup-btn-nav(href='/login') Sign in
|
||||||
else
|
else
|
||||||
li
|
li
|
||||||
if (user.profile.username)
|
if (user.username)
|
||||||
|
|
||||||
a(href='/' + user.profile.username) [ #{user.progressTimestamps.length} ]
|
a(href='/' + user.username) [ #{user.progressTimestamps.length} ]
|
||||||
|
|
||||||
else
|
else
|
||||||
a(href='/account') [ #{user.progressTimestamps.length} ]
|
a(href='/account') [ #{user.progressTimestamps.length} ]
|
||||||
.hidden-xs.hidden-sm
|
.hidden-xs.hidden-sm
|
||||||
if (user.profile.username)
|
if (user.username)
|
||||||
a(href='/' + user.profile.username)
|
a(href='/' + user.username)
|
||||||
img.profile-picture.float-right(src='#{user.profile.picture}')
|
img.profile-picture.float-right(src='#{user.picture}')
|
||||||
else
|
else
|
||||||
a(href='/account')
|
a(href='/account')
|
||||||
img.profile-picture.float-right(src='#{user.profile.picture}')
|
img.profile-picture.float-right(src='#{user.picture}')
|
||||||
|
@ -4,7 +4,7 @@ block content
|
|||||||
script.
|
script.
|
||||||
var isLoggedIn = true;
|
var isLoggedIn = true;
|
||||||
var B3BA669EC5C1DD70FB478221E067A7E1B686929C569F5E73561B69C8F42129B = !{JSON.stringify(user._id)};
|
var B3BA669EC5C1DD70FB478221E067A7E1B686929C569F5E73561B69C8F42129B = !{JSON.stringify(user._id)};
|
||||||
var DF105CFA89562196E702912B3818C6A5B46E80D262442FDF29976621E5AF0D23 = !{JSON.stringify(user.profile.username)};
|
var DF105CFA89562196E702912B3818C6A5B46E80D262442FDF29976621E5AF0D23 = !{JSON.stringify(user.username)};
|
||||||
else
|
else
|
||||||
script.
|
script.
|
||||||
var isLoggedIn = false;
|
var isLoggedIn = false;
|
||||||
|
Reference in New Issue
Block a user