Module:Sandbox/B2project/NHL Standings: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 310:
 
local standingsPage
if (templateName ~= nil) then
standingsPage = templateName
else
standingsPage = year .. ' NHL ' .. divisionForNavbox .. ' standings'
end
tableHeaderInfo.navbarText =
Line 334:
end
local teamInfo = listOfTeams[standingsLeaderIdx]
--leadingHalfGames = (teamInfo.wins - teamInfo.losses)
end
 
Line 348:
}
 
if (fDisplayGamesBehind) then
local halfGamesBehind = leadingHalfGames - (teamInfo.wins - teamInfo.losses)
local prefix = nil
-- if games behind is negative, take the absolute value and prefix a +
-- character
if (halfGamesBehind < 0) then
halfGamesBehind = -halfGamesBehind
prefix = '+'
end
if (halfGamesBehind == 0) then
teamRowInfo.gamesBehind = '—'
else -- if halfGamesBehind is not 0
teamRowInfo.gamesBehind = math.floor(halfGamesBehind / 2)
if (halfGamesBehind % 2 == 1) then
if (halfGamesBehind == 1) then
teamRowInfo.gamesBehind = '½'
else
teamRowInfo.gamesBehind = teamRowInfo.gamesBehind .. '½'
end
end
if ( prefix ~= nil ) then
teamRowInfo.gamesBehind = prefix .. teamRowInfo.gamesBehind
end
end -- if halfGamesBehind is not 0
end -- if (fDisplayGamesBehind)
 
if (seedInfo[teamInfo.name] ~= nil) then
teamRowInfo.seedText = '<sup>(' .. seedInfo[teamInfo.name] .. ')</sup> '
teamRowInfo.rowStyle = ' style="background:#CCFFCC"'
end
 
if (teamsToHighlight[teamInfo.name]) then