tsection.htm 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
  2. <% if self.title and #self.title > 0 then -%>
  3. <legend><%=self.title%></legend>
  4. <%- end %>
  5. <div class="cbi-section-descr"><%=self.description%></div>
  6. <% local isempty = true for i, k in ipairs(self:cfgsections()) do -%>
  7. <% if self.addremove then -%>
  8. <div class="cbi-section-remove right">
  9. <input type="submit" name="cbi.rts.<%=self.config%>.<%=k%>" onclick="this.form.cbi_state='del-section'; return true" value="<%:Delete%>" class="cbi-button" />
  10. </div>
  11. <%- end %>
  12. <%- section = k; isempty = false -%>
  13. <% if not self.anonymous then -%>
  14. <h3><%=section:upper()%></h3>
  15. <%- end %>
  16. <%+cbi/tabmenu%>
  17. <fieldset class="cbi-section-node<% if self.tabs then %> cbi-section-node-tabbed<% end %>" id="cbi-<%=self.config%>-<%=section%>">
  18. <%+cbi/ucisection%>
  19. </fieldset>
  20. <br />
  21. <%- end %>
  22. <% if isempty then -%>
  23. <em><%:This section contains no values yet%><br /><br /></em>
  24. <%- end %>
  25. <% if self.addremove then -%>
  26. <% if self.template_addremove then include(self.template_addremove) else -%>
  27. <div class="cbi-section-create">
  28. <% if self.anonymous then -%>
  29. <input type="submit" class="cbi-button cbi-button-add" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" value="<%:Add%>" />
  30. <%- else -%>
  31. <% if self.invalid_cts then -%><div class="cbi-section-error"><% end %>
  32. <input type="text" class="cbi-section-create-name" id="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" />
  33. <script type="text/javascript">cbi_validate_field('cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>', true, 'uciname');</script>
  34. <input type="submit" class="cbi-button cbi-button-add" onclick="this.form.cbi_state='add-section'; return true" value="<%:Add%>" />
  35. <% if self.invalid_cts then -%>
  36. <br /><%:Invalid%></div>
  37. <%- end %>
  38. <%- end %>
  39. </div>
  40. <%- end %>
  41. <%- end %>
  42. </fieldset>