libs/cbi: Added TextValue
[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 <fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
17         <% if self.title and #self.title > 0 then -%>
18                 <legend><%=self.title%></legend>
19         <%- end %>
20         <div class="cbi-section-descr"><%=self.description%></div>
21         <% local isempty = true for i, k in ipairs(self:cfgsections()) do -%>
22                 <% if self.addremove then -%>
23                         <div class="cbi-section-remove right">
24                                 <input type="submit" name="cbi.rts.<%=self.config%>.<%=k%>" value="<%:cbi_del%>" />
25                         </div>
26                 <%- end %>
27                 <% section = k; isempty = false %>
28
29                 <% if not self.anonymous then -%>
30                         <h3><%=k:upper()%></h3>
31                 <%- end %>
32
33                 <fieldset class="cbi-section-node" id="cbi-<%=self.config%>-<%=section%>">
34                         <%+cbi/ucisection%>
35                 </fieldset>
36                 <br />
37         <%- end %>
38
39         <% if isempty then -%>
40                 <em><%:cbi_sectempty%><br /><br /></em>
41         <%- end %>
42
43         <% if self.addremove then -%>
44                 <div class="cbi-section-create">
45                         <% if self.anonymous then -%>
46                                 <input type="submit" class="cbi-button cbi-button-add" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" value="<%:cbi_add%>" />
47                         <%- else -%>
48                                 <input type="text" class="cbi-section-create-name" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" />
49                                 <input type="submit" class="cbi-button cbi-button-add" value="<%:cbi_add%>" />
50                         <%- end %>
51
52                         <% if self.err_invalid then -%>
53                                 <div class="cbi-error"><%:cbi_invalid%></div>
54                         <%- end %>
55                 </div>
56         <%- end %>
57 </fieldset>