diff options
Diffstat (limited to 'tinydns-view-html.lsp')
-rw-r--r-- | tinydns-view-html.lsp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tinydns-view-html.lsp b/tinydns-view-html.lsp index 24ba38b..472bae3 100644 --- a/tinydns-view-html.lsp +++ b/tinydns-view-html.lsp @@ -1,4 +1,5 @@ <% local view, viewlibrary, page_info = ... +htmlviewfunctions = require("htmlviewfunctions") html = require("acf.html") %> @@ -47,10 +48,9 @@ html = require("acf.html") }); </script> -<h1>DNS Entries -<% if view.filename then io.write(" for "..html.html_escape(string.gsub(view.filename, "^.*/", ""))) end %> -</h1> -<h2>Locations</h2> +<% if view.filename then view.label = view.label.." for "..string.gsub(view.filename, "^.*/", "") end %> +<% local header_level = htmlviewfunctions.displaysectionstart(view, page_info) %> +<% local header_level2 = htmlviewfunctions.displaysectionstart(cfe({label="Locations"}), page_info, htmlviewfunctions.incrementheader(header_level)) %> <ul id="locations"> <% local currentloc = "" for i,loc in ipairs(view.value) do @@ -75,6 +75,7 @@ end %> <% else %> </ul> <% end %> +<% htmlviewfunctions.displaysectionend(header_level2) %> <% local function doListIndents(next, indent) @@ -104,7 +105,7 @@ local function doListIndents(next, indent) end %> -<h2>Records</h2> +<% htmlviewfunctions.displaysectionstart(cfe({label="Records"}), page_info, header_level2) %> <form id="filter-list">Filter: <input name="filter" id="filter" value="" maxlength="30" size="30" type="text"></form> <ul id="records"> <% local indent = {} @@ -123,9 +124,7 @@ for j,entry in ipairs(view.value) do <% end end %> </table> - <% if entry.errtxt then %> - <p class='error'><%= string.gsub(html.html_escape(entry.errtxt), "\n", "<br/>") %></p> - <% end %> + <% htmlviewfunctions.displayinfo(entry) %> </li></ul> <% end end @@ -136,3 +135,5 @@ if #indent == 0 then %> doListIndents("", indent) %> </ul> <% end %> +<% htmlviewfunctions.displaysectionend(header_level2) %> +<% htmlviewfunctions.displaysectionend(header_level) %> |