/
userlog.tt
61 lines (60 loc) · 1.84 KB
/
userlog.tt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
[% IF results.count == 0 %]
<div class="span2 alert alert-info">The user activity log is empty.</div>
[% ELSE %]
<table id="aul-data-table" class="table table-bordered table-condensed table-hover" width="100%" cellspacing="0">
<thead>
<tr>
<th class="nd_center-cell">Creation</th>
<th class="nd_center-cell">User</th>
<th class="nd_center-cell">User IP</th>
<th class="nd_center-cell">Event</th>
<th class="nd_center-cell">Action</th>
</tr>
</thead>
</table>
[% END %]
<script>
$(document).ready(function() {
$('#aul-data-table').dataTable( {
"serverSide": true,
"order": [[ 0, "desc" ]],
"ajax": "[% uri_for('/ajax/control/admin/userlog/data') | none %]",
"columns": [{
"data": 'creation',
"className": "nd_center-cell",
"render": function(data, type, row, meta) {
return moment(data).format('YYYY-MM-DD HH:mm');
}
}, {
"data": 'username',
"className": "nd_center-cell",
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'userip',
"className": "nd_center-cell",
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'event',
"className": "nd_center-cell",
"render": function(data, type, row, meta) {
return he.encode(data || '');
}
}, {
"data": 'entry',
"className": "nd_center-cell",
"searchable": false,
"orderable": false,
"render": function(data, type, row, meta) {
return '<input data-form="del" name="entry" type="hidden" value="' + encodeURIComponent(data) +
'"><button class="btn nd_adminbutton" name="del" type="submit"><i class="icon-trash text-error"></i></button>';
}
}
],
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
} );
} );
</script>