forked from Differential/accounts-entry
-
Notifications
You must be signed in to change notification settings - Fork 6
/
helpers.coffee
41 lines (30 loc) · 1.17 KB
/
helpers.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
UI.registerHelper "signedInAs", (date) ->
if Meteor.user().username
Meteor.user().username
else if Meteor.user().profile && Meteor.user().profile.name
Meteor.user().profile.name
else if Meteor.user().emails and Meteor.user().emails[0]
Meteor.user().emails[0].address
else
"Signed In"
UI.registerHelper 'accountButtons', ->
Template.entryAccountButtons
UI.registerHelper 'capitalize', (str) ->
str.charAt(0).toUpperCase() + str.slice(1)
UI.registerHelper 'signupClass', ->
if AccountsEntry.settings.showOtherLoginServices && Accounts.oauth && Accounts.oauth.serviceNames().length > 0
"collapse"
UI.registerHelper 'signedIn', ->
return true if Meteor.user()
UI.registerHelper 'otherLoginServices', ->
AccountsEntry.settings.showOtherLoginServices &&
Accounts.oauth &&
Accounts.oauth.serviceNames().length > 0
UI.registerHelper 'loginServices', ->
Accounts.oauth.serviceNames()
UI.registerHelper 'showSignupCode', ->
AccountsEntry.settings.showSignupCode is true
UI.registerHelper 'passwordLoginService', ->
!!Package['accounts-password']
UI.registerHelper 'showCreateAccountLink', ->
return !Accounts._options.forbidClientAccountCreation