Модуль:Football: различия между версиями
Внешний вид
Andrew (обсуждение | вклад) Убрано добавление гостевых результатов в шахматке |
Andrew (обсуждение | вклад) Теперь ячейки выделяются цветом в зависимости от результата |
||
| Строка 211: | Строка 211: | ||
local score | local score | ||
-- | -- Формат с номером круга: | ||
-- круг;хозяева;гости;счёт | -- круг;хозяева;гости;счёт | ||
if #parts >= 4 then | if #parts >= 4 then | ||
| Строка 220: | Строка 220: | ||
score = trim(parts[4]) | score = trim(parts[4]) | ||
-- | -- Формат без номера круга: | ||
-- хозяева;гости;счёт | -- хозяева;гости;счёт | ||
elseif #parts >= 3 then | elseif #parts >= 3 then | ||
| Строка 862: | Строка 862: | ||
if match.played then | if match.played then | ||
text = match.score | text = match.score | ||
if matches.homeGoals > matches.awayGoals then | |||
resultCell.addClass("ui green") | |||
elseif matches.homeGoals < matches.awayGoals then | |||
resultCell.addClass("ui red") | |||
else | |||
resultCell.addClass("ui yellow") | |||
end | |||
elseif match.status ~= "" then | elseif match.status ~= "" then | ||
text = match.status | text = match.status | ||
else | else | ||
text = "—" | text = "—" | ||
end | end | ||
resultCell | resultCell | ||
:wikitext(text) | :wikitext(text) | ||