modules/admin-full: fix arp lookup in wifi overview
[project/luci.git] / libs / cbi / luasrc / view / cbi / ucisection.htm
index 5023f6a..db32c90 100644 (file)
@@ -13,11 +13,35 @@ $Id$
 
 -%>
 
-<% self:render_children(section, scope or {}) %>
+<%-
+       if type(self.hidden) == "table" then
+               for k, v in pairs(self.hidden) do
+-%>
+       <input type="hidden" id="<%=k%>" name="<%=k%>" value="<%=pcdata(v)%>" />
+<%-
+               end
+       end
+%>
+
+<% if self.tabs then %>
+       <%+cbi/tabcontainer%>
+<% else %>
+       <% self:render_children(section, scope or {}) %>
+<% end %>
 
 <% if self.error and self.error[section] then -%>
        <div class="cbi-section-error">
-               <ul><% for _, e in ipairs(self.error[section]) do %><li><%=luci.util.pcdata(e):gsub("\n","<br />")%></li><% end %></ul>
+               <ul><% for _, e in ipairs(self.error[section]) do -%>
+                       <li>
+                               <%- if e == "invalid" then -%>
+                                       <%:One or more fields contain invalid values!%>
+                               <%- elseif e == "missing" then -%>
+                                       <%:One or more required fields have no value!%>
+                               <%- else -%>
+                                       <%=pcdata(e)%>
+                               <%- end -%>
+                       </li>
+               <%- end %></ul>
        </div>
 <%- end %>
 
@@ -36,12 +60,12 @@ $Id$
                                <%-
                                        end
                                -%>
-                               }, '', '<%-:cbi_manual-%>');
+                               }, '', '<%-: -- custom -- -%>');
                        </script>
                        <% end %>
                <% else %>
-               <select name="cbi.opt.<%=self.config%>.<%=section%>">
-                       <option><%:cbi_addopt%></option>
+               <select id="cbi.opt.<%=self.config%>.<%=section%>" name="cbi.opt.<%=self.config%>.<%=section%>">
+                       <option><%: -- Additional Field -- %></option>
                        <% for key, val in pairs(self.optionals[section]) do -%>
                                <option id="cbi-<%=self.config.."-"..section.."-"..val.option%>" value="<%=val.option%>"><%=striptags(val.title)%></option>
                        <%- end %>
@@ -52,7 +76,8 @@ $Id$
                <%-
                        for k,v in pairs(d.deps) do
                -%>
-                       <%-=string.format('"cbid.%s.%s.%s"', self.config, section, k) .. ":" .. string.format("%q", v)-%>,
+                       <%-=string.format('"cbid.%s.%s.%s"', self.config, section, k) .. ":" .. string.format("%q", v)-%>
+                       <%-if next(d.deps, k) then-%>,<%-end-%>
                <%-
                        end
                -%>
@@ -60,6 +85,6 @@ $Id$
                <%- end %><% end %>
                <% end %></script>
        <% end %>
-               <input type="submit" class="cbi-button cbi-button-fieldadd" value="<%:add%>" />
+               <input type="submit" class="cbi-button cbi-button-fieldadd" value="<%:Add%>" />
        </div>
 <% end %>