Roughing in measurements again
This commit is contained in:
parent
6f50a381fc
commit
878e8d1b60
12 changed files with 127 additions and 20 deletions
|
@ -13,6 +13,9 @@
|
|||
{{#link-to 'characteristics' tagName='li' href=false}}
|
||||
{{#link-to 'characteristics'}}Characteristics{{/link-to}}
|
||||
{{/link-to}}
|
||||
{{#link-to 'measurements' tagName='li' href=false}}
|
||||
{{#link-to 'measurements'}}Measurements{{/link-to}}
|
||||
{{/link-to}}
|
||||
{{#link-to 'about' tagName='li' href=false}}
|
||||
{{#link-to 'about'}}About{{/link-to}}
|
||||
{{/link-to}}
|
||||
|
|
5
app/pods/components/measurement-index-row/component.js
Normal file
5
app/pods/components/measurement-index-row/component.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
tagName: 'tr',
|
||||
});
|
11
app/pods/components/measurement-index-row/template.hbs
Normal file
11
app/pods/components/measurement-index-row/template.hbs
Normal file
|
@ -0,0 +1,11 @@
|
|||
<td>
|
||||
{{#link-to 'strains.show' data.strain.id}}
|
||||
{{scientific-name strain=data.strain}}
|
||||
{{/link-to}}
|
||||
</td>
|
||||
<td>
|
||||
{{data.characteristic.characteristicName}}
|
||||
</td>
|
||||
<td>
|
||||
{{{data.computedValue}}}
|
||||
</td>
|
21
app/pods/measurements/route.js
Normal file
21
app/pods/measurements/route.js
Normal 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');
|
||||
},
|
||||
});
|
11
app/pods/measurements/template.hbs
Normal file
11
app/pods/measurements/template.hbs
Normal 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}}
|
Reference in a new issue