From 85075e70e38dfdf722d24e467c198df010d9a4ce Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 17 Apr 2014 01:26:12 +0000 Subject: Fix rc-status-html for when to display Action column --- rc-status-html.lsp | 54 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/rc-status-html.lsp b/rc-status-html.lsp index aab9470..f9cc92d 100644 --- a/rc-status-html.lsp +++ b/rc-status-html.lsp @@ -24,37 +24,39 @@ <% local header_level = htmlviewfunctions.displaysectionstart(view, page_info) %> - -<% if viewlibrary.check_permission("edit") then %> - -<% end %> - - - - - + + <% if viewlibrary.check_permission("edit") or viewlibrary.check_permission("startstop") then %> + + <% end %> + + + + + <% local redir = cfe({type="hidden", value=page_info.orig_action}) for i,item in ipairs(view.value) do %> - - - - - + <% if viewlibrary.check_permission("edit") or viewlibrary.check_permission("startstop") then %> + + <% end %> + + + + <% end %>
ActionService NameStatusRunlevelsDescription
ActionService NameStatusRunlevelsDescription
- <% local servicename = cfe({type="hidden", value=item.servicename}) %> - <% if viewlibrary.check_permission("edit") then - htmlviewfunctions.displayitem(cfe({type="link", value={servicename=servicename, redir=redir}, label="", option="Edit", action="edit" }), page_info, -1) - end %> - <% if viewlibrary.check_permission("startstop") and item.actions then - local startstopform = cfe({type="form", value={servicename=servicename}, label="", option={}, action="startstop" }) - for i,a in ipairs(item.actions) do - startstopform.option[#startstopform.option+1] = a:gsub("^%l", string.upper) - end - htmlviewfunctions.displayitem(startstopform, page_info, -1) - end %> - <%= html.html_escape(item.servicename) %><%= html.html_escape(item.status) %><%= html.html_escape(table.concat(item.runlevels, ", ")) %> <%= html.html_escape(item.description) %> + <% local servicename = cfe({type="hidden", value=item.servicename}) %> + <% if viewlibrary.check_permission("edit") then + htmlviewfunctions.displayitem(cfe({type="link", value={servicename=servicename, redir=redir}, label="", option="Edit", action="edit" }), page_info, -1) + end %> + <% if viewlibrary.check_permission("startstop") and item.actions then + local startstopform = cfe({type="form", value={servicename=servicename}, label="", option={}, action="startstop" }) + for i,a in ipairs(item.actions) do + startstopform.option[#startstopform.option+1] = a:gsub("^%l", string.upper) + end + htmlviewfunctions.displayitem(startstopform, page_info, -1) + end %> + <%= html.html_escape(item.servicename) %><%= html.html_escape(item.status) %><%= html.html_escape(table.concat(item.runlevels, ", ")) %> <%= html.html_escape(item.description) %>
-- cgit v1.2.3