From d4dc08dcb219a278a94e68aa87c13bca6361eeca Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 11 Jun 2014 14:00:09 +0000 Subject: Fix wrong directory in luci-base --- modules/base/luasrc/view/cbi/tblsection.htm | 146 ++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 modules/base/luasrc/view/cbi/tblsection.htm (limited to 'modules/base/luasrc/view/cbi/tblsection.htm') diff --git a/modules/base/luasrc/view/cbi/tblsection.htm b/modules/base/luasrc/view/cbi/tblsection.htm new file mode 100644 index 0000000000..d928791167 --- /dev/null +++ b/modules/base/luasrc/view/cbi/tblsection.htm @@ -0,0 +1,146 @@ +<%- +local rowcnt = 1 +function rowstyle() + rowcnt = rowcnt + 1 + return (rowcnt % 2) + 1 +end + +function width(o) + if o.width then + if type(o.width) == 'number' then + return ' style="width:%dpx"' % o.width + end + return ' style="width:%s"' % o.width + end + return '' +end +-%> + + +
+ <% if self.title and #self.title > 0 then -%> + <%=self.title%> + <%- end %> + <%- if self.sortable then -%> + + <%- 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.sortable then -%> + + <%- 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.sortable then -%> + + <%- 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.sortable then -%> + + <%- 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 -%> + <%:Sort%> 
<%=self.sectiondesc%>><%=k.description%>

<%=(type(self.sectiontitle) == "function") and self:sectiontitle(section) or k%>

+ + + + <%- if self.extedit then -%> + onclick="location.href='<%=self.extedit:format(section)%>'" + <%- elseif type(self.extedit) == "function" then + %> onclick="location.href='<%=self:extedit(section)%>'" + <%- end + %> alt="<%:Edit%>" title="<%:Edit%>" /> + <%- end; if self.addremove then %> + + <%- end -%> +

<%:This section contains no values yet%>
+ + <% 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 -%> +
<%:Invalid%>
+ <%- end %> + <% end %> +
+ <%- end %> + <%- end -%> +
+
+ -- cgit v1.2.3