2 Copyright
2017-
2018 Dirk Brenken (dev@brenken.org)
3 This is free software, licensed under the Apache License, Version
2.0
10 return (rowcnt %
2) +
1
15 if type(o.width) == 'number' then
16 return '
style=
"width:%dpx"' % o.width
18 return '
style=
"width:%s"' % o.width
24 <style type=
"text/css">
25 .table.cbi-section-table .th,
26 .table.cbi-section-table .td,
27 .cbi-section-table-cell,
28 .cbi-section-table-row
37 .table.cbi-section-table .th
41 .table.cbi-section-table input
51 background:transparent;
58 local anonclass = (not self.anonymous or self.sectiontitle) and
"named" or
"anonymous"
59 local titlename = ifattr(not self.anonymous or self.sectiontitle,
"data-title", translate(
"Name"))
62 <fieldset class=
"cbi-section" id=
"cbi-<%=self.config%>-<%=self.sectiontype%>">
63 <% if self.title then -%
>
64 <legend><%=self.title%
></legend>
66 <div class=
"cbi-section-descr"><%=self.description%
></div>
67 <div class=
"cbi-section-node">
68 <div class=
"table cbi-section-table">
69 <div class=
"tr cbi-section-table-titles <%=anonclass%>"<%=titlename%
>>
70 <%- for i, k in pairs(self.children) do -%
>
71 <div class=
"th cbi-section-table-cell"<%=width(k)%
>>
76 <%- local isempty = true
77 for i, k in ipairs(self:cfgsections()) do
79 local sectionname = striptags((type(self.sectiontitle) ==
"function") and self:sectiontitle(section) or k)
80 local sectiontitle = ifattr(sectionname and (not self.anonymous or self.sectiontitle),
"data-title", sectionname)
83 scope = { valueheader =
"cbi/cell_valueheader", valuefooter =
"cbi/cell_valuefooter" }
85 <div class=
"tr cbi-section-table-row" id=
"cbi-<%=self.config%>-<%=section%>"<%=sectiontitle%
>>
87 for k, node in ipairs(self.children) do
88 node:render(section, scope or {})
90 if not scope.cbid:match(
"adb_src_cat") then
92 <div class=
"td cbi-value-field"> </div>