diff options
-rw-r--r-- | ppp-listpeers-html.lsp | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/ppp-listpeers-html.lsp b/ppp-listpeers-html.lsp index 19e0d0b..75a58aa 100644 --- a/ppp-listpeers-html.lsp +++ b/ppp-listpeers-html.lsp @@ -3,29 +3,47 @@ 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() { + $("#list").tablesorter({widgets: ['zebra']}); + }); +</script> + <% htmlviewfunctions.displaycommandresults({"deletepeer", "editpeer"}, session) %> <% htmlviewfunctions.displaycommandresults({"createpeer"}, session, true) %> <h1>Peer Files</h1> -<DL><TABLE> - <TR style="background:#eee;font-weight:bold;"> - <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Action</TD> - <TD style="white-space:nowrap;text-align:left;" class="header">Peer File</TD> - </TR> +<table id="list" class="tablesorter"><thead> + <tr> + <th>Action</th> + <th>Peer File</th> + </tr> +</thead><tbody> <% for i,file in ipairs(form.value) do %> - <TR> - <TD style="padding-right:20px;white-space:nowrap;"> + <tr> + <td> <% if viewlibrary.check_permission("deletepeer") then io.write(html.link{value = "deletepeer?submit=true&name=" .. file, label="Delete " }) end if viewlibrary.check_permission("editpeer") then io.write(html.link{value = "editpeer?name=" .. file.."&redir="..page_info.orig_action, label="Edit " }) end %> - </TD> - <TD style="white-space:nowrap;" width="90%"><%= html.html_escape(string.gsub(file, "^.*/", "")) %></TD> - </TR> + </td> + <td><%= html.html_escape(string.gsub(file, "^.*/", "")) %></td> + </tr> <% end %> -</TABLE></DL> +</tbody></table> <% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createpeer") then viewlibrary.dispatch_component("createpeer") end %> - |