summaryrefslogtreecommitdiffstats
path: root/provisioning-listclasses-html.lsp
diff options
context:
space:
mode:
Diffstat (limited to 'provisioning-listclasses-html.lsp')
-rw-r--r--provisioning-listclasses-html.lsp52
1 files changed, 52 insertions, 0 deletions
diff --git a/provisioning-listclasses-html.lsp b/provisioning-listclasses-html.lsp
new file mode 100644
index 0000000..21a2b3f
--- /dev/null
+++ b/provisioning-listclasses-html.lsp
@@ -0,0 +1,52 @@
+<% local view, viewlibrary, page_info, session = ...
+require("viewfunctions")
+%>
+
+<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"></script>
+<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery.tablesorter.js"></script>
+<script type="text/javascript">
+ $(document).ready(function() {
+ $("#list").tablesorter({headers: {0:{sorter: false}}});
+ });
+</script>
+
+<% displaycommandresults({"deleteclass", "editclass"}, session) %>
+<% displaycommandresults({"createclass"}, session, true) %>
+
+<h1>Classes</h1>
+<DL>
+<TABLE id="list" class="tablesorter"><THEAD>
+ <TR style="background:#eee;font-weight:bold;">
+ <TH>Action</TH>
+ <TH>Name</TH>
+ <TH>Label</TH>
+ </TR>
+</THEAD><TBODY>
+<% for k,v in ipairs( view.value ) do %>
+ <TR>
+ <TD>
+ <% if viewlibrary.check_permission("deleteclass") then %>
+ <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deleteclass?class_id="..v.class_id, label="Delete "} %>
+ <% end %>
+ <% if viewlibrary.check_permission("editclass") then %>
+ <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editclass?class_id="..v.class_id.."&redir="..page_info.orig_action, label="Edit "} %>
+ <% end %>
+ </TD>
+ <TD><%= html.html_escape(v.name) %></TD>
+ <TD><%= html.html_escape(v.label) %></TD>
+ </TR>
+<% end %>
+</TBODY>
+</TABLE>
+
+<% if view.errtxt then %>
+<p class="error"><%= html.html_escape(view.errtxt) %></p>
+<% end %>
+<% if #view.value == 0 then %>
+<p>No classes found</p>
+<% end %>
+
+<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createclass") then
+ viewlibrary.dispatch_component("createclass")
+end %>
+</DL>