summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2014-02-03 21:26:16 +0000
committerTed Trask <ttrask01@yahoo.com>2014-02-03 21:26:16 +0000
commitaccdc5b2ac969092e0a21bef5cff679875d2430c (patch)
treeed912db428ee57be9029467639691c1da168c01d
parent16fa324c5bb5cab0ac21b2a0b3ac23a396163211 (diff)
downloadacf-dhcp-accdc5b2ac969092e0a21bef5cff679875d2430c.tar.bz2
acf-dhcp-accdc5b2ac969092e0a21bef5cff679875d2430c.tar.xz
Cleanup HTML including removing DL/DT/DD, use tablesorter where possible, and use lowercase tags
-rw-r--r--dhcp-home-html.lsp13
-rw-r--r--dhcp-listfiles-html.lsp48
-rw-r--r--dhcp-listhosts-html.lsp56
-rw-r--r--dhcp-listsubnets-html.lsp56
4 files changed, 113 insertions, 60 deletions
diff --git a/dhcp-home-html.lsp b/dhcp-home-html.lsp
index 0cfc404..39be215 100644
--- a/dhcp-home-html.lsp
+++ b/dhcp-home-html.lsp
@@ -8,15 +8,14 @@
viewlibrary.dispatch_component("status")
end %>
-<H1>Global Settings</H1>
-
-<DL>
-<dt>Edit global settings</dt>
-<dd><form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/settings") %>" method="POST">
+<h1>Global Settings</h1>
+<div class='item'><p class='left'>Edit global settings</p>
+<div class='right'>
+<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/settings") %>" method="post">
<input class="hidden" type="hidden" name="redir" value="<%= html.html_escape(page_info.orig_action) %>" >
<input type=submit value="Edit" class="submit">
-</form></dd>
-</DL>
+</form>
+</div></div><!-- end .item -->
<% if viewlibrary and viewlibrary.dispatch_component then
viewlibrary.dispatch_component("listsubnets")
diff --git a/dhcp-listfiles-html.lsp b/dhcp-listfiles-html.lsp
index c733bfd..3b9b2fe 100644
--- a/dhcp-listfiles-html.lsp
+++ b/dhcp-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({widgets: ['zebra']});
+ });
+</script>
+
<% htmlviewfunctions.displaycommandresults({"expert"}, session) %>
<% if viewlibrary and viewlibrary.dispatch_component then
@@ -10,20 +28,20 @@ html = require("acf.html")
end %>
<h1><%= html.html_escape(data.label) %></h1>
-<DL><TABLE>
- <TR style="background:#eee;font-weight:bold;">
- <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">File</TD>
- <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Size</TD>
- <TD style="white-space:nowrap;text-align:left;" class="header">Last Modified</TD>
- </TR>
-
+<table id="list" class="tablesorter"><thead>
+ <tr>
+ <th>File</th>
+ <th>Size</th>
+ <th>Last Modified</th>
+ </tr>
+</thead><tbody>
<% for i,file in ipairs(data.value) do %>
- <TR>
- <TD style="padding-right:20px;white-space:nowrap;">
- <%= html.link{value = "expert?filename=" .. file.filename.."&redir="..page_info.orig_action, label=file.filename} %>
- </TD>
- <TD style="padding-right:20px;white-space:nowrap;"><%= html.html_escape(file.filesize) %></TD>
- <TD style="white-space:nowrap;" width="90%"><%= html.html_escape(file.mtime) %></TD>
- </TR>
+ <tr>
+ <td>
+ <%= html.link{value = "expert?filename=" .. file.filename.."&redir="..page_info.orig_action, label=file.filename} %>
+ </td>
+ <td><%= html.html_escape(file.filesize) %></td>
+ <td><%= html.html_escape(file.mtime) %></td>
+ </tr>
<% end %>
-</TABLE></DL>
+</tbody></table>
diff --git a/dhcp-listhosts-html.lsp b/dhcp-listhosts-html.lsp
index 4c4cde8..871f92e 100644
--- a/dhcp-listhosts-html.lsp
+++ b/dhcp-listhosts-html.lsp
@@ -1,31 +1,49 @@
<% local view, viewlibrary, page_info, session = ... %>
<% 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>
-<% htmlviewfunctions.displaycommandresults({"edithost", "delhost", "createhost"}, session) %>
+<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() {
+ $("#listhosts").tablesorter({headers: {0:{sorter: false}}, widgets: ['zebra']});
+ });
+</script>
-<H1>Host Declarations</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">Host</TD>
- </TR>
+<% htmlviewfunctions.displaycommandresults({"edithost", "delhost", "createhost"}, session) %>
+
+<h1>Host Declarations</h1>
+<table id="listhosts" class="tablesorter"><thead>
+ <tr>
+ <th>Action</th>
+ <th>Host</th>
+ </tr>
+</thead><tbody>
<% for i,host 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.."/edithost?host="..host.."&redir="..page_info.orig_action, label="Edit "} %>
<%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/delhost?submit=true&host="..host, label="Delete "} %>
- </TD>
- <TD style="white-space:nowrap;"><%= html.html_escape(host) %></TD>
- </TR>
+ </td>
+ <td><%= html.html_escape(host) %></td>
+ </tr>
<% end %>
-</TABLE>
+</tbody></table>
-<dt>Add new host</dt>
-<dd><form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/createhost") %>" method="POST">
+<div class='item'><p class='left'>Add new host</p>
+<div class='right'>
+<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/createhost") %>" method="post">
<input class="hidden" type="hidden" name="redir" value="<%= html.html_escape(page_info.orig_action) %>" >
-<input type=submit value="New" class="submit">
-</form></dd>
-</DL>
+<input class="submit" type="submit" name="submit" value="New">
+</form>
+</div></div><!-- end .item -->
diff --git a/dhcp-listsubnets-html.lsp b/dhcp-listsubnets-html.lsp
index cfefa6b..00bd1ef 100644
--- a/dhcp-listsubnets-html.lsp
+++ b/dhcp-listsubnets-html.lsp
@@ -2,30 +2,48 @@
<% htmlviewfunctions = require("htmlviewfunctions") %>
<% html = require("acf.html") %>
-<% htmlviewfunctions.displaycommandresults({"editsubnet", "delsubnet", "createsubnet"}, session) %>
+<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>
-<H1>Subnet Declarations</H1>
+<script type="text/javascript">
+ $(document).ready(function() {
+ $("#listsubnets").tablesorter({headers: {0:{sorter: false}}, widgets: ['zebra']});
+ });
+</script>
+
+<% htmlviewfunctions.displaycommandresults({"editsubnet", "delsubnet", "createsubnet"}, session) %>
-<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">Subnet</TD>
- </TR>
+<h1>Subnet Declarations</h1>
+<table id="listsubnets" class="tablesorter"><thead>
+ <tr>
+ <th>Action</th>
+ <th>Subnet</th>
+ </tr>
+</thead><tbody>
<% for i,subnet 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.."/editsubnet?subnet="..subnet.."&redir="..page_info.orig_action, label="Edit "} %>
<%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/delsubnet?submit=true&subnet="..subnet, label="Delete "} %>
- </TD>
- <TD style="white-space:nowrap;"><%= html.html_escape(subnet) %></TD>
- </TR>
+ </td>
+ <td><%= html.html_escape(subnet) %></td>
+ </tr>
<% end %>
-</TABLE>
+</tbody></table>
-<dt>Add new subnet</dt>
-<dd><form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/createsubnet") %>" method="POST">
+<div class='item'><p class='left'>Add new subnet</p>
+<div class='right'>
+<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/createsubnet") %>" method="post">
<input class="hidden" type="hidden" name="redir" value="<%= html.html_escape(page_info.orig_action) %>" >
-<input type=submit value="New" class="submit">
-</form></dd>
-</DL>
+<input class="submit" type="submit" name="submit" value="New">
+</form>
+</div></div><!-- end .item -->