From d0b91bcca266a6d386f9ebeef695e1cef34ad9cf Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 19 Jun 2018 17:10:38 +0200 Subject: luci-base: globally cleanup markup - add responsive attributes to partial cbi templates - unify and fix button style classes - fix styling of sysauth dialog - rework firewall_zoneforwards widget Signed-off-by: Jo-Philipp Wich --- modules/luci-base/luasrc/view/cbi/tblsection.htm | 203 +++++++++++------------ 1 file changed, 93 insertions(+), 110 deletions(-) (limited to 'modules/luci-base/luasrc/view/cbi/tblsection.htm') diff --git a/modules/luci-base/luasrc/view/cbi/tblsection.htm b/modules/luci-base/luasrc/view/cbi/tblsection.htm index bb11cf1c06..76434f7e2b 100644 --- a/modules/luci-base/luasrc/view/cbi/tblsection.htm +++ b/modules/luci-base/luasrc/view/cbi/tblsection.htm @@ -14,10 +14,11 @@ function width(o) end return '' end + -%> -
+
<% if self.title and #self.title > 0 then -%> <%=self.title%> <%- end %> @@ -25,121 +26,103 @@ end <%- end -%>
<%=self.description%>
-
- <%- local count = 0 -%> -
-
- <%- if not self.anonymous then -%> - <%- if self.sectionhead then -%> -
<%=self.sectionhead%>
- <%- else -%> -
 
- <%- end -%> - <%- count = count +1; end -%> - <%- for i, k in pairs(self.children) do if not k.optional then -%> -
> - <%- if k.titleref then -%><%- end -%> - <%-=k.title-%> - <%- if k.titleref then -%><%- end -%> -
- <%- count = count + 1; end; end; if self.sortable then -%> -
<%:Sort%>
- <%- count = count + 1; end; if self.extedit or self.addremove then -%> -
 
- <%- count = count + 1; end -%> -
-
- <%- if not self.anonymous then -%> - <%- if self.sectiondesc then -%> -
<%=self.sectiondesc%>
- <%- else -%> -
- <%- end -%> - <%- end -%> - <%- for i, k in pairs(self.children) do if not k.optional then -%> -
><%=k.description%>
- <%- end; end; if self.sortable then -%> -
- <%- end; if self.extedit or self.addremove then -%> -
- <%- end -%> + <%- local count = 0 -%> +
+
"> + <%- for i, k in pairs(self.children) do if not k.optional then -%> +
> + <%- if k.titleref then -%><%- end -%> + <%-=k.title-%> + <%- if k.titleref 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 -%> -

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

- <%- end %> - - - <%- - for k, node in ipairs(self.children) do - if not node.optional then - node:render(section, scope or {}) - end + <%- count = count + 1; end; end; if self.sortable or self.extedit or self.addremove then -%> +
+ <%- count = count + 1; end -%> +
+
+ <%- for i, k in pairs(self.children) do if not k.optional then -%> +
><%=k.description%>
+ <%- end; end; if self.sortable or self.extedit or self.addremove then -%> +
+ <%- end -%> +
+ <%- local isempty = true + for i, k in ipairs(self:cfgsections()) do + section = k + isempty = false + title = striptags((type(self.sectiontitle) == "function") and self:sectiontitle(section) or k) + scope = { + valueheader = "cbi/cell_valueheader", + valuefooter = "cbi/cell_valuefooter" + } + -%> +
> + <%- + for k, node in ipairs(self.children) do + if not node.optional then + node:render(section, scope or {}) end - -%> - - <%- if self.sortable then -%> -
- - -
- <%- end -%> - - <%- if self.extedit or self.addremove then -%> -
- <%- 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 -%> -
- <%- end -%> -
- <%- end -%> + end + -%> - <%- if isempty then -%> -
-

<%:This section contains no values yet%>
-
+ <%- if self.sortable or self.extedit or self.addremove then -%> +
+ <%- if self.sortable then -%> + + + <% end; 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 -%> +
<%- end -%>
+ <%- end -%> - <% 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 %> + <%- if isempty then -%> +
+
<%:This section contains no values yet%>
+
<%- end -%>
-
+ + <% 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 -%> +
<%:Invalid%>
+ <%- end %> +
+ +
+ + <% end %> +
+ <%- end %> + <%- end -%> + -- cgit v1.2.3