1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-30 00:00:13 +01:00
VILLASweb/app/templates/dialog/simulation.hbs
Markus Grigull 22780b9d7a Move value plot modal to component
Change simulator and signal from numbers to combo boxes
2016-10-12 22:06:24 +02:00

108 lines
3 KiB
Handlebars

{{#if isShowingNewModal}}
{{#modal-dialog attachment="middle center" translucentOverlay=true}}
<h1>New model</h1>
<form class="form-create-record" {{action 'submitNew' on='submit'}}>
<table>
<tr>
<td>
<label for="name">Name</label>
</td>
<td>
{{input id='name' placeholder='Enter model name' value=name}}
</td>
</tr>
<tr>
<td>
<label for="simulator">Simulator</label>
</td>
<td>
<select onchange={{action "selectSimulator" value="target.value"}}>
{{#each model.simulators as |simulator|}}
<option value={{simulator.name}}>{{simulator.name}}</option>
{{/each}}
</select>
</td>
</tr>
<tr>
<td>
<label for="length">Length</label>
</td>
<td>
{{input id='length' type='number' value=length min='1'}}
</td>
</tr>
<tr>
<td colspan="2">
<button {{action 'cancelNew'}}>Cancel</button>
<button type="submit">Create</button>
</td>
</tr>
</table>
</form>
{{#if errorMessage}}
<p><strong>Error:</strong> {{errorMessage}}</p>
{{/if}}
{{/modal-dialog}}
{{/if}}
{{#if isShowingEditModal}}
{{#modal-dialog attachment="middle center" translucentOverlay=true}}
<h1>Edit model</h1>
<form class="form-edit-record" {{action 'submitEdit' on='submit'}}>
<table>
<tr>
<td>
<label for="name">Name</label>
</td>
<td>
{{input id='name' placeholder='Enter model name' value=name}}
</td>
</tr>
<tr>
<td>
<label for="simulator">Simulator</label>
</td>
<td>
<select onchange={{action "selectSimulator" value="target.value"}}>
{{#each model.simulators as |simulator|}}
<option value={{simulator.name}} selected={{eq simulatorName simulator.name}}>{{simulator.name}}</option>
{{/each}}
</select>
</td>
</tr>
<tr>
<td>
<label for="length">Length</label>
</td>
<td>
{{input id='length' type='number' value=length min='1'}}
</td>
</tr>
<tr>
<td colspan="2">
<button {{action 'cancelEdit'}}>Cancel</button>
<button type="submit">Save</button>
</td>
</tr>
</table>
</form>
{{#if errorMessage}}
<p><strong>Error:</strong> {{errorMessage}}</p>
{{/if}}
{{/modal-dialog}}
{{/if}}
{{#if isShowingDeleteModal}}
{{#modal-dialog attachment="middle center" translucentOverlay=true}}
<h1>Delete simulation-model</h1>
<p>Are you sure you want to delete the simulation-model <b><i>{{simulationModel.name}}</i></b>?</p>
<button {{action 'cancelDelete'}}>Cancel</button>
<button {{action 'confirmDelete'}}>Delete</button>
{{/modal-dialog}}
{{/if}}