Infobox: Difference between revisions

Subpages:
m 1 revision imported
hiding un-needed blank rows that show up in child infoboxes per talk page
Line 44: Line 44:
end
end
end
end
end
local function isUntitledChildBox(sval)
return sval and ( sval:match( '^%s*<%s*[Tt][Rr]' ) or sval:match( '^%s*\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127%s*<%s*[Tt][Rr]' ) )
end
end


Line 156: Line 160:
:tag('tr')
:tag('tr')
:addClass(rowArgs.rowclass)
:addClass(rowArgs.rowclass)
:addClass( isUntitledChildBox( rowArgs.header ) and 'infobox-hiddenrow' or nil )
:cssText(rowArgs.rowstyle)
:cssText(rowArgs.rowstyle)
:tag('th')
:tag('th')
Line 188: Line 193:
:wikitext(rowArgs.label)
:wikitext(rowArgs.label)
:done()
:done()
else
row:addClass( isUntitledChildBox( rowArgs.data ) and 'infobox-hiddenrow' or nil )
end
end


Line 228: Line 235:
root
root
:tag('tr')
:tag('tr')
:addClass( isUntitledChildBox( args.above ) and 'infobox-hiddenrow' or nil )
:tag('th')
:tag('th')
:attr('colspan', '2')
:attr('colspan', '2')
Line 245: Line 253:
root
root
:tag('tr')
:tag('tr')
:addClass( isUntitledChildBox( args.below ) and 'infobox-hiddenrow' or nil )
:tag('td')
:tag('td')
:attr('colspan', '2')
:attr('colspan', '2')
Line 262: Line 271:
local row = root:tag('tr')
local row = root:tag('tr')
row:addClass(subheaderArgs.rowclass)
row:addClass(subheaderArgs.rowclass)
row:addClass( isUntitledChildBox( subheaderArgs.data ) and 'infobox-hiddenrow' or nil )


local dataCell = row:tag('td')
local dataCell = row:tag('td')
Line 306: Line 316:
local row = root:tag('tr')
local row = root:tag('tr')
row:addClass(imageArgs.rowclass)
row:addClass(imageArgs.rowclass)
row:addClass( isUntitledChildBox( imageArgs.data ) and 'infobox-hiddenrow' or nil )


local dataCell = row:tag('td')
local dataCell = row:tag('td')