luci/applications/luci-app-adblock/luasrc/view/adblock/blocklist.htm
Jo-Philipp Wich 067d7dc9f7 treewide: convert HTML tables to div
Mostly convert HTML tables to div based markup to allow for easier styling
in the future. Also change JS accessor code accordingly.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-28 15:18:45 +02:00

87 lines
2 KiB
HTML

<%#
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,
.cbi-input-text
{
text-align:left;
vertical-align:top;
margin-right:auto;
margin-left:0px;
}
.cbi-input-text
{
outline:none;
box-shadow:none;
background:transparent;
padding-left:2px;
line-height:25px;
height:25px;
width:10em;
}
</style>
<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">
<%- if self.sectionhead then -%>
<div class="th cbi-section-table-cell"><%=self.sectionhead%></div>
<%- else -%>
<div class="th">&#160;</div>
<%- end -%>
<%- 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
section = k
isempty = false
scope = { valueheader = "cbi/cell_valueheader", valuefooter = "cbi/cell_valuefooter" }
-%>
<div class="tr cbi-section-table-row" id="cbi-<%=self.config%>-<%=section%>">
<div class="th"><%=k%></div>
<%-
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>