Skip to content

Commit

Permalink
Get meteor developer accounts working a bit better.
Browse files Browse the repository at this point in the history
  • Loading branch information
queso committed May 27, 2014
1 parent 2c547b9 commit be97ac8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
3 changes: 3 additions & 0 deletions client/helpers.coffee
Expand Up @@ -19,6 +19,9 @@ Handlebars.registerHelper 'signupClass', ->
if Accounts.oauth && Accounts.oauth.serviceNames().length > 0
"collapse"

Handlebars.registerHelper 'signedIn', ->
return true if Meteor.user()

Handlebars.registerHelper 'otherLoginServices', ->
Accounts.oauth &&
Accounts.oauth.serviceNames().length > 0
Expand Down
13 changes: 11 additions & 2 deletions client/views/social/social.coffee
Expand Up @@ -5,12 +5,18 @@ Template.entrySocial.helpers
Session.get('buttonText')

unconfigured: ->
Accounts.loginServiceConfiguration.find({service: @toString()}).fetch().length is 0
ServiceConfiguration.configurations.find({service: @toString()}).fetch().length is 0

google: ->
if @[0] == 'g' && @[1] == 'o'
true

icon: ->
switch @.toString()
when 'google' then 'google-plus'
when 'meteor-developer' then 'rocket'
else @

Template.entrySocial.events

'click .btn': (event)->
Expand All @@ -29,7 +35,10 @@ Template.entrySocial.events
Accounts._loginButtonsSession.configureService(serviceName)
else
Accounts._loginButtonsSession.errorMessage(err.reason || t9n("error.unknown"))
loginWithService = Meteor["loginWith" + capitalize(serviceName)]
if serviceName is 'meteor'
loginWithService = Meteor["loginWithMeteorDeveloperAccount"]
else
loginWithService = Meteor["loginWith" + capitalize(serviceName)]
options = {}

if (Accounts.ui._options.requestPermissions[serviceName])
Expand Down
12 changes: 2 additions & 10 deletions client/views/social/social.html
@@ -1,17 +1,9 @@
<template name='entrySocial'>
<button class="btn" id="entry-{{this}}" name="{{this}}">
{{#if unconfigured}}
{{#if google}}
<i class="fa fa-{{this}}-plus"></i> {{t9n "configure"}} {{capitalize this}}
{{else}}
<i class="fa fa-{{this}}"></i> {{t9n "configure"}} {{capitalize this}}
{{/if}}
<i class="fa fa-{{icon}}"></i> {{t9n "configure"}} {{capitalize this}}
{{else}}
{{#if google}}
<i class="fa fa-{{this}}-plus"></i> {{t9n "sign"}} {{buttonText}} {{t9n "with"}} {{capitalize this}}
{{else}}
<i class="fa fa-{{this}}"></i> {{t9n "sign"}} {{buttonText}} {{t9n "with"}} {{capitalize this}}
{{/if}}
<i class="fa fa-{{icon}}"></i> {{t9n "sign"}} {{buttonText}} {{t9n "with"}} {{capitalize this}}
{{/if}}
</button>
</template>

0 comments on commit be97ac8

Please sign in to comment.