Skip to content

Commit

Permalink
Add before hooks to all the account navigation links.
Browse files Browse the repository at this point in the history
  • Loading branch information
queso committed Feb 13, 2014
1 parent 042ea94 commit 8b9555e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
12 changes: 12 additions & 0 deletions client/views/accountButtons/accountButtons.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,15 @@ Template.entryAccountButtons.helpers

wrapLinks: ->
AccountsEntry.settings.wrapLinks

beforeSignIn: ->
AccountsEntry.settings.beforeSignIn

beforeSignUp: ->
AccountsEntry.settings.beforeSignUp

beforeSignOut: ->
AccountsEntry.settings.beforeSignOut

beforeSignedInAs: ->
AccountsEntry.settings.beforeSignedInAs
10 changes: 5 additions & 5 deletions client/views/accountButtons/accountButtons.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@

{{#if profileUrl}}
{{#if wrapLinks}}<li>{{/if}}
<a class='profileLink' href='{{profileUrl}}'>{{signedInAs}}</a>
<a class='profileLink' href='{{profileUrl}}'>{{{beforeSignedInAs}}}{{signedInAs}}</a>
{{#if wrapLinks}}</li>{{/if}}
{{else}}
{{#if wrapLinks}}<li>{{/if}}
<p class="navbar-text">{{signedInAs}}</p>
<p class="navbar-text">{{{beforeSignedInAs}}}{{signedInAs}}</p>
{{#if wrapLinks}}</li>{{/if}}
{{/if}}

{{#if wrapLinks}}<li>{{/if}}
<a href="/sign-out">{{i18n "signOut"}}</a>
<a href="/sign-out">{{{beforeSignOut}}}{{i18n "signOut"}}</a>
{{#if wrapLinks}}</li>{{/if}}

{{else}}

{{#if wrapLinks}}<li>{{/if}}
<a href="/sign-in">{{i18n "signIn"}}</a>
<a href="/sign-in">{{{beforeSignIn}}}{{i18n "signIn"}}</a>
{{#if wrapLinks}}</li>{{/if}}

{{#unless wrapLinks}}<span>or</span>{{/unless}}

{{#if wrapLinks}}<li>{{/if}}
<a href="/sign-up">{{i18n "signUp"}}</a>
<a href="/sign-up">{{{beforeSignUp}}}{{i18n "signUp"}}</a>
{{#if wrapLinks}}</li>{{/if}}

{{/if}}
Expand Down

0 comments on commit 8b9555e

Please sign in to comment.