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/characteristics/controller.js
Normal file
6
app/pods/characteristics/controller.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
sortParams: ['characteristicType.characteristicTypeName', 'characteristicName'],
|
||||
sortedCharacteristics: Ember.computed.sort('characteristics', 'sortParams'),
|
||||
});
|
|
@ -8,14 +8,8 @@ export default Ember.Route.extend(AuthenticatedRouteMixin, {
|
|||
characteristics: this.store.findAll('characteristic'),
|
||||
});
|
||||
},
|
||||
|
||||
setupController: function(controller, models) {
|
||||
var tableAttrs = [
|
||||
{ name: 'Name', attr: 'characteristicName' },
|
||||
{ name: 'Type', attr: 'characteristicType.characteristicTypeName' }
|
||||
];
|
||||
controller.set('model', models.characteristics);
|
||||
controller.set('tableAttrs', tableAttrs);
|
||||
controller.set('row', 'characteristic-index-row');
|
||||
controller.set('sort', ['characteristicType.characteristicTypeName', 'sortOrder']);
|
||||
controller.setProperties(models);
|
||||
},
|
||||
});
|
||||
|
|
|
@ -1,10 +1,19 @@
|
|||
<h2>{{genus-name}} Characteristics</h2>
|
||||
<h3>Total characteristics: {{model.length}}</h3>
|
||||
<h3>Total characteristics: {{characteristics.length}}</h3>
|
||||
|
||||
{{
|
||||
sortable-table
|
||||
content=model
|
||||
tableAttrs=tableAttrs
|
||||
row=row
|
||||
sortProperties=sort
|
||||
}}
|
||||
<table class="flakes-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each sortedCharacteristics as |row|}}
|
||||
<tr>
|
||||
<td>{{row.characteristicName}}</td>
|
||||
<td>{{row.characteristicType.characteristicTypeName}}</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
Reference in a new issue