diff --git a/app/pods/protected/species/index/controller.js b/app/pods/protected/species/index/controller.js
deleted file mode 100644
index 77916f1..0000000
--- a/app/pods/protected/species/index/controller.js
+++ /dev/null
@@ -1,6 +0,0 @@
-import Ember from 'ember';
-
-export default Ember.Controller.extend({
- sortParams: ['speciesName', 'strainCount'],
- sortedSpecies: Ember.computed.sort('model', 'sortParams'),
-});
diff --git a/app/pods/protected/species/index/route.js b/app/pods/protected/species/index/route.js
index 89c832d..7e7714a 100644
--- a/app/pods/protected/species/index/route.js
+++ b/app/pods/protected/species/index/route.js
@@ -1,17 +1,8 @@
import Ember from 'ember';
export default Ember.Route.extend({
- currentUser: Ember.inject.service('session-account'),
-
model: function() {
return this.store.findAll('species');
},
- 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/species/index/species-table/component.js b/app/pods/protected/species/index/species-table/component.js
new file mode 100644
index 0000000..b0e6815
--- /dev/null
+++ b/app/pods/protected/species/index/species-table/component.js
@@ -0,0 +1,17 @@
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+ currentUser: Ember.inject.service('session-account'),
+
+ metaData: null,
+
+ setupMetaDataOnInit: Ember.on('init', function() {
+ this.get('currentUser.account').then((user) => {
+ this.set('metaData', user.get('metaData'));
+ });
+ }),
+
+ sortParams: ['speciesName', 'strainCount'],
+ sortedSpecies: Ember.computed.sort('species', 'sortParams'),
+
+});
diff --git a/app/pods/protected/species/index/species-table/template.hbs b/app/pods/protected/species/index/species-table/template.hbs
new file mode 100644
index 0000000..b56eba8
--- /dev/null
+++ b/app/pods/protected/species/index/species-table/template.hbs
@@ -0,0 +1,33 @@
+
Total species: {{species.length}}
+
+{{add-button label="Add Species" link="protected.species.new" canAdd=metaData.canAdd}}
+
+
+
+
+ Name |
+ Strains |
+
+
+
+ {{#each sortedSpecies as |species|}}
+
+
+
+ {{#link-to 'protected.species.show' species}}
+ {{species.speciesName}}
+ {{/link-to}}
+
+ |
+
+ {{#each species.strains as |strain index|}}
+ {{if index ","}}
+ {{#link-to 'protected.strains.show' strain.id}}
+ {{{strain.strainNameMU}}}
+ {{/link-to}}
+ {{/each}}
+ |
+
+ {{/each}}
+
+
diff --git a/app/pods/protected/species/index/template.hbs b/app/pods/protected/species/index/template.hbs
index 0774bb3..b3a3f8a 100644
--- a/app/pods/protected/species/index/template.hbs
+++ b/app/pods/protected/species/index/template.hbs
@@ -1,34 +1,6 @@
{{genus-name}} Species
-Total species: {{model.length}}
-{{add-button label="Add Species" link="protected.species.new" canAdd=metaData.canAdd}}
-
-
-
-
- Name |
- Strains |
-
-
-
- {{#each sortedSpecies as |species|}}
-
-
-
- {{#link-to 'protected.species.show' species}}
- {{species.speciesName}}
- {{/link-to}}
-
- |
-
- {{#each species.strains as |strain index|}}
- {{if index ","}}
- {{#link-to 'protected.strains.show' strain.id}}
- {{{strain.strainNameMU}}}
- {{/link-to}}
- {{/each}}
- |
-
- {{/each}}
-
-
+{{
+ protected/species/index/species-table
+ species=model
+}}