local pp =
-- Roster formatfunction pp.headings(args, keys) local h = mw.html.create('tr') if keys['pos'] then h:tag('th'):tag('abbr'):attr('title', 'Position'):wikitext('Pos.') end if keys['num'] then h:tag('th'):tag('abbr'):attr('title', 'Number'):wikitext('No.') end if keys['nat'] then h:tag('th'):tag('abbr'):attr('title', 'Nationality'):wikitext('Nat.') end h:tag('th'):wikitext('Name') if keys['ft'] or keys['in'] then h:tag('th'):wikitext('Height') end if keys['lbs'] then h:tag('th'):wikitext('Weight') end if keys['DOB'] then h:tag('th'):tag('abbr'):attr('title', 'Date of birth'):wikitext('DOB') end if keys['college'] or keys['school'] or keys['from'] then h:tag('th'):wikitext('From') end if keys['yrs'] then h:tag('th'):tag('abbr'):attr('title', 'Years'):wikitext('Yrs') end return tostring(h)end
function pp.players_roster(args, players, keys) local tracking = local res = mw.html.create() for k,v in ipairs(players) do local r = res:tag('tr'):css('text-align', 'center') if keys['pos'] then r:tag('td'):wikitext(v['pos'] or ) end if keys['num'] then r:tag('td'):wikitext(v['num'] or ) end if keys['nat'] then r:tag('td'):wikitext(v['nat'] or ) end local name = v['name'] or if (v['inj'] or 'no')
if keys['DOB'] then r:tag('td'):wikitext(v['DOB']) end if keys['college'] or keys['school'] or keys['from'] then if v['college'] or v['school'] then r:tag('td'):css('text-align', 'left'):wikitext(v['college'] or v['school']) elseif v['from'] then r:tag('td'):css('text-align', 'left'):wikitext('' .. v['from'] .. '') else r:tag('td') end end if keys['yrs'] then if v['yrs']
function pp.coaches_roster(coaches) local res = local role = for k,v in ipairs(coaches) do if v['role'] ~= role then role = v['role'] res = res .. '\n; ' .. role end res = res .. '\n: ' .. (v['nat'] or ) .. ' ' .. (v['name'] or ) if v['college'] then res = res .. ' (' .. v['college'] .. ')' elseif v['from'] then res = res .. ' (' .. v['from'] .. ')' end end return resend
function pp.staff_roster(staff) local res = local role = for k,v in ipairs(staff) do if v['role'] ~= role then role = v['role'] res = res .. '\n; ' .. role end res = res .. '\n: ' .. (v['nat'] or ) .. ' ' .. (v['name'] or ) if v['college'] then res = res .. ' (' .. v['college'] .. ')' elseif v['from'] then res = res .. ' (' .. v['from'] .. ')' end end return resend
function pp.legend(args) local res = if args['legend'] then res = res .. '\n----' res = res .. '\n;Legend' res = res .. args['legend'] end if args['notes'] then if res
function pp.above(args, keys) return args['above']end
function pp.abovestyle(frame, args, keys) return args['abovestyle']end
function pp.headingstyle(frame, args, keys) return args['headingstyle']end
function pp.footer(args, keys) return args['footer']end
function pp.footerstyle(frame, args, keys) return args['footerstyle']end
-- Navbox format
function pp.players_list(args, players, keys) local r = for k,v in ipairs(players) do r = r .. '\n*' .. (v['num'] or ) .. ' ' .. (v['name'] or ) end return rend
function pp.coaches_list(coaches) local res = local role = for k,v in ipairs(coaches) do if v['role'] ~= role then role = v['role'] res = res .. '\n; ' .. role end res = res .. '\n: ' .. (v['name'] or ) end return resend
function pp.title(args, keys) return args['title']end
function pp.titlestyle(frame, args, keys) return args['titlestyle']end
function pp.below(args, keys) return args['below']end
function pp.belowstyle(frame, args, keys) return 'background:transparent;' .. (args['belowstyle'] or )end
return pp