1[% IF NOT results.size %] 2<div class="span4 alert alert-info">No duplicate devices found.</div> 3[% ELSE %] 4<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0"> 5 <thead> 6 <tr> 7 <th class="nd_center-cell">Device IP</th> 8 <th class="nd_center-cell">Contact</th> 9 <th class="nd_center-cell">Location</th> 10 <th class="nd_center-cell">System Name</th> 11 <th class="nd_center-cell">Model</th> 12 <th class="nd_center-cell">OS Version</th> 13 <th class="nd_center-cell">Serial</th> 14 <th class="nd_center-cell">Last Discovered</th> 15 <th class="nd_center-cell">Delete</th> 16 </tr> 17 </thead> 18 <tbody> 19 [% SET count = 0 %] 20 [% FOREACH row IN results %] 21 [% SET count = count + 1 %] 22 <tr> 23 <td class="nd_center-cell"><a class="nd_linkcell" 24 href="[% uri_for('/device') | none %]?tab=details&q=[% row.ip | uri %]">[% row.ip | html_entity %]</a> 25 [% row.dns | html_entity %]</td> 26 <td class="nd_center-cell">[% row.contact | html_entity %]</td> 27 <td class="nd_center-cell">[% row.location | html_entity %]</td> 28 <td class="nd_center-cell">[% row.name | html_entity %]</td> 29 <td class="nd_center-cell">[% row.model | html_entity %]</td> 30 <td class="nd_center-cell">[% row.os_ver | html_entity %]</td> 31 <td class="nd_center-cell">[% row.serial | html_entity %]</td> 32 <td class="nd_center-cell">[% row.last_discover_stamp | html_entity %]</td> 33 34 <td class="nd_center-cell"> 35 <button class="btn btn-danger btn-small" 36 data-toggle="modal" data-target="#nd_devdel-[% count | html_entity %]" type="button"> 37 <i class="icon-trash text-danger"></i> 38 </button> 39 40 <div id="nd_devdel-[% count | html_entity %]" class="nd_modal nd_deep-horizon modal hide fade" tabindex="-1" 41 role="dialog" aria-labelledby="nd_devdel-label-[% count | html_entity %]" aria-hidden="true"> 42 <div class="modal-header"> 43 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button> 44 <h3 id="nd_devdel-label-[% count | html_entity %]">Confirm Delete: [% row.ip || row.dns | html_entity %]</h3> 45 </div> 46 <div class="modal-body"> 47 <blockquote> 48 <ul> 49 <li><p>This action is immediate and not reversible</p></li> 50 <li><p>All associated Nodes may be removed from the database</p></li> 51 </ul> 52 </blockquote> 53 <textarea id="nd_devdel-log" class="input-block-level" rows="2" data-form="delete" 54 placeholder="Enter a log message" name="log"></textarea> 55 <label class="checkbox" style="display: block"> 56 <input id="nd_devdel-archive" type="checkbox" data-form="delete" name="archive"> 57 <h4 class="nd_unbolden">Archive Nodes</h4> 58 </label> 59 <input type="hidden" data-form="delete" value="[% row.ip | html_entity %]" name="device"/> 60 </div> 61 <div class="modal-footer"> 62 <button class="btn btn-success" data-dismiss="modal" aria-hidden="true">Cancel</button> 63 <button class="btn btn-danger nd_adminbutton" name="delete" data-dismiss="modal">Confirm</button> 64 </div> 65 </div> 66 </td> 67 </tr> 68 [% END %] 69 </tbody> 70</table> 71[% END %] 72 73<script> 74$(document).ready(function() { 75 $('#data-table').dataTable({ 76[% INCLUDE 'ajax/datatabledefaults.tt' -%] 77 } ); 78} ); 79</script> 80