Merge pull request #1983 from dibdot/adblock
[project/luci.git] / applications / luci-app-adblock / luasrc / view / adblock / blocklist.htm
index 93713c92b14c18d646a1fa13f0fdd862c6d49eac..f59e51857413514f561dc06618fcf5f1bef30fe0 100644 (file)
@@ -4,35 +4,20 @@ 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
+local anonclass  = (not self.anonymous or self.sectiontitle) and "named" or "anonymous"
 -%>
 
 <style type="text/css">
 .table.cbi-section-table .th,
 .table.cbi-section-table .td,
 .cbi-section-table-cell,
-.cbi-section-table-row
+.cbi-section-table-row,
+.tr[data-title]::before
 {
        text-align:left;
        vertical-align:top;
-       margin-right:auto;
        margin-left:0px;
        padding-left:2px;
-       line-height:20px;
 }
 .table.cbi-section-table .th
 {
@@ -42,6 +27,12 @@ end
 {
        width:7em;
 }
+.cbi-section-table-row > .cbi-value-field [data-dynlist] > input,
+.table.cbi-section-table input
+{
+       width:7em;
+}
+
 .cbi-input-text
 {
        text-align:left;
@@ -49,36 +40,29 @@ end
        outline:none;
        box-shadow:none;
        background:transparent;
-       height:20px;
-       width:10em;
+       width:7em;
 }
 </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%>">
+<div 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%>>
+                       <div class="tr cbi-section-table-titles <%=anonclass%>">
                        <%- for i, k in pairs(self.children) do -%>
-                               <div class="th cbi-section-table-cell"<%=width(k)%>>
+                               <div class="th cbi-section-table-cell">
                                        <%-=k.title-%>
                                </div>
                        <%- end -%>
                        </div>
-                       <%- local isempty = true
+                       <%- local section, scope, 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)
+                                       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" }
                        -%>
@@ -95,4 +79,4 @@ end
                        <%- end -%>
                </div>
        </div>
-</fieldset>
+</div>