View source for Module:Football squad
Jump to navigation
Jump to search
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page.
-- This implements Template:Football squad
local p = {}
local getArgs = require('Module:Arguments').getArgs
local Navbox = require('Module:Navbox')
local function buildList(args, listType)
local list={}
for k, v in pairs(args) do
if (type(k) == 'string') and (mw.ustring.match((v or ''),'%S') ~= nil) then
local prefix, n = k:sub(1,string.len(listType)), k:sub(string.len(listType)+1)
if prefix == listType and (tonumber(n) or n == '') then
if listType == 'manager' then
n = (args['manager_type' .. n] or "Manager") .. ':'
end
if k == listType then k = listType .. '1' end
local row = string.format('* <span class="nowrap agent vcard fbsquad_%s">%s <span class="fn">%s</span></span>', k, n, v)
table.insert(list, row)
end
end
end
table.sort(list, function (x, y) return tonumber(string.match(x, 'fbsquad_' .. listType .. '(%d*)"')) < tonumber(string.match(y, 'fbsquad_' .. listType .. '(%d*)"')) end )
000
1:0
Template used on this page:
Return to Module:Football squad.