diff --git a/app/pods/protected/characteristics/index/characteristics-table/component.js b/app/pods/protected/characteristics/index/characteristics-table/component.js
new file mode 100644
index 0000000..eea4c8a
--- /dev/null
+++ b/app/pods/protected/characteristics/index/characteristics-table/component.js
@@ -0,0 +1,12 @@
+import Ember from 'ember';
+import SetupMetaData from '../../../../../mixins/setup-metadata';
+
+const { Component } = Ember;
+
+export default Component.extend(SetupMetaData, {
+ characteristics: null,
+
+ sortParams: ['characteristicTypeName', 'sortOrder', 'characteristicName'],
+ sortedCharacteristics: Ember.computed.sort('characteristics', 'sortParams'),
+
+});
diff --git a/app/pods/protected/characteristics/index/characteristics-table/template.hbs b/app/pods/protected/characteristics/index/characteristics-table/template.hbs
new file mode 100644
index 0000000..200e2ef
--- /dev/null
+++ b/app/pods/protected/characteristics/index/characteristics-table/template.hbs
@@ -0,0 +1,26 @@
+
Total characteristics: {{characteristics.length}}
+
+{{add-button label="Add Characteristic" link="protected.characteristics.new" canAdd=metaData.canAdd}}
+
+
+
+
+ Name |
+ Type |
+ Sort Order |
+
+
+
+ {{#each sortedCharacteristics as |row|}}
+
+
+ {{#link-to 'protected.characteristics.show' row}}
+ {{row.characteristicName}}
+ {{/link-to}}
+ |
+ {{row.characteristicTypeName}} |
+ {{row.sortOrder}} |
+
+ {{/each}}
+
+
diff --git a/app/pods/protected/characteristics/index/controller.js b/app/pods/protected/characteristics/index/controller.js
deleted file mode 100644
index 0403cc5..0000000
--- a/app/pods/protected/characteristics/index/controller.js
+++ /dev/null
@@ -1,6 +0,0 @@
-import Ember from 'ember';
-
-export default Ember.Controller.extend({
- sortParams: ['characteristicTypeName', 'sortOrder', 'characteristicName'],
- sortedCharacteristics: Ember.computed.sort('model', 'sortParams'),
-});
diff --git a/app/pods/protected/characteristics/index/route.js b/app/pods/protected/characteristics/index/route.js
index 3ee78f4..283f54c 100644
--- a/app/pods/protected/characteristics/index/route.js
+++ b/app/pods/protected/characteristics/index/route.js
@@ -1,17 +1,10 @@
import Ember from 'ember';
-export default Ember.Route.extend({
- currentUser: Ember.inject.service('session-account'),
+const { Route } = Ember;
+export default Route.extend({
model: function() {
return this.store.findAll('characteristic');
},
- setupController: function(controller, model) {
- controller.set('model', model);
- this.get('currentUser.account').then((user) => {
- controller.set('metaData', user.get('metaData'));
- });
- },
-
});
diff --git a/app/pods/protected/characteristics/index/template.hbs b/app/pods/protected/characteristics/index/template.hbs
index 2aaf25b..ddf9691 100644
--- a/app/pods/protected/characteristics/index/template.hbs
+++ b/app/pods/protected/characteristics/index/template.hbs
@@ -1,27 +1,6 @@
{{genus-name}} Characteristics
-Total characteristics: {{model.length}}
-{{add-button label="Add Characteristic" link="protected.characteristics.new" canAdd=metaData.canAdd}}
-
-
-
-
- Name |
- Type |
- Sort Order |
-
-
-
- {{#each sortedCharacteristics as |row|}}
-
-
- {{#link-to 'protected.characteristics.show' row}}
- {{row.characteristicName}}
- {{/link-to}}
- |
- {{row.characteristicTypeName}} |
- {{row.sortOrder}} |
-
- {{/each}}
-
-
+{{
+ protected/characteristics/index/characteristics-table
+ characteristics=model
+}}