diff options
Diffstat (limited to 'tinydns-view-html.lsp')
-rw-r--r-- | tinydns-view-html.lsp | 51 |
1 files changed, 24 insertions, 27 deletions
diff --git a/tinydns-view-html.lsp b/tinydns-view-html.lsp index d86fce6..24ba38b 100644 --- a/tinydns-view-html.lsp +++ b/tinydns-view-html.lsp @@ -47,12 +47,11 @@ html = require("acf.html") }); </script> -<H1>DNS Entries +<h1>DNS Entries <% if view.filename then io.write(" for "..html.html_escape(string.gsub(view.filename, "^.*/", ""))) end %> -</H1> -<H2>Locations</H2> -<DL id="locations"> -<ul> +</h1> +<h2>Locations</h2> +<ul id="locations"> <% local currentloc = "" for i,loc in ipairs(view.value) do if loc.type == '%' then @@ -60,23 +59,22 @@ for i,loc in ipairs(view.value) do if currentloc ~= "" then %> </ul> <% end %> - <li><IMG SRC='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/places/start-here.png' width='16' height='16' alt> <B><%= html.html_escape(loc[1]) %></B></li> - <ul STYLE='margin-left:30px';> + <li><img src='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/places/start-here.png' width='16' height='16' alt> <b><%= html.html_escape(loc[1]) %></b></li> + <ul style='margin-left:30px';> <% end currentloc = loc[1] %> <li id='filename=<%= html.html_escape(loc.filename) %>;linenumber=<%= html.html_escape(loc.linenumber) %>'> <%= html.html_escape(loc[2]) %><% if loc[2] == "" then io.write('*') end %> - <% if (loc.errtxt) then %><P CLASS='error'><%= string.gsub(html.html_escape(loc.errtxt), "\n", "<BR>") %></P><% end %> + <% if (loc.errtxt) then %><p class='error'><%= string.gsub(html.html_escape(loc.errtxt), "\n", "<br/>") %></p><% end %> </li> <% end end %> + </ul> <% if currentloc == "" then %> - No locations defined + <p>No locations defined</p> <% else %> </ul> <% end %> -</ul> -</DL> <% local function doListIndents(next, indent) @@ -98,7 +96,7 @@ local function doListIndents(next, indent) io.write("</li></ul>\n") end for j=1,starting do - io.write("<ul><li STYLE='margin-left:10px;'><strong>") + io.write("<ul><li style='margin-left:10px;'><strong>") io.write(html.html_escape(table.concat(newentry, ".", #newentry-(i+j-2), #newentry))) io.write("</strong>\n") end @@ -106,36 +104,35 @@ local function doListIndents(next, indent) end %> -<H2>Records</H2> -<DL id="records"> +<h2>Records</h2> <form id="filter-list">Filter: <input name="filter" id="filter" value="" maxlength="30" size="30" type="text"></form> -<ul> +<ul id="records"> <% local indent = {} for j,entry in ipairs(view.value) do if entry.type ~= '%' then indent = doListIndents(entry[1], indent) %> - <ul><li STYLE='margin-left:10px;' id='filename=<%= html.html_escape(entry.filename) %>;linenumber=<%= html.html_escape(entry.linenumber) %>'> - <IMG SRC='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/devices/computer.png' width='16' height='16'><%= html.html_escape(entry.label) %><BR> + <ul><li style='margin-left:10px;' id='filename=<%= html.html_escape(entry.filename) %>;linenumber=<%= html.html_escape(entry.linenumber) %>'> + <img src='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/devices/computer.png' width='16' height='16'><%= html.html_escape(entry.label) %><br/> <pre><%= html.html_escape(entry.configline) %></pre> - <TABLE STYLE='margin-left:<%= html.html_escape(tostring(7-#indent)) %>0px;'> + <table style='margin-left:<%= html.html_escape(tostring(7-#indent)) %>0px;'> <% for k=2,#entry do local option = entry[k] if (option) and option ~= "" then %> - <TR><TD WIDTH='160px' STYLE='border:none;'><%= html.html_escape(view.fieldlabels[entry.type][k]) %>:</TD> - <TD STYLE='border:none;'><%= html.html_escape(option) %></TD></TR> + <tr><td width='160px' style='border:none;'><%= html.html_escape(view.fieldlabels[entry.type][k]) %>:</td> + <td style='border:none;'><%= html.html_escape(option) %></td></tr> <% end end %> - </TABLE> + </table> <% if entry.errtxt then %> - <P CLASS='error'><%= string.gsub(html.html_escape(entry.errtxt), "\n", "<BR>") %></P> + <p class='error'><%= string.gsub(html.html_escape(entry.errtxt), "\n", "<br/>") %></p> <% end %> </li></ul> <% end end if #indent == 0 then %> - No records defined + </ul> + <p>No records defined</p> <% else - doListIndents("", indent) -end %> -</ul> -</DL> + doListIndents("", indent) %> + </ul> +<% end %> |