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/projects.hbs
2016-10-12 11:29:09 +02:00

92 lines
2.7 KiB
Handlebars

{{#if isShowingNewModal}}
{{#modal-dialog attachment="middle center" translucentOverlay=true}}
<h1>New project</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 project name' value=name}}
</td>
</tr>
<tr>
<td>
<label for="simulation">Simulation</label>
</td>
<td>
<select onchange={{action "selectSimulation" value="target.value"}}>
{{#each model.simulations as |simulation|}}
<option value={{simulation.name}}>{{simulation.name}}</option>
{{/each}}
</select>
</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 project</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 project name' value=name}}
</td>
</tr>
<tr>
<td>
<label for="simulation">Simulation</label>
</td>
<td>
<select onchange={{action "selectSimulation" value="target.value"}}>
{{#each model.simulations as |simulation|}}
<option value={{simulation.name}} selected={{eq simulation.name projectSimulation.name}}>{{simulation.name}}</option>
{{/each}}
</select>
</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 project</h1>
<p>Are you sure you want to delete the project <b><i>{{project.name}}</i></b>?</p>
<button {{action 'cancelDelete'}}>Cancel</button>
<button {{action 'confirmDelete'}}>Delete</button>
{{/modal-dialog}}
{{/if}}