Changes

Module:Documentation

216 bytes added, 22:22, 27 September 2014
don't use pp-template for move-protected pages, to avoid them being wrongly categorised in Category:Wikipedia pages with incorrect protection templates
-- 'protection-template' --> 'pp-template'
-- 'protection-template-args' --> {docusage = 'yes'}
local protectionLevels, mProtectionBanner
local title = env.title
local protectionLevels local protectionTemplate = message('protection-template') local namespace = if title.namespace if not (protectionTemplate and (namespace =~= 10 or and title.namespace =~= 828)) then
-- Don't display the protection template if we are not in the template or module namespaces.
return nil
return nil
end
local editLevels editProt = protectionLevels.editand protectionLevels.edit[1] local moveLevels moveProt = protectionLevels.move if moveLevels and moveLevelsprotectionLevels.move[1] if editProt then -- The page is edit-protected. mProtectionBanner =require('Module:Protection banner') local reason = message('sysopprotection-reason-edit' or editLevels ) return mProtectionBanner._main{reason, small = true} elseif moveProt and editLevels[1] moveProt ~= 'autoconfirmed' then -- The page is fullmove-protected but not edit-protected. Exclude move protected -- protection with the level "autoconfirmed", or full, template, or semias this is equivalent to --protectedno move protection at all. local frame mProtectionBanner = mw.getCurrentFramerequire('Module:Protection banner') return frame:expandTemplatemProtectionBanner._main{title action = protectionTemplate, args = message('protection-template-argsmove', nil, 'table')small = true}
else
return nil
Anonymous user