From faf2cc54f95987f740a60d1576017f528b15b942 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Mon, 3 Feb 2014 21:58:17 +0000 Subject: Cleanup HTML including removing DL/DT/DD, use tablesorter where possible, and use lowercase tags --- tinydns-edit-html.lsp | 30 +++++++++++----------- tinydns-listfiles-html.lsp | 54 ++++++++++++++++++++++++++-------------- tinydns-listpermissions-html.lsp | 51 ++++++++++++++++++++++++++----------- tinydns-status-html.lsp | 20 ++++++++------- tinydns-view-html.lsp | 51 ++++++++++++++++++------------------- 5 files changed, 121 insertions(+), 85 deletions(-) diff --git a/tinydns-edit-html.lsp b/tinydns-edit-html.lsp index d251638..2dcfc81 100644 --- a/tinydns-edit-html.lsp +++ b/tinydns-edit-html.lsp @@ -121,7 +121,7 @@ name = "testme"; } - form = form + '
' + entryType.descriptions[i] + '
' + extra + '
'; + form = form + '

' + entryType.descriptions[i] + '

\n
\n' + extra + '\n
'; } form = form + "\n"; entry.empty().append(form); @@ -192,32 +192,30 @@ }); -

Configuration

-

Expert Configuration

-

File Details

-
+

Configuration

+

Expert Configuration

+

File Details

<% htmlviewfunctions.displayitem(form.value.filename) htmlviewfunctions.displayitem(form.value.filesize) htmlviewfunctions.displayitem(form.value.mtime) %> -
-

File Entries

-<% if form.descr then %>

<%= string.gsub(html.html_escape(form.descr), "\n", "
") %>

<% end %> -<% if form.errtxt then %>

<%= string.gsub(html.html_escape(form.errtxt), "\n", "
") %>

<% end %> - +

File Entries

+<% if form.descr then %>

<%= string.gsub(html.html_escape(form.descr), "\n", "
") %>

<% end %> +<% if form.errtxt then %>

<%= string.gsub(html.html_escape(form.errtxt), "\n", "
") %>

<% end %> +
<% for line in string.gmatch(html.html_escape(form.value.filecontent.value), "([^\n]*)\n?") do %> - - - + + + <% end %> -
<%= line %>
<%= line %>
-<% if form.value.filecontent.errtxt then %>

<%= string.gsub(html.html_escape(form.value.filecontent.errtxt), "\n", "
") %>

<% end %> + +<% if form.value.filecontent.errtxt then %>

<%= string.gsub(html.html_escape(form.value.filecontent.errtxt), "\n", "
") %>

<% end %> <% form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action %> <% htmlviewfunctions.displayformstart(form) %> -

Save and Apply Above Settings

+

Save and Apply Above Settings

<% htmlviewfunctions.displayformend(form) %> diff --git a/tinydns-listfiles-html.lsp b/tinydns-listfiles-html.lsp index 470693f..33c7860 100644 --- a/tinydns-listfiles-html.lsp +++ b/tinydns-listfiles-html.lsp @@ -3,42 +3,60 @@ htmlviewfunctions = require("htmlviewfunctions") html = require("acf.html") %> + + + + + + <% htmlviewfunctions.displaycommandresults({"delete", "edit", "editfile"}, session) %> <% htmlviewfunctions.displaycommandresults({"newfile", "startstop"}, session, true) %>

Configuration

-

Edit/View existing Domains

-
- - - - - - +

Edit/View Existing Domains

+
ActionSizeLast ModifiedFile
+ + + + + + + <% for i,file in ipairs(form.value) do %> - - + - - - - + + + + + <% end %> -
ActionSizeLast ModifiedFile
+
<% if viewlibrary.check_permission("delete") then io.write(html.link{value = "delete?submit=true&filename=" .. file.value.filename.value, label="Delete " }) end io.write(html.link{value = "view?filename=" .. file.value.filename.value, label="View " }) if viewlibrary.check_permission("edit") then io.write(html.link{value = "edit?filename=" .. file.value.filename.value.."&redir="..page_info.orig_action, label="Edit " }) end if viewlibrary.check_permission("editfile") then io.write(html.link{value = "editfile?filename=" .. file.value.filename.value.."&redir="..page_info.orig_action, label="Expert " }) end %> - <%= html.html_escape(file.value.filesize.value) %><%= html.html_escape(file.value.mtime.value) %><%= html.html_escape(string.gsub(file.value.filename.value, "^.*/", "")) %>
<%= html.html_escape(file.value.filesize.value) %><%= html.html_escape(file.value.mtime.value) %><%= html.html_escape(string.gsub(file.value.filename.value, "^.*/", "")) %>
+ <% if #form.value == 0 then %> No domains defined <% end %> -
<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("newfile") then local newfileform = viewlibrary.dispatch_component("newfile", nil, true) %> -

Create new Domain

+

Create New Domain

<% newfileform.action = page_info.script .. page_info.prefix .. page_info.controller .. "/newfile" htmlviewfunctions.displayform(newfileform) diff --git a/tinydns-listpermissions-html.lsp b/tinydns-listpermissions-html.lsp index f0f4379..0662aba 100644 --- a/tinydns-listpermissions-html.lsp +++ b/tinydns-listpermissions-html.lsp @@ -2,30 +2,51 @@ <% htmlviewfunctions = require("htmlviewfunctions") %> <% html = require("acf.html") %> + + + + + + <% htmlviewfunctions.displaycommandresults({"edituserpermissions", "editrolepermissions"}, session) %> -

<%= html.html_escape(view.label) %>

+

<%= html.html_escape(view.label) %>

-

User Permissions

-
- +

User Permissions

+
UserPermissions
+ + <% for i,user in ipairs(view.value.user) do %> - + <% end %> -
UserPermissions
<%= html.link{value=page_info.script .. page_info.prefix .. page_info.controller .. "/edituserpermissions?userid=" .. user.id .. "&redir="..page_info.orig_action, label=user.id} %> +
<%= html.link{value=page_info.script .. page_info.prefix .. page_info.controller .. "/edituserpermissions?userid=" .. user.id .. "&redir="..page_info.orig_action, label=user.id} %> <% for y,allowed in pairs(user.allowed) do - print(html.html_escape(allowed), "
") + print(html.html_escape(allowed), "
") end %> -
+ -

Role Permissions

-
- +

Role Permissions

+
RolePermissions
+ + <% for i,role in ipairs(view.value.role) do %> - + <% end %> -
RolePermissions
<%= html.link{value=page_info.script .. page_info.prefix .. page_info.controller .. "/editrolepermissions?role=" .. role.id .. "&redir="..page_info.orig_action, label=role.id} %> +
<%= html.link{value=page_info.script .. page_info.prefix .. page_info.controller .. "/editrolepermissions?role=" .. role.id .. "&redir="..page_info.orig_action, label=role.id} %> <% for y,allowed in pairs(role.allowed) do - print(html.html_escape(allowed), "
") + print(html.html_escape(allowed), "
") end %> -
+ diff --git a/tinydns-status-html.lsp b/tinydns-status-html.lsp index bdceb23..77050d8 100644 --- a/tinydns-status-html.lsp +++ b/tinydns-status-html.lsp @@ -6,36 +6,38 @@ html = require("acf.html") <% htmlviewfunctions.displaycommandresults({"install","edit"}, session) %> <% htmlviewfunctions.displaycommandresults({"startstop"}, session) %> -

System Info

-
+

System Info

<% htmlviewfunctions.displayitem(data.value.status) htmlviewfunctions.displayitem(data.value.version) if data.value.version and data.value.version.errtxt and viewlibrary.check_permission("apk-tools/apk/install") then %> -
Install package
-
" method="POST"> +

Install package

+
+ " method="post"> -
+ + <% end htmlviewfunctions.displayitem(data.value.autostart) if not (data.value.version and data.value.version.errtxt) and data.value.autostart and data.value.autostart.errtxt and viewlibrary.check_permission("alpine-baselayout/rc/edit") then %> -
Enable autostart
-
" method="POST"> +

Enable autostart

+
+ " method="post"> -
+ + <% end htmlviewfunctions.displayitem(data.value.configdir) htmlviewfunctions.displayitem(data.value.listen) %> -
<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("startstop") then viewlibrary.dispatch_component("startstop") 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") }); -

DNS Entries +

DNS Entries <% if view.filename then io.write(" for "..html.html_escape(string.gsub(view.filename, "^.*/", ""))) end %> -

-

Locations

-
- -
<% local function doListIndents(next, indent) @@ -98,7 +96,7 @@ local function doListIndents(next, indent) io.write("\n") end for j=1,starting do - io.write("