Jump to content

Module:Football squad

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Ahecht (talk | contribs) at 16:59, 30 March 2022 (Sync from sandbox. Implement Template:Football squad). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

-- This implements Template:Football squad
local p = {}

local getArgs = require('Module:Arguments').getArgs
local Navbox = require('Module:Navbox')

function p.navbox(frame)
	local args = getArgs(frame)
	
	args.name = args.name or "{{{name}}}"
	args.state = args.state or "autocollapse"
	args.teamname = args.teamname or "{{{teamname}}}"
	args.bgcolor = args.bgcolor or "#ccf"
	args.textcolor = args.textcolor or "#000"
	args.bordercolor = args.bordercolor or ""
	args.list1 = args.list1 or args.list or '{{{list}}}'

	args.titlestyle = args.titlestyle or ("background:" .. args.bgcolor .. 
		"; color:" .. args.textcolor .. 
		"; box-shadow: inset 1px 1px 0 " .. args.bordercolor .. ", inset -1px -1px 0 " .. args.bordercolor .. 
		"; width:87%;")
	args.title = args.title or args.teamdisplay or args.teamname
	args.title = "[[" .. args.teamname .. "|<span style=\"color:" .. args.textcolor .. ";\">" .. args.title .. "</span>]] <span style=\"color:" .. args.textcolor .. ";\"> &ndash; current squad</span>"
	
	return Navbox._navbox({
		name       = args.name,
		state      = args.state,
		bodystyle  = nil,
		bodyclass  = "vcard",
		titleclass = "fn org",
		listclass  = "hlist",
		titlestyle = args.titlestyle,
		title      = args.title,
		list1      = args.list1
	})
end

return p