summaryrefslogtreecommitdiffstats
path: root/openssh-listauth-html.lsp
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2014-02-03 21:43:24 +0000
committerTed Trask <ttrask01@yahoo.com>2014-02-03 21:43:24 +0000
commit0d87bb5527f504012fa877a988f1a3e7591ba584 (patch)
tree0b90f56204933342c243f8fffc8b90824702dbe8 /openssh-listauth-html.lsp
parent32833592fb47f66ceb99848bef2ba132e3a3686c (diff)
downloadacf-openssh-0d87bb5527f504012fa877a988f1a3e7591ba584.tar.bz2
acf-openssh-0d87bb5527f504012fa877a988f1a3e7591ba584.tar.xz
Cleanup HTML including removing DL/DT/DD, use tablesorter where possible, and use lowercase tags
Diffstat (limited to 'openssh-listauth-html.lsp')
-rw-r--r--openssh-listauth-html.lsp52
1 files changed, 35 insertions, 17 deletions
diff --git a/openssh-listauth-html.lsp b/openssh-listauth-html.lsp
index de89648..8d8ebad 100644
--- a/openssh-listauth-html.lsp
+++ b/openssh-listauth-html.lsp
@@ -2,31 +2,49 @@
<% 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({"deleteauth"}, session) %>
<% htmlviewfunctions.displaycommandresults({"addauth"}, session, true) %>
-<H1>Authorized Keys for <%= html.html_escape(view.value.user.value) %></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">ID</TD>
- <TD style="white-space:nowrap;text-align:left;" class="header">Key</TD>
- </TR>
+<h1>Authorized Keys for <%= html.html_escape(view.value.user.value) %></h1>
+<table id="list" class="tablesorter"><thead>
+ <tr>
+ <th>Action</th>
+ <th>ID</th>
+ <th>Key</th>
+ </tr>
+</thead><tbody>
<% for i,auth in ipairs(view.value.auth.value) do %>
- <TR>
- <TD style="padding-right:20px;white-space:nowrap;">
-<form action="<%= html.html_escape(page_info.script..page_info.prefix..page_info.controller.."/deleteauth") %>" method="POST">
+ <tr>
+ <td>
+<form action="<%= html.html_escape(page_info.script..page_info.prefix..page_info.controller.."/deleteauth") %>" method="post">
<input class="hidden" type="hidden" name="user" value="<%= html.html_escape(view.value.user.value) %>">
<input class="hidden" type="hidden" name="auth" value="<%= html.html_escape(auth.id) %>">
-<input class="submit" type="submit" name="submit" value="Delete"></DD>
+<input class="submit" type="submit" name="submit" value="Delete">
</form>
- </TD>
- <TD style="padding-right:20px;white-space:nowrap;"><%= html.html_escape(auth.id) %></TD>
- <TD style="white-space:nowrap;"><% if #auth.key>32 then io.write(html.html_escape(string.sub(auth.key,0,16)) .. " ... " .. html.html_escape(string.sub(auth.key, -16))) else io.write(html.html_escape(auth.key)) end %></TD>
- </TR>
+ </td>
+ <td><%= html.html_escape(auth.id) %></td>
+ <td><% if #auth.key>32 then io.write(html.html_escape(string.sub(auth.key,0,16)) .. " ... " .. html.html_escape(string.sub(auth.key, -16))) else io.write(html.html_escape(auth.key)) end %></td>
+ </tr>
<% end %>
-</TABLE>
+</tbody></table>
<p>In order to preserve keys with lbu, you must add /<% if view.value.user.value ~= "root" then io.write("home/") end %><%= view.value.user.value %>/.ssh/authorized_keys to lbu include
-</DL>
<% viewlibrary.dispatch_component("addauth", {user=view.value.user.value}) %>