diff --git a/app/pods/protected/users/index/route.js b/app/pods/protected/users/index/route.js index 8429726..2752983 100644 --- a/app/pods/protected/users/index/route.js +++ b/app/pods/protected/users/index/route.js @@ -1,7 +1,9 @@ import Ember from 'ember'; -export default Ember.Route.extend({ - currentUser: Ember.inject.service('session-account'), +const { Route, inject: { service } } = Ember; + +export default Route.extend({ + currentUser: service('session-account'), beforeModel: function(transition) { this._super(transition); diff --git a/app/pods/protected/users/index/template.hbs b/app/pods/protected/users/index/template.hbs index 5354e95..f75072a 100644 --- a/app/pods/protected/users/index/template.hbs +++ b/app/pods/protected/users/index/template.hbs @@ -1,33 +1,6 @@

{{genus-name}} Users

-

Total users: {{model.length}}

- - - - - - - - - - - {{#each model as |row|}} - - - - - - - {{/each}} - -
NameEmailRoleDate Registered
- {{#link-to 'protected.users.show' row}} - {{row.name}} - {{/link-to}} - - {{row.email}} - - {{row.fullRole}} - - {{null-time row.createdAt 'LL'}} -
+{{ + protected/users/index/users-table + users=model +}} diff --git a/app/pods/protected/users/index/users-table/component.js b/app/pods/protected/users/index/users-table/component.js new file mode 100644 index 0000000..2abad45 --- /dev/null +++ b/app/pods/protected/users/index/users-table/component.js @@ -0,0 +1,7 @@ +import Ember from 'ember'; + +const { Component } = Ember; + +export default Component.extend({ + users: null, +}); diff --git a/app/pods/protected/users/index/users-table/template.hbs b/app/pods/protected/users/index/users-table/template.hbs new file mode 100644 index 0000000..ad2a064 --- /dev/null +++ b/app/pods/protected/users/index/users-table/template.hbs @@ -0,0 +1,33 @@ + +

Total users: {{users.length}}

+ + + + + + + + + + + + {{#each users as |user|}} + + + + + + + {{/each}} + +
NameEmailRoleDate Registered
+ {{#link-to 'protected.users.show' user}} + {{user.name}} + {{/link-to}} + + {{user.email}} + + {{user.fullRole}} + + {{null-time user.createdAt 'LL'}} +
diff --git a/app/pods/protected/users/loading/template.hbs b/app/pods/protected/users/loading/template.hbs new file mode 100644 index 0000000..e5a3e05 --- /dev/null +++ b/app/pods/protected/users/loading/template.hbs @@ -0,0 +1 @@ +{{loading-panel}}