Content deleted Content added
Self-closing div, span, and other tags deprecated. |
Amorymeltzer (talk | contribs) Support interface-protected edit requests |
||
Line 29:
function title.getProtectionLevelText(protectionLevel)
-- Gets the text to use in anchors and urn links.
local levels = {unprotected = 'editunprotected', autoconfirmed = 'editsemiprotected', extendedconfirmed = 'editextendedprotected', templateeditor = 'edittemplateprotected', sysop = 'editprotected', interfaceadmin = 'editinterfaceprotected'}
return levels[protectionLevel]
end
Line 278:
function blurb:makeProtectionText()
local boxProtectionLevel = self.boxProtectionLevel
local levels = {['*'] = 'unprotected', autoconfirmed = 'semi-protected', extendedconfirmed = 'extended-confirmed-protected', templateeditor = 'template-protected', sysop = 'fully protected', interfaceadmin = 'interface-protected'}
for level, protectionText in pairs(levels) do
if level == boxProtectionLevel then
Line 429:
elseif boxProtectionLevel == 'autoconfirmed' then
userText = '[[Wikipedia:User access levels#Autoconfirmed|autoconfirmed]] user'
elseif boxProtectionLevel == 'interfaceadmin' then
userText = '[[Wikipedia:User access levels#Interface administrators|interface-admin]]'
else
userText = 'user'
Line 458 ⟶ 460:
smallText = smallText .. ' To request that a page be protected or unprotected, make a [[Wikipedia:Requests for page protection|protection request]].'
end
if boxProtectionLevel == 'sysop' or boxProtectionLevel == 'templateeditor' or boxProtectionLevel == 'interfaceadmin' then
smallText = smallText .. ' When the request has been completed or denied, please add the ' .. blurb.makeParaText('answered', 'yes') .. ' parameter to deactivate the template.'
end
Line 487 ⟶ 489:
local obj = getmetatable(box).new(protectionType, args)
setmetatable(obj, box)
local boxProtectionLevels = {semi = 'autoconfirmed', extended = 'extendedconfirmed', template = 'templateeditor', full = 'sysop', interface = 'interfaceadmin'}
obj.boxProtectionLevel = boxProtectionLevels[protectionType]
obj.demo = yesno(args.demo)
Line 503 ⟶ 505:
local boxProtectionLevel = self.boxProtectionLevel
local padlock
if boxProtectionLevel == 'sysop' or boxProtectionLevel == 'interfaceadmin' then
padlock = 'Padlock.svg'
elseif boxProtectionLevel == 'templateeditor' then
Line 552 ⟶ 554:
extendedconfirmed = 'Wikipedia extended-confirmed-protected edit requests',
templateeditor = 'Wikipedia template-protected edit requests',
sysop = 'Wikipedia fully-protected edit requests',
interfaceadmin = 'Wikipedia interface-protected edit requests'
}
addCat(protectionCats[boxProtectionLevel])
|