From 7c8053de0ba2d90ebfb4a23888c91e93e7a215ca Mon Sep 17 00:00:00 2001 From: Gabriel Pugliese Date: Sun, 22 Mar 2015 14:30:46 -0300 Subject: [PATCH 1/2] Set telescope required info to users on user insert hook --- server/collections/users.js | 6 +++++- server/methods.js | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/server/collections/users.js b/server/collections/users.js index 0e6855a..57b5ccd 100644 --- a/server/collections/users.js +++ b/server/collections/users.js @@ -22,6 +22,10 @@ Meteor.users.allow({ } }); +Meteor.users.before.insert(function addTelescopeFields (userId, doc) { + doc.profile.email = doc.services.google.email; +}); + Meteor.users.after.insert(function (userId, doc) { if (! doc.services.google.refreshToken) return; @@ -34,7 +38,7 @@ Meteor.users.after.insert(function (userId, doc) { return; } doc.superchat = Meteor.users.saveSuperchatInfo(profile); - doc.gplus = profile; + doc.gplus = profile; debug('Finished saving profile.'); }); diff --git a/server/methods.js b/server/methods.js index 0c01039..df7a11d 100644 --- a/server/methods.js +++ b/server/methods.js @@ -35,6 +35,8 @@ Meteor.methods({ setUsername: function (username) { var user = Meteor.user(); + check(username, String); + if (user.username) { throw new Meteor.Error(400, 'User already has username defined.'); } @@ -44,7 +46,11 @@ Meteor.methods({ } Meteor.users.update({_id: user._id}, { - $set: {'profile.username': username} + $set: { + 'profile.username': username, + username: username, + slug: username.toLowerCase() + } }); return 'You have changed your username successfully. Your username now is ' + username; From b2dda61333fd48e046dfe6a2ebf5a13c6ded4f42 Mon Sep 17 00:00:00 2001 From: Gabriel Pugliese Date: Sun, 22 Mar 2015 14:42:48 -0300 Subject: [PATCH 2/2] Make header fluid to fit new buttons --- client/views/layout/header.less | 1 + client/views/layout/layout.html | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/client/views/layout/header.less b/client/views/layout/header.less index a1ce420..339606c 100644 --- a/client/views/layout/header.less +++ b/client/views/layout/header.less @@ -16,6 +16,7 @@ vertical-align: text-top; margin-top: 18px; margin-right: 20px; + margin-left: 10px !important; } .navbar-nav > li > a { color: #CCC; diff --git a/client/views/layout/layout.html b/client/views/layout/layout.html index d1953bf..73739b6 100644 --- a/client/views/layout/layout.html +++ b/client/views/layout/layout.html @@ -79,7 +79,7 @@

Loading...