summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2014-02-03 21:51:04 +0000
committerTed Trask <ttrask01@yahoo.com>2014-02-03 21:51:04 +0000
commit0e135f4fc7b475c9dff7e0a5b4c48ca38e8d08bc (patch)
tree6bf73e6950be416dea07e44a99cf095f8b5bfb53
parentdb191aa26855c0082f4a286455cfe30540319688 (diff)
downloadacf-samba-0e135f4fc7b475c9dff7e0a5b4c48ca38e8d08bc.tar.bz2
acf-samba-0e135f4fc7b475c9dff7e0a5b4c48ca38e8d08bc.tar.xz
Cleanup HTML including removing DL/DT/DD, use tablesorter where possible, and use lowercase tags
-rw-r--r--samba-listfiles-html.lsp46
-rw-r--r--samba-listshares-html.lsp64
2 files changed, 74 insertions, 36 deletions
diff --git a/samba-listfiles-html.lsp b/samba-listfiles-html.lsp
index b6460e8..48ffa17 100644
--- a/samba-listfiles-html.lsp
+++ b/samba-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;">
+ <tr>
+ <td>
<%= 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>
+ </td>
+ <td><%= html.html_escape(file.filesize) %></td>
+ <td><%= html.html_escape(file.mtime) %></td>
+ </tr>
<% end %>
-</TABLE></DL>
+</tbody></table>
diff --git a/samba-listshares-html.lsp b/samba-listshares-html.lsp
index 46a1678..dca452a 100644
--- a/samba-listshares-html.lsp
+++ b/samba-listshares-html.lsp
@@ -3,43 +3,63 @@ 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({"editshare", "deleteshare"}, session) %>
<% htmlviewfunctions.displaycommandresults({"createshare"}, session, true) %>
-<H1>Shares</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">Name</TD>
- <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Path</TD>
- <TD style="white-space:nowrap;text-align:left;" class="header">Comment</TD>
- </TR>
+<h1>Shares</h1>
+<table id="list" class="tablesorter"><thead>
+ <tr>
+ <th>Action</th>
+ <th>Name</th>
+ <th>Path</th>
+ <th>Comment</th>
+ </tr>
+</thead><tbody>
<% for i,share in ipairs(view.value) do %>
- <TR>
- <TD style="padding-right:20px;white-space:nowrap;">
+ <tr>
+ <td>
<% if viewlibrary.check_permission("editshare") then %>
<%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editshare?name="..share.name.."&redir="..page_info.orig_action, label="Edit "} %>
<% end %>
<% if viewlibrary.check_permission("deleteshare") then %>
<%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deleteshare?submit=true&name="..share.name, label="Delete "} %>
<% end %>
- </TD>
- <TD style="padding-right:20px;white-space:nowrap;"><%= html.html_escape(share.name) %></TD>
- <TD style="padding-right:20px;white-space:nowrap;"><%= html.html_escape(share.path) %></TD>
- <TD style="white-space:nowrap;"><%= html.html_escape(share.comment) %></TD>
- </TR>
+ </td>
+ <td><%= html.html_escape(share.name) %></td>
+ <td><%= html.html_escape(share.path) %></td>
+ <td><%= html.html_escape(share.comment) %></td>
+ </tr>
<% end %>
-</TABLE>
+</tbody></table>
<% if #view.value == 0 then %>
-No Shares Found
+<p>No Shares Found</p>
<% end %>
-</DL>
<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createshare") then %>
-<H2>Create new share</H2>
-<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller) %>/createshare" method="POST">
+<h2>Create new share</h2>
+<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller) %>/createshare" method="post">
<input class="hidden" type="hidden" name="redir" value="<%= html.html_escape(page_info.orig_action) %>" >
-<dl><dt></dt><dd><input class="submit" type="submit" value="Create Share"></dd></dl>
+<div class='item'><p class='left'></p>
+<div class='right'>
+<input class="submit" type="submit" value="Create Share">
+</div></div><!-- end .item -->
</form>
<% end %>