5233
редагування
Admin (обговорення | внесок) Немає опису редагування Мітка: Скасовано |
Admin (обговорення | внесок) Немає опису редагування Мітка: Ручний відкіт |
||
| Рядок 1: | Рядок 1: | ||
local p = {} | local p = {} | ||
local tournament_order = { | local tournament_order = { | ||
"Перший сезон", | "Перший сезон", | ||
| Рядок 15: | Рядок 14: | ||
} | } | ||
local function find_tournament_index(tournament_name) | local function find_tournament_index(tournament_name) | ||
for i, name in ipairs(tournament_order) do | for i, name in ipairs(tournament_order) do | ||
| Рядок 25: | Рядок 23: | ||
end | end | ||
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 | ||
| Рядок 34: | Рядок 31: | ||
end | end | ||
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] | ||
| Рядок 41: | Рядок 37: | ||
end | end | ||
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 | ||
| Рядок 50: | Рядок 45: | ||
end | end | ||
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] | ||