summaryrefslogtreecommitdiffstats
path: root/db-listdatabases-html.lsp
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2014-06-28 20:59:24 +0000
committerTed Trask <ttrask01@yahoo.com>2014-06-28 20:59:24 +0000
commit2e9893a02d83e1b0c93756ae16dd67e91ef5f2c3 (patch)
treeb923ebb184e01971e87e8aef4ee5fb81447751ea /db-listdatabases-html.lsp
parent57f6d90ad110cff20b54506105a36241f69b25b9 (diff)
downloadacf-db-2e9893a02d83e1b0c93756ae16dd67e91ef5f2c3.tar.bz2
acf-db-2e9893a02d83e1b0c93756ae16dd67e91ef5f2c3.tar.xz
Cleanup HTML including removing DL/DT/DD, use tablesorter where possible, use lowercase tags, remove styling, and use new htmlviewfunctions functions
Diffstat (limited to 'db-listdatabases-html.lsp')
-rw-r--r--db-listdatabases-html.lsp59
1 files changed, 45 insertions, 14 deletions
diff --git a/db-listdatabases-html.lsp b/db-listdatabases-html.lsp
index 4fd9362..b4c6694 100644
--- a/db-listdatabases-html.lsp
+++ b/db-listdatabases-html.lsp
@@ -1,19 +1,50 @@
<% local form, viewlibrary, page_info, session = ... %>
-<% require("htmlviewfunctions") %>
+<% htmlviewfunctions = require("htmlviewfunctions") %>
<% html = require("acf.html") %>
-<H1><%= html.html_escape(form.label) %></H1>
-<DL>
-<% if form.errtxt then %><P CLASS='error'><%= string.gsub(html.html_escape(form.errtxt), "\n", "<BR>") %></P><% end %>
-<% for i,database in ipairs(form.value) do %>
- <li>
- <% if viewlibrary.check_permission("listtables") then %>
- <%= html.link{value = "listtables?database=" .. database, label=database} %>
- <% else %>
- <%= html.html_escape(database) %>
- <% end %>
+<% if #form.value>0 then %>
+<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() {
+ $("#listdatabases").tablesorter({headers: {0:{sorter: false}}, widgets: ['zebra']});
+ });
+</script>
+<% end %>
+
+<% local header_level = htmlviewfunctions.displaysectionstart(form, page_info) %>
+<% htmlviewfunctions.displayinfo(form) %>
+<% if #form.value>0 then %>
+<table id="listdatabases" class="tablesorter"><thead>
+ <tr>
+ <th>Action</th>
+ <th>Database</th>
+ </tr>
+</thead><tbody>
+<% local database = cfe({ type="hidden" }) %>
+<% for i,dbase in ipairs(form.value) do %>
+ <% database.value = dbase %>
+ <tr>
+ <td>
+ <% if viewlibrary.check_permission("listtables") then %>
+ <% htmlviewfunctions.displayitem(cfe({type="link", value={database=database}, label="", option="View", action="listtables"}), page_info, -1) %>
+ <% end %>
+ </td>
+ <td><%= html.html_escape(dbase) %></td>
+ </tr>
<% end %>
-<% if #form.value == 0 then %>
-No databases found
+</tbody></table>
+<% else %>
+<p>No databases found</p>
<% end %>
-</DL>
+<% htmlviewfunctions.displaysectionend(header_level) %>