summaryrefslogtreecommitdiffstats
path: root/provisioning-listclassgroups-html.lsp
blob: 757e8a185b0e6714fd7a541422cee45634a43ba4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<% 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}}});
		$(".deletegroup").click(function(){ return confirm("Are you sure you want to delete this group?")});
        });
</script>

<% displaycommandresults({"deleteclassgroup", "editclassgroup"}, session) %>
<% displaycommandresults({"createclassgroup"}, session, true) %>

<h1>Class Groups</h1>
<DL>
<TABLE id="list" class="tablesorter"><THEAD>
	<TR style="background:#eee;font-weight:bold;">
		<TH>Action</TH>
		<TH>Name</TH>
		<TH>Label</TH>
		<TH>Sequence</TH>
	</TR>		
</THEAD><TBODY>
<% for k,v in ipairs( view.value ) do %>
	<TR>
		<TD>
		<% if viewlibrary.check_permission("deleteclassgroup") then %>
			<%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deleteclassgroup?class_group_id="..v.class_group_id, label="Delete ", class="deletegroup"} %>
		<% end %>
		<% if viewlibrary.check_permission("editclassgroup") then %>
			<%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editclassgroup?class_group_id="..v.class_group_id.."&redir="..page_info.orig_action, label="Edit "} %>
		<% end %>
		</TD>
                <TD><%= html.html_escape(v.name) %></TD>
                <TD><%= html.html_escape(v.label) %></TD>
                <TD><%= html.html_escape(v.seq) %></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 class groups found</p>
<% end %>

<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createclassgroup") then
        viewlibrary.dispatch_component("createclassgroup")
end %>
</DL>