diff options
author | Ted Trask <ttrask01@yahoo.com> | 2014-02-04 17:02:41 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2014-02-04 17:02:41 +0000 |
commit | 50b8c1bd4d52e53ab9ce98c67550b995a5682865 (patch) | |
tree | 56edbca0c20eac5ea6b7ea1c3932c344a502ec1f /kamailio-listusers-html.lsp | |
parent | b535cc71e1b2fa53b0ca3a422522d2a8f45287e0 (diff) | |
download | acf-kamailio-50b8c1bd4d52e53ab9ce98c67550b995a5682865.tar.bz2 acf-kamailio-50b8c1bd4d52e53ab9ce98c67550b995a5682865.tar.xz |
Cleanup HTML including removing DL/DT/DD, use tablesorter where possible, and use lowercase tags
Diffstat (limited to 'kamailio-listusers-html.lsp')
-rw-r--r-- | kamailio-listusers-html.lsp | 56 |
1 files changed, 38 insertions, 18 deletions
diff --git a/kamailio-listusers-html.lsp b/kamailio-listusers-html.lsp index c631716..0b7183f 100644 --- a/kamailio-listusers-html.lsp +++ b/kamailio-listusers-html.lsp @@ -2,42 +2,62 @@ <% htmlviewfunctions = require("htmlviewfunctions") %> <% html = require("acf.html") %> +<script type="text/javascript"> + if (typeof jQuery == 'undefined') { + document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"><\/script>'); + } +</script> + +<script type="text/javascript"> + if (typeof $.tablesorter == 'undefined') { + document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery.tablesorter.js"><\/script>'); + } +</script> + +<script type="text/javascript"> + $(document).ready(function() { + <% if viewlibrary.check_permission("deleteuser") or viewlibrary.check_permission("updateuser") then %> + $("#list").tablesorter({headers: {0:{sorter: false}}, widgets: ['zebra']}); + <% else %> + $("#list").tablesorter({widgets: ['zebra']}); + <% end %> + }); +</script> + <% htmlviewfunctions.displaycommandresults({"deleteuser", "updateuser"}, session) %> <% htmlviewfunctions.displaycommandresults({"createuser"}, session, true) %> -<H1><%= html.html_escape(form.label) %></H1> -<DL> -<TABLE> - <TR style="background:#eee;font-weight:bold;"> +<h1><%= html.html_escape(form.label) %></h1> +<table id="list" class="tablesorter"><thead> + <tr> <% if viewlibrary.check_permission("deleteuser") or viewlibrary.check_permission("updateuser") then %> - <TD style="padding-right:20px;white-space:nowrap;" class="header">Action</TD> + <th>Action</th> <% end %> - <TD style="padding-right:20px;white-space:nowrap;" class="header">User Name</TD> - <TD style="white-space:nowrap;" class="header">Password</TD> - </TR> - + <th>User Name</th> + <th>Password</th> + </tr> +</thead><tbody> <% for i,user in ipairs(form.value) do %> - <TR> + <tr> <% if viewlibrary.check_permission("deleteuser") or viewlibrary.check_permission("updateuser") then %> - <TD style="padding-right:20px;white-space:nowrap;"> + <td> <% if viewlibrary.check_permission("updateuser") then %> <%= html.link{value = "updateuser?username=" .. user.username.."&redir="..page_info.orig_action, label="Update "} %> <% end %> <% if viewlibrary.check_permission("deleteuser") then %> <%= html.link{value = "deleteuser?submit=true&username=" .. user.username, label="Delete "} %> <% end %> - </TD> + </td> <% end %> - <TD><%= html.html_escape(user.username) %></TD> + <td><%= html.html_escape(user.username) %></td> <% if viewlibrary.check_permission("updateuser") then %> - <TD><%= html.html_escape(user.password) %></TD> + <td><%= html.html_escape(user.password) %></td> <% else %> - <TD>******</TD> + <td>******</td> <% end %> - </TR> + </tr> <% end %> -</TABLE> -</DL> +</tbody></table> <% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createuser") then viewlibrary.dispatch_component("createuser") |