X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=libs%2Fcbi%2Fluasrc%2Fview%2Fcbi%2Ftblsection.htm;h=5a2b247344012d5cd6e5c75742ff6ff19a9939a6;hb=898c45743aeda97da9e129d4d317d542eca3b4a4;hp=367af80b880984c80b73c1c01852b6b7e4b7f3ec;hpb=dfe0287c6fbab70c359f97c4b9d72a53bc5ff0e2;p=project%2Fluci.git diff --git a/libs/cbi/luasrc/view/cbi/tblsection.htm b/libs/cbi/luasrc/view/cbi/tblsection.htm index 367af80b8..5a2b24734 100644 --- a/libs/cbi/luasrc/view/cbi/tblsection.htm +++ b/libs/cbi/luasrc/view/cbi/tblsection.htm @@ -12,64 +12,112 @@ You may obtain a copy of the License at $Id$ -%> -
-

<%=self.title%>

-
<%=self.description%>
-
- <%- local count = 0 -%> - - - <%- for i, k in pairs(self.children) do -%> - - <%- count = count + 1; end; if self.addremove then -%> - - <%- count = count + 1; end -%> - - - <%- for i, k in pairs(self.children) do -%> - - <%- end; if self.addremove then -%> - - <%- end -%> - - <%- for i, k in ipairs(self:cfgsections()) do - if not self.anonymous then - -%> - - - - <%- end - section = k - scope = { valueheader = "cbi/cell_valueheader", valuefooter = "cbi/cell_valuefooter" } - -%> - - <%-+cbi/ucisection-%> - <%- if self.addremove then -%> - - <%- end -%> - - <%- end -%> +<%- +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 -%> +
<%=k.title%> 
<%=k.description%> 

<%=k%>

- -
+ + <%- 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 %> - <%- if self.addremove then -%> - - - + <%- + 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 -%> +
  + <%- if k.titleref then -%><%- end -%> + <%-=k.title-%> + <%- if k.titleref then -%><%- end -%> +  
<%=k.description%>

<%=k%>

-
- <% if self.anonymous then %> - - <% else %> - - - <% end %> - <% if self.err_invalid then %> -
<%:cbi_invalid%>
- <% end %> -
-
+ <%- 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 -%> + + <%- end -%> + + <%- end -%> + + <%- if isempty then -%> + +
<%:cbi_sectempty%>
+ + <%- end -%> + + + <% if self.error then %> +
+
    <% for _, e in ipairs(self.error) do %>
  • <%=luci.util.pcdata(e):gsub("\n","
    ")%>
  • <% end %>
+
+ <% end %> + + <%- if self.addremove then -%> +
+ +
+ <% if self.anonymous then %> + + <% else %> + + + <% end %>
-
+ +
+ <%- end -%> +
+ +