Rough in measurements.

This commit is contained in:
Matthew Dillon 2015-01-26 12:11:27 -09:00
parent 1a59456ae9
commit db22b89e6f
6 changed files with 80 additions and 0 deletions

15
app/models/measurement.js Normal file
View file

@ -0,0 +1,15 @@
import DS from 'ember-data';
export default DS.Model.extend({
characteristicId: DS.attr(),
textMeasurementTypeId: DS.attr(),
txtValue: DS.attr(),
numValue: DS.attr(),
confidenceInterval: DS.attr(),
unitTypeId: DS.attr(),
notes: DS.attr(),
testMethodId: DS.attr(),
strain: DS.belongsTo('strain', {async: true}),
createdAt: DS.attr('date'),
updatedAt: DS.attr('date')
});

View file

@ -8,6 +8,7 @@ export default DS.Model.extend({
genbankEmblDdb: DS.attr(), genbankEmblDdb: DS.attr(),
isolatedFrom: DS.attr(), isolatedFrom: DS.attr(),
species: DS.belongsTo('species', {async: true}), species: DS.belongsTo('species', {async: true}),
measurements: DS.hasMany('measurement', {async: true}),
createdAt: DS.attr('date'), createdAt: DS.attr('date'),
updatedAt: DS.attr('date'), updatedAt: DS.attr('date'),
deletedAt: DS.attr('date') deletedAt: DS.attr('date')

View file

@ -11,6 +11,7 @@ Router.map(function() {
this.resource('genera'); this.resource('genera');
this.resource('species'); this.resource('species');
this.resource('strains'); this.resource('strains');
this.resource('measurements');
}); });
export default Router; export default Router;

View file

@ -0,0 +1,7 @@
import Ember from 'ember';
export default Ember.Route.extend({
model: function() {
return this.store.find('measurement');
}
});

View file

@ -10,6 +10,9 @@
{{#link-to 'strains' tagName='li' href=false}} {{#link-to 'strains' tagName='li' href=false}}
{{#link-to 'strains'}}Strains{{/link-to}} {{#link-to 'strains'}}Strains{{/link-to}}
{{/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' tagName='li' href=false}}
{{#link-to 'about'}}About{{/link-to}} {{#link-to 'about'}}About{{/link-to}}
{{/link-to}} {{/link-to}}

View file

@ -0,0 +1,53 @@
<div class="grid-1">
{{#each}}
<div class="span-1">
<fieldset class="read-only-information">
<legend>{{id}}</legend>
<dl>
<dt>Strain</dt>
<dd>{{strain.strainName}}</dd>
</dl>
<dl>
<dt>Characteristic</dt>
<dd>{{characteristicId}}</dd>
</dl>
<dl>
<dt>Text Measurement Type</dt>
<dd>{{textMeasurementTypeId}}</dd>
</dl>
<dl>
<dt>Text Value</dt>
<dd>{{txtValue}}</dd>
</dl>
<dl>
<dt>Numerical Value</dt>
<dd>{{numValue}}</dd>
</dl>
<dl>
<dt>Confidence Interval</dt>
<dd>{{confidenceInterval}}</dd>
</dl>
<dl>
<dt>Unit Type</dt>
<dd>{{unitTypeId}}</dd>
</dl>
<dl>
<dt>Notes</dt>
<dd>{{notes}}</dd>
</dl>
<dl>
<dt>Test Method</dt>
<dd>{{testMethodId}}</dd>
</dl>
<dl>
<dt>Created</dt>
<dd>{{createdAt}}</dd>
</dl>
<dl>
<dt>Updated</dt>
<dd>{{updatedAt}}</dd>
</dl>
</fieldset>
</div>
{{/each}}
</div>