Module:Sports series: Difference between revisions

Content deleted Content added
allow for coloring aggregate score yellow for single-leg draws
add support for FBR style coloring
Line 228:
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 matchesStyle = args.matches_style
local isFBRStyle = matchesStyle and matchesStyle:upper() == "FBR"
 
local tableClass = 'wikitable'
Line 385 ⟶ 387:
-- Create aggregate score cell with conditional styling
local aggregateStyle = 'text-align: center;'
if legs == 0 and isDraw and colorWinner then
if isFBRStyle then
aggregateStyle = aggregateStyle .. '; background-color: #FFFFBB;'
if team1Winner then
aggregateStyle = aggregateStyle .. '; background-color: #BBF3FF;'
elseif team2Winner then
aggregateStyle = aggregateStyle .. '; background-color: #FFBBBB;'
elseif isDraw then
aggregateStyle = aggregateStyle .. '; background-color: #FFFFBB;'
end
elseif isDraw and colorWinner then
aggregateStyle = aggregateStyle .. '; background-color: #FFFFBB;'
end
end
-- Create rows for aggregate score and team names, bolded if set by user
Line 427 ⟶ 439:
-- Create aggregate score cell with conditional styling
local aggregateStyle = 'text-align: center;'
if legs == 0 and isDraw and colorWinner then
if isFBRStyle then
aggregateStyle = aggregateStyle .. '; background-color: #FFFFBB;'
if team1Winner then
aggregateStyle = aggregateStyle .. '; background-color: #BBF3FF;'
elseif team2Winner then
aggregateStyle = aggregateStyle .. '; background-color: #FFBBBB;'
elseif isDraw then
aggregateStyle = aggregateStyle .. '; background-color: #FFFFBB;'
end
elseif isDraw and colorWinner then
aggregateStyle = aggregateStyle .. '; background-color: #FFFFBB;'
end
end
-- Create rows for aggregate score and team names, bolded if set by user