Commit 67efc1ef authored by Ted Trask's avatar Ted Trask

Changes to use new htmlviewfunctions functions

parent c35e16d5
......@@ -6,8 +6,4 @@ htmlviewfunctions = require("htmlviewfunctions")
viewlibrary.dispatch_component("status")
end %>
<h1>Config</h1>
<%
form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action
htmlviewfunctions.displayform(form)
%>
<% htmlviewfunctions.displayitem(form, page_info) %>
......@@ -24,26 +24,37 @@ html = require("acf.html")
<% htmlviewfunctions.displaycommandresults({"editdomain", "deletedomain"}, session) %>
<% htmlviewfunctions.displaycommandresults({"createdomain"}, session, true) %>
<h1>Configuration</h1>
<h2>Edit/View DNS server entries</h2>
<%
local header_level = htmlviewfunctions.displaysectionstart(cfe({label="Configuration"}), page_info)
local header_level2 = htmlviewfunctions.displaysectionstart(cfe({label="Edit/View DNS server entries"}), page_info, htmlviewfunctions.incrementheader(header_level))
%>
<table id="list" class="tablesorter"><thead>
<tr>
<th>Action</th>
<th>Domain</th>
</tr>
</thead><tbody>
<% for i,domain in ipairs(data.value) do %>
<% local domain = cfe({ type="hidden", value="" }) %>
<% local redir = cfe({ type="hidden", value=page_info.orig_action }) %>
<% for i,d in ipairs(data.value) do %>
<tr>
<td>
<% io.write(html.link{value = "editdomain?domain=" .. domain.."&redir="..page_info.orig_action, label="Edit " }) %>
<% if domain ~= "@" then
io.write(html.link{value = "deletedomain?submit=true&domain=" .. domain, label="Delete " })
end %>
<%
domain.value = d
htmlviewfunctions.displayitem(cfe({type="link", value={domain=domain, redir=redir}, label="", option="Edit", action="editdomain"}), page_info, -1)
if d ~= "@" then
htmlviewfunctions.displayitem(cfe({type="form", value={domain=domain}, label="", option="Delete", action="deletedomain"}), page_info, -1)
end
%>
</td>
<td><%= html.html_escape(domain) %></td>
<td><%= html.html_escape(d) %></td>
</tr>
<% end %>
</tbody></table>
<%
htmlviewfunctions.displaysectionend(header_level2)
htmlviewfunctions.displaysectionend(header_level)
%>
<% if viewlibrary and viewlibrary.dispatch_component then
viewlibrary.dispatch_component("createdomain")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment