Module:Sports series: Difference between revisions

Content deleted Content added
creating module
 
.
Line 170:
end
 
local legs = tonumber(args.legs) == '1' or 2args.legs == --'n' Defaultor numberargs.legs of== 'no' or args.legs is== 'none' or args.legs == 'null' or args.legs == 'single' or args.legs == 'one') and 0 or tonumber(args.legs) or 2
local teamWidth = args['team-widthteam_width'] or '250px'
local scoreWidth = args['score-widthscore_width'] or '80px'
local boldWinner = args.bold_winner and (args.bold_winner == 'y' or args.bold_winner == 'yes' or args.bold_winner == '1')
local colorWinner = args.color_winner
Line 199:
end
 
-- SetCount legsnumber toof 0 for single-leg matchescolumns
local colCount = 3 + legs
if legs == 1 or args.legs == 'n' or args.legs == 'no' or args.legs == 'none' or args.legs == 'null' or args.legs == 'single' or args.legs == 'one' then
legs = 0
end
 
local colCount = 3 + legs -- Adjust column count based on the number of legs
 
-- Add a title row above column headings if the "title" parameter is passed
Line 220 ⟶ 216:
local defaultTeam2 = args.h_a and 'Away' or 'Team 2'
header:tag('th'):css('text-align', 'right'):css('width', teamWidth):wikitext(args['team1'] or defaultTeam1)
header:tag('th'):css('width', scoreWidth):wikitext(args['agg-scoreaggregate'] or legs == 0 and 'Score' or expandTemplate(frame, 'Abbrlink', {'Agg.', 'Aggregate score'}))
header:tag('th'):css('text-align', 'left'):css('width', teamWidth):wikitext(args['team2'] or defaultTeam2)