Refactored users/edit

This commit is contained in:
Matthew Dillon 2015-11-06 11:20:28 -07:00
parent b742ddbb51
commit 1dd0910ed1
13 changed files with 92 additions and 65 deletions

View file

@ -5,7 +5,9 @@ const { Component, computed, inject: { service } } = Ember;
export default Component.extend({
currentUser: service('session-account'),
isUser: computed('model.id', 'currentUser.account.id', function() {
return this.get('model.id') === this.get('currentUser.account.id');
user: null,
isUser: computed('user.id', 'currentUser.account.id', function() {
return this.get('user.id') === this.get('currentUser.account.id');
}),
});

View file

@ -44,7 +44,7 @@
{{/if}}
<div class="span-1">
{{#if model.canEdit}}
{{#if user.canEdit}}
{{#link-to 'protected.users.edit' user.id class="button-gray smaller"}}
Edit
{{/link-to}}