tsection.htm 2.0 KB

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