1<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0"> 2 <thead> 3 <tr> 4 <th class="nd_center-cell">Full Name</th> 5 <th class="nd_center-cell">Username</th> 6 <th class="nd_center-cell">Password</th> 7 <th class="nd_center-cell">LDAP Auth</th> 8 <th class="nd_center-cell">RADIUS Auth</th> 9 <th class="nd_center-cell">TACACS+ Auth</th> 10 <th class="nd_center-cell">Port Control</th> 11 <th class="nd_center-cell">Administrator</th> 12 <th class="nd_center-cell">Created</th> 13 <th class="nd_center-cell">Last Login</th> 14 <th class="nd_center-cell">Note</th> 15 <th class="nd_center-cell">Action</th> 16 </tr> 17 </thead> 18 <tbody> 19 <tr> 20 <td class="nd_center-cell"><input data-form="add" name="fullname" type="text"></td> 21 <td class="nd_center-cell"><input class="span2" data-form="add" name="username" type="text"></td> 22 <td class="nd_center-cell"><input class="span2" data-form="add" name="password" type="password"></td> 23 <td class="nd_center-cell"><input data-form="add" type="checkbox" name="ldap"></td> 24 <td class="nd_center-cell"><input data-form="add" type="checkbox" name="radius"></td> 25 <td class="nd_center-cell"><input data-form="add" type="checkbox" name="tacacs"></td> 26 <td class="nd_center-cell"><input data-form="add" type="checkbox" name="port_control"></td> 27 <td class="nd_center-cell"><input data-form="add" type="checkbox" name="admin"></td> 28 <td class="nd_center-cell"></td> 29 <td class="nd_center-cell"></td> 30 <td class="nd_center-cell"><input class="span2" data-form="add" name="note" type="text"></td> 31 <td nowrap class="nd_center-cell"> 32 <button class="btn btn-small nd_adminbutton" name="add" type="submit"><i class="icon-plus-sign"></i> Add</button> 33 </td> 34 </tr> 35 36 [% SET count = 0 %] 37 [% FOREACH row IN results %] 38 [% SET count = count + 1 %] 39 <tr> 40 <td class="nd_center-cell"> 41 <input data-form="update" name="fullname" type="text" value="[% row.fullname | html_entity %]"> 42 </td> 43 <td class="nd_center-cell"> 44 <input class="span2" data-form="update" name="username" type="text" value="[% row.username | html_entity %]"> 45 </td> 46 <td class="nd_center-cell"> 47 <input class="span2" data-form="update" name="password" type="password" value="********"> 48 </td> 49 <td class="nd_center-cell"> 50 <input data-form="update" name="ldap" type="checkbox" [% ' checked="checked"' IF row.ldap %]> 51 </td> 52 <td class="nd_center-cell"> 53 <input data-form="update" name="radius" type="checkbox" [% ' checked="checked"' IF row.radius %]> 54 </td> 55 <td class="nd_center-cell"> 56 <input data-form="update" name="tacacs" type="checkbox" [% ' checked="checked"' IF row.tacacs %]> 57 </td> 58 <td class="nd_center-cell"> 59 <input data-form="update" name="port_control" type="checkbox" [% ' checked="checked"' IF row.port_control %]> 60 </td> 61 <td class="nd_center-cell"> 62 <input data-form="update" name="admin" type="checkbox" [% ' checked="checked"' IF row.admin %]> 63 </td> 64 <td class="nd_center-cell">[% row.created | html_entity %]</td> 65 <td class="nd_center-cell">[% row.last_seen | html_entity %]</td> 66 <td class="nd_center-cell"> 67 <input class="span2" data-form="update" name="note" type="text" value="[% row.note | html_entity %]"> 68 </td> 69 70 <td nowrap class="nd_center-cell"> 71 <button class="btn nd_adminbutton" name="update" type="submit"><i class="icon-save text-warning"></i></button> 72 73 <button class="btn" data-toggle="modal" 74 data-target="#nd_devdel-[% count | html_entity %]" type="button"><i class="icon-trash text-error"></i></button> 75 76 <div id="nd_devdel-[% count | html_entity %]" class="nd_modal nd_deep-horizon modal hide fade" tabindex="-1" 77 role="dialog" aria-labelledby="nd_devdel-label-[% count | html_entity %]" aria-hidden="true"> 78 <div class="modal-header"> 79 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button> 80 <h3 id="nd_devdel-label-[% count | html_entity %]">Are you sure?</h3> 81 </div> 82 <div class="modal-body"> 83 <blockquote> 84 <p class="text-info">User "[% row.username | html_entity %]" will be deleted.</p> 85 </blockquote> 86 <input data-form="del" name="username" type="hidden" value="[% row.username | html_entity %]"> 87 </div> 88 <div class="modal-footer"> 89 <button class="btn btn-success" data-dismiss="modal" aria-hidden="true">Cancel</button> 90 <button class="btn btn-danger nd_adminbutton" name="del" data-dismiss="modal">Confirm</button> 91 </div> 92 </div> 93 </td> 94 </tr> 95 [% END %] 96 </tbody> 97</table> 98 99<script> 100$(document).ready(function() { 101 $('#data-table').dataTable({ 102 "columnDefs": [ 103 { 104 "targets": [ 2, 3, 4, 5, 6, 7, 8, 9 ], 105 "searchable": false 106 }, 107 { 108 "targets": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], 109 "orderable": false 110 } 111 ], 112[% INCLUDE 'ajax/datatabledefaults.tt' -%] 113 } ); 114} ); 115</script> 116 117