hal/web-resource/event_overview.tmpl
Ziver Koc ed3babdc56 Added relative timestamps. issue 14
Former-commit-id: 3504444f91bb2dec714e02b15aa6bf31edda9573
2016-01-24 17:40:01 +01:00

47 lines
No EOL
1.9 KiB
Cheetah
Executable file

<h1 class="page-header">Event Overview</h1>
<div class="col-md-12">
<div class="panel panel-default drop-shadow">
<div class="panel-heading">Local Events</div>
<div class="panel-body">
<table class="table table-hover table-condensed">
<thead>
<th class="col-md-4">Name</th>
<th class="col-md-3">Type</th>
<th class="col-md-2">Data</th>
<th class="col-md-2">Last Update</th>
<th class="col-md-1 text-right">Actions</th>
</thead>
{{#events}}
<tr>
<td><a href="?id={{.getId()}}">{{.getName()}}</a></td>
<td>{{.getDeviceData().getClass().getSimpleName()}}</td>
<td>{{.getDeviceData().getData()}}</td>
<td><span class="timestamp">{{.getDeviceData().getTimestamp()}}</span></td>
<td>
<form method="POST">
<input type="hidden" name="action" value="-">
<input type="hidden" name="id" value="{{.getId()}}">
<div class="btn-toolbar pull-right">
<input class="toggle-switch" type="checkbox" name="data"
data-size="mini" data-on-color="danger"
{{#.getDeviceData().getData()}}checked{{/.getDeviceData().getData()}} >
</div>
</form>
</td>
</tr>
{{/events}}
</table>
</div>
</div>
</div>
<script>
$(function (){
$(".toggle-switch").on("switchChange.bootstrapSwitch", function (event, state) {
$(this).closest('form').submit();
});
});
</script>