diff options
Diffstat (limited to 'provisioning-listdevices-html.lsp')
-rw-r--r-- | provisioning-listdevices-html.lsp | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/provisioning-listdevices-html.lsp b/provisioning-listdevices-html.lsp index 6bad516..84206aa 100644 --- a/provisioning-listdevices-html.lsp +++ b/provisioning-listdevices-html.lsp @@ -28,7 +28,7 @@ html = require("acf.html") %> $(document).ready(function() { - $("#list").tablesorter({headers: {0:{sorter: false}}}); + $("#list").tablesorter({headers: {0:{sorter: false}}, widgets: ['zebra']}); $(".deletedevice").click(function(){ return confirm("Are you sure you want to delete this device?")}); }); </script> @@ -53,19 +53,18 @@ table.sort(display) %> <h1>Devices</h1> -<DL> -<TABLE id="list" class="tablesorter"><THEAD> - <TR style="background:#eee;font-weight:bold;"> - <TH>Action</TH> - <TH>Device ID</TH> +<table id="list" class="tablesorter"><thead> + <tr> + <th>Action</th> + <th>Device ID</th> <% for i,n in ipairs(display) do %> - <TH><%= string.gsub(n, "^.", string.upper) %> + <th><%= string.gsub(n, "^.", string.upper) %> <% end %> - </TR> -</THEAD><TBODY> + </tr> +</thead><tbody> <% for k,v in ipairs( view.value ) do %> - <TR> - <TD> + <tr> + <td> <% if viewlibrary.check_permission("deletedevice") then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deletedevice?submit=true&device_id="..v.device_id, label="Delete ", class="deletedevice"} %> <% end %> @@ -80,15 +79,15 @@ table.sort(display) <% if viewlibrary.check_permission("getdevicevalues") then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/getdevicevalues?submit=true&id=device_id&value="..v.device_id.."&viewtype=templated", label="View "} %> <% end %> - </TD> - <TD><%= html.html_escape(v.device_id) %></TD> + </td> + <td><%= html.html_escape(v.device_id) %></td> <% for i,n in ipairs(display) do %> - <TD><%= html.html_escape(v[n]) %></TD> + <td><%= html.html_escape(v[n]) %></td> <% end %> - </TR> + </tr> <% end %> -</TBODY> -</TABLE> +</tbody> +</table> <% if view.errtxt then %> <p class="error"><%= html.html_escape(view.errtxt) %></p> @@ -96,7 +95,6 @@ table.sort(display) <% if #view.value == 0 then %> <p>No devices found</p> <% end %> -</DL> <% if page_info.action == "listdevices" and viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createdevice") then viewlibrary.dispatch_component("createdevice") |