2 LuCI - Lua Configuration Interface
3 Copyright 2008 Steven Barth <steven@midlink.org>
4 Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
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
10 http://www.apache.org/licenses/LICENSE-2.0
17 <div class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
18 <h2><%=self.title%></h2>
19 <div class="cbi-section-descr"><%=self.description%></div>
20 <div class="cbi-section-node">
21 <%- local count = 0 -%>
22 <table class="cbi-section-table">
23 <tr class="cbi-section-table-titles">
24 <%- if not self.anonymous then -%>
27 <%- for i, k in pairs(self.children) do -%>
28 <th class="cbi-section-table-cell"><%=k.title%></th>
29 <%- count = count + 1; end; if self.extedit then -%>
30 <th class="cbi-section-table-cell"> </th>
31 <%- count = count + 1; end; if self.addremove then -%>
32 <th class="cbi-section-table-cell"> </th>
33 <%- count = count + 1; end -%>
35 <tr class="cbi-section-table-descr">
36 <%- if not self.anonymous then -%>
39 <%- for i, k in pairs(self.children) do -%>
40 <th class="cbi-section-table-cell"><%=k.description%></th>
41 <%- end; if self.extedit then -%>
42 <th class="cbi-section-table-cell"> </th>
43 <%- end; if self.addremove then -%>
44 <th class="cbi-section-table-cell"> </th>
47 <%- local isempty = true
48 for i, k in ipairs(self:cfgsections()) do
51 scope = { valueheader = "cbi/cell_valueheader", valuefooter = "cbi/cell_valuefooter" }
53 <tr class="cbi-section-table-row" id="cbi-<%=self.config%>-<%=section%>">
54 <% if not self.anonymous then -%>
55 <th><h3><%=k%></h3></th>
58 <%- if self.extedit or self.addremove then -%>
59 <td class="cbi-section-table-cell">
60 <%- if self.extedit then -%>
61 <a href="<%=self.extedit:format(section)%>"><img style="border: none" src="<%=resource%>/cbi/edit.gif" alt="<%:edit%>" /></a>
62 <%- end; if self.addremove then %>
63 <button class="clean" type="submit" value="1" name="cbi.rts.<%=self.config%>.<%=k%>" title="<%:delete%>"><img src="<%=resource%>/cbi/remove.gif" alt="<%:delete%>" /></button>
67 <%- if self.addremove then -%>
68 <td class="cbi-section-table-cell">
75 <%- if isempty then -%>
76 <tr class="cbi-section-table-row">
77 <td colspan="<%=count%>"><em><br /><%:cbi_sectempty%></em></td>
81 <%- if self.addremove then -%>
83 <div class="cbi-section-table-row">
84 <td colspan="<%=count%>" class="cbi-section-table-optionals">
85 <div class="cbi-section-create">
86 <% if self.anonymous then %>
87 <input type="submit" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" value="<%:cbi_add%>" />
89 <input type="text" class="cbi-section-create-name" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" />
90 <input type="submit" value="<%:cbi_add%>" />
93 <% if self.err_invalid then %>
94 <div class="cbi-error"><%:cbi_invalid%></div>