Roughing in measurements again

This commit is contained in:
Matthew Dillon 2015-06-05 15:48:15 -08:00
parent 6f50a381fc
commit 878e8d1b60
12 changed files with 127 additions and 20 deletions

View file

@ -0,0 +1,21 @@
import Ember from 'ember';
import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin';
export default Ember.Route.extend(AuthenticatedRouteMixin, {
model: function() {
return Ember.RSVP.hash({
measurements: this.store.findAll('measurement'),
species: this.store.findAll('species')
});
},
setupController: function(controller, models) {
var tableAttrs = [
{ name: 'Strain', attr: 'strain.strainName' },
{ name: 'Characteristic', attr: 'characteristic.CharacteristicName' },
{ name: 'Value', attr: 'computedValue'}
];
controller.set('model', models);
controller.set('tableAttrs', tableAttrs);
controller.set('row', 'measurement-index-row');
},
});

View file

@ -0,0 +1,11 @@
<h2>{{genus-name}} Measurements</h2>
<h3>Total measurements: {{model.length}}</h3>
{{
view "select"
content=model.species
optionValuePath="content.id"
optionLabelPath="content.speciesName"
}}
{{sortable-table content=model.measurements tableAttrs=tableAttrs row=row}}