luci-base, luci-app-firewall: port custom rules to client side view
[project/luci.git] / modules / luci-base / luasrc / view / cbi / map.htm
1 <%- if firstmap and messages then local msg; for _, msg in ipairs(messages) do -%>
2 <div class="alert-message warning"><%=pcdata(msg)%></div>
3 <%- end end -%>
4
5 <div class="cbi-map" id="cbi-<%=self.config%>">
6 <% if self.title and #self.title > 0 then %>
7 <h2 name="content"><%=self.title%></h2>
8 <% end %>
9 <% if self.description and #self.description > 0 then %>
10 <div class="cbi-map-descr"><%=self.description%></div>
11 <% end %>
12 <% if self.tabbed then %>
13 <div>
14 <% for i, section in ipairs(self.children) do
15 tab = section.section or section.sectiontype %>
16 <div class="cbi-tabcontainer"<%=
17 attr("id", "container.m-%s.%s" %{ self.config, tab }) ..
18 attr("data-tab", tab) ..
19 attr("data-tab-title", section.title or tab)
20 %>>
21 <% section:render() %>
22 </div>
23 <% end %>
24 </div>
25
26 <% if not self.save then -%>
27 <div class="cbi-section-error">
28 <% for _, section in ipairs(self.children) do %>
29 <% if section.error and section.error[section.section] then -%>
30 <ul><li>
31 <%:One or more invalid/required values on tab%>:&nbsp;<%=section.title or section.section or section.sectiontype%>
32 </li></ul>
33 <%- end %>
34 <% end %>
35 </div>
36 <%- end %>
37 <% else %>
38 <%- self:render_children() %>
39 <% end %>
40 </div>