rowcnt = rowcnt + 1
return (rowcnt % 2) + 1
end
+
+function width(o)
+ if o.width then
+ if type(o.width) == 'number' then
+ return ' style="width:%dpx"' % o.width
+ end
+ return ' style="width:%s"' % o.width
+ end
+ return ''
+end
-%>
<!-- tblsection -->
<%- end -%>
<%- end -%>
<%- for i, k in pairs(self.children) do if not k.optional then -%>
- <th class="cbi-section-table-cell">
+ <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 -%>
<%-=k.title-%>
<%- if k.titleref then -%></a><%- end -%>
<%- end -%>
<%- end -%>
<%- for i, k in pairs(self.children) do if not k.optional then -%>
- <th class="cbi-section-table-cell"><%=k.description%></th>
+ <th class="cbi-section-table-cell"<%=width(k)%>><%=k.description%></th>
<%- end; end; if self.extedit or self.addremove then -%>
<th class="cbi-section-table-cell"></th>
<%- end -%>
-%>
<%- if self.extedit or self.addremove then -%>
- <td class="cbi-section-table-cell">
+ <td class="cbi-section-table-cell" style="width:50px">
<%- if self.extedit then -%>
<a href="
<%- if type(self.extedit) == "string" then -%>
<input class="cbi-button cbi-button-add" type="submit" value="<%:Add%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" title="<%:Add%>" />
<% else %>
<% if self.invalid_cts then -%><div class="cbi-section-error"><% end %>
- <input type="text" class="cbi-section-create-name" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" />
+ <input type="text" class="cbi-section-create-name" id="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" />
+ <script type="text/javascript">cbi_validate_field('cbi.cts.<%=self.config%>.<%=self.sectiontype%>', true, 'uciname');</script>
<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>