summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2014-02-03 21:55:41 +0000
committerTed Trask <ttrask01@yahoo.com>2014-02-03 21:55:41 +0000
commit02f08e3420245cb727783f5abe460d336f135459 (patch)
tree1630a5c11156182687f89627943aafd33ea02dc2
parent3994357e9ab748f5fbf6cbca682e5e3ce3be8001 (diff)
downloadacf-tcpproxy-02f08e3420245cb727783f5abe460d336f135459.tar.bz2
acf-tcpproxy-02f08e3420245cb727783f5abe460d336f135459.tar.xz
Cleanup HTML including removing DL/DT/DD, use tablesorter where possible, and use lowercase tags
-rw-r--r--tcpproxy-listsmtpentries-html.lsp54
-rw-r--r--tcpproxy-listsmtpfiles-html.lsp47
-rw-r--r--tcpproxy-smtpstatus-html.lsp12
3 files changed, 73 insertions, 40 deletions
diff --git a/tcpproxy-listsmtpentries-html.lsp b/tcpproxy-listsmtpentries-html.lsp
index 6fffd1b..228aa76 100644
--- a/tcpproxy-listsmtpentries-html.lsp
+++ b/tcpproxy-listsmtpentries-html.lsp
@@ -3,32 +3,48 @@ 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() {
+ $("#listentries").tablesorter({headers: {0:{sorter: false}}, widgets: ['zebra']});
+ });
+</script>
+
<% htmlviewfunctions.displaycommandresults({"editsmtpentry", "delsmtpentry"}, session) %>
-<H1>Interface Entries</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="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Interface</TD>
- <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">IP Address</TD>
- <TD style="white-space:nowrap;text-align:left;" class="header">Command Entry</TD>
- </TR>
+<h1>Interface Entries</h1>
+<table id="listentries" class="tablesorter"><thead>
+ <tr>
+ <th>Action</th>
+ <th>Interface</th>
+ <th>IP Address</th>
+ <th>Command Entry</th>
+ </tr>
+</thead><tbody>
<% for i,interface in ipairs(view.value) do %>
- <TR>
- <TD style="padding-right:20px;white-space:nowrap;">
+ <tr>
+ <td>
<% if viewlibrary.check_permission("editsmtpentry") then %>
<%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editsmtpentry?ipaddr="..(interface.ipaddr or interface.interface).."&redir="..page_info.orig_action, label="Edit "} %>
<% end %>
<% if viewlibrary.check_permission("delsmtpentry") then %>
<%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/delsmtpentry?submit=true&ipaddr="..(interface.ipaddr or interface.interface), label="Delete "} %>
<% end %>
- </TD>
- <TD style="padding-right:20px;white-space:nowrap;"><%= html.html_escape(interface.interface) %></TD>
- <TD style="padding-right:20px;white-space:nowrap;"><%= html.html_escape(interface.ipaddr) %></TD>
- <TD style="white-space:nowrap;"><%= html.html_escape(interface.cmd) %></TD>
- </TR>
+ </td>
+ <td><%= html.html_escape(interface.interface) %></td>
+ <td><%= html.html_escape(interface.ipaddr) %></td>
+ <td><%= html.html_escape(interface.cmd) %></td>
+ </tr>
<% end %>
-</TABLE>
-
-</DL>
+</tbody></table>
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)
diff --git a/tcpproxy-smtpstatus-html.lsp b/tcpproxy-smtpstatus-html.lsp
index d5f4a46..7edf5e0 100644
--- a/tcpproxy-smtpstatus-html.lsp
+++ b/tcpproxy-smtpstatus-html.lsp
@@ -6,17 +6,17 @@ html = require("acf.html")
<% htmlviewfunctions.displaycommandresults({"editsmtpentry", "delsmtpentry", "editsmtpfile", "delsmtpfile"}, session) %>
<% htmlviewfunctions.displaycommandresults({"createsmtpfile"}, session, true) %>
-<H1>SMTP Proxy Status</H1>
-<DL>
+<h1>SMTP Proxy Status</h1>
<% htmlviewfunctions.displayitem(view.value.version)
if view.value.version and view.value.version.errtxt and viewlibrary.check_permission("apk-tools/apk/install") then
%>
- <DT>Install package</DT>
- <DD><form action="<%= html.html_escape(page_info.script .. "/apk-tools/apk/install") %>" method="POST">
+ <div class='item'><p class='left'>Install package</p>
+ <div class='right'>
+ <form action="<%= html.html_escape(page_info.script .. "/apk-tools/apk/install") %>" method="post">
<input type='hidden' name='package' value='<%= html.html_escape(view.value.version.name) %>'>
- <input class='submit' type='submit' name='submit' value='Install'></form></DD>
+ <input class='submit' type='submit' name='submit' value='Install'></form>
+ </div></div><!-- end .item -->
<% end %>
-</DL>
<% if viewlibrary and viewlibrary.dispatch_component then
viewlibrary.dispatch_component("listsmtpentries")