2688e7a1b3efd02e01f0592c1168c7d51920bc3a
[project/luci.git] / libs / cbi / luasrc / view / cbi / tblsection.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 <div class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
16 <h2><%=self.title%></h2>
17 <div class="cbi-section-descr"><%=self.description%></div>
18 <div class="cbi-section-node">
19 <div class="cbi-section-row">
20 <% for i, k in pairs(self.children) do %>
21 <div class="cbi-section-row-head"><%=k.title%></div>
22 <% end %>
23 </div>
24 <div class="cbi-section-row">
25 <% for i, k in pairs(self.children) do %>
26 <div class="cbi-section-row-descr"><%=k.description%></div>
27 <% end %>
28 </div>
29 <% for i, k in ipairs(self:cfgsections()) do%>
30 <% if not self.anonymous then %><h3 class="table-cell"><%=k%></h3><% end %>
31 <%
32 section = k
33 scope = {valueheader = "cbi/tiny_valueheader", valuefooter = "cbi/tiny_valuefooter"}
34 %>
35 <div class="cbi-section-row" id="cbi-<%=self.config%>-<%=section%>">
36 <%+cbi/ucisection%>
37 <% if self.addremove then %><div class="cbi-section-remove table-cell">
38 <input type="submit" name="cbi.rts.<%=self.config%>.<%=k%>" value="X" />
39 </div><% end %>
40 </div>
41 <% end %>
42 <% if self.addremove then %>
43 <div class="cbi-section-create">
44 <% if self.anonymous then %>
45 <input type="submit" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" value="<%:cbi_add%>" />
46 <% else %>
47 <input type="text" class="cbi-section-create-name" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" />
48 <input type="submit" value="<%:cbi_add%>" />
49 <% end %><% if self.err_invalid then %><div class="cbi-error"><%:cbi_invalid%></div><% end %>
50 </div>
51 </div>
52 <% end %>
53 </div>