Модуль:Предмет: различия между версиями
Pok (обсуждение | вклад) мНет описания правки |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 16: | Строка 16: | ||
local prefix = args[2] or "" | local prefix = args[2] or "" | ||
local size = args["size"] or "32px" | local size = args["size"] or "32px" | ||
| Строка 35: | Строка 34: | ||
local image | local image | ||
if input_image == nil then | if input_image == nil then | ||
image = "" | image = string.format("[[Файл:%s.png|%s]]", id, size) | ||
else | else | ||
if input_image == "" then | if input_image == "" then | ||
image = | image = "" | ||
else | else | ||
image = string.format("[[Файл:%s|%s]]", input_image, size) | image = string.format("[[Файл:%s|%s]]", input_image, size) | ||
| Строка 59: | Строка 58: | ||
-- Сбор информации в зависимости от наличия репозитория | -- Сбор информации в зависимости от наличия репозитория | ||
local | local input_repository = argsWithWhitespace.repository | ||
if | local repository | ||
if input_repository == nil then | |||
repository = prefix .. " " .. labelOutput | |||
else | else | ||
repository = itemStack .. " " .. labelOutput .. " " .. itemContained .. " " .. itemSlot .. " " .. itemChem | |||
end | end | ||
local result = image .. " " .. | local result = image .. " " .. repository | ||
-- Формирование вывода через LinkCard, если указан непустой обёртка | -- Формирование вывода через LinkCard, если указан непустой обёртка | ||
| Строка 72: | Строка 72: | ||
local pixel = string.match(size, "(%d+)") | local pixel = string.match(size, "(%d+)") | ||
local wrapperInfo | local wrapperInfo | ||
if | if input_repository == nil then | ||
wrapperInfo = label .. prefix | |||
else | |||
wrapperInfo = label .. itemStack .. " " .. itemContained .. " " .. itemSlot .. " " .. itemChem | wrapperInfo = label .. itemStack .. " " .. itemContained .. " " .. itemSlot .. " " .. itemChem | ||
end | end | ||