Module:Team

local p = {}

function p.team ( frame ) local args = frame if frame == mw.getCurrentFrame then args = require( 'Module:ProcessArgs' ).merge( true ) else frame = mw.getCurrentFrame end local teaminput = mw.ustring.lower(args[1] or '') local teamstyle = mw.ustring.lower(args[2] or 'rightlonglinked') local exceptionCases = mw.loadData('Module:Teamexceptions') --Empty if not args[1] or args[1] == '' then return '' --Special Cases elseif exceptionCases[teaminput] then namevars = exceptionCases[teaminput] Styles = require('Module:Teamexceptionstyles') settings = Styles.styleNames(teamstyle) if args['size'] then settings.size = args['size'] end return Styles[settings.style](namevars, settings) -- Normal Teams else local tnames = mw.loadData('Module:Teamnames') local Styles = require('Module:Teamstyles') local namevars = tnames[teaminput] local util = require('Module:Util') local suffix = (args.system or args.suffix) and util.concatSystemSubpage(args.system, args.suffix) local settings = { size = args['size'], suffix = suffix and ('/' .. suffix) or '', }

if not namevars then namevars = { link = args[1], long = args[1], medium = args[1], short = args['short'] or args[1] } settings.logo = "" elseif type(namevars) == 'string' then namevars = tnames[namevars] end return Styles[teamstyle](namevars, settings) end end return p