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=44ff589d7c27bfa4153dccd30f7664f698eb5bed;hb=68d499edb91de2d73f14d5dcc4d6328fff2e23ea;hpb=94a968e62fba7c6a8bead83db339e525d6a9d39a diff --git a/libs/cbi/luasrc/view/cbi/tblsection.htm b/libs/cbi/luasrc/view/cbi/tblsection.htm index 44ff589d7..d03d6f497 100644 --- a/libs/cbi/luasrc/view/cbi/tblsection.htm +++ b/libs/cbi/luasrc/view/cbi/tblsection.htm @@ -12,65 +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 -%> <%- local isempty = true for i, k in ipairs(self:cfgsections()) do - isempty = false - - if not self.anonymous then - -%> - - - - <%- end 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 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%>
<%:cbi_sectempty%>
<%- if self.addremove then -%> - +
<% if self.anonymous then %> - + <% else %> - + <% end %> <% if self.err_invalid then %> @@ -78,8 +107,8 @@ $Id$ <% end %>
- +
<%- end -%> -
-
+ +