From 29f88d18703ba3136d1b0b4739a302b64305f3d4 Mon Sep 17 00:00:00 2001 From: Zach LeBar Date: Tue, 12 Feb 1980 06:06:50 +0000 Subject: Cleaned up HTML in 'status-html.lsp' and 'displayitem()'. Began removing the use of
,
, and
tags for more semantic choices. --- app/status-html.lsp | 28 ++++++++++++++++------------ lib/htmlviewfunctions.lua | 14 +++++++------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/app/status-html.lsp b/app/status-html.lsp index 579cff8..9ebd3d3 100644 --- a/app/status-html.lsp +++ b/app/status-html.lsp @@ -5,31 +5,35 @@ require("htmlviewfunctions") <% 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 %> -
<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("startstop") then viewlibrary.dispatch_component("startstop") diff --git a/lib/htmlviewfunctions.lua b/lib/htmlviewfunctions.lua index 3db6618..4e8d4b8 100644 --- a/lib/htmlviewfunctions.lua +++ b/lib/htmlviewfunctions.lua @@ -53,17 +53,17 @@ function displayitem(myitem, header_level, page_info) end end elseif myitem.type ~= "hidden" then - io.write("" .. html.html_escape(myitem.label) .. "
\n") - io.write("
") - io.write(string.gsub(html.html_escape(tostring(myitem.value)), "\n", "
") .. "\n") - if myitem.descr then io.write("

" .. string.gsub(html.html_escape(myitem.descr), "\n", "
") .. "

\n") end - if myitem.errtxt then io.write("

" .. string.gsub(html.html_escape(myitem.errtxt), "\n", "
") .. "

\n") end - io.write("
\n") + io.write(">

" .. html.html_escape(myitem.label) .. "

") + io.write("
") + io.write(string.gsub(html.html_escape(tostring(myitem.value)), "\n", "
") .. "\n") + if myitem.descr then io.write("

" .. string.gsub(html.html_escape(myitem.descr), "\n", "
") .. "

") end + if myitem.errtxt then io.write("

" .. string.gsub(html.html_escape(myitem.errtxt), "\n", "
") .. "

") end + io.write("
") end end -- cgit v1.2.3