Characteristics details
This commit is contained in:
parent
ceccf6e536
commit
fb296340c3
9 changed files with 48 additions and 53 deletions
|
@ -0,0 +1,16 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
measurementsTable: function() {
|
||||
let measurements = this.get('model.measurements');
|
||||
let table = [];
|
||||
measurements.forEach((measurement) => {
|
||||
let row = {};
|
||||
row['measurement'] = measurement;
|
||||
row['strain'] = this.store.peekRecord('strain', measurement.get('strain.id'));
|
||||
table.push(row);
|
||||
});
|
||||
return table;
|
||||
}.property(),
|
||||
|
||||
});
|
|
@ -0,0 +1,26 @@
|
|||
<table class="flakes-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Strain</th>
|
||||
<th>Value</th>
|
||||
<th>Notes</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each measurementsTable as |row|}}
|
||||
<tr>
|
||||
<td>
|
||||
{{#link-to 'protected.strains.show' row.strain.id}}
|
||||
{{{row.strain.strainNameMU}}}
|
||||
{{/link-to}}
|
||||
</td>
|
||||
<td>
|
||||
{{row.measurement.value}}
|
||||
</td>
|
||||
<td>
|
||||
{{row.measurement.notes}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
|
@ -18,17 +18,9 @@
|
|||
{{! ROW 2 }}
|
||||
<div class="grid-2 gutter-20">
|
||||
<dl class="span-2">
|
||||
<dt>Strains</dt>
|
||||
<dt>Measurements</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
{{#each model.strains as |strain index|}}
|
||||
<li>
|
||||
{{#link-to 'protected.strains.show' strain.id}}
|
||||
{{{strain.strainNameMU}}}
|
||||
{{/link-to}}
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
{{protected/characteristics/show/measurements-table model=model}}
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
|
Reference in a new issue