As part of the Unified Community Platform project, your wiki will be migrated to the new platform in the next few weeks. Read more here.

Module:Infobox/TeamHist

From PUBG Esports Wiki
Jump to: navigation, search

To edit the documentation or categories for this module, click here.


local m_role = require('Module:Role')
local m_team = require('Module:Team')
local util_args = require('Module:ArgsUtil')

local p = {}

function p.teamHist(storeto, args)
	local i = 1
	if args['teamhist' .. 1] then
		local tbl = mw.html.create('table'):addClass('teamhist')
		while args['teamhist' .. i] do
			tbl:tag('tr')
			:tag('td')
				:addClass('teamdate')
				:wikitext(args['teamdate' .. i] or '')
			:done()
			:tag('td')
				:wikitext(m_role.onlyimage(args['teamrole' .. i], { sub = util_args.castAsBool(args['issub' .. i]) }))
				:wikitext(' ')
				:wikitext(m_team.rightmediumlinked(args['teamhist' .. i]))
			i = i + 1
		end
		storeto.teamhist = tostring(tbl)
		i = i - 1
	end
	return {
		team = args['teamhist' .. i] and m_team.teamlinkname(args['teamhist' .. i]),
		date = args['teamdate' .. i],
		role = args['teamrole' .. i]
	}
end

return p