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