X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=libs%2Fcbi%2Fluasrc%2Fview%2Fcbi%2Ftblsection.htm;h=a557c584fd1668f514fe8931502c080e2a89c38a;hb=e63d3f03eb1360c1d2c1bc58a343e2e8adc78ace;hp=2688e7a1b3efd02e01f0592c1168c7d51920bc3a;hpb=15886656187565d990230b681cdcd1221ffc3d8b;p=project%2Fluci.git diff --git a/libs/cbi/luasrc/view/cbi/tblsection.htm b/libs/cbi/luasrc/view/cbi/tblsection.htm index 2688e7a1b..a557c584f 100644 --- a/libs/cbi/luasrc/view/cbi/tblsection.htm +++ b/libs/cbi/luasrc/view/cbi/tblsection.htm @@ -12,42 +12,122 @@ You may obtain a copy of the License at $Id$ -%> -
-

<%=self.title%>

-
<%=self.description%>
-
-
-<% for i, k in pairs(self.children) do %> -
<%=k.title%>
-<% end %> -
-
-<% for i, k in pairs(self.children) do %> -
<%=k.description%>
-<% end %> -
-<% for i, k in ipairs(self:cfgsections()) do%> - <% if not self.anonymous then %>

<%=k%>

<% end %> -<% -section = k -scope = {valueheader = "cbi/tiny_valueheader", valuefooter = "cbi/tiny_valuefooter"} -%> -
-<%+cbi/ucisection%> - <% if self.addremove then %>
- -
<% end %> -
-<% end %> -<% if self.addremove then %> +<%- +local rowcnt = 1 +function rowstyle() + rowcnt = rowcnt + 1 + return (rowcnt % 2) + 1 +end +-%> + + +
+ <% if self.title and #self.title > 0 then -%> + <%=self.title%> + <%- end %> +
<%=self.description%>
+
+ <%- local count = 0 -%> + + + <%- if not self.anonymous then -%> + + <%- end -%> + <%- for i, k in pairs(self.children) do if not k.optional then -%> + + <%- count = count + 1; end; end; if self.extedit or self.addremove then -%> + + <%- count = count + 1; end -%> + + + <%- if not self.anonymous then -%> + + <%- end -%> + <%- for i, k in pairs(self.children) do if not k.optional then -%> + + <%- end; end; if self.extedit or self.addremove then -%> + + <%- end -%> + + <%- local isempty = true + for i, k in ipairs(self:cfgsections()) do + section = k + isempty = false + scope = { valueheader = "cbi/cell_valueheader", valuefooter = "cbi/cell_valuefooter" } + -%> + + <% if not self.anonymous then -%> + + <%- end %> + + + <%- + for k, node in ipairs(self.children) do + if not node.optional then + node:render(section, scope or {}) + end + end + -%> + + <%- if self.extedit or self.addremove then -%> + + <%- end -%> + + <% if self.tag_deperror[section] or self.tag_invalid[section] or self.tag_error[section] then %> + + + + <% end %> + <%- end -%> + + <%- if isempty then -%> + + + + <%- end -%> +
  + <%- if k.titleref then -%><%- end -%> + <%-=k.title-%> + <%- if k.titleref then -%><%- end -%> +  
<%=k.description%>

<%=k%>

+ <%- if self.extedit then -%> + + <%=self.extedit:format(section)%> + <%- elseif type(self.extedit) == "function" then -%> + <%=self:extedit(section)%> + <%- end -%> + " title="<%:edit%>"><%:edit%> + <%- end; if self.addremove then %> + + <%- end -%> +
+ <%- if self.tag_deperror[section] then -%> +
<%:cbi_deperror%>
+ <%- elseif self.tag_invalid[section] then -%> +
<%:cbi_invalid_section%>
+ <%- elseif self.tag_error[section] then -%> +
<%=self.tag_error[section]%>
+ <%- end -%> +

<%:cbi_sectempty%>
+ <%- if self.addremove then -%> +
+
<% if self.anonymous then %> - + <% else %> - - <% end %><% if self.err_invalid then %>
<%:cbi_invalid%>
<% end %> -
+ + <% end %> + + <% if self.err_invalid then %> +
<%:cbi_invalid%>
+ <% end %>
-<% end %> -
+ +
+ <%- end -%> +
+ +