luci-base: cbi: fix dependency handling of list and multivalues with radio/checkbox...
[project/luci.git] / modules / luci-base / luasrc / view / cbi / tsection.htm
index 087548b..726521a 100644 (file)
@@ -2,7 +2,9 @@
        <% if self.title and #self.title > 0 then -%>
                <legend><%=self.title%></legend>
        <%- end %>
-       <div class="cbi-section-descr"><%=self.description%></div>
+       <% if self.description and #self.description > 0 then -%>
+               <div class="cbi-section-descr"><%=self.description%></div>
+       <%- end %>
        <% local isempty = true for i, k in ipairs(self:cfgsections()) do -%>
                <% if self.addremove then -%>
                        <div class="cbi-section-remove right">
@@ -35,8 +37,7 @@
                                <input type="submit" class="cbi-button cbi-button-add" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" value="<%:Add%>" />
                        <%- else -%>
                                <% if self.invalid_cts then -%><div class="cbi-section-error"><% end %>
-                               <input type="text" class="cbi-section-create-name" id="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" />
-                               <script type="text/javascript">cbi_validate_field('cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>', true, 'uciname');</script>
+                               <input type="text" class="cbi-section-create-name" id="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" data-type="uciname" data-optional="true" />
                                <input type="submit" class="cbi-button cbi-button-add" onclick="this.form.cbi_state='add-section'; return true" value="<%:Add%>" />
                                <% if self.invalid_cts then -%>
                                        <br /><%:Invalid%></div>