summaryrefslogtreecommitdiffstats
path: root/provisioning-searchdevices-html.lsp
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2014-04-23 16:12:07 +0000
committerTed Trask <ttrask01@yahoo.com>2014-04-23 16:12:07 +0000
commitd051bf48fb53481082b12a6778e7c7863f1979ca (patch)
treec36b471fe04729755c3c3bb264f2698a08505384 /provisioning-searchdevices-html.lsp
parent9e6bec69bac4ee45a8355aa5993bbd3f1c71dfcf (diff)
downloadacf-provisioning-d051bf48fb53481082b12a6778e7c7863f1979ca.tar.bz2
acf-provisioning-d051bf48fb53481082b12a6778e7c7863f1979ca.tar.xz
Changes to use new htmlviewfunctions functions
Diffstat (limited to 'provisioning-searchdevices-html.lsp')
-rw-r--r--provisioning-searchdevices-html.lsp25
1 files changed, 11 insertions, 14 deletions
diff --git a/provisioning-searchdevices-html.lsp b/provisioning-searchdevices-html.lsp
index 4732c53..3cecce2 100644
--- a/provisioning-searchdevices-html.lsp
+++ b/provisioning-searchdevices-html.lsp
@@ -1,4 +1,4 @@
-<% local form, viewlibrary, page_info = ...
+<% local form, viewlibrary, page_info, session = ...
htmlviewfunctions = require("htmlviewfunctions")
html = require("acf.html")
%>
@@ -23,28 +23,25 @@ html = require("acf.html")
<% htmlviewfunctions.displaycommandresults({"deletedevice", "editdevice", "editdeviceparams", "overridedeviceparams"}, session) %>
-<% if form.value.values then %>
-<h1>Device</h1>
-<% if form.errtxt then io.write("<p class='error'>" .. string.gsub(html.html_escape(form.errtxt), "\n", "<br/>") .. "</p>\n") end %>
- <div class='item'><p class='left'>Device ID</p>
- <div class='right'>
- <input class="text" type="text" value="<%= html.html_escape(form.value.result.value[1].device_id) %>" readonly="true">
- </div></div><!-- end .item -->
-<h2>Parameter Values</h2>
<%
- session = require("session")
- val = session.serialize("values", form.value.values.value)
+if form.value.values then
+ local header_level = htmlviewfunctions.displaysectionstart(cfe({label="Device"}), page_info)
+ htmlviewfunctions.displayinfo(form)
+ htmlviewfunctions.displayitem(cfe({label="Device ID", readonly=true, value=form.value.result.value[1].device_id}), page_info)
+ local header_level2 = htmlviewfunctions.displaysectionstart(cfe({label="Parameter Values"}), page_info, htmlviewfunctions.incrementheader(header_level))
+ val = require("session").serialize("values", form.value.values.value)
val = string.gsub(val, "[^\n]*%{%}\n", "")
print("<pre>"..val.."</pre>")
+ htmlviewfunctions.displaysectionend(header_level2)
+ htmlviewfunctions.displaysectionend(header_level)
form.value.values = nil
elseif form.value.result then
local func = haserl.loadfile(page_info.viewfile:gsub("searchdevices", "listdevices"))
func(form.value.result, viewlibrary, page_info, session)
+end
%>
-<% end %>
-<h1><%= html.html_escape(form.label) %></h1>
<%
form.value.result = nil
- htmlviewfunctions.displayform(form, nil, nil, page_info, 2)
+ htmlviewfunctions.displayitem(form, page_info)
%>