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">
26 .cbi-section-table-cell,
27 .cbi-section-table-row
36 <fieldset class=
"cbi-section" id=
"cbi-<%=self.config%>-<%=self.sectiontype%>">
37 <% if self.title then -%
>
38 <legend><%=self.title%
></legend>
40 <div class=
"cbi-section-descr"><%=self.description%
></div>
41 <div class=
"cbi-section-node">
42 <%- local count =
0 -%
>
43 <table class=
"cbi-section-table">
44 <tr class=
"cbi-section-table-titles">
45 <%- if self.sectionhead then -%
>
46 <th class=
"cbi-section-table-cell"><%=self.sectionhead%
></th>
50 <%- for i, k in pairs(self.children) do -%
>
51 <th class=
"cbi-section-table-cell"<%=width(k)%
>>
54 <%- count = count +
1; end; -%
>
56 <%- local isempty = true
57 for i, k in ipairs(self:cfgsections()) do
60 scope = { valueheader =
"cbi/cell_valueheader", valuefooter =
"cbi/cell_valuefooter" }
62 <tr class=
"cbi-section-table-row" id=
"cbi-<%=self.config%>-<%=section%>">
65 for k, node in ipairs(self.children) do
66 if not node.optional then
67 node:render(section, scope or {})
73 <%- if isempty then -%
>
74 <tr class=
"cbi-section-table-row">
75 <td colspan=
"<%=count%>"><em><br /><%:This section contains no values yet%
></em></td>