Merge pageactions
[project/luci.git] / libs / cbi / luasrc / view / cbi / ucisection.htm
index 92343bb..5504a74 100644 (file)
@@ -31,7 +31,8 @@ $Id$
                                <%-
                                        for i, val in pairs(self.optionals[section]) do
                                -%>
-                                       <%-=string.format("%q", striptags(val.title)) .. ":" .. string.format("%q", val.option)-%>,
+                                       <%-=string.format("%q", val.option) .. ":" .. string.format("%q", striptags(val.title))-%>
+                                       <%-if next(self.optionals[section], i) then-%>,<%-end-%>
                                <%-
                                        end
                                -%>
@@ -39,7 +40,7 @@ $Id$
                        </script>
                        <% end %>
                <% else %>
-               <select name="cbi.opt.<%=self.config%>.<%=section%>">
+               <select id="cbi.opt.<%=self.config%>.<%=section%>" 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%>"><%=striptags(val.title)%></option>
@@ -51,7 +52,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
                -%>