Module:Sports series: Difference between revisions

Content deleted Content added
improve
add custom options
Line 243:
if legs > 0 then
for leg = 1, legs do
local legHeading
header:tag('th'):css('width', scoreWidth):wikitext(args['leg' .. leg] or ordinal(leg) .. ' leg')
 
-- Check if "legN" parameter is present
if args['leg' .. leg] then
legHeading = args['leg' .. leg]
else
-- Check if "prefix" parameter is present
if args.prefix then
-- Check if prefix is y, yes, 1, or true
if args.prefix == 'y' or args.prefix == 'yes' or args.prefix == '1' or args.prefix == 'true' then
legHeading = 'Leg ' .. leg
else
legHeading = args.prefix .. ' ' .. leg
end
-- Check if "suffix" parameter is present and does not equal y, yes, 1, or true
elseif args.suffix and args.suffix ~= 'y' and args.suffix ~= 'yes' and args.suffix ~= '1' and args.suffix ~= 'true' then
legHeading = ordinal(leg) .. ' ' .. args.suffix
else
legHeading = ordinal(leg) .. ' leg'
end
end
 
header:tag('th'):css('width', scoreWidth):wikitext(args['leg' .. leg] or ordinal(leg) .. ' leg'legHeading)
end
end