diff --git a/app/models/measurement.js b/app/models/measurement.js new file mode 100644 index 0000000..671480b --- /dev/null +++ b/app/models/measurement.js @@ -0,0 +1,15 @@ +import DS from 'ember-data'; + +export default DS.Model.extend({ + strain: DS.belongsTo('strain'), + characteristic: DS.attr('string'), + textMeasurementType: DS.attr('string'), + txtValue: DS.attr('string'), + numValue: DS.attr('number'), + confidenceInterval: DS.attr('number'), + unitType: DS.attr('string'), + notes: DS.attr('string'), + testMethod: DS.attr('string'), + createdAt: DS.attr('date'), + updatedAt: DS.attr('date') +}); diff --git a/app/models/strain.js b/app/models/strain.js index 3bd7de2..cbde6ed 100644 --- a/app/models/strain.js +++ b/app/models/strain.js @@ -1,6 +1,7 @@ import DS from 'ember-data'; export default DS.Model.extend({ + measurements: DS.hasMany('measurements', { async: true }), strainName: DS.attr('string'), strainType: DS.attr('string'), etymology: DS.attr('string'), diff --git a/app/router.js b/app/router.js index 4f8d6ef..9a11680 100644 --- a/app/router.js +++ b/app/router.js @@ -9,7 +9,9 @@ Router.map(function() { this.route('login'); this.route('about'); this.resource('strains', function() { - this.route('show', { path: ':strain_id' }); + this.route('show', { path: ':strain_id' }, function() { + this.resource('measurements', function() {}); + }); }); }); diff --git a/app/routes/measurements.js b/app/routes/measurements.js new file mode 100644 index 0000000..26d9f31 --- /dev/null +++ b/app/routes/measurements.js @@ -0,0 +1,4 @@ +import Ember from 'ember'; + +export default Ember.Route.extend({ +}); diff --git a/app/routes/measurements/index.js b/app/routes/measurements/index.js new file mode 100644 index 0000000..fdf177a --- /dev/null +++ b/app/routes/measurements/index.js @@ -0,0 +1,7 @@ +import Ember from 'ember'; + +export default Ember.Route.extend({ + model: function() { + return this.modelFor('strains/show').get('measurements'); + } +}); diff --git a/app/styles/app.css b/app/styles/app.css index e69de29..f160708 100644 --- a/app/styles/app.css +++ b/app/styles/app.css @@ -0,0 +1,3 @@ +.measurements-container { + padding: 2em 0em 0em 0em; +} diff --git a/app/templates/measurements.hbs b/app/templates/measurements.hbs new file mode 100644 index 0000000..c24cd68 --- /dev/null +++ b/app/templates/measurements.hbs @@ -0,0 +1 @@ +{{outlet}} diff --git a/app/templates/measurements/index.hbs b/app/templates/measurements/index.hbs new file mode 100644 index 0000000..c20b937 --- /dev/null +++ b/app/templates/measurements/index.hbs @@ -0,0 +1,28 @@ +
Characteristic | +Text Meas. Type | +Text Value | +Num. Value | +Confidence Int. | +Unit | +Notes | +Test Method | +
---|---|---|---|---|---|---|---|
{{measurement.characteristic}} | +{{measurement.textMeasurementType}} | +{{measurement.txtValue}} | +{{measurement.numValue}} | +{{measurement.confidenceInterval}} | +{{measurement.unitType}} | +{{measurement.notes}} | +{{measurement.testMethod}} | +