From e5f62555031d500d50405ba395e330223ac28e9f Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Mon, 3 Feb 2014 21:48:48 +0000 Subject: Cleanup HTML including removing DL/DT/DD, use tablesorter where possible, and use lowercase tags --- provisioning-dumpdatabase-html.lsp | 6 ++--- provisioning-editdevice-html.lsp | 2 +- provisioning-editdeviceparams-html.lsp | 2 +- provisioning-editparam-html.lsp | 12 +++++---- provisioning-edittemplate-html.lsp | 12 ++++----- provisioning-getclassvalues-html.lsp | 12 ++++----- provisioning-listclasses-html.lsp | 38 +++++++++++++-------------- provisioning-listclassgroups-html.lsp | 38 +++++++++++++-------------- provisioning-listdevices-html.lsp | 34 ++++++++++++------------ provisioning-listfiles-html.lsp | 34 ++++++++++++++++++------ provisioning-listgroups-html.lsp | 38 +++++++++++++-------------- provisioning-listparams-html.lsp | 42 ++++++++++++++---------------- provisioning-listrequests-html.lsp | 43 +++++++++++++++--------------- provisioning-listtemplates-html.lsp | 46 ++++++++++++++++----------------- provisioning-searchbyextension-html.lsp | 18 ++++++++----- provisioning-searchbymac-html.lsp | 16 +++++++----- provisioning-searchdevices-html.lsp | 15 ++++++----- 17 files changed, 209 insertions(+), 199 deletions(-) diff --git a/provisioning-dumpdatabase-html.lsp b/provisioning-dumpdatabase-html.lsp index e5f182a..cb7b50b 100644 --- a/provisioning-dumpdatabase-html.lsp +++ b/provisioning-dumpdatabase-html.lsp @@ -4,15 +4,13 @@ html = require("acf.html") %> <% if form.value.data then %> -

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

-
+

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

-
<% end %> -

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

+

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

<% form.value.data = nil htmlviewfunctions.displayform(form, nil, nil, page_info, 2) diff --git a/provisioning-editdevice-html.lsp b/provisioning-editdevice-html.lsp index 653758a..cfb444c 100644 --- a/provisioning-editdevice-html.lsp +++ b/provisioning-editdevice-html.lsp @@ -43,7 +43,7 @@ html = require("acf.html") <% end %> <% end %> -

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

+

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

<% if page_info.action == "editdevice" then form.value.device_id.readonly = "true" diff --git a/provisioning-editdeviceparams-html.lsp b/provisioning-editdeviceparams-html.lsp index ef9a1ce..c3e9038 100644 --- a/provisioning-editdeviceparams-html.lsp +++ b/provisioning-editdeviceparams-html.lsp @@ -51,7 +51,7 @@ end <% end %> <% end %> -

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

+

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

<% form.value.device_id.readonly = "true" if not form.errtxt and form.value.groupdefaultoverride.value then diff --git a/provisioning-editparam-html.lsp b/provisioning-editparam-html.lsp index 574cd31..e86faa2 100644 --- a/provisioning-editparam-html.lsp +++ b/provisioning-editparam-html.lsp @@ -3,14 +3,16 @@ htmlviewfunctions = require("htmlviewfunctions") html = require("acf.html") %> -

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

+

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

<% htmlviewfunctions.displayform(form, nil, nil, page_info, 2) %> -

Options

-
-
+

Options

+

+
+ -
+ + diff --git a/provisioning-edittemplate-html.lsp b/provisioning-edittemplate-html.lsp index d7f44e7..9415968 100644 --- a/provisioning-edittemplate-html.lsp +++ b/provisioning-edittemplate-html.lsp @@ -2,8 +2,8 @@ <% htmlviewfunctions = require("htmlviewfunctions") %> <% html = require("acf.html") %> -

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

-

Template Details

+

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

+

Template Details

<% form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action %> <% htmlviewfunctions.displayformstart(form) %> <% @@ -14,14 +14,12 @@ htmlviewfunctions.displayformitem(form.value.filename, "filename") htmlviewfunctions.displayformitem(form.value.label, "label") htmlviewfunctions.displayformitem(form.value.seq, "seq") %> - -

File Content

-
+

File Content

-<% if form.value.filecontent.errtxt then %>

<%= string.gsub(html.html_escape(form.value.filecontent.errtxt), "\n", "
") %>

<% end %> -<% if form.value.filecontent.descr then %>

<%= string.gsub(html.html_escape(form.value.filecontent.descr), "\n", "
") %>

<% end %> +<% if form.value.filecontent.errtxt then %>

<%= string.gsub(html.html_escape(form.value.filecontent.errtxt), "\n", "
") %>

<% end %> +<% if form.value.filecontent.descr then %>

<%= string.gsub(html.html_escape(form.value.filecontent.descr), "\n", "
") %>

<% end %> <% htmlviewfunctions.displayformend(form) %> diff --git a/provisioning-getclassvalues-html.lsp b/provisioning-getclassvalues-html.lsp index cf39cfa..616137e 100644 --- a/provisioning-getclassvalues-html.lsp +++ b/provisioning-getclassvalues-html.lsp @@ -4,23 +4,21 @@ html = require("acf.html") %> <% if form.value.values then %> -

Class

-
-<% if form.errtxt then io.write("

" .. string.gsub(html.html_escape(form.errtxt), "\n", "
") .. "

\n") end %> +

Class

+<% if form.errtxt then io.write("

" .. string.gsub(html.html_escape(form.errtxt), "\n", "
") .. "

\n") end %> <% htmlviewfunctions.displayitem(form.value.class_id) %> <% htmlviewfunctions.displayitem(form.value.label) %> -

Parameter Values

+

Parameter Values

<% session = require("session") val = session.serialize("values", form.value.values.value) val = string.gsub(val, "[^\n]*%{%}\n", "") print("
"..val.."
") form.value.values = nil +end %> -
-<% end %> -

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

+

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

<% form.value.values = nil form.value.label = nil diff --git a/provisioning-listclasses-html.lsp b/provisioning-listclasses-html.lsp index e1b9538..59933d3 100644 --- a/provisioning-listclasses-html.lsp +++ b/provisioning-listclasses-html.lsp @@ -25,7 +25,7 @@ html = require("acf.html") end %> $(document).ready(function() { - $("#list").tablesorter({headers: {0:{sorter: false}}}); + $("#list").tablesorter({headers: {0:{sorter: false}}, widgets: ['zebra']}); $(".deleteclass").click(function(){ return confirm("Are you sure you want to delete this class?")}); }); @@ -34,18 +34,17 @@ html = require("acf.html") <% htmlviewfunctions.displaycommandresults({"createclass"}, session, true) %>

Classes

-
- - - - - - - - +
ActionClass GroupLabelSequence
+ + + + + + + <% for k,v in ipairs( view.value ) do %> - - + - - - - + + + + + <% end %> - -
ActionClass GroupLabelSequence
+
<% if viewlibrary.check_permission("deleteclass") then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deleteclass?submit=true&class_id="..v.class_id, label="Delete ", class="deleteclass"} %> <% end %> @@ -55,14 +54,14 @@ html = require("acf.html") <% if viewlibrary.check_permission("getclassvalues") then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/getclassvalues?submit=true&class_id="..v.class_id, label="View "} %> <% end %> - <%= html.html_escape(v.group) %><%= html.html_escape(v.label) %><%= html.html_escape(v.seq) %>
<%= html.html_escape(v.group) %><%= html.html_escape(v.label) %><%= html.html_escape(v.seq) %>
+ + <% if view.errtxt then %>

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

@@ -74,4 +73,3 @@ html = require("acf.html") <% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createclass") then viewlibrary.dispatch_component("createclass") end %> -
diff --git a/provisioning-listclassgroups-html.lsp b/provisioning-listclassgroups-html.lsp index 4ec7605..8a23ad4 100644 --- a/provisioning-listclassgroups-html.lsp +++ b/provisioning-listclassgroups-html.lsp @@ -17,7 +17,7 @@ html = require("acf.html") @@ -26,32 +26,31 @@ html = require("acf.html") <% htmlviewfunctions.displaycommandresults({"createclassgroup"}, session, true) %>

Class Groups

-
- - - - - - - - +
ActionNameLabelSequence
+ + + + + + + <% for k,v in ipairs( view.value ) do %> - - + - - - - + + + + + <% end %> - -
ActionNameLabelSequence
+
<% if viewlibrary.check_permission("deleteclassgroup") then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deleteclassgroup?submit=true&class_group_id="..v.class_group_id, label="Delete ", class="deletegroup"} %> <% end %> <% if viewlibrary.check_permission("editclassgroup") then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editclassgroup?class_group_id="..v.class_group_id.."&redir="..page_info.orig_action, label="Edit "} %> <% end %> - <%= html.html_escape(v.name) %><%= html.html_escape(v.label) %><%= html.html_escape(v.seq) %>
<%= html.html_escape(v.name) %><%= html.html_escape(v.label) %><%= html.html_escape(v.seq) %>
+ + <% if view.errtxt then %>

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

@@ -63,4 +62,3 @@ html = require("acf.html") <% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createclassgroup") then viewlibrary.dispatch_component("createclassgroup") end %> -
diff --git a/provisioning-listdevices-html.lsp b/provisioning-listdevices-html.lsp index 6bad516..84206aa 100644 --- a/provisioning-listdevices-html.lsp +++ b/provisioning-listdevices-html.lsp @@ -28,7 +28,7 @@ html = require("acf.html") %> $(document).ready(function() { - $("#list").tablesorter({headers: {0:{sorter: false}}}); + $("#list").tablesorter({headers: {0:{sorter: false}}, widgets: ['zebra']}); $(".deletedevice").click(function(){ return confirm("Are you sure you want to delete this device?")}); }); @@ -53,19 +53,18 @@ table.sort(display) %>

Devices

-
- - - - +
ActionDevice ID
+ + + <% for i,n in ipairs(display) do %> - - + + <% for k,v in ipairs( view.value ) do %> - - + - + + <% for i,n in ipairs(display) do %> - + <% end %> - + <% end %> - -
ActionDevice ID<%= string.gsub(n, "^.", string.upper) %> + <%= string.gsub(n, "^.", string.upper) %> <% end %> -
+
<% if viewlibrary.check_permission("deletedevice") then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deletedevice?submit=true&device_id="..v.device_id, label="Delete ", class="deletedevice"} %> <% end %> @@ -80,15 +79,15 @@ table.sort(display) <% if viewlibrary.check_permission("getdevicevalues") then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/getdevicevalues?submit=true&id=device_id&value="..v.device_id.."&viewtype=templated", label="View "} %> <% end %> - <%= html.html_escape(v.device_id) %><%= html.html_escape(v.device_id) %><%= html.html_escape(v[n]) %><%= html.html_escape(v[n]) %>
+ + <% if view.errtxt then %>

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

@@ -96,7 +95,6 @@ table.sort(display) <% if #view.value == 0 then %>

No devices found

<% end %> -
<% if page_info.action == "listdevices" and viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createdevice") then viewlibrary.dispatch_component("createdevice") diff --git a/provisioning-listfiles-html.lsp b/provisioning-listfiles-html.lsp index e94b207..cc9e02a 100644 --- a/provisioning-listfiles-html.lsp +++ b/provisioning-listfiles-html.lsp @@ -3,19 +3,37 @@ htmlviewfunctions = require("htmlviewfunctions") html = require("acf.html") %> + + + + + + <% htmlviewfunctions.displaycommandresults({"editfile"}, session) %>

Provisioning Script Files

-
- - - - - - +
FileSizeLast Modified
+ + + + + + <% for k,v in ipairs( view.value ) do io.write( "\n" ) end %> -
FileSizeLast Modified
" .. html.html_escape(v.filename) .. "" .. html.html_escape(v.size) .."" .. html.html_escape(v.mtime) .."
+ diff --git a/provisioning-listgroups-html.lsp b/provisioning-listgroups-html.lsp index 3154df6..9d8268b 100644 --- a/provisioning-listgroups-html.lsp +++ b/provisioning-listgroups-html.lsp @@ -17,7 +17,7 @@ html = require("acf.html") @@ -26,32 +26,31 @@ html = require("acf.html") <% htmlviewfunctions.displaycommandresults({"creategroup"}, session, true) %>

Groups

-
- - - - - - - - +
ActionNameLabelSequence
+ + + + + + + <% for k,v in ipairs( view.value ) do %> - - + - - - - + + + + + <% end %> - -
ActionNameLabelSequence
+
<% if viewlibrary.check_permission("deletegroup") then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deletegroup?submit=true&group_id="..v.group_id, label="Delete ", class="deletegroup"} %> <% end %> <% if viewlibrary.check_permission("editgroup") then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editgroup?group_id="..v.group_id.."&redir="..page_info.orig_action, label="Edit "} %> <% end %> - <%= html.html_escape(v.name) %><%= html.html_escape(v.label) %><%= html.html_escape(v.seq) %>
<%= html.html_escape(v.name) %><%= html.html_escape(v.label) %><%= html.html_escape(v.seq) %>
+ + <% if view.errtxt then %>

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

@@ -63,4 +62,3 @@ html = require("acf.html") <% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("creategroup") then viewlibrary.dispatch_component("creategroup") end %> -
diff --git a/provisioning-listparams-html.lsp b/provisioning-listparams-html.lsp index e8f2f94..3b0e255 100644 --- a/provisioning-listparams-html.lsp +++ b/provisioning-listparams-html.lsp @@ -17,7 +17,7 @@ html = require("acf.html") @@ -26,34 +26,33 @@ html = require("acf.html") <% htmlviewfunctions.displaycommandresults({"createparam"}, session, true) %>

Parameters

-
- - - - - - - - - +
ActionNameLabelDefaultSequence
+ + + + + + + + <% for k,v in ipairs( view.value ) do %> - - + - - - - - + + + + + + <% end %> - -
ActionNameLabelDefaultSequence
+
<% if viewlibrary.check_permission("deleteparam") then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deleteparam?submit=true¶m_id="..v.param_id, label="Delete ", class="deleteparam"} %> <% end %> <% if viewlibrary.check_permission("editparam") then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editparam?param_id="..v.param_id.."&redir="..page_info.orig_action, label="Edit "} %> <% end %> - <%= html.html_escape(v.name) %><%= html.html_escape(v.label) %><%= html.html_escape(v.value) %><%= html.html_escape(v.seq) %>
<%= html.html_escape(v.name) %><%= html.html_escape(v.label) %><%= html.html_escape(v.value) %><%= html.html_escape(v.seq) %>
+ + <% if view.errtxt then %>

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

@@ -65,4 +64,3 @@ html = require("acf.html") <% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createparam") then viewlibrary.dispatch_component("createparam") end %> -
diff --git a/provisioning-listrequests-html.lsp b/provisioning-listrequests-html.lsp index d4e24ff..a53e24f 100644 --- a/provisioning-listrequests-html.lsp +++ b/provisioning-listrequests-html.lsp @@ -41,7 +41,7 @@ html = require("acf.html") %> $(document).ready(function() { - $("#list").tablesorter({headers: {1:{sorter:'digit'}, 3:{sorter:'ipAddress'}}}); + $("#list").tablesorter({headers: {1:{sorter:'digit'}, 3:{sorter:'ipAddress'}}, widgets: ['zebra']}); $(".deleterequest").click(function(){ return confirm("Are you sure you want to delete this request?")}); }); @@ -49,19 +49,18 @@ html = require("acf.html") <% htmlviewfunctions.displaycommandresults({"deleterequest", "editdevice"}, session) %>

Requests

-
- - - - - - - - - +
ActionTimestampMAC AddressIP AddressUser Agent
+ + + + + + + + <% for k,v in ipairs( view.value ) do %> - - + - + - - - - + + + + + <% end %> - -
ActionTimestampMAC AddressIP AddressUser Agent
+
<% if viewlibrary.check_permission("deleterequest") then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deleterequest?submit=true&mac="..v.mac, label="Delete ", class="deleterequest"} %> <% end %> @@ -74,8 +73,8 @@ html = require("acf.html") <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/createdevicefromrequest?submit=true&mac="..v.mac, label="Create "} %> <% end %> <% end %> - + <% local date = {} date.year, date.month, date.day, date.hour, date.min, date.sec, remainder = string.match(v.date, "(%d+)%-(%d+)%-(%d+) (%d+):(%d+):(%d+)") @@ -83,11 +82,11 @@ html = require("acf.html") io.write((os.time(date) - 1318000000)..(rem or "")) %> <%= html.html_escape(v.date) %> - <%= html.html_escape(v.mac) %><%= html.html_escape(v.ip) %><%= html.html_escape(v.agent) %>
<%= html.html_escape(v.mac) %><%= html.html_escape(v.ip) %><%= html.html_escape(v.agent) %>
+ + diff --git a/provisioning-listtemplates-html.lsp b/provisioning-listtemplates-html.lsp index 4adc23f..ee67b17 100644 --- a/provisioning-listtemplates-html.lsp +++ b/provisioning-listtemplates-html.lsp @@ -17,7 +17,7 @@ html = require("acf.html") @@ -26,20 +26,19 @@ html = require("acf.html") <% htmlviewfunctions.displaycommandresults({"createtemplate"}, session, true) %>

Templates

-
- - - - - - - - - - +
ActionFile NameLabelSequenceFile SizeLast Modified
+ + + + + + + + + <% for k,v in ipairs( view.value ) do %> - - + - - - - - - + + + + + + + <% end %> - -
ActionFile NameLabelSequenceFile SizeLast Modified
+
<% if viewlibrary.check_permission("deletetemplate") and v.label then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deletetemplate?submit=true&filename="..v.filename, label="Delete ", class="deletetemplate"} %> <% end %> @@ -49,16 +48,16 @@ html = require("acf.html") <% if viewlibrary.check_permission("createtemplate") and not v.label then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/createtemplate?filename="..v.filename.."&redir="..page_info.orig_action, label="Create "} %> <% end %> - <%= html.html_escape(v.filename) %><%= html.html_escape(v.label) %><%= html.html_escape(v.seq) %><%= html.html_escape(v.filesize) %><%= html.html_escape(v.mtime) %>
<%= html.html_escape(v.filename) %><%= html.html_escape(v.label) %><%= html.html_escape(v.seq) %><%= html.html_escape(v.filesize) %><%= html.html_escape(v.mtime) %>
+ + <% if view.errtxt then %>

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

@@ -70,4 +69,3 @@ html = require("acf.html") <% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createtemplate") then viewlibrary.dispatch_component("createtemplate") end %> -
diff --git a/provisioning-searchbyextension-html.lsp b/provisioning-searchbyextension-html.lsp index 5ab9228..d8dda52 100644 --- a/provisioning-searchbyextension-html.lsp +++ b/provisioning-searchbyextension-html.lsp @@ -36,12 +36,16 @@ if session.searchdevicesresult then end %> -

Search by Extension

-
-
+

Search by Extension

+ -
Extension
-
-
-
+

Extension

+
+ +
+

+
+ +
+ diff --git a/provisioning-searchbymac-html.lsp b/provisioning-searchbymac-html.lsp index 6e6c1cc..ce50f47 100644 --- a/provisioning-searchbymac-html.lsp +++ b/provisioning-searchbymac-html.lsp @@ -36,11 +36,15 @@ end %>

Search by MAC Address

-
-
+ -
MAC Address
-
-
-
+

MAC Address

+
+ +
+

+
+ +
+ diff --git a/provisioning-searchdevices-html.lsp b/provisioning-searchdevices-html.lsp index f5cd09f..4732c53 100644 --- a/provisioning-searchdevices-html.lsp +++ b/provisioning-searchdevices-html.lsp @@ -24,11 +24,13 @@ html = require("acf.html") <% htmlviewfunctions.displaycommandresults({"deletedevice", "editdevice", "editdeviceparams", "overridedeviceparams"}, session) %> <% if form.value.values then %> -

Device

-
-<% if form.errtxt then io.write("

" .. string.gsub(html.html_escape(form.errtxt), "\n", "
") .. "

\n") end %> -
Device ID
-

Parameter Values

+

Device

+<% if form.errtxt then io.write("

" .. string.gsub(html.html_escape(form.errtxt), "\n", "
") .. "

\n") end %> +

Device ID

+
+ +
+

Parameter Values

<% session = require("session") val = session.serialize("values", form.value.values.value) @@ -39,10 +41,9 @@ elseif form.value.result then local func = haserl.loadfile(page_info.viewfile:gsub("searchdevices", "listdevices")) func(form.value.result, viewlibrary, page_info, session) %> -
<% end %> -

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

+

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

<% form.value.result = nil htmlviewfunctions.displayform(form, nil, nil, page_info, 2) -- cgit v1.2.3