0
0
mirror of https://github.com/openwrt/luci.git synced 2025-02-23 14:46:18 +00:00
luci/modules/luci-compat/luasrc/view/cbi/cell_valueheader.htm
Jo-Philipp Wich 2155868175 luci-compat: update markup for CBI TableSections
Update legacy CBI markup to use actual table, tr, th and td elements
instead of using div element corresponding table classes.

Fixes compatibility with OpenWrt 2020 theme.

Ref: https://github.com/openwrt/luci/issues/4972
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-04-09 14:29:12 +02:00

13 lines
718 B
HTML

<%-
local title = luci.util.trim(striptags(self.title))
local descr = luci.util.trim(striptags(self.description))
local ftype = self.typename or (self.template and self.template:gsub("^.+/", ""))
-%>
<td class="td cbi-value-field<% if self.error and self.error[section] then %> cbi-value-error<% end %><% if self.password then %> nowrap<% end %>"<%=
attr("data-name", self.option) ..
ifattr(ftype and #ftype > 0, "data-widget", ftype) ..
ifattr(title and #title > 0, "data-title", title, true) ..
ifattr(descr and #descr > 0, "data-description", descr, true)
%>>
<div id="cbi-<%=self.config.."-"..section.."-"..self.option%>" data-index="<%=self.index%>" data-depends="<%=pcdata(self:deplist2json(section))%>">