X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=libs%2Fcbi%2Fluasrc%2Fview%2Fcbi%2Ftblsection.htm;h=898645a72bf3599069a15021e97a7bb84c4e4243;hp=df16efbed03788c64f94a1a91ea1477f29076d3b;hb=50442d7438766d8d67b33167978c23eb7713375c;hpb=d35a620e9f5665a94967f4bd02c93581a1dd7e00 diff --git a/libs/cbi/luasrc/view/cbi/tblsection.htm b/libs/cbi/luasrc/view/cbi/tblsection.htm index df16efbed..898645a72 100644 --- a/libs/cbi/luasrc/view/cbi/tblsection.htm +++ b/libs/cbi/luasrc/view/cbi/tblsection.htm @@ -1,39 +1,127 @@ -
-

<%=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 %> -
- <% if self.anonymous then %> - - <% else %> - - - <% end %><% if self.err_invalid then %>
<%:cbi_invalid Fehler: Ungültige Eingabe%>
<% end %> -
-
-<% end %> -
+<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ + +-%> +<%- +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 -%> + + <%- 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 -%> +

<%:cbi_sectempty%>
+ + <% 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 %> + + <%- 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 -%> +
+
+