map.htm 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. <div class="cbi-map" id="cbi-<%=self.config%>">
  5. <% if self.title and #self.title > 0 then %>
  6. <h2 name="content"><%=self.title%></h2>
  7. <% end %>
  8. <% if self.description and #self.description > 0 then %>
  9. <div class="cbi-map-descr"><%=self.description%></div>
  10. <% end %>
  11. <% if self.tabbed then %>
  12. <div>
  13. <% for i, section in ipairs(self.children) do
  14. tab = section.section or section.sectiontype %>
  15. <div class="cbi-tabcontainer"<%=
  16. attr("id", "container.m-%s.%s" %{ self.config, tab }) ..
  17. attr("data-tab", tab) ..
  18. attr("data-tab-title", section.title or tab)
  19. %>>
  20. <% section:render() %>
  21. </div>
  22. <% end %>
  23. </div>
  24. <% if not self.save then -%>
  25. <div class="cbi-section-error">
  26. <% for _, section in ipairs(self.children) do %>
  27. <% if section.error and section.error[section.section] then -%>
  28. <ul><li>
  29. <%:One or more invalid/required values on tab%>:&nbsp;<%=section.title or section.section or section.sectiontype%>
  30. </li></ul>
  31. <%- end %>
  32. <% end %>
  33. </div>
  34. <%- end %>
  35. <% else %>
  36. <%- self:render_children() %>
  37. <% end %>
  38. </div>