Editing Module:Documentation

From MINR.ORG WIKI

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
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 402: Line 403:
 
-- '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
 +
local protectionLevels
 +
local protectionTemplate = message('protection-template')
 +
local namespace = title.namespace
 +
if not (protectionTemplate and (namespace == 10 or namespace == 828)) then
 +
-- Don't display the protection template if we are not in the template or module namespaces.
 +
return nil
 +
end
 
protectionLevels = env.protectionLevels
 
protectionLevels = env.protectionLevels
 
if not protectionLevels then
 
if not protectionLevels then
 
return nil
 
return nil
 
end
 
end
local editProt = protectionLevels.edit and protectionLevels.edit[1]
+
local editLevels = protectionLevels.edit
local moveProt = protectionLevels.move and protectionLevels.move[1]
+
local moveLevels = protectionLevels.move
if editProt then
+
if moveLevels and moveLevels[1] == 'sysop' or editLevels and editLevels[1] then
-- The page is edit-protected.
+
-- The page is full-move protected, or full, template, or semi-protected.
mProtectionBanner = require('Module:Protection banner')
+
local frame = mw.getCurrentFrame()
local reason = message('protection-reason-edit')
+
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

Please note that all contributions to MINR.ORG WIKI may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see MINR.ORG WIKI:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)