Add measurement count & speciesName to strain
This commit is contained in:
parent
ddc306ef29
commit
86b3fb46d7
4 changed files with 32 additions and 14 deletions
|
@ -2,6 +2,7 @@ import DS from 'ember-data';
|
|||
|
||||
export default DS.Model.extend({
|
||||
measurements: DS.hasMany('measurements', { async: true }),
|
||||
speciesName: DS.attr('string'),
|
||||
strainName: DS.attr('string'),
|
||||
strainType: DS.attr('string'),
|
||||
etymology: DS.attr('string'),
|
||||
|
@ -10,5 +11,6 @@ export default DS.Model.extend({
|
|||
isolatedFrom: DS.attr('string'),
|
||||
createdAt: DS.attr('date'),
|
||||
updatedAt: DS.attr('date'),
|
||||
deletedAt: DS.attr('date')
|
||||
deletedAt: DS.attr('date'),
|
||||
totalMeasurements: DS.attr('number')
|
||||
});
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
{{#each strain in model}}
|
||||
<tr>
|
||||
<td>{{link-to strain.strainName 'measurements' strain}}</td>
|
||||
<td></td>
|
||||
<td>{{strain.totalMeasurements}}</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
|
|
|
@ -2,29 +2,41 @@
|
|||
<div class="span-1">
|
||||
<fieldset class="flakes-information-box">
|
||||
<legend>{{model.strainName}}</legend>
|
||||
{{! ROW 1 }}
|
||||
<div class="grid-4">
|
||||
<dl class="span-1">
|
||||
<dl class="span-2">
|
||||
<dt>Species</dt>
|
||||
<dd>{{model.speciesName}}</dd>
|
||||
</dl>
|
||||
<dl class="span-2">
|
||||
<dt>Type</dt>
|
||||
<dd>{{model.strainType}}</dd>
|
||||
</dl>
|
||||
<dl class="span-1">
|
||||
<dt>Etymology</dt>
|
||||
<dd>{{model.etymology}}</dd>
|
||||
</dl>
|
||||
<dl class="span-1">
|
||||
</div>
|
||||
{{! ROW 2 }}
|
||||
<div class="grid-4">
|
||||
<dl class="span-2">
|
||||
<dt>Accession Banks</dt>
|
||||
<dd>{{model.accessionBanks}}</dd>
|
||||
</dl>
|
||||
<dl class="span-1">
|
||||
<dl class="span-2">
|
||||
<dt>Genbank</dt>
|
||||
<dd>{{model.genbankEmblDdb}}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
{{! ROW 3 }}
|
||||
<div class="grid-4">
|
||||
<dl class="span-1">
|
||||
<dl class="span-2">
|
||||
<dt>Etymology</dt>
|
||||
<dd>{{model.etymology}}</dd>
|
||||
</dl>
|
||||
<dl class="span-2">
|
||||
<dt>Isolated From</dt>
|
||||
<dd>{{model.isolatedFrom}}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
{{! ROW 4 }}
|
||||
<div class="grid-4">
|
||||
<dl class="span-1">
|
||||
<dt>Record Created</dt>
|
||||
<dd>{{null-time model.createdAt 'LL'}}</dd>
|
||||
|
|
|
@ -5,7 +5,7 @@ module.exports = function(app) {
|
|||
var STRAINS = [
|
||||
{
|
||||
id: 1,
|
||||
species: 1,
|
||||
speciesName: "Species One",
|
||||
strainName: "Strain One",
|
||||
strainType: "Test Type",
|
||||
etymology: "Test Etymology",
|
||||
|
@ -16,10 +16,11 @@ module.exports = function(app) {
|
|||
createdAt: "0001-01-01T00:00:00Z",
|
||||
updatedAt: "0001-01-01T00:00:00Z",
|
||||
deletedAt: null,
|
||||
totalMeasurements: 5,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
species: 2,
|
||||
speciesName: "Species Two",
|
||||
strainName: "Strain Two",
|
||||
strainType: "Test Type",
|
||||
etymology: "Test Etymology",
|
||||
|
@ -30,10 +31,11 @@ module.exports = function(app) {
|
|||
createdAt: "0001-01-01T00:00:00Z",
|
||||
updatedAt: "0001-01-01T00:00:00Z",
|
||||
deletedAt: null,
|
||||
totalMeasurements: 5,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
species: 3,
|
||||
speciesName: "Species Three",
|
||||
strainName: "Strain Three",
|
||||
strainType: "Test Type",
|
||||
etymology: "Test Etymology",
|
||||
|
@ -44,10 +46,11 @@ module.exports = function(app) {
|
|||
createdAt: "0001-01-01T00:00:00Z",
|
||||
updatedAt: "0001-01-01T00:00:00Z",
|
||||
deletedAt: null,
|
||||
totalMeasurements: 0,
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
species: 4,
|
||||
speciesName: "Species Four",
|
||||
strainName: "Strain Four",
|
||||
strainType: "Test Type",
|
||||
etymology: "Test Etymology",
|
||||
|
@ -58,6 +61,7 @@ module.exports = function(app) {
|
|||
createdAt: "0001-01-01T00:00:00Z",
|
||||
updatedAt: "0001-01-01T00:00:00Z",
|
||||
deletedAt: null,
|
||||
totalMeasurements: 0,
|
||||
}
|
||||
];
|
||||
|
||||
|
|
Reference in a new issue