* Major CBI improvements
[project/luci.git] / src / ffluci / view / cbi / nsection.htm
index 7615104..c1f4c8b 100644 (file)
@@ -2,27 +2,30 @@
                                <div class="cbi-section" id="cbi-<%=self.config%>-<%=self.section%>">
                                        <h2><%=self.title%></h2>
                                        <div class="cbi-section-descr"><%=self.description%></div>
+                                       <% if self.addremove then %><div class="cbi-section-remove">
+                                               <input type="submit" name="cbi.rns.<%=self.config%>.<%=self.section%>" value="<%:cbi_del Eintrag entfernen%>" />
+                                       </div><% end %>
                                        <fieldset class="cbi-section-node">
 <% self:render_children(self.section) %>
                                        <% if #self.optionals[self.section] > 0 or self.dynamic then %>
                                                <div class="cbi-optionals">
+                                                       <input type="submit" value="<%:cbi_addopt Feld hinzufügen%>" />
                                                <% if self.dynamic then %>
                                                        <input type="text" name="cbi.opt.<%=self.config%>.<%=self.section%>" />
                                                <% else %>
                                                        <select name="cbi.opt.<%=self.config%>.<%=self.section%>">
                                                                <option><%:cbi_selopt *** Zusätzliche Parameter ***%></option>
                                                        <% for key, val in pairs(self.optionals[self.section]) do %>
-                                                               <option value="<%=val.option%>"><%=val.title%></option>
+                                                               <option id="cbi-<%=self.config.."-"..self.section.."-"..val.option%>" value="<%=val.option%>"><%=val.title%></option>
+                                                               <% if #val.deps > 0 then %><script type="text/javascript">
+                                                                               <% for j, d in ipairs(val.deps) do %>cbi_d_add("cbi-<%=self.config.."-"..self.section.."-"..val.option%>", "cbid.<%=self.config.."."..self.section.."."..d.field%>", "<%=d.value%>");
+                                                                               <% end %>
+                                                               </script><% end %>
                                                        <% end %>
                                                        </select>
                                                <% end %>
-                                                       <input type="submit" value="<%:cbi_addopt Feld hinzufügen%>" />
                                                </div>
                                        <% end %>
-                                       <br />
-                                       <% if self.addremove then %>
-                                               <input type="submit" name="cbi.rns.<%=self.config%>.<%=self.section%>" value="<%:cbi_del Eintrag entfernen%>" />
-                                       <% end %>
                                        </fieldset>
                                </div>
 <% elseif self.addremove then %>