Modulo:TeamBracket: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
m fix
m meglio inherit di color base
 
(14 versioni intermedie di 4 utenti non mostrate)
Riga 21:
local RD1seedmap = {}
local tcats = ''
local yes_replies = { 'yes', 'y', 's', 'si', 'sì'}
local no_replies = { 'n', 'no', 'none'}
 
local function isnotblank(s)
Line 67 ⟶ 65:
end
return 0
end
 
local function unboldParenthetical(s)
if s then
s = mw.ustring.gsub(s, '(%(%[%[[^%[%]]*%]%]%))', '<span style="font-weight:normal">%1</span>')
end
return s
end
 
Line 99 ⟶ 104:
k = mw.ustring.gsub(k, '^' .. rdstr .. '(%-[a-z][a-z]*)4', '3rd%12')
elseif k:find('^Consol') then
k = mw.ustring.gsub(k, '^Consol', '3rdRD-finalina')
tcats = tcats .. '[[Categoria:Errori nella compilazione di TeamBracket|3]]'
elseif k:find('^group[0-9]') then
Line 204 ⟶ 209:
if sepwidth > 1 then topcell = true end
if seedorteam then
cell:css('border', '1px solid var(--border-color-base, #aaa)')
:css('border-top-width', topcell and '1px' or '0')
else
cell:css('border-color', 'var(--border-color-base, #aaa)')
:css('border-style', 'solid')
:css('border-top-width', topcell and '1px' or '0')
Line 221 ⟶ 226:
:attr('colspan', tonumber(hideSeeds and '1' or '2') + legs[r] + pad)
:css('text-align', 'center')
:css('border', '1px solid var(--border-color-base, #aaa)')
:css('background-color', args['RD-shade'] or 'var(--background-color-neutral, #f2f2f2)')
:css('color', 'inherit')
:wikitext(text)
:newline()
Line 256 ⟶ 262:
local value = args[argname]
if isblank(value) then
return 'var(--background-color-neutral-subtle, #f9f9f9)'
end
return value
Line 322 ⟶ 328:
{['border-width'] = '0',
['border-style'] = 'solid',
['border-color'] = 'var(--color-base, black)'}, (not compact) and 2 or 1)
if left or round < maxround and not left then
cell:css(prop, w or '2px')
Line 346 ⟶ 352:
seedCell = row:tag('td')
:css('text-align', 'center')
:css('background-color', 'var(--background-color-neutral, #f2f2f2)')
:css('color', 'inherit')
:attr('rowspan', (not compact) and '2' or nil)
:wikitext(seedArg)
Line 356 ⟶ 363:
if isblank(teamArg) then
teamArg = '&nbsp;'
elseif boldwinner ~= '' then
teamArg = unboldParenthetical(teamArg)
end
 
Line 363 ⟶ 372:
 
local teamCell = row:tag('td')
:css('background-color', 'var(--background-color-neutral-subtle, #f9f9f9)')
:css('padding', '0 2px')
:css('color', 'inherit')
:attr('rowspan', (not compact) and '2' or nil)
:attr('colspan', (tcs > 1) and tcs or nil)
Line 394 ⟶ 404:
or nil
end
if (score1 == nil or score1 == '') and (score2 == nil or score2 == '') then
if hideomittedscores > 0 and s >= hideomittedscores then
teamcolspan = teamcolspan + 1
Line 413 ⟶ 423:
end
end
if not (agg and (aggregate == 'score' or aggregate == 'legs' or aggregate == 'sets')) then wins = wins + 1 end
elseif winner == 2 then
if not (agg and (aggregate == 'score' or aggregate == 'legs' or aggregate == 'sets')) then otherwins = otherwins + 1 end
end
scoreCells[s] = row:tag('td')
Line 421 ⟶ 431:
:css('background-color', getShadeArg(round, team, s))
:css('font-weight', fw)
:css('color', 'inherit')
:attr('rowspan', (not compact) and '2' or nil)
:wikitext(score1)
Line 507 ⟶ 518:
addHeading(rows[offset-4], r + 1, getRoundName(r+1), legs[r] - legs[r+1])
local b = addBlank(offset-4, {
['border-color'] = 'var(--color-base, black)',
['border-style']= 'solid',
['border-width']= '0'}, 2)
Line 535 ⟶ 546:
{['border-width'] = '0',
['border-style'] = 'solid',
['border-color'] = 'var(--color-base, black)'},
height, 1)
else
Line 541 ⟶ 552:
{['border-width'] = '0',
['border-style'] = 'solid',
['border-color'] = 'var(--color-base, black)'},
height, tonumber(hideSeeds and '3' or '4') + legs[r] + pad)
end
Line 602 ⟶ 613:
if (round < maxround) then
addBlank(i, {
['border-color'] = 'var(--color-base, black)',
['border-style'] = 'solid',
['border-width'] = '0 ' .. w .. ' 0 0'})
Line 614 ⟶ 625:
if (round < maxround) then
addBlank(i+1, {
['border-color'] = 'var(--color-base, black)',
['border-style'] = 'solid',
['border-width'] = '0 ' .. w .. ' 0 0'})
Line 646 ⟶ 657:
end
blank = addBlank(k, rounds < 2 and {['height'] = '7px'} or nil)
addHeading(row, rounds + 1, args['3rdRD-finalina'] or 'Finale 3º posto')
if rounds < 2 then
for i = 1,(compact and 1 or 2) do
Line 738 ⟶ 749:
local blank = addBlank(i, nil, 1, tonumber(hideSeeds and '3' or '4') + legs[1])
if compact and (rounds > 2) then
blank = addBlank(i, nil, 1, tonumber(hideSeeds and '3' or '4') + legs[12])
end
end
Line 777 ⟶ 788:
local legsr = legs[r]
if compactFinal and r == (maxround-1) then
legsr = legs[r+1] > legs[r] and legs[r+1] or legs[r]
end
if showThird and r==maxround then
legsr = legs[r+1] > legs[r] and legs[r+1] or legs[r]
end
for s = 1, legsr do
local score_width = '30px'
scoreCells[s] = widthRow:tag('td'):css('width', getWidth('score', '25px'))
if aggregate and aggregate ~= '' and s > 1 and s == legsr then
score_width = getWidth('agg', getWidth('score', score_width))
else
score_width = getWidth('score', score_width)
end
scoreCells[s] = widthRow:tag('td'):css('width', getWidth('score', '25px')score_width)
end
titleRow:tag('td')