Editing Module:Protection banner

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 173: Line 173:
 
function Protection:isProtected()
 
function Protection:isProtected()
 
return self.level ~= '*'
 
return self.level ~= '*'
end
 
 
function Protection:isTemporary()
 
return type(self.expiry) == 'number'
 
 
end
 
end
  
Line 526: Line 522:
  
 
function Blurb:_makeIntroBlurbParameter()
 
function Blurb:_makeIntroBlurbParameter()
if self._protectionObj:isTemporary() then
+
if type(self._protectionObj.expiry) == 'number' then
 
return self:_getExpandedMessage('intro-blurb-expiry')
 
return self:_getExpandedMessage('intro-blurb-expiry')
 
else
 
else
Line 621: Line 617:
  
 
function Blurb:_makeTooltipBlurbParameter()
 
function Blurb:_makeTooltipBlurbParameter()
if self._protectionObj:isTemporary() then
+
if type(self._protectionObj.expiry) == 'number' then
 
return self:_getExpandedMessage('tooltip-blurb-expiry')
 
return self:_getExpandedMessage('tooltip-blurb-expiry')
 
else
 
else
Line 691: Line 687:
 
local action = protectionObj.action
 
local action = protectionObj.action
 
local level = protectionObj.level
 
local level = protectionObj.level
 +
local expiry = protectionObj.expiry
 
local namespace = protectionObj.title.namespace
 
local namespace = protectionObj.title.namespace
 
local reason = protectionObj.reason
 
local reason = protectionObj.reason
Line 702: Line 699:
 
and action == 'edit'
 
and action == 'edit'
 
and level == 'sysop'
 
and level == 'sysop'
and not protectionObj:isTemporary()
+
and (not expiry or expiry == 'indef')
 
then
 
then
 
-- Fully protected modules and templates get the special red "indef"
 
-- Fully protected modules and templates get the special red "indef"

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)