diff options
Diffstat (limited to 'squid-listfiles-html.lsp')
-rw-r--r-- | squid-listfiles-html.lsp | 47 |
1 files changed, 32 insertions, 15 deletions
diff --git a/squid-listfiles-html.lsp b/squid-listfiles-html.lsp index 90d2fe2..0aea8bf 100644 --- a/squid-listfiles-html.lsp +++ b/squid-listfiles-html.lsp @@ -3,6 +3,24 @@ 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({headers: {0:{sorter: false}}, widgets: ['zebra']}); + }); +</script> + <% htmlviewfunctions.displaycommandresults({"editfile", "deletefile"}, session) %> <% htmlviewfunctions.displaycommandresults({"createfile"}, session, true) %> @@ -10,32 +28,31 @@ html = require("acf.html") viewlibrary.dispatch_component("status") end %> -<H1>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">File</TD> - </TR> +<h1>Files</h1> +<table id="list" class="tablesorter"><thead> + <tr> + <th>Action</th> + <th>File</th> + </tr> +</thead><tbody> <% for i,file in ipairs(view.value) do %> - <TR> - <TD style="padding-right:20px;white-space:nowrap;"> + <tr> + <td> <% if viewlibrary.check_permission("editfile") then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editfile?filename="..file.."&redir="..page_info.orig_action, label="Edit "} %> <% end %> <% if viewlibrary.check_permission("deletefile") then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deletefile?submit=true&filename="..file, label="Delete "} %> <% end %> - </TD> - <TD style="white-space:nowrap;"><%= html.html_escape(file) %></TD> - </TR> + </td> + <td><%= html.html_escape(file) %></td> + </tr> <% end %> -</TABLE> -</DL> +</tbody></table> <% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createfile") then local createform = viewlibrary.dispatch_component("createfile", nil, true) %> -<H2><%= html.html_escape(createform.label) %></H2> +<h2><%= html.html_escape(createform.label) %></h2> <% createform.action = page_info.script .. page_info.prefix .. page_info.controller .. "/createfile" htmlviewfunctions.displayform(createform) |