Component cleanup (dropping sortable table)
+ remove `sortable-table` + remove `sortable-table-header` + remove `characteristic-index-row` + remove `species-index-row` + remove `strain-index-row`
This commit is contained in:
parent
2cca773f57
commit
33e7b92a8c
19 changed files with 100 additions and 137 deletions
6
app/pods/strains/index/controller.js
Normal file
6
app/pods/strains/index/controller.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
sortParams: ['fullNameMU', 'totalMeasurements'],
|
||||
sortedStrains: Ember.computed.sort('strains', 'sortParams'),
|
||||
});
|
|
@ -3,16 +3,12 @@ import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixi
|
|||
|
||||
export default Ember.Route.extend(AuthenticatedRouteMixin, {
|
||||
model: function() {
|
||||
return this.store.findAll('strain');
|
||||
return Ember.RSVP.hash({
|
||||
strains: this.store.findAll('strain'),
|
||||
});
|
||||
},
|
||||
|
||||
setupController: function(controller, model) {
|
||||
var tableAttrs = [
|
||||
{ name: 'Name', attr: 'fullNameMU' },
|
||||
{ name: 'Total Measurements', attr: 'totalMeasurements' }
|
||||
];
|
||||
controller.set('model', model);
|
||||
controller.set('tableAttrs', tableAttrs);
|
||||
controller.set('row', 'strain-index-row');
|
||||
controller.set('sort', ['sortOrder']);
|
||||
controller.setProperties(model);
|
||||
},
|
||||
});
|
||||
|
|
|
@ -1,12 +1,27 @@
|
|||
<h2>{{genus-name}} Strains</h2>
|
||||
<h3>Total strains: {{model.length}}</h3>
|
||||
<h3>Total strains: {{strains.length}}</h3>
|
||||
|
||||
{{add-button label="Add Strain" link="strains.new"}}
|
||||
|
||||
{{
|
||||
sortable-table
|
||||
content=model
|
||||
tableAttrs=tableAttrs
|
||||
row=row
|
||||
sortProperties=sort
|
||||
}}
|
||||
<table class="flakes-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Species</th>
|
||||
<th>Total Measurements</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each sortedStrains as |row|}}
|
||||
<tr>
|
||||
<td>
|
||||
{{#link-to 'strains.show' row.id classBinding="data.typeStrain:type-strain"}}
|
||||
{{row.fullNameMU}}
|
||||
{{/link-to}}
|
||||
</td>
|
||||
<td>
|
||||
{{row.totalMeasurements}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
Reference in a new issue