Module:Navbox: Difference between revisions

remove titlegroup per templatestyles section on talk page
en>Izno
(templatestyles, basic i18n, look for titlegroup)
en>Izno
(remove titlegroup per templatestyles section on talk page)
Line 98: Line 98:


local titleRow = tbl:tag('tr')
local titleRow = tbl:tag('tr')
if args[cfg.arg.titlegroup] then
titleRow
:tag('th')
:attr('scope', 'row')
:addClass(cfg.class.navbox_group)
:addClass(args[cfg.arg.titlegroupclass])
:cssText(args[cfg.arg.basestyle])
:cssText(args[cfg.arg.groupstyle])
:cssText(args[cfg.arg.titlegroupstyle])
:wikitext(args[cfg.arg.titlegroup])
end


local titleCell = titleRow:tag('th'):attr('scope', 'col')
local titleCell = titleRow:tag('th'):attr('scope', 'col')
if args[cfg.arg.titlegroup] then
titleCell
:css('border-left', '2px solid #fdfdfd')
:css('width', '100%')
end


local titleColspan = 2
local titleColspan = 2
if args[cfg.arg.imageleft] then titleColspan = titleColspan + 1 end
if args[cfg.arg.imageleft] then titleColspan = titleColspan + 1 end
if args[cfg.arg.image] then titleColspan = titleColspan + 1 end
if args[cfg.arg.image] then titleColspan = titleColspan + 1 end
if args[cfg.arg.titlegroup] then titleColspan = titleColspan - 1 end


titleCell
titleCell
Line 287: Line 268:
cfg.arg.bodyclass, cfg.arg.listclass, cfg.arg.aboveclass,
cfg.arg.bodyclass, cfg.arg.listclass, cfg.arg.aboveclass,
cfg.arg.belowclass, cfg.arg.titleclass, cfg.arg.navboxclass,
cfg.arg.belowclass, cfg.arg.titleclass, cfg.arg.navboxclass,
cfg.arg.groupclass, cfg.arg.titlegroupclass, cfg.arg.imageclass
cfg.arg.groupclass, cfg.arg.imageclass
}
}
local patterns = {
local patterns = {
Line 319: Line 300:
return true
return true
end
end
end
return false
end
local function hasTitleGroup()
if args[cfg.arg.titlegroup] and args[cfg.arg.titlegroup] ~= '' then
return true
end
end
return false
return false
Line 358: Line 332:
if isIllegible() then table.insert(cats, cfg.category.illegible) end
if isIllegible() then table.insert(cats, cfg.category.illegible) end
if hasBorders() then table.insert(cats, cfg.category.borders) end
if hasBorders() then table.insert(cats, cfg.category.borders) end
if hasTitleGroup() then table.insert(cats, cfg.category.titlegroup) end
return cats
return cats
end
end
Anonymous user