Модуль:Prototypes/Роль/Лодаут: различия между версиями
Pok (обсуждение | вклад) мНет описания правки |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 10: | Строка 10: | ||
local roleParam = args[2] | local roleParam = args[2] | ||
if not roleParam then | if not roleParam then | ||
return ' | return 'Параметр roleId не указан' | ||
end | end | ||
local roleId = "Job" .. roleParam | local roleId = "Job" .. roleParam | ||
| Строка 22: | Строка 22: | ||
end | end | ||
if not role then | if not role then | ||
return ' | return 'Роль с id "' .. roleId .. '" не найдена' | ||
end | end | ||
for _, groupId in ipairs(role.groups or {}) do | for _, groupId in ipairs(role.groups or {}) do | ||
| Строка 57: | Строка 57: | ||
local req = eff.requirement | local req = eff.requirement | ||
if req["!type"] == "DepartmentTimeRequirement" and req.department and req.time then | if req["!type"] == "DepartmentTimeRequirement" and req.department and req.time then | ||
extraInfo = extraInfo "{{#invoke:Ftl|main|translation|department-" .. req.department .. "}}: " .. req.time .. "<br>" | extraInfo = extraInfo .. "{{#invoke:Ftl|main|translation|department-" .. req.department .. "}}: " .. req.time .. "<br>" | ||
elseif req["!type"] == "RoleTimeRequirement" and req.role and req.time then | elseif req["!type"] == "RoleTimeRequirement" and req.role and req.time then | ||
extraInfo = extraInfo "{{#invoke:Ftl|main|translation|".. req.role .. "}}: " .. req.time .. "<br>" | extraInfo = extraInfo .. "{{#invoke:Ftl|main|translation|".. req.role .. "}}: " .. req.time .. "<br>" | ||
end | end | ||
end | end | ||
| Строка 71: | Строка 71: | ||
end | end | ||
end | end | ||
table.insert(results, extraInfo .. eqValue) | table.insert(results, '<div class="time">' .. extraInfo .. '</div>' .. eqValue) | ||
end | end | ||
end | end | ||