diff --git a/app/pods/species/edit/controller.js b/app/pods/species/edit/controller.js deleted file mode 100644 index 463392e..0000000 --- a/app/pods/species/edit/controller.js +++ /dev/null @@ -1,29 +0,0 @@ -import Ember from 'ember'; - -export default Ember.Controller.extend({ - actions: { - save: function() { - let species = this.get('model'); - - if (species.get('isDirty')) { - species.save().then((species) => { - this.transitionToRoute('species.show', species.get('id')); - }, (err) => { - this.get('flashMessages').error(err.responseJSON.error); - }); - } else { - this.transitionToRoute('species.show', species.get('id')); - } - }, - - cancel: function() { - let species = this.get('model'); - - species.get('errors').clear(); - species.rollback(); - - this.transitionToRoute('species.show', species.get('id')); - }, - - }, -}); diff --git a/app/pods/species/edit/route.js b/app/pods/species/edit/route.js deleted file mode 100644 index b3f843f..0000000 --- a/app/pods/species/edit/route.js +++ /dev/null @@ -1,4 +0,0 @@ -import Ember from 'ember'; -import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin'; - -export default Ember.Route.extend(AuthenticatedRouteMixin, {}); diff --git a/app/pods/species/edit/template.hbs b/app/pods/species/edit/template.hbs deleted file mode 100644 index 5c6c82f..0000000 --- a/app/pods/species/edit/template.hbs +++ /dev/null @@ -1,6 +0,0 @@ -{{ - forms/species-form - species=model - save="save" - cancel="cancel" -}} diff --git a/app/pods/species/index/controller.js b/app/pods/species/index/controller.js deleted file mode 100644 index 2714e73..0000000 --- a/app/pods/species/index/controller.js +++ /dev/null @@ -1,11 +0,0 @@ -import Ember from 'ember'; - -export default Ember.Controller.extend({ - sortParams: ['speciesName', 'strainCount'], - sortedSpecies: Ember.computed.sort('model', 'sortParams'), - - metaData: function() { - return this.store.metadataFor('species'); - }.property('model.isLoaded').readOnly(), - -}); diff --git a/app/pods/species/index/route.js b/app/pods/species/index/route.js deleted file mode 100644 index 6b02e0e..0000000 --- a/app/pods/species/index/route.js +++ /dev/null @@ -1,8 +0,0 @@ -import Ember from 'ember'; -import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin'; - -export default Ember.Route.extend(AuthenticatedRouteMixin, { - model: function() { - return this.store.findAll('species'); - } -}); diff --git a/app/pods/species/new/controller.js b/app/pods/species/new/controller.js deleted file mode 100644 index 568648f..0000000 --- a/app/pods/species/new/controller.js +++ /dev/null @@ -1,30 +0,0 @@ -import Ember from 'ember'; - -export default Ember.Controller.extend({ - actions: { - save: function() { - let species = this.get('model'); - - if (species.get('isDirty')) { - species.save().then((species) => { - this.transitionToRoute('species.show', species.get('id')); - }, (err) => { - this.get('flashMessages').error(err.responseJSON.error); - }); - } else { - this.transitionToRoute('species.index'); - } - }, - - cancel: function() { - let species = this.get('model'); - - if (species.get('isNew')) { - species.deleteRecord(); - } - - this.transitionToRoute('species.index'); - }, - - }, -}); diff --git a/app/pods/species/show/controller.js b/app/pods/species/show/controller.js deleted file mode 100644 index d9625f4..0000000 --- a/app/pods/species/show/controller.js +++ /dev/null @@ -1,14 +0,0 @@ -import Ember from 'ember'; - -export default Ember.Controller.extend({ - userCanEdit: function() { - let meta = this.store.metadataFor('species'); - let id = this.get('model.id'); - - if (meta.canEdit.indexOf( +id ) === -1) { - return false - } - return true; - }.property('model.isLoaded').readOnly(), - -});