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
16 <% self:render_children(section, scope or {}) %
>
18 <% if #self.optionals[section]
> 0 or self.dynamic then %
>
19 <% if self.tag_deperror[section] then -%
>
20 <div class=
"cbi-error"><%:cbi_deperror%
></div>
21 <% elseif self.tag_invalid[section] then -%
>
22 <div class=
"cbi-error"><%:cbi_invalid_section%
></div>
23 <%- elseif self.tag_error[section] then -%
>
24 <div class=
"cbi-error"><%=self.tag_error[section]%
></div>
26 <div class=
"cbi-optionals">
27 <% if self.dynamic then %
>
28 <input type=
"text" name=
"cbi.opt.<%=self.config%>.<%=section%>" />
30 <select name=
"cbi.opt.<%=self.config%>.<%=section%>">
31 <option><%:cbi_addopt%
></option>
32 <% for key, val in pairs(self.optionals[section]) do -%
>
33 <option id=
"cbi-<%=self.config.."-
"..section.."-
"..val.option%>" value=
"<%=val.option%>"><%=striptags(val.title)%
></option>
36 <script type=
"text/javascript"><% for key, val in pairs(self.optionals[section]) do %
>
37 <% if #val.deps
> 0 then %
><% for j, d in ipairs(val.deps) do -%
>
38 cbi_d_add(
"cbi-<%=self.config.."-
"..section.."-
"..val.option..d.add%>", {
40 for k,v in pairs(d.deps) do
42 <%-=string.format('
"cbid.%s.%s.%s"', self.config, section, k) ..
":" .. string.format(
"%q", v)-%
>,
50 <input type=
"submit" class=
"cbi-button cbi-button-fieldadd" value=
"<%:add%>" />