Added toggle witch to detail page
This commit is contained in:
parent
9de2ee1e3c
commit
5d21a0cc05
3 changed files with 30 additions and 3 deletions
|
|
@ -23,6 +23,21 @@
|
|||
<th class="text-right">Owner:</th>
|
||||
<td>{{event.getUser().getUsername()}} <p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-right">State:</th>
|
||||
<td>
|
||||
<form method="POST">
|
||||
<input type="hidden" name="action" value="modify">
|
||||
<input type="hidden" name="action_id" value="{{.getId()}}">
|
||||
|
||||
<div class="btn-toolbar pull-left">
|
||||
<input class="toggle-switch" type="checkbox" name="enabled"
|
||||
data-size="mini" data-on-color="danger"
|
||||
{{event.getDeviceData().getData()}}checked{{/event.getDeviceData().getData()}} >
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{{#event.getDeviceConfigurator().getConfiguration()}}
|
||||
<tr>
|
||||
<th class="text-right">{{.getNiceName()}}:</th>
|
||||
|
|
@ -54,3 +69,11 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function (){
|
||||
$(".toggle-switch").on("switchChange.bootstrapSwitch", function (event, state) {
|
||||
$(this).closest('form').submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
<td>
|
||||
<form method="POST">
|
||||
<input type="hidden" name="action" value="modify">
|
||||
<input type="hidden" name="id" value="{{.getId()}}">
|
||||
<input type="hidden" name="action_id" value="{{.getId()}}">
|
||||
|
||||
<div class="btn-toolbar pull-right">
|
||||
<input class="toggle-switch" type="checkbox" name="enabled"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue