Difference between revisions of "Module:Documentation"
show padlock in other namespaces, e.g. userspace
>BDavis (WMF) m (1 revision imported from w:en:Module:Documentation) |
w:en>MSGJ (show padlock in other namespaces, e.g. userspace) |
||
Line 136: | Line 136: | ||
:attr('id', message('main-div-id')) | :attr('id', message('main-div-id')) | ||
:addClass(message('main-div-classes')) | :addClass(message('main-div-classes')) | ||
:newline() | :newline() | ||
:wikitext(p._startBox(args, env)) | :wikitext(p._startBox(args, env)) | ||
Line 405: | Line 404: | ||
-- 'protection-template' --> 'pp-template' | -- 'protection-template' --> 'pp-template' | ||
-- 'protection-template-args' --> {docusage = 'yes'} | -- 'protection-template-args' --> {docusage = 'yes'} | ||
local protectionLevels, mProtectionBanner | |||
local title = env.title | local title = env.title | ||
protectionLevels = env.protectionLevels | protectionLevels = env.protectionLevels | ||
if not protectionLevels then | if not protectionLevels then | ||
return nil | return nil | ||
end | end | ||
local | local editProt = protectionLevels.edit and protectionLevels.edit[1] | ||
local | local moveProt = protectionLevels.move and protectionLevels.move[1] | ||
if editProt then | |||
-- The page is | -- The page is edit-protected. | ||
mProtectionBanner = require('Module:Protection banner') | |||
return | local reason = message('protection-reason-edit') | ||
return mProtectionBanner._main{reason, small = true} | |||
elseif moveProt and moveProt ~= 'autoconfirmed' then | |||
-- The page is move-protected but not edit-protected. Exclude move | |||
-- protection with the level "autoconfirmed", as this is equivalent to | |||
-- no move protection at all. | |||
mProtectionBanner = require('Module:Protection banner') | |||
return mProtectionBanner._main{action = 'move', small = true} | |||
else | else | ||
return nil | return nil |