Module:Sports series: Difference between revisions

Content deleted Content added
.
improvements to logic
Line 164:
if args.flag and args.flag:find('+') then
flagTemplate, flagParam1 = processIcon(args.flag) -- Process flag icons with variants
elseif args.flag and (args.flag == 'nonen' or args.flag == 'no' or args.flag == 'noflag0' or args.flag == '0false' or args.flag == 'nnull' or args.flag == 'nullnone' or args.flag == 'noflag') then
noFlagIcons = true -- Hide flag icons for club matches
else
Line 170:
end
 
local legs = (args.legs == '1' or args.legs == 'n' or args.legs == 'no' or args.legs == 'nonefalse' or args.legs == 'null' or args.legs == 'none' or args.legs == 'single' or args.legs == 'one') and 0 or tonumber(args.legs) or 2
local teamWidth = (tonumber(args['team_width']) and args['team_width'] .. 'px') or '250px'
local scoreWidth = (tonumber(args['score_width']) and args['score_width'] .. 'px') or '80px'
local boldWinner = args.bold_winner and (args.bold_winner == 'y' or args.bold_winner == 'yes' or args.bold_winner == '1' or args.bold_winner == 'true')
local colorWinner = args.color_winner and (args.color_winner == 'y' or args.color_winner == 'yes' or args.color_winner == '1' or args.color_winner == 'true')
 
local tableClass = 'wikitable'
local tableStyle = 'text-align: center;'
if args.collapsed and (args.collapsed == 'y' or args.collapsed == 'yes' or args.collapsed == '1' or args.collapsed == 'true') then
if args.collapsed then
tableClass = 'wikitable mw-collapsible mw-collapsed'
tableStyle = 'width: 100%; text-align: center;'
end
if args.nowrap and (args.nowrap == 'y' or args.nowrap == 'yes' or args.nowrap == '1' or args.nowrap == 'true') then
if args.nowrap then
tableStyle = tableStyle .. ' white-space: nowrap;'
end
Line 213:
-- Create the header row with team and score columns
local header = table:tag('tr')
local defaultTeam1 = (args.h_a == 'y' or args.h_a == 'yes' or args.h_a == '1' or args.h_a == 'true') and 'Home' or 'Team 1'
local defaultTeam2 = (args.h_a == 'y' or args.h_a == 'yes' or args.h_a == '1' or args.h_a == 'true') 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['aggregate'] or legs == 0 and 'Score' or expandTemplate(frame, 'Abbrlink', {'Agg.', 'Aggregate score'}))