From: Paul Donald Date: Mon, 2 Feb 2026 16:11:24 +0000 (+0100) Subject: luci-base: restore titles class X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=94da6ead86d0bf445aea8d9a3c91555d297c4bb7;p=project%2Fluci.git luci-base: restore titles class follow-up to 720c96ce5b85583c8c6db6ef31857dc8a3eeb600 While ::before CSS styling has been deactivated, and 'content' removed, cbi-value-first-field is a bit ambiguous. So, restore cbi-section-table-titles, and replace the ::before tags in CSS. Remove also the data-title for title rows. We already insert titles for named headers and rows via HTML and not via CSS after the mentioned commit. Signed-off-by: Paul Donald --- diff --git a/modules/luci-base/htdocs/luci-static/resources/form.js b/modules/luci-base/htdocs/luci-static/resources/form.js index 502bf7032c..0464b9ef71 100644 --- a/modules/luci-base/htdocs/luci-static/resources/form.js +++ b/modules/luci-base/htdocs/luci-static/resources/form.js @@ -2633,8 +2633,11 @@ const CBITableSection = CBITypedSection.extend(/** @lends LuCI.form.TableSection if (this.extedit || this.rowcolors) trEl.classList.add(!(tableEl.childNodes.length % 2) ? 'cbi-rowstyle-1' : 'cbi-rowstyle-2'); + if (sectionname && (!this.anonymous || this.sectiontitle)) { - trEl.appendChild(E('td', {'class': 'td cbi-value-field cbi-value-first-field'}, [ (sectionname && (!this.anonymous || this.sectiontitle)) ? sectionname : null ])); + trEl.appendChild(E('td', {'class': 'td cbi-value-field cbi-section-table-titles'}, [ + (sectionname && (!this.anonymous || this.sectiontitle)) ? sectionname : null + ])); } for (let j = 0; j < max_cols && nodes[i].firstChild; j++) @@ -2676,16 +2679,16 @@ const CBITableSection = CBITypedSection.extend(/** @lends LuCI.form.TableSection if (has_titles) { const trEl = E('tr', { - 'class': `tr cbi-value-first-field cbi-section-table-titles ${anon_class}`, - 'data-title': (!this.anonymous || this.sectiontitle) ? _('Name') : null, + 'class': `tr cbi-section-table-titles ${anon_class}`, 'click': this.sortable ? ui.createHandlerFn(this, 'handleSort') : null }); + if (!this.anonymous || this.sectiontitle) { trEl.appendChild(E('th', { - 'class': 'th cbi-section-table-cell', - 'data-sortable-row': this.sortable ? '' : null - }, (!this.anonymous || this.sectiontitle) ? _('Name') : null - )); + 'class': 'th cbi-section-table-cell', + 'data-sortable-row': this.sortable ? '' : null + }, (!this.anonymous || this.sectiontitle) ? _('Name') : null + )); } for (let i = 0, opt; i < max_cols && (opt = this.children[i]) != null; i++) { diff --git a/themes/luci-theme-bootstrap/htdocs/luci-static/bootstrap/cascade.css b/themes/luci-theme-bootstrap/htdocs/luci-static/bootstrap/cascade.css index 7d8922e6fc..c1b214fc13 100644 --- a/themes/luci-theme-bootstrap/htdocs/luci-static/bootstrap/cascade.css +++ b/themes/luci-theme-bootstrap/htdocs/luci-static/bootstrap/cascade.css @@ -2034,7 +2034,10 @@ form.inline { display: inline; margin-bottom: 0; } font-weight: normal; } -.cbi-section-table-titles.named::before, +.cbi-section-table-titles { + font-weight: bold; +} + .cbi-section-table-descr.named::before, .cbi-section-table-row[data-title]::before { content: none; @@ -2319,10 +2322,6 @@ div.cbi-value var, color: #0069d6; } -.cbi-value-first-field { - font-weight: bold; -} - div.cbi-value var[data-tooltip], .td.cbi-value-field var[data-tooltip], div.cbi-value var.cbi-tooltip-container, diff --git a/themes/luci-theme-material/htdocs/luci-static/material/cascade.css b/themes/luci-theme-material/htdocs/luci-static/material/cascade.css index f31b5edd9e..f512312c97 100644 --- a/themes/luci-theme-material/htdocs/luci-static/material/cascade.css +++ b/themes/luci-theme-material/htdocs/luci-static/material/cascade.css @@ -1323,6 +1323,10 @@ td > table > tbody > tr > td, display: none; } +.tr.cbi-section-table-titles { + font-weight: bold; +} + .tr[data-title]::before, .tr.cbi-section-table-titles.named::before { content: none; @@ -2158,10 +2162,6 @@ td.cbi-value-field var, color: #0069d6; } -.cbi-value-first-field { - font-weight: bold; -} - .cbi-optionals { padding: 1rem 1rem 0 1rem; border-top: thin solid #ccc; diff --git a/themes/luci-theme-openwrt-2020/htdocs/luci-static/openwrt2020/cascade.css b/themes/luci-theme-openwrt-2020/htdocs/luci-static/openwrt2020/cascade.css index 521bcc5572..e72f600fba 100644 --- a/themes/luci-theme-openwrt-2020/htdocs/luci-static/openwrt2020/cascade.css +++ b/themes/luci-theme-openwrt-2020/htdocs/luci-static/openwrt2020/cascade.css @@ -299,9 +299,8 @@ table { border-collapse: collapse; } -tr.cbi-section-table-titles[data-title]::before { +tr.cbi-section-table-titles { font-weight: bold; - border-top: none; } tr[data-title]::before { @@ -1156,10 +1155,6 @@ textarea { flex: 1 1 100%; } -.cbi-value-first-field { - font-weight: bold; -} - .cbi-map-descr, .cbi-tab-descr, .cbi-section-descr, @@ -1784,8 +1779,6 @@ ul.errors { padding-bottom: .5em; } - tr.cbi-section-table-titles[data-title]::before, - tr.cbi-section-table-titles, tr.cbi-section-table-descr { display: none; } diff --git a/themes/luci-theme-openwrt/htdocs/luci-static/openwrt.org/cascade.css b/themes/luci-theme-openwrt/htdocs/luci-static/openwrt.org/cascade.css index fb05910e36..a16908da60 100644 --- a/themes/luci-theme-openwrt/htdocs/luci-static/openwrt.org/cascade.css +++ b/themes/luci-theme-openwrt/htdocs/luci-static/openwrt.org/cascade.css @@ -1035,10 +1035,6 @@ div.cbi-optionals { color: #2222FF; } -.cbi-value-first-field { - font-weight: bold; -} - ul.cbi-tabmenu { list-style-type: none; @@ -1923,8 +1919,11 @@ select + .cbi-button { margin: 0; } + .cbi-section-table-titles { + font-weight: bold; + } + .tr.table-titles, - .cbi-section-table-titles, .cbi-section-table-descr { display: none; }