summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2014-02-03 21:32:09 +0000
committerTed Trask <ttrask01@yahoo.com>2014-02-03 21:32:09 +0000
commitcc4fd41686f103acdc72c72a8e8295c3c169a28f (patch)
tree5135a6bfe506108edc24c3cce11cb73d4c9766ed
parent72c892f9d401585566ebf6e5b3dffd3c0c178165 (diff)
downloadacf-ipsec-tools-cc4fd41686f103acdc72c72a8e8295c3c169a28f.tar.bz2
acf-ipsec-tools-cc4fd41686f103acdc72c72a8e8295c3c169a28f.tar.xz
Cleanup HTML including removing DL/DT/DD, use tablesorter where possible, and use lowercase tags
-rw-r--r--ipsectools-details-html.lsp20
-rw-r--r--ipsectools-listcerts-html.lsp45
-rw-r--r--ipsectools-uploadcert-html.lsp2
-rw-r--r--ipsectools-viewcert-html.lsp2
4 files changed, 42 insertions, 27 deletions
diff --git a/ipsectools-details-html.lsp b/ipsectools-details-html.lsp
index b1df6a7..1e8bfe6 100644
--- a/ipsectools-details-html.lsp
+++ b/ipsectools-details-html.lsp
@@ -5,33 +5,31 @@ html = require("acf.html")
<% viewlibrary.dispatch_component("status") %>
-<H2><%= html.html_escape(data.label) %></H2>
-<DL>
+<h2><%= html.html_escape(data.label) %></h2>
<%
if not data.value.show_isakmp or #data.value.show_isakmp.value == 0 then
- io.write("No status details available")
+ io.write("<p>No status details available</p>")
else
for i,entry in pairs(data.value.show_isakmp.value) do
if (type(entry) == "table") and (entry.Destination) and (entry.Destination.value) and (#entry.Destination.value > 0) then
- io.write("<H3><IMG SRC='"..html.html_escape(page_info.wwwprefix..page_info.staticdir).."/tango/16x16/status/network-")
+ io.write("<h3><img src='"..html.html_escape(page_info.wwwprefix..page_info.staticdir).."/tango/16x16/status/network-")
if (tonumber(entry.St.value) < 9) then
io.write("error")
else
io.write("idle")
end
- io.write(".png' width='16' height='16'> ".. html.html_escape(entry.Destination.value) .. "</H3>")
- io.write("<TABLE>\n")
+ io.write(".png' width='16' height='16'> ".. html.html_escape(entry.Destination.value) .. "</h3>")
+ io.write("<table>\n")
local tags = {"Created","Source","Destination", "St", "Phase2details"}
for j,tag in pairs(tags) do
- io.write("<TR><TD STYLE='font-weight:bold;width:120px;border:none;'>" ..
- html.html_escape(entry[tag].label) .. "</TD><TD STYLE='border:none;'>"..string.gsub(html.html_escape(entry[tag].value), "\n", "<BR>"))
+ io.write("<tr><td style='font-weight:bold;width:120px;border:none;'>" ..
+ html.html_escape(entry[tag].label) .. "</td><td style='border:none;'>"..string.gsub(html.html_escape(entry[tag].value), "\n", "<br/>"))
if (entry[tag].descr) and (#entry[tag].descr > 0) then io.write(" (".. html.html_escape(entry[tag].descr) .. ")") end
- io.write("</TD></TR>")
+ io.write("</td></tr>")
end
- io.write("</TABLE>")
+ io.write("</table>")
end
end
end
--htmlviewfunctions.displayitem(data.value.ip_xfrm_policy)
%>
-</DL>
diff --git a/ipsectools-listcerts-html.lsp b/ipsectools-listcerts-html.lsp
index e7a30dc..465d0e7 100644
--- a/ipsectools-listcerts-html.lsp
+++ b/ipsectools-listcerts-html.lsp
@@ -2,29 +2,46 @@
<% 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({"deletecert"}, session) %>
<% htmlviewfunctions.displaycommandresults({"uploadcert"}, session, true) %>
-<H1><%= html.html_escape(view.label) %></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">Certificate</TD>
- </TR>
+<h1><%= html.html_escape(view.label) %></h1>
+<table id="list" class="tablesorter"><thead>
+ <tr>
+ <th>Action</th>
+ <th>Certificate</th>
+ </tr>
+</thead><tbody>
<% for i,cert in ipairs(view.value) do %>
- <TR>
- <TD style="padding-right:20px;white-space:nowrap;">
+ <tr>
+ <td>
<%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deletecert?submit=true&cert="..cert, label="Delete "} %>
<% if not string.find(cert, "%-key") then %>
<%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/viewcert?cert="..cert, label="View "} %>
<% end %>
- </TD>
- <TD style="white-space:nowrap;"><%= html.html_escape(cert) %></TD>
- </TR>
+ </td>
+ <td><%= html.html_escape(cert) %></td>
+ </tr>
<% end %>
-</TABLE></DL>
+</tbody></table>
<% if viewlibrary.dispatch_component and viewlibrary.check_permission("uploadcert") then
viewlibrary.dispatch_component("uploadcert")
diff --git a/ipsectools-uploadcert-html.lsp b/ipsectools-uploadcert-html.lsp
index 4f9d5ee..41048e4 100644
--- a/ipsectools-uploadcert-html.lsp
+++ b/ipsectools-uploadcert-html.lsp
@@ -2,7 +2,7 @@
<% htmlviewfunctions = require("htmlviewfunctions") %>
<% html = require("acf.html") %>
-<H1><%= html.html_escape(form.label) %></H1>
+<h1><%= html.html_escape(form.label) %></h1>
<%
form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action
form.enctype = "multipart/form-data"
diff --git a/ipsectools-viewcert-html.lsp b/ipsectools-viewcert-html.lsp
index d31c1eb..fb8b196 100644
--- a/ipsectools-viewcert-html.lsp
+++ b/ipsectools-viewcert-html.lsp
@@ -3,7 +3,7 @@
<% html = require("acf.html") %>
<% if view.value.result then %>
-<H1>Certificate Details</H1>
+<h1>Certificate Details</h1>
<% htmlviewfunctions.displayitem(view.value.cert, 1, page_info) %>
<pre><%= html.html_escape(view.value.result.value) %></pre>
<% else