Skip to content

Commit

Permalink
Merge pull request #52 from CodersTV/telescope-integration
Browse files Browse the repository at this point in the history
Telescope integration
  • Loading branch information
gabrielhpugliese committed Mar 29, 2015
2 parents 6740aaf + b2dda61 commit f101598
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions client/views/layout/header.less
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
vertical-align: text-top;
margin-top: 18px;
margin-right: 20px;
margin-left: 10px !important;
}
.navbar-nav > li > a {
color: #CCC;
Expand Down
5 changes: 4 additions & 1 deletion client/views/layout/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ <h1 class="oswald text-muted">Loading...</h1>

<template name="header">
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
Expand All @@ -100,6 +100,9 @@ <h1 class="oswald text-muted">Loading...</h1>
<li>
<a href="{{pathFor 'dashboard'}}"><i class="fa fa-video-camera"></i>Start a Broadcast</a>
</li>
<li>
<a href="http://forums.coderstv.com" target="_blank"><i class="fa fa-comment"></i>Forums</a>
</li>
</ul>

<!-- Search form for extra small screens -->
Expand Down
6 changes: 5 additions & 1 deletion server/collections/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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.');
});

Expand Down
8 changes: 7 additions & 1 deletion server/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}
Expand All @@ -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;
Expand Down

0 comments on commit f101598

Please sign in to comment.