From 5832775f8f2fa176a1ccb4be5eb0e8ede11b185e Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 10 Apr 2014 05:23:03 +0000 Subject: Changes to use new htmlviewfunctions functions --- apk-available-html.lsp | 19 +++++++++++-------- apk-details-html.lsp | 19 ++++++------------- apk-expert-html.lsp | 19 ++++--------------- apk-loaded-html.lsp | 40 ++++++++++++++++++++++++---------------- 4 files changed, 45 insertions(+), 52 deletions(-) diff --git a/apk-available-html.lsp b/apk-available-html.lsp index 985ad8e..3d7c8bc 100644 --- a/apk-available-html.lsp +++ b/apk-available-html.lsp @@ -16,13 +16,13 @@ <% htmlviewfunctions.displaycommandresults({"upgrade", "install"}, session) %> -

<%= form.label %>

+<% local header_level = htmlviewfunctions.displaysectionstart(form, page_info) %> <% if viewlibrary.check_permission("install") or viewlibrary.check_permission("upgrade") then %> @@ -32,16 +32,18 @@ +<% local packagecfe = cfe({ type="hidden", value="" }) %> <% for i,packagetable in pairs(form.value) do %> <% if viewlibrary.check_permission("install") or viewlibrary.check_permission("upgrade") then %> + <% packagecfe.value = packagetable.name %> <% end %> @@ -49,3 +51,4 @@ <% end %>
Version
- <% if viewlibrary.check_permission("install") and not packagetable.upgrade then %> - <%= html.link{value = "install?submit=true&package=" .. packagetable.name, label="Install "} %> - <% end %> - <% if viewlibrary.check_permission("upgrade") and packagetable.upgrade then %> - <%= html.link{value = "upgrade?submit=true&package=" .. packagetable.name, label="Upgrade "} %> - <% end %> + <% if viewlibrary.check_permission("install") and not packagetable.upgrade then %> + <% htmlviewfunctions.displayitem(cfe({type="form", value={package=packagecfe}, label="", option="Install", action="install" }), page_info, -1) %> + <% end %> + <% if viewlibrary.check_permission("upgrade") and packagetable.upgrade then %> + <% htmlviewfunctions.displayitem(cfe({type="form", value={package=packagecfe}, label="", option="Upgrade", action="upgrade" }), page_info, -1) %> + <% end %> <%= html.link{value = "details?package="..packagetable.name, label=packagetable.name} %>
+<% htmlviewfunctions.displaysectionend(header_level) %> diff --git a/apk-details-html.lsp b/apk-details-html.lsp index 6fdb6f2..814234a 100644 --- a/apk-details-html.lsp +++ b/apk-details-html.lsp @@ -4,7 +4,7 @@ htmlviewfunctions = require("htmlviewfunctions") <% htmlviewfunctions.displaycommandresults({"install", "upgrade"}, session) %> -

<%= data.label %>

+<% local header_level = htmlviewfunctions.displaysectionstart(data, page_info) %> <% htmlviewfunctions.displayitem(data.value.package) htmlviewfunctions.displayitem(data.value.installed) @@ -15,18 +15,11 @@ htmlviewfunctions.displayitem(data.value.size) htmlviewfunctions.displayitem(data.value.upgrade) %> +<% local packagecfe = cfe({ type="hidden", value=data.value.package.value }) %> <% if viewlibrary.check_permission("install") and data.value.installed.value == "" then %> -

Install

-
-
-> -
-
+ <% htmlviewfunctions.displayitem(cfe({type="form", value={package=packagecfe}, label="Install", option="Install", action="install" }), page_info, 0) %> <% elseif viewlibrary.check_permission("upgrade") and data.value.upgrade.value ~= "" then %> -

Upgrade

-
-
-> -
-
+ <% htmlviewfunctions.displayitem(cfe({type="form", value={package=packagecfe}, label="Upgrade", option="Upgrade", action="upgrade" }), page_info, 0) %> <% end %> + +<% htmlviewfunctions.displaysectionend(header_level) %> diff --git a/apk-expert-html.lsp b/apk-expert-html.lsp index 6dde79f..a46318e 100644 --- a/apk-expert-html.lsp +++ b/apk-expert-html.lsp @@ -11,23 +11,12 @@ func(form, viewlibrary, page_info, session) %> <% if viewlibrary.check_permission("updateall") or viewlibrary.check_permission("upgradeall") then %> -

Update / Upgrade

+<% local header_level = htmlviewfunctions.displaysectionstart(cfe({label="Update / Upgrade"}), page_info) %> <% if viewlibrary.check_permission("updateall") then %> -

Update Index

-
-
- - -
-
+ <% htmlviewfunctions.displayitem(cfe({type="form", value={}, label="Update Index", option="Update", action="updateall" }), page_info, 0) %> <% end %> <% if viewlibrary.check_permission("upgradeall") then %> -

Upgrade All

-
-
- - -
-
+ <% htmlviewfunctions.displayitem(cfe({type="form", value={}, label="Upgrade All", option="Upgrade", action="upgradeall" }), page_info, 0) %> <% end %> +<% htmlviewfunctions.displaysectionend(header_level) %> <% end %> diff --git a/apk-loaded-html.lsp b/apk-loaded-html.lsp index e0b6ff6..4113e80 100644 --- a/apk-loaded-html.lsp +++ b/apk-loaded-html.lsp @@ -16,15 +16,15 @@ <% htmlviewfunctions.displaycommandresults({"delete", "install", "upgrade"}, session) %> -

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

-

<%= html.html_escape(form.value.toplevel.label) %>

+<% local header_level = htmlviewfunctions.displaysectionstart(form, page_info) %> +<% local header_level2 = htmlviewfunctions.displaysectionstart(form.value.toplevel, page_info, htmlviewfunctions.incrementheader(header_level)) %> <% if viewlibrary.check_permission("delete") or viewlibrary.check_permission("upgrade") then %> @@ -35,14 +35,18 @@ +<% local packagecfe = cfe({ type="hidden", value="" }) %> <% for i,packagetable in pairs(form.value.toplevel.value) do %> - <% if viewlibrary.check_permission("delete") then %> + <% if viewlibrary.check_permission("delete") or viewlibrary.check_permission("upgrade") then %> + <% packagecfe.value = packagetable.name %> <% end %> @@ -51,8 +55,9 @@ <% end %>
Description
- <%= html.link{value = "delete?submit=true&package=" .. packagetable.name, label="Delete "} %> - <% if viewlibrary.check_permission("upgrade") and packagetable.upgrade then %> - <%= html.link{value = "upgrade?submit=true&package=" .. packagetable.name, label="Upgrade "} %> - <% end %> + <% if viewlibrary.check_permission("delete") then %> + <% htmlviewfunctions.displayitem(cfe({type="form", value={package=packagecfe}, label="", option="Delete", action="delete" }), page_info, -1) %> + <% end %> + <% if viewlibrary.check_permission("upgrade") and packagetable.upgrade then %> + <% htmlviewfunctions.displayitem(cfe({type="form", value={package=packagecfe}, label="", option="Upgrade", action="upgrade" }), page_info, -1) %> + <% end %> <%= html.link{value = "details?package="..packagetable.name, label=packagetable.name} %>
+<% htmlviewfunctions.displaysectionend(header_level2) %> -

<%= html.html_escape(form.value.dependent.label) %>

+<% htmlviewfunctions.displaysectionstart(form.value.dependent, page_info, header_level2) %> <% if viewlibrary.check_permission("install") or viewlibrary.check_permission("upgrade") then %> @@ -66,13 +71,14 @@ <% for i,packagetable in pairs(form.value.dependent.value) do %> <% if viewlibrary.check_permission("install") or viewlibrary.check_permission("upgrade") then %> + <% packagecfe.value = packagetable.name %> <% end %> @@ -81,3 +87,5 @@ <% end %>
- <% if viewlibrary.check_permission("install") then %> - <%= html.link{value = "install?submit=true&package=" .. packagetable.name, label="Promote "} %> - <% end %> - <% if viewlibrary.check_permission("upgrade") and packagetable.upgrade then %> - <%= html.link{value = "upgrade?submit=true&package=" .. packagetable.name, label="Upgrade "} %> - <% end %> + <% if viewlibrary.check_permission("install") then %> + <% htmlviewfunctions.displayitem(cfe({type="form", value={package=packagecfe}, label="", option="Promote", action="install" }), page_info, -1) %> + <% end %> + <% if viewlibrary.check_permission("upgrade") and packagetable.upgrade then %> + <% htmlviewfunctions.displayitem(cfe({type="form", value={package=packagecfe}, label="", option="Upgrade", action="upgrade" }), page_info, -1) %> + <% end %> <%= html.link{value = "details?package="..packagetable.name, label=packagetable.name} %>
+<% htmlviewfunctions.displaysectionend(header_level2) %> +<% htmlviewfunctions.displaysectionend(header_level) %> -- cgit v1.2.3