2
0

map.htm 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. <% if readable then %>
  5. <div class="cbi-map" id="cbi-<%=self.config%>"<%=ifattr(not writable, "style", "opacity:.6; pointer-events:none")%>>
  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. <% if not self.save then -%>
  26. <div class="cbi-section-error">
  27. <% for _, section in ipairs(self.children) do %>
  28. <% if section.error and section.error[section.section] then -%>
  29. <ul><li>
  30. <%:One or more invalid/required values on tab%>:&nbsp;<%=section.title or section.section or section.sectiontype%>
  31. </li></ul>
  32. <%- end %>
  33. <% end %>
  34. </div>
  35. <%- end %>
  36. <% else %>
  37. <%- self:render_children() %>
  38. <% end %>
  39. </div>
  40. <% else %>
  41. <div class="alert-message warning"><%:Insufficient permissions to read UCI configuration.%></div>
  42. <% end %>