<%# 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 -%> <%- if self.sectionhead then -%> <%- else -%> <%- end -%> <%- 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 -%> <%- if self.sectiondesc then -%> <%- else -%> <%- end -%> <%- 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 -%>
<%=self.sectionhead%>  <%- if k.titleref then -%><%- end -%> <%-=k.title-%> <%- if k.titleref then -%><%- end -%>  
<%=self.sectiondesc%><%=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 -%>
  • <%=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 -%>