blocklist.htm 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <%#
  2. Copyright 2017-2018 Dirk Brenken (dev@brenken.org)
  3. This is free software, licensed under the Apache License, Version 2.0
  4. -%>
  5. <%-
  6. local anonclass = (not self.anonymous or self.sectiontitle) and "named" or "anonymous"
  7. -%>
  8. <%+adblock/adblock_css%>
  9. <div class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
  10. <% if self.title then -%>
  11. <h3><%=self.title%></h3>
  12. <%- end %>
  13. <div class="cbi-section-descr"><%=self.description%></div>
  14. <div class="cbi-section-node">
  15. <div class="table cbi-section-table">
  16. <div class="tr cbi-section-table-titles <%=anonclass%>">
  17. <%- for i, k in pairs(self.children) do -%>
  18. <div class="th cbi-section-table-cell">
  19. <%-=k.title-%>
  20. </div>
  21. <%- end -%>
  22. </div>
  23. <%- local section, scope, isempty = true
  24. for i, k in ipairs(self:cfgsections()) do
  25. section = k
  26. local sectionname = striptags((type(self.sectiontitle) == "function") and self:sectiontitle(section) or k)
  27. local sectiontitle = ifattr(sectionname and (not self.anonymous or self.sectiontitle), "data-title", sectionname, true)
  28. isempty = false
  29. scope = { valueheader = "cbi/cell_valueheader", valuefooter = "cbi/cell_valuefooter" }
  30. -%>
  31. <div class="tr cbi-section-table-row" id="cbi-<%=self.config%>-<%=section%>"<%=sectiontitle%>>
  32. <%-
  33. for k, node in ipairs(self.children) do
  34. node:render(section, scope or {})
  35. end
  36. if not scope.cbid:match("adb_src_cat") then
  37. -%>
  38. <div class="td cbi-value-field">&#160;</div>
  39. <%- end -%>
  40. </div>
  41. <%- end -%>
  42. </div>
  43. </div>
  44. </div>