summaryrefslogtreecommitdiffstats
path: root/provisioning-edittemplate-html.lsp
blob: 56d344610e9e88583c03ad24aaffd3e216efd8a0 (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
<% local form, viewlibrary, page_info = ... %>
<% htmlviewfunctions = require("htmlviewfunctions") %>
<% html = require("acf.html") %>

<script type="text/javascript">
	if (typeof jQuery == 'undefined') {
		document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"><\/script>');
	}
</script>

<script type="text/javascript">
        $(document).ready(function() {
		$("[id=<%= page_info.action %>]").submit(function(event){
			if ($(this).find("#notifydevices").is(":checked")) {
				return confirm("Are you sure you want to notify affected devices? This might cause a reboot.");
			}
			return true;
		});
        });
</script>

<% local header_level = htmlviewfunctions.displaysectionstart(form, page_info) %>
<% htmlviewfunctions.displayformstart(form, page_info) %>
<% htmlviewfunctions.displayformitem(form.value.notifydevices, "notifydevices") %>
<% local header_level2 = htmlviewfunctions.displaysectionstart(cfe({label="Template Details"}), page_info, htmlviewfunctions.incrementheader(header_level)) %>
<%
if page_info.action == "edittemplate" then
	form.value.filename.readonly = "true"
end
htmlviewfunctions.displayformitem(form.value.filename, "filename")
htmlviewfunctions.displayformitem(form.value.label, "label")
htmlviewfunctions.displayformitem(form.value.seq, "seq")
%>
<% htmlviewfunctions.displaysectionend(header_level2) %>

<% if form.value.filecontent then %>
<% htmlviewfunctions.displaysectionstart(cfe({label="File Content"}), page_info, header_level2) %>
<textarea name="filecontent">
<%= html.html_escape(form.value.filecontent.value) %>
</textarea>
<% htmlviewfunctions.displayinfo(form.value.filecontent) %>

<% htmlviewfunctions.displaysectionend(header_level2) %>
<% end %>

<% htmlviewfunctions.displayformend(form) %>
<% htmlviewfunctions.displaysectionend(header_level) %>