1 <%- if firstmap and messages then local msg; for _, msg in ipairs(messages) do -%>
2 <div class="alert-message warning"><%=pcdata(msg)%></div>
6 local function has_access(config, level)
7 local rv = luci.util.ubus("session", "access", {
8 ubus_rpc_session = luci.dispatcher.context.authsession,
14 return (type(rv) == "table" and rv.access == true) or false
17 local is_readable = has_access(self.config, "read")
18 local is_writable = has_access(self.config, "write")
20 has_writeable_map = has_writeable_map or is_writable
23 <% if is_readable then %>
24 <div class="cbi-map" id="cbi-<%=self.config%>"<%=ifattr(not is_writable, "style", "opacity:.6; pointer-events:none")%>>
25 <% if self.title and #self.title > 0 then %>
26 <h2 name="content"><%=self.title%></h2>
28 <% if self.description and #self.description > 0 then %>
29 <div class="cbi-map-descr"><%=self.description%></div>
31 <% if self.tabbed then %>
33 <% for i, section in ipairs(self.children) do
34 tab = section.section or section.sectiontype %>
35 <div class="cbi-tabcontainer"<%=
36 attr("id", "container.m-%s.%s" %{ self.config, tab }) ..
37 attr("data-tab", tab) ..
38 attr("data-tab-title", section.title or tab)
40 <% section:render() %>
45 <% if not self.save then -%>
46 <div class="cbi-section-error">
47 <% for _, section in ipairs(self.children) do %>
48 <% if section.error and section.error[section.section] then -%>
50 <%:One or more invalid/required values on tab%>: <%=section.title or section.section or section.sectiontype%>
57 <%- self:render_children() %>
61 <div class="alert-message warning"><%:Insufficient permissions to read UCI configuration.%></div>