Модуль:Football: различия между версиями
Внешний вид
Andrew (обсуждение | вклад) Исправлено отображение диагональных ячеек |
Andrew (обсуждение | вклад) Исправлено отображение домашних и гостевых результатов на разных строчках |
||
| Строка 912: | Строка 912: | ||
for _, homeCode in ipairs(teamOrder) do | for _, homeCode in ipairs(teamOrder) do | ||
local | local homeRow = | ||
mw.html.create("tr") | mw.html.create("tr") | ||
local awayRow = | |||
mw.html.create("tr") | |||
local teamHeader = | local teamHeader = | ||
| Строка 925: | Строка 927: | ||
teamHeader:css("text-align", "right") | teamHeader:css("text-align", "right") | ||
homeRow:node(teamHeader) | |||
| Строка 933: | Строка 935: | ||
local diagonal = cell("td", "—", "football-diagonal") | local diagonal = cell("td", "—", "football-diagonal") | ||
diagonal:attr("rowspan", 2) | diagonal:attr("rowspan", 2) | ||
homeRow:node( | |||
diagonal | diagonal | ||
) | ) | ||
| Строка 994: | Строка 996: | ||
if match.played then | if match.played then | ||
text = match.score | text = match.score | ||
if match.homeGoals | if match.homeGoals < match.awayGoals then | ||
awayResultCell | awayResultCell | ||
:addClass("ui") | :addClass("ui") | ||
:addClass("green") | :addClass("green") | ||
elseif match.homeGoals | elseif match.homeGoals > match.awayGoals then | ||
awayResultCell | awayResultCell | ||
:addClass("ui") | :addClass("ui") | ||
| Строка 1032: | Строка 1034: | ||
end | end | ||
homeRow:node(homeResultCell) | |||
awayRow:node(awayResultCell) | |||
end | end | ||
| Строка 1039: | Строка 1041: | ||
end | end | ||
resultsTable:node( | resultsTable:node(homeRow) | ||
resultsTable:node(awayRow) | |||
end | end | ||