X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=libs%2Fcbi%2Fluasrc%2Fview%2Fcbi%2Ftblsection.htm;h=029ad661ccd632b5bc309dd12591fae8978bc62d;hp=cfee09f1c9f6d57d47776bf9edb399a17d9b753c;hb=c730262d146891919a12cc07765805a77e9c4ff2;hpb=5a92c0fc089f8af4cdd5c35e94a563526c872ffd diff --git a/libs/cbi/luasrc/view/cbi/tblsection.htm b/libs/cbi/luasrc/view/cbi/tblsection.htm index cfee09f1c..029ad661c 100644 --- a/libs/cbi/luasrc/view/cbi/tblsection.htm +++ b/libs/cbi/luasrc/view/cbi/tblsection.htm @@ -21,30 +21,44 @@ end -%> -
-

<%=self.title%>

+
+ <% if self.title and #self.title > 0 then -%> + <%=self.title%> + <%- end %>
<%=self.description%>
<%- local count = 0 -%> <%- if not self.anonymous then -%> - + <%- if self.sectionhead then -%> + + <%- else -%> + + <%- end -%> <%- end -%> - <%- for i, k in pairs(self.children) do -%> - - <%- count = count + 1; end; if self.extedit or self.addremove then -%> - + <%- 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 -%> - + <%- if self.sectiondesc then -%> + + <%- else -%> + + <%- end -%> <%- end -%> - <%- for i, k in pairs(self.children) do -%> + <%- for i, k in pairs(self.children) do if not k.optional then -%> - <%- end; if self.extedit or self.addremove then -%> - + <%- end; end; if self.extedit or self.addremove then -%> + <%- end -%> <%- local isempty = true @@ -53,15 +67,30 @@ end isempty = false scope = { valueheader = "cbi/cell_valueheader", valuefooter = "cbi/cell_valuefooter" } -%> - + <% if not self.anonymous then -%> <%- end %> - <%-+cbi/ucisection-%> + + + <%- + 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 -%>
 <%=self.sectionhead%> <%=k.title%>  + <%- if k.titleref then -%><%- end -%> + <%-=k.title-%> + <%- if k.titleref then -%><%- end -%> +  
 <%=self.sectiondesc%><%=k.description%> 

<%=k%>

<%- if self.extedit then -%> - <%:edit%> + + <%=self.extedit:format(section)%> + <%- elseif type(self.extedit) == "function" then -%> + <%=self:extedit(section)%> + <%- end -%> + " title="<%:edit%>"><%:edit%> <%- end; if self.addremove then %> <%- end -%> @@ -76,25 +105,31 @@ end
- <%- if self.addremove then -%> -
-
- -
- <% if self.anonymous then %> - - <% else %> - - - <% end %> - <% if self.err_invalid then %> -
<%:cbi_invalid%>
- <% end %> -
- + <% if self.error then %> +
+
    <% for _, c in pairs(self.error) do for _, e in ipairs(c) do -%> +
  • <%=luci.util.pcdata(e):gsub("\n","
    ")%>
  • + <%- end end %>
- <%- end -%> + <% end %> + + <%- if self.addremove then -%> + <% if self.template_addremove then include(self.template_addremove) else -%> +
+ <% if self.anonymous then %> + + <% else %> + <% if self.invalid_cts then -%>
<% end %> + + + <% if self.invalid_cts then -%> +
<%:cbi_invalid%>
+ <%- end %> + <% end %> +
+ <%- end %> + <%- end -%>
-
+