Wait to load until currentUser returns
This commit is contained in:
parent
eb1a8bb6e3
commit
e36d327f36
12 changed files with 85 additions and 84 deletions
|
@ -7,4 +7,11 @@ export default Ember.Component.extend({
|
|||
FlakesFrame.init();
|
||||
},
|
||||
|
||||
actions: {
|
||||
invalidateSession: function() {
|
||||
this.sendAction('invalidateSession');
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
});
|
||||
|
|
|
@ -1 +1,51 @@
|
|||
{{yield}}
|
||||
<div class="flakes-navigation">
|
||||
{{site-logo}}
|
||||
{{#if session.isAuthenticated}}
|
||||
<ul>
|
||||
{{#link-to 'protected.compare' tagName='li' href=false}}
|
||||
{{link-to 'Compare' 'protected.compare'}}
|
||||
{{/link-to}}
|
||||
{{#link-to 'protected.measurements' tagName='li' href=false}}
|
||||
{{link-to 'Measurements' 'protected.measurements'}}
|
||||
{{/link-to}}
|
||||
{{#link-to 'protected.characteristics' tagName='li' href=false}}
|
||||
{{link-to 'Characteristics' 'protected.characteristics'}}
|
||||
{{/link-to}}
|
||||
{{#link-to 'protected.species' tagName='li' href=false}}
|
||||
{{link-to 'Species' 'protected.species'}}
|
||||
{{/link-to}}
|
||||
{{#link-to 'protected.strains' tagName='li' href=false}}
|
||||
{{link-to 'Strains' 'protected.strains'}}
|
||||
{{/link-to}}
|
||||
{{#link-to 'protected.about' tagName='li' href=false}}
|
||||
{{link-to 'About' 'protected.about'}}
|
||||
{{/link-to}}
|
||||
</ul>
|
||||
<p class="foot">
|
||||
{{session.currentUser.name}}<br>
|
||||
<a {{action 'invalidateSession'}}>Logout</a>
|
||||
</p>
|
||||
{{else}}
|
||||
<p class="foot">
|
||||
{{link-to 'Login' 'login'}}
|
||||
<br>
|
||||
{{link-to 'Sign Up' 'users.new'}}
|
||||
</p>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<div class="flakes-content">
|
||||
<div class="flakes-mobile-top-bar">
|
||||
{{site-logo}}
|
||||
<a href="" class="navigation-expand-target">
|
||||
<img src="img/navigation-expand-target.png" height="26px">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="view-wrap">
|
||||
{{#each flashMessages.queue as |flash|}}
|
||||
{{custom-flash-message flash=flash}}
|
||||
{{/each}}
|
||||
{{yield}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
Reference in a new issue