Module:Protection banner: Difference between revisions

hacky code for image rendering
(add image names)
(hacky code for image rendering)
Line 133: Line 133:
create = 'Padlock-skyblue.svg'
create = 'Padlock-skyblue.svg'
}
}
function banner:renderImage()
local image
if self.reason == 'office' or self.reason == 'reset' then
image = cfg.images.office
elseif self.title.namespace == 10 or self.title.namespace == 828 then
-- We are in the template or module namespaces.
if self.protectionLevel == 'templateeditor' then
image = cfg.images.template
elseif self.protectionLevel == 'sysop' then
image = cfg.images.indef
end
elseif self.action == 'create' then
image = cfg.images.create
elseif self.action == 'move'
and (
self.protectionLevel == 'templateeditor'
or self.protectionLevel == 'sysop'
)
then
image = cfg.images.move
elseif self.action == 'edit' then
if self.protectionLevel == 'sysop' then
image = cfg.images.full
elseif self.protectionLevel == 'autoconfirmed' then
image = cfg.images.semi
end
elseif self.action == 'autoreview' then
if self.protectionLevel == 'autoconfirmed' then
image = cfg.images.pc1
elseif self.protectionLevel == 'reviewer' then
image = cfg.images.pc2
end
else
image = 'Transparent.gif'
end
return image
end


cfg.categories = {
cfg.categories = {