diff options
Diffstat (limited to 'tinydns-view-html.lsp')
-rw-r--r-- | tinydns-view-html.lsp | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/tinydns-view-html.lsp b/tinydns-view-html.lsp index 354b199..e851569 100644 --- a/tinydns-view-html.lsp +++ b/tinydns-view-html.lsp @@ -1,6 +1,6 @@ -<? local view, viewlibrary = ... +<% local view, viewlibrary = ... require("viewfunctions") -?> +%> <script type="text/javascript" src="/js/jquery-latest.js"></script> <script type="text/javascript"> @@ -42,46 +42,46 @@ require("viewfunctions") }); </script> -<? +<% --[[ DEBUG INFORMATION io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>") io.write(html.cfe_unpack(view)) io.write("</span>") --]] -?> +%> <H1>DNS Entries -<? if view.filename then io.write(" for "..view.filename) end ?> +<% if view.filename then io.write(" for "..view.filename) end %> </H1> <H2>Locations</H2> <DL id="locations"> <ul> -<? local currentloc = "" +<% local currentloc = "" for i,loc in ipairs(view.value) do if loc.type == '%' then if currentloc ~= loc[1] then - if currentloc ~= "" then ?> + if currentloc ~= "" then %> </ul> - <? end ?> - <li><IMG SRC='/skins/static/tango/16x16/places/start-here.png' width='16' height='16' alt> <B><?= loc[1] ?></B></li> + <% end %> + <li><IMG SRC='/skins/static/tango/16x16/places/start-here.png' width='16' height='16' alt> <B><%= loc[1] %></B></li> <ul STYLE='margin-left:30px';> - <? end - currentloc = loc[1] ?> - <li id='filename=<?= loc.filename ?>;linenumber=<?= loc.linenumber ?>'> - <?= loc[2] ?><? if loc[2] == "" then io.write('*') end ?> - <? if (loc.errtxt) then ?><P CLASS='error'><?= string.gsub(loc.errtxt, "\n", "<BR>") ?></P><? end ?> + <% end + currentloc = loc[1] %> + <li id='filename=<%= loc.filename %>;linenumber=<%= loc.linenumber %>'> + <%= loc[2] %><% if loc[2] == "" then io.write('*') end %> + <% if (loc.errtxt) then %><P CLASS='error'><%= string.gsub(loc.errtxt, "\n", "<BR>") %></P><% end %> </li> - <? end -end ?> -<? if currentloc == "" then ?> + <% end +end %> +<% if currentloc == "" then %> No locations defined -<? else ?> +<% else %> </ul> -<? end ?> +<% end %> </ul> </DL> -<? +<% local function doListIndents(next, indent) local newentry = {} for mt in string.gmatch(next, "([^.]+)") do @@ -107,38 +107,38 @@ local function doListIndents(next, indent) end return revnewentry end -?> +%> <H2>Records</H2> <form id="filter-list">Filter: <input name="filter" id="filter" value="" maxlength="30" size="30" type="text"></form> <DL id="records"> <ul> -<? local indent = {} +<% 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=<?= entry.filename ?>;linenumber=<?= entry.linenumber ?>'> - <IMG SRC='/skins/static/tango/16x16/devices/computer.png' width='16' height='16'><?= entry.label ?><BR> - <pre><?= entry.configline ?></pre> - <TABLE STYLE='margin-left:<?= tostring(7-#indent) ?>0px;'> - <? for k=2,#entry do + indent = doListIndents(entry[1], indent) %> + <ul><li STYLE='margin-left:10px;' id='filename=<%= entry.filename %>;linenumber=<%= entry.linenumber %>'> + <IMG SRC='/skins/static/tango/16x16/devices/computer.png' width='16' height='16'><%= entry.label %><BR> + <pre><%= entry.configline %></pre> + <TABLE STYLE='margin-left:<%= 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;'><?= view.fieldlabels[entry.type][k] ?>:</TD> - <TD STYLE='border:none;'><?= option ?></TD></TR> - <? end - end ?> + if (option) and option ~= "" then %> + <TR><TD WIDTH='160px' STYLE='border:none;'><%= view.fieldlabels[entry.type][k] %>:</TD> + <TD STYLE='border:none;'><%= option %></TD></TR> + <% end + end %> </TABLE> - <? if entry.errtxt then ?> - <P CLASS='error'><?= string.gsub(entry.errtxt, "\n", "<BR>") ?></P> - <? end ?> + <% if entry.errtxt then %> + <P CLASS='error'><%= string.gsub(entry.errtxt, "\n", "<BR>") %></P> + <% end %> </li></ul> - <? end + <% end end -if #indent == 0 then ?> +if #indent == 0 then %> No records defined -<? else +<% else doListIndents("", indent) -end ?> +end %> </ul> </DL> |