summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-banip/luasrc/view/banip/sourcelist.htm
diff options
context:
space:
mode:
authorDirk Brenken <dev@brenken.org>2018-11-11 14:59:39 +0100
committerGitHub <noreply@github.com>2018-11-11 14:59:39 +0100
commitad4c7b01532471ee09a04fc1ae288e6e15849a8b (patch)
tree1316dd64bdd25b71da9e12646a850ac42998c512 /applications/luci-app-banip/luasrc/view/banip/sourcelist.htm
parentbe47cb741f488a14fb4b11a89c3a8b2e7b44d6cb (diff)
parente50021f77fbc593cee841a02ad66c4bfea072f9e (diff)
Merge pull request #2264 from dibdot/banip
luci-app-banip: new package
Diffstat (limited to 'applications/luci-app-banip/luasrc/view/banip/sourcelist.htm')
-rw-r--r--applications/luci-app-banip/luasrc/view/banip/sourcelist.htm47
1 files changed, 47 insertions, 0 deletions
diff --git a/applications/luci-app-banip/luasrc/view/banip/sourcelist.htm b/applications/luci-app-banip/luasrc/view/banip/sourcelist.htm
new file mode 100644
index 0000000000..743886f884
--- /dev/null
+++ b/applications/luci-app-banip/luasrc/view/banip/sourcelist.htm
@@ -0,0 +1,47 @@
+<%#
+Copyright 2018 Dirk Brenken (dev@brenken.org)
+This is free software, licensed under the Apache License, Version 2.0
+-%>
+
+<%-
+local anonclass = (not self.anonymous or self.sectiontitle) and "named" or "anonymous"
+-%>
+
+<%+banip/banip_css%>
+
+<div class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
+ <% if self.title then -%>
+ <h3><%=self.title%></h3>
+ <%- end %>
+ <div class="cbi-section-descr"><%=self.description%></div>
+ <div class="cbi-section-node">
+ <div class="table cbi-section-table">
+ <div class="tr cbi-section-table-titles <%=anonclass%>">
+ <%- for i, k in pairs(self.children) do -%>
+ <div class="th cbi-section-table-cell">
+ <%-=k.title-%>
+ </div>
+ <%- end -%>
+ </div>
+ <%- local section, scope, isempty = true
+ for i, k in ipairs(self:cfgsections()) do
+ section = k
+ local sectionname = striptags((type(self.sectiontitle) == "function") and self:sectiontitle(section) or k)
+ local sectiontitle = ifattr(sectionname and (not self.anonymous or self.sectiontitle), "data-title", sectionname)
+ isempty = false
+ scope = { valueheader = "cbi/cell_valueheader", valuefooter = "cbi/cell_valuefooter" }
+ -%>
+ <div class="tr cbi-section-table-row" id="cbi-<%=self.config%>-<%=section%>"<%=sectiontitle%>>
+ <%-
+ for k, node in ipairs(self.children) do
+ node:render(section, scope or {})
+ end
+ if not scope.cbid:match("ban_src_cat") then
+ -%>
+ <div class="td cbi-value-field">&#160;</div>
+ <%- end -%>
+ </div>
+ <%- end -%>
+ </div>
+ </div>
+</div>