9f4f2a50d7067a631129b4b1992189b95ea1563c
[project/luci.git] / libs / cbi / luasrc / view / cbi / tsection.htm
1 <%#
2 LuCI - Lua Configuration Interface
3 Copyright 2008 Steven Barth <steven@midlink.org>
4 Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10         http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13
14 -%>
15
16 <div class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
17         <h2><%=self.title%></h2>
18         <div class="cbi-section-descr"><%=self.description%></div>
19                 <% for i, k in ipairs(self:cfgsections()) do -%>
20                         <% if self.addremove then -%>
21                                 <div class="cbi-section-remove right">
22                                         <input type="submit" name="cbi.rts.<%=self.config%>.<%=k%>" value="<%:cbi_del%>" />
23                                 </div>
24                         <%- end %>
25                         <% if not self.anonymous then %><h3><%=k%></h3><% end %>
26                         <% section = k %>
27                         <div class="cbi-section-node" id="cbi-<%=self.config%>-<%=section%>">
28                                 <%+cbi/ucisection%>
29                         </div>
30                         <br />
31                 <%- end %>
32
33                 <% if self.addremove then -%>
34                         <div class="cbi-section-create">
35                                 <% if self.anonymous then -%>
36                                         <input type="submit" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" value="<%:cbi_add%>" />
37                                 <%- else -%>
38                                         <input type="text" class="cbi-section-create-name" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" />
39                                         <input type="submit" value="<%:cbi_add%>" />
40                                 <%- end %>
41
42                                 <% if self.err_invalid then -%>
43                                         <div class="cbi-error"><%:cbi_invalid%></div>
44                                 <%- end %>
45                         </div>
46                 <%- end %>
47         </div>