summaryrefslogtreecommitdiffstats
path: root/rrdtool-newgraphcfg-html.lsp
blob: 9da49b3512a2a7ee5e7be82e88e54c960b982786 (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
<% local form, viewlibrary, page_info = ... %>
<% htmlviewfunctions = require("htmlviewfunctions") %>
<% html = require("acf.html") %>

<h1>Create new rrdtool-graph file</h1>

<% if form.type == "form" then %>
<% form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action %>
<% htmlviewfunctions.displayformstart(form) %>
<h3>File Details</h3>
<div class='item'><p class='left'><% io.write(form.value.filename.label) %></p>
<div class='right'>
<input class="text" type="text" name="filename" value="<%= html.html_escape(form.value.filename.value) %>">
<% if form.value.filename.errtxt then %><p class='error'><%= string.gsub(html.html_escape(form.value.filename.errtxt), "\n", "<br/>") %></p><% end %>
<% if form.value.filename.descr then %><p class='descr'><%= string.gsub(html.html_escape(form.value.filename.descr), "\n", "<br/>") %></p><% end %>
</div></div><!-- end .item -->
<% end %>
<h3>File Content</h3>
<textarea name="filecontent">
<%= html.html_escape(form.value.filecontent.value) %>
</textarea>
<% if form.value.filecontent.errtxt then %><p class='error'><%= string.gsub(html.html_escape(form.value.filecontent.errtxt), "\n", "<br/>") %></p><% end %>
<% if form.value.filecontent.descr then %><p class='descr'><%= string.gsub(html.html_escape(form.value.filecontent.descr), "\n", "<br/>") %></p><% end %>

<% if form.type == "form" then %>
<h3>Save</h3>
<% htmlviewfunctions.displayformend(form) %>
<% end %>
</form>