summaryrefslogtreecommitdiffstats
path: root/ppp-listpeers-html.lsp
blob: 19e0d0bc3d4c153c2db0154d359f0e191c50da55 (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
<% local form, viewlibrary, page_info, session = ... 
htmlviewfunctions = require("htmlviewfunctions")
html = require("acf.html")
%>

<% htmlviewfunctions.displaycommandresults({"deletepeer", "editpeer"}, session) %>
<% htmlviewfunctions.displaycommandresults({"createpeer"}, session, true) %>

<h1>Peer Files</h1>
<DL><TABLE>
	<TR style="background:#eee;font-weight:bold;">
		<TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Action</TD>
		<TD style="white-space:nowrap;text-align:left;" class="header">Peer File</TD>
	</TR>		
<% for i,file in ipairs(form.value) do %>
	<TR>
		<TD style="padding-right:20px;white-space:nowrap;">
			<%
			if viewlibrary.check_permission("deletepeer") then io.write(html.link{value = "deletepeer?submit=true&name=" .. file, label="Delete " }) end
			if viewlibrary.check_permission("editpeer") then io.write(html.link{value = "editpeer?name=" .. file.."&redir="..page_info.orig_action, label="Edit " }) end
			%>
		</TD>
		<TD style="white-space:nowrap;" width="90%"><%= html.html_escape(string.gsub(file, "^.*/", "")) %></TD>
	</TR>
<% end %>
</TABLE></DL>

<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createpeer") then
	viewlibrary.dispatch_component("createpeer")
end %>