luci-base: fix colspans calculation in tblsection
[project/luci.git] / modules / luci-base / luasrc / view / cbi / tblsection.htm
index fcf2161..3cb8756 100644 (file)
@@ -35,7 +35,7 @@ end
                                <%- else -%>
                                        <th>&#160;</th>
                                <%- end -%>
-                       <%- end -%>
+                       <%- count = count +1; end -%>
                        <%- for i, k in pairs(self.children) do if not k.optional then -%>
                                <th class="cbi-section-table-cell"<%=width(k)%>>
                                <%- if k.titleref then -%><a title="<%=self.titledesc or translate('Go to relevant configuration page')%>" class="cbi-title-ref" href="<%=k.titleref%>"><%- end -%>
@@ -44,7 +44,7 @@ end
                                </th>
                        <%- count = count + 1; end; end; if self.sortable then -%>
                                <th class="cbi-section-table-cell"><%:Sort%></th>
-                       <%- end; if self.extedit or self.addremove then -%>
+                       <%- count = count + 1; end; if self.extedit or self.addremove then -%>
                                <th class="cbi-section-table-cell">&#160;</th>
                        <%- count = count + 1; end -%>
                        </tr>
@@ -131,8 +131,7 @@ end
                                        <input class="cbi-button cbi-button-add" type="submit" value="<%:Add%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" title="<%: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 class="cbi-button cbi-button-add" type="submit" onclick="this.form.cbi_state='add-section'; return true" value="<%:Add%>" title="<%:Add%>" />
                                        <% if self.invalid_cts then -%>
                                                <br /><%:Invalid%></div>