14,091
edits
m (1 revision) |
(revert) |
||
(10 intermediate revisions by the same user not shown) | |||
Line 146: | Line 146: | ||
.done() | .done() | ||
.wikitext(p._endBox(args, env)) | .wikitext(p._endBox(args, env)) | ||
.wikitext(p.addTrackingCategories(env)) | .wikitext(p.addTrackingCategories(env)) | ||
return tostring(root) | return tostring(root) | ||
Line 406: | Line 405: | ||
-- '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 | ||
if title.namespace ~= 10 and title.namespace ~= 828 then | |||
-- 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 418: | Line 415: | ||
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 | ||
Line 727: | Line 731: | ||
-- Add sandbox and testcases links. | -- Add sandbox and testcases links. | ||
-- "Editors can experiment in this template's sandbox and testcases pages." | -- "Editors can experiment in this template's sandbox and testcases pages." | ||
text = text .. p.makeExperimentBlurb(args, env) | text = text .. (p.makeExperimentBlurb(args, env) or '') | ||
text = text .. '<br />' | text = text .. '<br />' | ||
if not args.content and not args[1] then | if not args.content and not args[1] then |