%- local rowcnt = 0 function rowstyle() rowcnt = rowcnt + 1 if rowcnt % 2 == 0 then return " cbi-rowstyle-1" else return " cbi-rowstyle-2" end 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 local has_titles = false local has_descriptions = false local anonclass = (not self.anonymous or self.sectiontitle) and "named" or "anonymous" local titlename = ifattr(not self.anonymous or self.sectiontitle, "data-title", translate("Name")) local i, k for i, k in pairs(self.children) do if not k.typename then k.typename = k.template and k.template:gsub("^.+/", "") or "" end if not has_titles and k.title and #k.title > 0 then has_titles = true end if not has_descriptions and k.description and #k.description > 0 then has_descriptions = true end end function render_titles() if not has_titles then return end %>
<%=num%> <% num = num + 1 -%> |
<%-
local node
for k, node in ipairs(self.children) do
if not node.optional then
node:render(section, scope or {})
end
end
-%>
<%- 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 -%>
<%:This section contains no values yet%> |