summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2014-04-17 01:26:12 +0000
committerTed Trask <ttrask01@yahoo.com>2014-04-17 01:26:12 +0000
commit85075e70e38dfdf722d24e467c198df010d9a4ce (patch)
tree5a23363420fd99e71a693df89a5abb777b1d9c99
parent82f88b0be3006ee9abe40fd978d20f07e086bdb4 (diff)
downloadacf-alpine-baselayout-85075e70e38dfdf722d24e467c198df010d9a4ce.tar.bz2
acf-alpine-baselayout-85075e70e38dfdf722d24e467c198df010d9a4ce.tar.xz
Fix rc-status-html for when to display Action column
-rw-r--r--rc-status-html.lsp54
1 files 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) %>
<table id="list" class="tablesorter"><thead>
-<tr>
-<% if viewlibrary.check_permission("edit") then %>
-<th>Action</th>
-<% end %>
-<th>Service Name</th>
-<th>Status</th>
-<th>Runlevels</th>
-<th>Description</th>
-</tr>
+ <tr>
+ <% if viewlibrary.check_permission("edit") or viewlibrary.check_permission("startstop") then %>
+ <th>Action</th>
+ <% end %>
+ <th>Service Name</th>
+ <th>Status</th>
+ <th>Runlevels</th>
+ <th>Description</th>
+ </tr>
</thead><tbody>
<%
local redir = cfe({type="hidden", value=page_info.orig_action})
for i,item in ipairs(view.value) do %>
<tr>
- <td>
- <% 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 %>
- </td>
- <td><%= html.html_escape(item.servicename) %></td>
- <td><%= html.html_escape(item.status) %></td>
- <td><%= html.html_escape(table.concat(item.runlevels, ", ")) %>&nbsp;</td>
- <td><%= html.html_escape(item.description) %></td>
+ <% if viewlibrary.check_permission("edit") or viewlibrary.check_permission("startstop") then %>
+ <td>
+ <% 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 %>
+ </td>
+ <% end %>
+ <td><%= html.html_escape(item.servicename) %></td>
+ <td><%= html.html_escape(item.status) %></td>
+ <td><%= html.html_escape(table.concat(item.runlevels, ", ")) %>&nbsp;</td>
+ <td><%= html.html_escape(item.description) %></td>
</tr>
<% end %>
</tbody></table>