X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=libs%2Fcbi%2Fluasrc%2Fview%2Fcbi%2Ftblsection.htm;h=d03d6f49714b7649ea270d23a8bcc42d9c66019a;hp=6f2029e3bb07c85b0dd01de7addb7f3d0732ba26;hb=68d499edb91de2d73f14d5dcc4d6328fff2e23ea;hpb=05d3bf06b4ae6f07ed1c55fd1f7b4e97cb0e2d3d diff --git a/libs/cbi/luasrc/view/cbi/tblsection.htm b/libs/cbi/luasrc/view/cbi/tblsection.htm index 6f2029e3b..d03d6f497 100644 --- a/libs/cbi/luasrc/view/cbi/tblsection.htm +++ b/libs/cbi/luasrc/view/cbi/tblsection.htm @@ -12,56 +12,94 @@ You may obtain a copy of the License at $Id$ -%> +<%- +local rowcnt = 1 +function rowstyle() + rowcnt = rowcnt + 1 + return (rowcnt % 2) + 1 +end +-%> -
-

<%=self.title%>

+ +
+ <% if self.title and #self.title > 0 then -%> + <%=self.title%> + <%- end %>
<%=self.description%>
<%- local count = 0 -%> - <%- for i, k in pairs(self.children) do -%> - - <%- count = count + 1; end; if self.addremove then -%> + <%- 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 -%> - <%- for i, k in pairs(self.children) do -%> + <%- if not self.anonymous then -%> + + <%- end -%> + <%- for i, k in pairs(self.children) do if not k.optional then -%> - <%- end; if self.addremove then -%> - + <%- end; end; if self.extedit or self.addremove then -%> + <%- end -%> - <%- for i, k in ipairs(self:cfgsections()) do - if not self.anonymous 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" } -%> - - <%-+cbi/ucisection-%> - <%- if self.addremove then -%> + + <% 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 -%> <%- end -%> - <%- if self.addremove then -%> + <%- if isempty then -%> + + + <%- end -%> +
<%=k.title%>  + <%- if k.titleref then -%><%- end -%> + <%-=k.title-%> + <%- if k.titleref then -%><%- end -%> +  
<%=k.description%> 

<%=k%>

<%=k%>

- + <%- if self.extedit then -%> + <%:edit%> + <%- end; if self.addremove then %> + + <%- end -%>

<%:cbi_sectempty%>
+ <%- if self.addremove then -%> +
<% if self.anonymous then %> - + <% else %> - + <% end %> <% if self.err_invalid then %> @@ -69,8 +107,8 @@ $Id$ <% end %>
- +
<%- end -%> -
-
+ +