6208
редагувань
Admin (обговорення | внесок) Немає опису редагування |
Admin (обговорення | внесок) Немає опису редагування |
||
| Рядок 731: | Рядок 731: | ||
end | end | ||
if player_in_game then | |||
local role = get_player_role(player_name, cells) | local role = get_player_role(player_name, cells) | ||
local result = get_player_result(role, cells[16]) | local result = get_player_result(role, cells[16]) | ||
-- Конвертуємо час з "37 хв 26 с" в "37:26" | |||
local time_raw = cells[5] or "" | |||
local minutes, seconds = mw.ustring.match(time_raw, "(%d+)%s*хв%s*(%d+)%s*с") | |||
local time_formatted = time_raw | |||
if minutes and seconds then | |||
time_formatted = minutes .. ":" .. string.format("%02d", tonumber(seconds)) | |||
end | |||
table.insert(games, { | table.insert(games, { | ||
short = cells[3] or "", | short = cells[3] or "", | ||
tournament = cells[4] or "", | tournament = cells[4] or "", | ||
time = | time = time_formatted, | ||
role = role, | role = role, | ||
result = result, | result = result, | ||
| Рядок 776: | Рядок 784: | ||
headerRow:tag('th'):wikitext('Результат') | headerRow:tag('th'):wikitext('Результат') | ||
headerRow:tag('th'):wikitext('Запис') | headerRow:tag('th'):wikitext('Запис') | ||
-- | -- Колір для ролей (білий) | ||
local | local role_color = "#fff" | ||
for _, game in ipairs(games) do | for _, game in ipairs(games) do | ||
| Рядок 819: | Рядок 822: | ||
resultCell:tag('span') | resultCell:tag('span') | ||
:css('color', '#4caf50') | :css('color', '#4caf50') | ||
:wikitext(' | :wikitext('В') | ||
elseif game.result == "Поразка" then | |||
resultCell:tag('span') | resultCell:tag('span') | ||
:css('color', 'indianred') | :css('color', 'indianred') | ||
:wikitext(' | :wikitext('П') | ||
else | else | ||
resultCell:wikitext(game.result) | resultCell:wikitext(game.result) | ||