From 2e9893a02d83e1b0c93756ae16dd67e91ef5f2c3 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Sat, 28 Jun 2014 20:59:24 +0000 Subject: Cleanup HTML including removing DL/DT/DD, use tablesorter where possible, use lowercase tags, remove styling, and use new htmlviewfunctions functions --- db-viewtable-html.lsp | 70 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 28 deletions(-) (limited to 'db-viewtable-html.lsp') diff --git a/db-viewtable-html.lsp b/db-viewtable-html.lsp index e1531d0..1d64ece 100644 --- a/db-viewtable-html.lsp +++ b/db-viewtable-html.lsp @@ -1,54 +1,68 @@ <% local form, viewlibrary, page_info, session = ... %> -<% require("htmlviewfunctions") %> +<% htmlviewfunctions = require("htmlviewfunctions") %> <% html = require("acf.html") %> + + + + + + <% htmlviewfunctions.displaycommandresults({"deletetableentry", "updatetableentry"}, session) %> <% htmlviewfunctions.displaycommandresults({"createtableentry"}, session, true) %> -

<%= html.html_escape(form.label) %> - <%= html.html_escape(form.value.table.value) %>

-
- - +<% form.label = form.label.." - "..form.value.table.value %> +<% local header_level = htmlviewfunctions.displaysectionstart(form, page_info) %> +
+ <% if viewlibrary.check_permission("deletetableentry") or viewlibrary.check_permission("updatetableentry") then %> - + <% end %> <% for i,f in ipairs(form.value.fields.value) do %> - + <% end %> - - + + +<% local redir = cfe({ type="hidden", value=page_info.orig_action.."?table="..form.value.table.value }) %> +<% local table = cfe({ type="hidden", value=form.value.table.value }) %> +<% local id = cfe({ type="hidden" }) %> <% for i,tableentry in ipairs(form.value.entries.value) do %> - + <% if viewlibrary.check_permission("deletetableentry") or viewlibrary.check_permission("updatetableentry") then %> - + <% end %> <% for i,f in ipairs(form.value.fields.value) do %> - + <% end %> - -<% end %> -
ActionAction<%= html.html_escape(f) %><%= html.html_escape(f) %>
+ <% id.value = tableentry.id %> + <% if viewlibrary.check_permission("updatetableentry") then %> -
- - - -
+ <% htmlviewfunctions.displayitem(cfe({type="link", value={table=table, id=id, redir=redir}, label="", option="Update", action="updatetableentry"}), page_info, -1) %> <% end %> <% if viewlibrary.check_permission("deletetableentry") then %> -
- - -
+ <% htmlviewfunctions.displayitem(cfe({type="form", value={table=table, id=id}, label="", option="Delete", action="deletetableentry", class="deletetableentry"}), page_info, -1) %> <% end %> -
<%= html.html_escape(tableentry[f]) %><%= html.html_escape(tableentry[f]) %>
-<% if form.errtxt then %> -

<%= html.html_escape(form.errtxt) %>

+ <% end %> + +<% htmlviewfunctions.displayinfo(form) %> <% if #form.value.entries.value == 0 then %>

No entries found

<% end %> -
+<% htmlviewfunctions.displaysectionend(header_level) %> <% if page_info.action == "viewtable" and viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createtableentry") then viewlibrary.dispatch_component("createtableentry", {table=form.value.table.value}) -- cgit v1.2.3