Anonymous user
Module:Protection banner: Difference between revisions
move section, username and deletion discussion methods out of the ProtectionStatus class, as they don't really have anything to do with protection status
(get rid of unnecessary wrapper functions) |
(move section, username and deletion discussion methods out of the ProtectionStatus class, as they don't really have anything to do with protection status) |
||
Line 46:
self._reason = args.reason
self._expiry = args.expiry or 'indef'
self._section = args.section▼
self._protectionDate = args.date
self._username = args.user▼
self._deletionDiscussionPage = args.xfd▼
end
Line 66 ⟶ 63:
function ProtectionStatus:getExpiry()
return self._expiry
end▼
end
function ProtectionStatus:getProtectionDate()
return self._protectionDate
end▼
end▼
end
Line 138 ⟶ 123:
url = tostring(url)
return string.format('[%s %s]', url, display)
▲end
function Blurb:setDeletionDiscussionPage(page)
▲end
function Blurb:setUsername(username)
▲end
function Blurb:setSection(section)
end
Line 210 ⟶ 207:
-- parameter $3
-- "disputes", with or without a section link
local section = self.
local disputes = self.configObj:getMessage('dispute-section-link-display')
if section then
Line 252 ⟶ 249:
-- parameter $6
local mVandalM = require('Module:Vandal-m')
local username = self.
username = username or self._titleObj.baseText
return mVandalM.luaMain{username}
Line 336 ⟶ 333:
function Blurb:_makeTalkLinkParameter()
-- parameter $11
local section = self.
local display = self._configObj:getMessage('talk-page-link-display')
return string.format(
Line 395 ⟶ 392:
function Blurb:_makeDeletionBlurbParameter()
-- parameter $15
local deletionDiscussionPage =
local key
if deletionDiscussionPage then
Line 408 ⟶ 405:
function Blurb:_makeDeletionDiscussionLinkParameter()
-- parameter $16
local deletionDiscussionPage =
if deletionDiscussionPage then
local display = self._configObj:getMessage('deletion-discussion-link-display')
Line 766 ⟶ 763:
-- Render the banner
local theBanner
if yesno(args.small) then
theBanner = Padlock.new(theConfig, theProtectionStatus, title)
else
theBanner = Banner.new(theConfig, theProtectionStatus, title)
end
theBanner = Padlock.new(theConfig, theProtectionStatus, title)
theBanner:setDeletionDiscussionPage(args.xfd)
theBanner:setUsername(args.user)
theBanner:setSection(args.section)
ret[#ret + 1] = theBanner:export()
-- Render the categories
|