diff options
author | Ted Trask <ttrask01@yahoo.com> | 2014-02-03 21:55:41 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2014-02-03 21:55:41 +0000 |
commit | 02f08e3420245cb727783f5abe460d336f135459 (patch) | |
tree | 1630a5c11156182687f89627943aafd33ea02dc2 /tcpproxy-listsmtpfiles-html.lsp | |
parent | 3994357e9ab748f5fbf6cbca682e5e3ce3be8001 (diff) | |
download | acf-tcpproxy-02f08e3420245cb727783f5abe460d336f135459.tar.bz2 acf-tcpproxy-02f08e3420245cb727783f5abe460d336f135459.tar.xz |
Cleanup HTML including removing DL/DT/DD, use tablesorter where possible, and use lowercase tags
Diffstat (limited to 'tcpproxy-listsmtpfiles-html.lsp')
-rw-r--r-- | tcpproxy-listsmtpfiles-html.lsp | 47 |
1 files changed, 32 insertions, 15 deletions
diff --git a/tcpproxy-listsmtpfiles-html.lsp b/tcpproxy-listsmtpfiles-html.lsp index 8918a7e..b5e479a 100644 --- a/tcpproxy-listsmtpfiles-html.lsp +++ b/tcpproxy-listsmtpfiles-html.lsp @@ -3,35 +3,52 @@ 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() { + $("#listfiles").tablesorter({headers: {0:{sorter: false}}, widgets: ['zebra']}); + }); +</script> + <% htmlviewfunctions.displaycommandresults({"editsmtpfile", "delsmtpfile"}, session) %> <% htmlviewfunctions.displaycommandresults({"createsmtpfile"}, session, true) %> -<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="listfiles" 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("editsmtpfile") then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editsmtpfile?filename="..file.."&redir="..page_info.orig_action, label="Edit "} %> <% end %> <% if viewlibrary.check_permission("delsmtpfile") then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/delsmtpfile?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("createsmtpfile") then local createform = viewlibrary.dispatch_component("createsmtpfile", 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 .. "/createsmtpfile" htmlviewfunctions.displayform(createform) |