summaryrefslogtreecommitdiffstats
path: root/cron-listjobs-html.lsp
diff options
context:
space:
mode:
Diffstat (limited to 'cron-listjobs-html.lsp')
-rw-r--r--cron-listjobs-html.lsp57
1 files changed, 39 insertions, 18 deletions
diff --git a/cron-listjobs-html.lsp b/cron-listjobs-html.lsp
index fc18ee3..6dd3b14 100644
--- a/cron-listjobs-html.lsp
+++ b/cron-listjobs-html.lsp
@@ -2,6 +2,28 @@
<% 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() {
+<% for i,tabl in ipairs(view.value) do %>
+ <% if #tabl.jobs ~= 0 then %>
+ $("#joblist<%= i %>").tablesorter({headers: {1:{sorter: false}, 2:{sorter: false}}, widgets: ['zebra']});
+ <% end %>
+<% end %>
+ });
+</script>
+
<% htmlviewfunctions.displaycommandresults({"editjob", "deletejob", "movejob"}, session) %>
<% htmlviewfunctions.displaycommandresults({"createjob"}, session, true) %>
@@ -26,33 +48,32 @@ local function createmoveform(name)
end
%>
-<H1>Cron Jobs</H1>
+<h1>Cron Jobs</h1>
<% for i,tabl in ipairs(view.value) do %>
-<H2><%= html.html_escape(tabl.period) %></H2>
-<DL>
+<h2><%= html.html_escape(tabl.period) %></h2>
<% if #tabl.jobs == 0 then %>
-No jobs
+<p>No jobs</p>
<% else %>
-<TABLE>
- <TR style="background:#eee;font-weight:bold;">
- <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Job</TD>
- <TD style="white-space:nowrap;text-align:left;" class="header">Action</TD>
- <TD style="white-space:nowrap;text-align:left;" class="header"></TD>
- </TR>
+<table id="joblist<%= i %>" class="tablesorter"><thead>
+ <tr>
+ <th>Job</th>
+ <th>Action</th>
+ <th></th>
+ </tr>
+</thead><tbody>
<% for i,job in ipairs(tabl.jobs) do %>
- <TR>
- <TD style="white-space:nowrap;"><%= html.html_escape(string.gsub(job, "^.*/", "")) %></TD>
- <TD style="padding-right:20px;white-space:nowrap;">
+ <tr>
+ <td><%= html.html_escape(string.gsub(job, "^.*/", "")) %></td>
+ <td>
<%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editjob?name="..job.."&redir="..page_info.orig_action, label="Edit "} %>
<%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deletejob?name="..job.."&submit=true", label="Delete "} %>
- </TD><TD>
+ </td><td>
<% createmoveform(job, tabl.period) %>
- </TD>
- </TR>
+ </td>
+ </tr>
<% end %>
-</TABLE>
+</tbody></table>
<% end %>
-</DL>
<% end %>
<% if viewlibrary.check_permission("createjob") then