summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-adblock/luasrc/view/adblock/blocklist.htm
blob: 93713c92b14c18d646a1fa13f0fdd862c6d49eac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<%#
Copyright 2017-2018 Dirk Brenken (dev@brenken.org)
This is free software, licensed under the Apache License, Version 2.0
-%>

<%-
local rowcnt = 1
function rowstyle()
	rowcnt = rowcnt + 1
	return (rowcnt % 2) + 1
end

function width(o)
	if o.width then
		if type(o.width) == 'number' then
			return ' style="width:%dpx"' % o.width
		end
		return ' style="width:%s"' % o.width
	end
	return ''
end
-%>

<style type="text/css">
.table.cbi-section-table .th,
.table.cbi-section-table .td,
.cbi-section-table-cell,
.cbi-section-table-row
{
	text-align:left;
	vertical-align:top;
	margin-right:auto;
	margin-left:0px;
	padding-left:2px;
	line-height:20px;
}
.table.cbi-section-table .th
{
	white-space:nowrap;
}
.table.cbi-section-table input
{
	width:7em;
}
.cbi-input-text
{
	text-align:left;
	padding-left:2px;
	outline:none;
	box-shadow:none;
	background:transparent;
	height:20px;
	width:10em;
}
</style>

<%-
	local anonclass = (not self.anonymous or self.sectiontitle) and "named" or "anonymous"
	local titlename = ifattr(not self.anonymous or self.sectiontitle, "data-title", translate("Name"))
-%>

<fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
	<% if self.title then -%>
		<legend><%=self.title%></legend>
	<%- 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%>"<%=titlename%>>
			<%- for i, k in pairs(self.children) do -%>
				<div class="th cbi-section-table-cell"<%=width(k)%>>
					<%-=k.title-%>
				</div>
			<%- end -%>
			</div>
			<%- local isempty = true
				for i, k in ipairs(self:cfgsections()) do
					local 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("adb_src_cat") then
				-%>
					<div class="td cbi-value-field">&#160;</div>
				<%- end -%>
			</div>
			<%- end -%>
		</div>
	</div>
</fieldset>