Модуль:Сущность: различия между версиями
Pok (обсуждение | вклад) мНет описания правки |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 363: | Строка 363: | ||
local content = load_template_content(tplPath) | local content = load_template_content(tplPath) | ||
if not content then | if not content then | ||
if hasWhitelist then | if hasWhitelist then return end | ||
local typeStr = (kind and (kind:sub(1, 1):upper() .. kind:sub(2)) or "") .. (isStore and "Store" or "") | |||
table.insert(errors, "{{сущность/infobox|тип=" .. typeStr .. "|название=" .. name .. "|ссылка=Template:" .. tplPath .. "}}") | |||
local | |||
table.insert(errors, | |||
return | return | ||
end | end | ||
local parsed = getTemplateMeta(frame, tplPath) | local parsed = getTemplateMeta(frame, tplPath) | ||
local dataPage = (kind .. "/" .. pathName) .. ".json" | local dataPage = (kind .. "/" .. pathName) .. ".json" | ||
local | local entityIds = isStore and storeEntities or { id } | ||
for _, sw in ipairs(switches) do | |||
if isStore and sw ~= "card" then break end | |||
for _, sw in ipairs( | |||
local keys = parsed[sw] or {} | local keys = parsed[sw] or {} | ||
for _, key in ipairs(keys) do | for _, key in ipairs(keys) do | ||
| Строка 399: | Строка 387: | ||
table.insert(switchKeyOrder[sw], key) | table.insert(switchKeyOrder[sw], key) | ||
end | end | ||
for _, entityId in ipairs( | for _, entityId in ipairs(entityIds) do | ||
local extra = "" | local extra = "" | ||
if ok and dp and dp.flattenField then | if ok and dp and dp.flattenField then | ||