Dummy measurement edit
This commit is contained in:
parent
fa6507be66
commit
40f2b789e4
6 changed files with 93 additions and 14 deletions
|
@ -0,0 +1,17 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
tagName: 'tr',
|
||||
isEditing: false,
|
||||
|
||||
actions: {
|
||||
edit: function() {
|
||||
this.toggleProperty('isEditing');
|
||||
},
|
||||
|
||||
save: function() {
|
||||
this.toggleProperty('isEditing');
|
||||
console.log('saved');
|
||||
}
|
||||
},
|
||||
});
|
|
@ -0,0 +1,37 @@
|
|||
{{#if isEditing}}
|
||||
<td>
|
||||
{{input value='Foo'}}
|
||||
</td>
|
||||
<td>
|
||||
{{input value='Bar'}}
|
||||
</td>
|
||||
<td>
|
||||
{{input value='Baz'}}
|
||||
</td>
|
||||
{{#if canEdit}}
|
||||
<td>
|
||||
<button class="button-gray smaller" {{action 'save'}}>
|
||||
Save
|
||||
</button>
|
||||
</td>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<td>
|
||||
{{#link-to 'protected.characteristics.show' row.characteristic.id}}
|
||||
{{{row.characteristic.characteristicName}}}
|
||||
{{/link-to}}
|
||||
</td>
|
||||
<td>
|
||||
{{row.measurement.value}}
|
||||
</td>
|
||||
<td>
|
||||
{{row.measurement.notes}}
|
||||
</td>
|
||||
{{#if canEdit}}
|
||||
<td>
|
||||
<button class="button-gray smaller" {{action 'edit'}}>
|
||||
Edit
|
||||
</button>
|
||||
</td>
|
||||
{{/if}}
|
||||
{{/if}}
|
Reference in a new issue