Modulo:TeamBracket: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
m formattazione standard
Moroboshi (discussione | contributi)
test fix seed number finale terzo posto
Riga 13:
table = "border-style:none;font-size:90%;margin:1em 2em 1em 1em;border-collapse:separate;border-spacing:0",
seed_cell = "background-color:#f2f2f2;border:1px solid #aaa;text-align:center;",
team_cell = "background-color:#f2f2f2;border:1px solid #aaa;text-align:left;", --padding:0 2px",
score_cell ="background-color:#f9f9f9;border:1px solid #aaa;text-align:center;",
header_third_place = "text-align:center;border:1px solid #aaa;background-color:#f2f2f2",
header_cell = "text-align:center;border:1px solid #aaa;background-color:#f2f2f2",
path_bottom = "border:0 solid black;border-bottom-width:1px2px;",
path_rigth_top = "border:0 solid black;border-top-width:1px;border-right-width:2px;",
path_right_bottom = "border:0 solid black;border-bottom-width:1px;border-right-width:2px;",
Riga 409:
if row_base < self.min_row_used then self.min_row_used = row_base end
if row_base + 3 > self.max_row_used then self.max_row_used = row_base + 3 end
local showSeed = false
local seedArg1 = self:getTeamArg(self.current_round, 'seed', team_number1)
local seedArg2 = self:getTeamArg(self.current_round, 'seed', team_number2)
Line 439 ⟶ 438:
local seedArg2 = self:getTeamArg(self.rounds, 'seed', 4)
local showSeed = self.showSeeds
or (seedArg1 and seedArg1 =~= '-')
or (seedArg2 and seedArg2 =~= '-')
local winner, score_results = 0, {}
if self.bold_winner then
winner, score_results = self:getWinner(3)
end
local seedArg1 = self:getTeamArg(self.rounds, 'seed', 3)
local seedArg2 = self:getTeamArg(self.rounds, 'seed', 4)
self:addGap(row, self.current_col, self.current_width, 'f3')
if row+4 > self.max_row_used then self.max_row_used = row + 4 end
Line 600 ⟶ 597:
local team_bracket = TeamBracket:new(args)
return tostring(team_bracket)
end
 
function p.generateMan(frame)
local args = getArgs(frame)
local rounds = args.rounds
local seeds = in_array(args['seeds'], yes_replies)
local rows = {}
rows[1] = '<kbd>'
rows[2] = '{{' .. (args.tname or '')
for round = 1, rounds do
for team = 1, math.pow(2, rounds-round+1) do
if seeds then
rows[#rows+1] = mw.ustring.format('|RD%d-seed%d = ', round, team)
end
rows[#rows+1] = mw.ustring.format('|RD%d-team%d = ', round, team)
rows[#rows+1] = mw.ustring.format('|RD%d-score%d = ', round, team)
end
end
rows[#rows+1] = '}}'
rows[#rows+1] = '</kbd>'
return table.concat(rows, '<br />')
end