From 67efc1efa4a98a1f5d5e14fcbb716b9d4e2d8129 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 10 Apr 2014 06:13:46 +0000 Subject: [PATCH] Changes to use new htmlviewfunctions functions --- dnscache-config-html.lsp | 6 +----- dnscache-listdomains-html.lsp | 27 +++++++++++++++++++-------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/dnscache-config-html.lsp b/dnscache-config-html.lsp index c53da25..2fdd23b 100644 --- a/dnscache-config-html.lsp +++ b/dnscache-config-html.lsp @@ -6,8 +6,4 @@ htmlviewfunctions = require("htmlviewfunctions") viewlibrary.dispatch_component("status") end %> -

Config

-<% - form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action - htmlviewfunctions.displayform(form) -%> +<% htmlviewfunctions.displayitem(form, page_info) %> diff --git a/dnscache-listdomains-html.lsp b/dnscache-listdomains-html.lsp index 9f41a9c..8318904 100644 --- a/dnscache-listdomains-html.lsp +++ b/dnscache-listdomains-html.lsp @@ -24,26 +24,37 @@ html = require("acf.html") <% htmlviewfunctions.displaycommandresults({"editdomain", "deletedomain"}, session) %> <% htmlviewfunctions.displaycommandresults({"createdomain"}, session, true) %> -

Configuration

-

Edit/View DNS server entries

+<% +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)) +%> -<% 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 %> - + <% end %>
Action Domain
- <% 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 + %> <%= html.html_escape(domain) %><%= html.html_escape(d) %>
+<% +htmlviewfunctions.displaysectionend(header_level2) +htmlviewfunctions.displaysectionend(header_level) +%> <% if viewlibrary and viewlibrary.dispatch_component then viewlibrary.dispatch_component("createdomain") -- GitLab