Content added Content deleted
(sync sandbox. Fix (mirror) link for creating a sandbox.) |
m (1 revision imported from w:en:Module:Documentation) |
||
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')) |
||
:css('padding', '12px') |
|||
:newline() |
:newline() |
||
:wikitext(p._startBox(args, env)) |
:wikitext(p._startBox(args, env)) |
||
Line 404: | Line 405: | ||
-- 'protection-template' --> 'pp-template' |
-- 'protection-template' --> 'pp-template' |
||
-- 'protection-template-args' --> {docusage = 'yes'} |
-- 'protection-template-args' --> {docusage = 'yes'} |
||
⚫ | |||
local title = env.title |
local title = env.title |
||
⚫ | |||
⚫ | |||
local protectionTemplate = message('protection-template') |
|||
local namespace = title.namespace |
|||
⚫ | |||
-- Don't display the protection template if we are not in the template or module namespaces. |
-- Don't display the protection template if we are not in the template or module namespaces. |
||
return nil |
return nil |
||
Line 414: | Line 417: | ||
return nil |
return nil |
||
end |
end |
||
local |
local editLevels = protectionLevels.edit |
||
local |
local moveLevels = protectionLevels.move |
||
if moveLevels and moveLevels[1] == 'sysop' or editLevels and editLevels[1] then |
|||
if editProt then |
|||
-- The page is |
-- The page is full-move protected, or full, template, or semi-protected. |
||
local frame = mw.getCurrentFrame() |
|||
mProtectionBanner = require('Module:Protection banner') |
|||
return frame:expandTemplate{title = protectionTemplate, args = message('protection-template-args', nil, 'table')} |
|||
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 |