summaryrefslogtreecommitdiffstats
path: root/kamailio-listusers-html.lsp
diff options
context:
space:
mode:
Diffstat (limited to 'kamailio-listusers-html.lsp')
-rw-r--r--kamailio-listusers-html.lsp56
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")