5233
редагування
Admin (обговорення | внесок) Немає опису редагування Мітка: Ручний відкіт |
Admin (обговорення | внесок) Немає опису редагування |
||
| Рядок 25: | Рядок 25: | ||
function p.prevLink(frame) | function p.prevLink(frame) | ||
local current_tournament = frame.args[1] or mw.title.getCurrentTitle().text | local current_tournament = frame.args[1] or mw.title.getCurrentTitle().text | ||
if not | -- DEBUG: покажемо що передається | ||
return '<span style="color: | if not find_tournament_index(current_tournament) then | ||
return '<span style="color:red;" title="' .. current_tournament .. '">← (DEBUG: ' .. current_tournament .. ')</span>' | |||
end | end | ||
local index = find_tournament_index(current_tournament) | |||
local prev_index = index == 1 and #tournament_order or index - 1 | local prev_index = index == 1 and #tournament_order or index - 1 | ||
local prev_tournament = tournament_order[prev_index] | local prev_tournament = tournament_order[prev_index] | ||
| Рядок 39: | Рядок 40: | ||
function p.nextLink(frame) | function p.nextLink(frame) | ||
local current_tournament = frame.args[1] or mw.title.getCurrentTitle().text | local current_tournament = frame.args[1] or mw.title.getCurrentTitle().text | ||
if not | -- DEBUG: покажемо що передається | ||
return '<span style="color: | if not find_tournament_index(current_tournament) then | ||
return '<span style="color:red;" title="' .. current_tournament .. '">→ (DEBUG: ' .. current_tournament .. ')</span>' | |||
end | end | ||
local index = find_tournament_index(current_tournament) | |||
local next_index = index == #tournament_order and 1 or index + 1 | local next_index = index == #tournament_order and 1 or index + 1 | ||
local next_tournament = tournament_order[next_index] | local next_tournament = tournament_order[next_index] | ||