Content deleted Content added
mNo edit summary |
fix sum box error when no scores provided |
||
Line 362:
p.scoreBoxes = (tonumber(args:clean('score-boxes', {pattern = '%D'})) or 1) + sumBox
p.scoreSumBox = p.scoreBoxes > 0 and p.scoreSumBox or nil
local boxStyle = p.scoreBoxes > 1 and
(p.scoreSumBox and
setmetatable(
{{}, [p.scoreBoxes] = {'0 1ex'}},
{__call = function(t, i) if t[i] then return nil end return 0 end}
)
or setmetatable(
{},
{__call = function(t, i) return 0 end}
)
)
or setmetatable({}, {__call = function(t, i) return nil end})
p.colspan = p.scoreBoxes > 0 and (p.scoreBoxes + 1) or nil
local nodeArgs = {
Line 615 ⟶ 627:
clean = {}
}
local notSummed = not p.scoreSumBox or #m.nonEmpty
for s, i in ipairs(m.nonEmpty) do
m.bold.clean[s] = {p.scoreWasher:main(args[i[1]]), p.scoreWasher:main(args[i[2]])}
Line 636 ⟶ 648:
teamBox(args[step + nodeArgs.team[m.phase]], m.r, setmetatable(base, {__index = {bold = m.bold.win(m.phase)}}))
if p.colspan then
if
getmetatable(boxStyle).__index = nil
for s = 1, p.scoreBoxes do
teamBox('', m.r, setmetatable(base, p.scoreSumBoxes and {__index = {borderLeft = boxStyle(s)}}))
end
else
tab.r:attr{colspan = 1 + p.scoreBoxes - scoreBoxes}
end
for s, i in ipairs(m.nonEmpty) do
teamBox(args[i[m.phase]], m.r, setmetatable(base, {__index = {'center', borderLeft =
end
end
|