2008-07-07 22:00:56 +00:00
< %#
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth < steven @ midlink . org >
Copyright 2008 Jo-Philipp Wich < xm @ leipzig . freifunk . net >
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id$
-%>
2008-07-15 17:27:58 +00:00
2008-05-14 12:10:44 +00:00
< % self:render_children(section, scope or {}) %>
2008-07-15 17:27:58 +00:00
< % if #self.optionals[section] > 0 or self.dynamic then %>
< div class = "cbi-optionals" >
< % if self.dynamic then %>
< input type = "text" name = "cbi.opt.<%=self.config%>.<%=section%>" / >
< % else %>
< select name = "cbi.opt.<%=self.config%>.<%=section%>" >
< option > < %:cbi_addopt%>< / option >
< % for key, val in pairs(self.optionals[section]) do %>
< option id = "cbi-<%=self.config.." - " . . section . . " - " . . val . option % > " value="< %=val.option%>">< %=val.title%>< / option >
< % end %>
< / select >
< script type = "text/javascript" > < % f o r k e y , v a l i n p a i r s ( s e l f . o p t i o n a l s [ s e c t i o n ] ) d o % >
< % if #val.deps > 0 then %>< % for j, d in ipairs(val.deps) do %>cbi_d_add("cbi-< %=self.config.."-"..section.."-"..val.option%>", "cbid.< %=self.config.."."..section.."."..d.field%>", "< %=d.value%>");
< % end %>< % end %>
< % end %>< / script >
< % end %>
< input type = "submit" value = "<%:add%>" / >
< / div >
< % end %>