diff options
-rw-r--r-- | dnscache-config-html.lsp | 2 | ||||
-rw-r--r-- | dnscache-listdomains-html.lsp | 41 |
2 files changed, 31 insertions, 12 deletions
diff --git a/dnscache-config-html.lsp b/dnscache-config-html.lsp index f29644c..c53da25 100644 --- a/dnscache-config-html.lsp +++ b/dnscache-config-html.lsp @@ -6,7 +6,7 @@ htmlviewfunctions = require("htmlviewfunctions") viewlibrary.dispatch_component("status") end %> -<H1>Config</H1> +<h1>Config</h1> <% form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action htmlviewfunctions.displayform(form) diff --git a/dnscache-listdomains-html.lsp b/dnscache-listdomains-html.lsp index a28519e..9f41a9c 100644 --- a/dnscache-listdomains-html.lsp +++ b/dnscache-listdomains-html.lsp @@ -3,28 +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({"editdomain", "deletedomain"}, session) %> <% htmlviewfunctions.displaycommandresults({"createdomain"}, session, true) %> <h1>Configuration</h1> <h2>Edit/View DNS server entries</h2> -<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">Domain</TD> - </TR> +<table id="list" class="tablesorter"><thead> + <tr> + <th>Action</th> + <th>Domain</th> + </tr> +</thead><tbody> <% for i,domain in ipairs(data.value) do %> - <TR> - <TD style="padding-right:20px;white-space:nowrap;"> + <tr> + <td> <% io.write(html.link{value = "editdomain?domain=" .. domain.."&redir="..page_info.orig_action, label="Edit " }) %> <% if domain ~= "@" then io.write(html.link{value = "deletedomain?submit=true&domain=" .. domain, label="Delete " }) end %> - </TD> - <TD style="white-space:nowrap;" width="90%"><%= html.html_escape(domain) %></TD> - </TR> + </td> + <td><%= html.html_escape(domain) %></td> + </tr> <% end %> -</TABLE></DL> +</tbody></table> <% if viewlibrary and viewlibrary.dispatch_component then viewlibrary.dispatch_component("createdomain") |