summaryrefslogtreecommitdiffhomepage
path: root/libs/web/luasrc/view/cbi/simpleform.htm
blob: 9c40f8290c1da636eda3883270deabd6f7570b3c (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
56
57
58
59
60
61
62
63
64
65
66
<%#
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

	http://www.apache.org/licenses/LICENSE-2.0

$Id$

-%>
<% if not self.embedded then %>
<form method="post" action="<%=REQUEST_URI%>">
	<div>
		<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
		<input type="hidden" name="cbi.submit" value="1" />
	</div>
<% end %>
	<div class="cbi-map" id="cbi-<%=self.config%>">
		<% if self.title and #self.title > 0 then %><h2><a id="content" name="content"><%=self.title%></a></h2><% end %>
		<% if self.description and #self.description > 0 then %><div class="cbi-map-descr"><%=self.description%></div><% end %>
		<% self:render_children() %>
		<br />
	</div>
<%- if self.message then %>
	<div><%=self.message%></div>
<%- end %>
<%- if self.errmessage then %>
	<div class="error"><%=self.errmessage%></div>
<%- end %>	
<% if not self.embedded then %>
	<div>
<%-
	if type(self.hidden) == "table" then
		for k, v in pairs(self.hidden) do
-%>
	<input type="hidden" id="<%=k%>" name="<%=k%>" value="<%=pcdata(v)%>" />
<%-
		end
	end
%>
<%- if self.flow and self.flow.skip then %>
	<input class="cbi-button cbi-button-skip" type="submit" name="cbi.skip" value="<%:Skip%>" />
<% end %>
<%- if self.submit ~= false then %>
	<input class="cbi-button-save" type="submit" value="
		<%- if not self.submit then -%><%-:Submit-%><%-else-%><%=self.submit%><%end-%>
	" />
<% end %>
<%- if self.reset ~= false then %>
	<input class="cbi-button-reset" type="reset" value="
		<%- if not self.reset then -%><%-:Reset-%><%-else-%><%=self.reset%><%end-%>
	" />
<% end %>
<%- if self.cancel ~= false and self.on_cancel then %>
	<input class="cbi-button-reset" type="submit" name="cbi.cancel" value="
		<%- if not self.cancel then -%><%-:Cancel-%><%-else-%><%=self.cancel%><%end-%>
	" />
<% end %>
		<script type="text/javascript">cbi_d_update();</script>
	</div>
</form>
<% end %>