* luci/themes: fix help text styles in openwrt.org theme
[project/luci.git] / libs / cbi / luasrc / view / cbi / ucisection.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 <% self:render_children(section, scope or {}) %>
17
18 <% if #self.optionals[section] > 0 or self.dynamic then %>
19         <div class="cbi-optionals">
20                 <% if self.dynamic then %>
21                         <input type="text" name="cbi.opt.<%=self.config%>.<%=section%>" />
22                 <% else %>
23                 <select name="cbi.opt.<%=self.config%>.<%=section%>">
24                         <option><%:cbi_addopt%></option>
25                         <% for key, val in pairs(self.optionals[section]) do -%>
26                                 <option id="cbi-<%=self.config.."-"..section.."-"..val.option%>" value="<%=val.option%>"><%=val.title%></option>
27                         <%- end %>
28                 </select>
29                 <script type="text/javascript"><% for key, val in pairs(self.optionals[section]) do %>
30                         <% if #val.deps > 0 then %><% for j, d in ipairs(val.deps) do -%>
31                         cbi_d_add("cbi-<%=self.config.."-"..section.."-"..val.option..d.add%>", {
32                 <%-
33                         for k,v in pairs(d.deps) do
34                 -%>
35                         <%-=string.format('"cbid.%s.%s.%s"', self.config, section, k) .. ":" .. string.format("%q", v)-%>,
36                 <%-
37                         end
38                 -%>
39                         });
40                 <%- end %><% end %>
41                 <% end %></script>
42         <% end %>
43                 <input type="submit" class="cbi-button cbi-button-fieldadd" value="<%:add%>" />
44         </div>
45 <% end %>