Refactoring strains
This commit is contained in:
parent
5290e7efd7
commit
01a3075655
23 changed files with 275 additions and 223 deletions
|
@ -2,5 +2,10 @@ import Ember from 'ember';
|
|||
|
||||
export default Ember.Controller.extend({
|
||||
sortParams: ['fullNameMU', 'totalMeasurements'],
|
||||
sortedStrains: Ember.computed.sort('strains', 'sortParams'),
|
||||
sortedStrains: Ember.computed.sort('model', 'sortParams'),
|
||||
|
||||
metaData: function() {
|
||||
return this.store.metadataFor('strain');
|
||||
}.property('model.isLoaded').readOnly(),
|
||||
|
||||
});
|
||||
|
|
|
@ -3,12 +3,6 @@ import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixi
|
|||
|
||||
export default Ember.Route.extend(AuthenticatedRouteMixin, {
|
||||
model: function() {
|
||||
return Ember.RSVP.hash({
|
||||
strains: this.store.findAll('strain'),
|
||||
});
|
||||
},
|
||||
|
||||
setupController: function(controller, model) {
|
||||
controller.setProperties(model);
|
||||
return this.store.findAll('strain');
|
||||
},
|
||||
});
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<h2>{{genus-name}} Strains</h2>
|
||||
<h3>Total strains: {{strains.length}}</h3>
|
||||
<h3>Total strains: {{model.length}}</h3>
|
||||
|
||||
{{add-button label="Add Strain" link="strains.new"}}
|
||||
{{add-button label="Add Strain" link="strains.new" canAdd=metaData.canAdd}}
|
||||
|
||||
<table class="flakes-table">
|
||||
<thead>
|
||||
|
|
Reference in a new issue