refactored users/show
This commit is contained in:
parent
e6510992dc
commit
b742ddbb51
5 changed files with 84 additions and 64 deletions
11
app/pods/protected/users/show/user-card/component.js
Normal file
11
app/pods/protected/users/show/user-card/component.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
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');
|
||||
}),
|
||||
});
|
53
app/pods/protected/users/show/user-card/template.hbs
Normal file
53
app/pods/protected/users/show/user-card/template.hbs
Normal file
|
@ -0,0 +1,53 @@
|
|||
<div class="span-1">
|
||||
<fieldset class="flakes-information-box">
|
||||
<legend>
|
||||
{{user.name}}
|
||||
</legend>
|
||||
|
||||
{{! ROW 1 }}
|
||||
<div class="grid-2 gutter-20">
|
||||
<dl class="span-1">
|
||||
<dt>Email</dt>
|
||||
<dd>
|
||||
{{user.email}}
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="span-1">
|
||||
<dt>Role</dt>
|
||||
<dd>
|
||||
{{user.fullRole}}
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
{{! ROW 2 }}
|
||||
<div class="grid-2 gutter-20">
|
||||
<dl class="span-1">
|
||||
<dt>Record Created</dt>
|
||||
<dd>{{null-time user.createdAt 'LL'}}</dd>
|
||||
</dl>
|
||||
<dl class="span-1">
|
||||
<dt>Record Updated</dt>
|
||||
<dd>{{null-time user.updatedAt 'LL'}}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<br>
|
||||
<div class="grid-2 gutter-20">
|
||||
{{#if isUser}}
|
||||
<div class="span-1">
|
||||
{{#link-to 'protected.users.changepassword' user.id class="button-gray smaller"}}
|
||||
Change Password
|
||||
{{/link-to}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<div class="span-1">
|
||||
{{#if model.canEdit}}
|
||||
{{#link-to 'protected.users.edit' user.id class="button-gray smaller"}}
|
||||
Edit
|
||||
{{/link-to}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
Reference in a new issue