Documentation for this module may be created at Module:Infobox/Widget/Role/doc
local Role = {}
function Role.make(rowName, value, game)
value = string.upper(value)
local container = mw.html.create('div')
:addClass('ib-row')
local name = mw.html.create('div')
:addClass('ib-rowName')
:wikitext(rowName .. ': ')
local valueNode = mw.html.create('div')
-- If no game then return value without link
if game == nil then
return container:node(name):node(valueNode:wikitext(value))
end
local catName,visibleName
if value == 'COACH' then
linkName = 'Coaches'
visibleName = 'Coach'
end
local categoryLink = '[[:Category:' .. game .. '/' .. linkName .. '|' .. visibleName ..']]'
valueNode:wikitext(categoryLink)
return container:node(name):node(valueNode)
end
return Role