Module:Protection banner: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
m (remove unnecessary whitespace and copy edit one of the error messages)
(remove parameter methods specific to individual reasons - the logic has been moved to Moudle:Protection banner/config)
Line 414: Line 414:
self:_getExpandedMessage('current-version-edit-display')
self:_getExpandedMessage('current-version-edit-display')
)
)
end
end

function Blurb:_makeDisputeBlurbParameter()
if type(self._protectionObj.expiry) == 'number' then
return self:_getExpandedMessage('dispute-blurb-expiry')
else
return self:_getExpandedMessage('dispute-blurb-noexpiry')
end
end

function Blurb:_makeDisputeSectionParameter()
-- "disputes", with or without a section link
local disputes = self:_getExpandedMessage('dispute-section-link-display')
if self._data.section then
return string.format(
'[[%s:%s#%s|%s]]',
mw.site.namespaces[self._protectionObj.title.namespace].talk.name,
self._protectionObj.title.text,
self._data.section,
disputes
)
else
return disputes
end
end
end
end
Line 523: Line 499:
else
else
return self:_getExpandedMessage('intro-blurb-noexpiry')
return self:_getExpandedMessage('intro-blurb-noexpiry')
end
end

function Blurb:_makeOfficeBlurbParameter()
if self._protectionObj.protectionDate then
return self:_getExpandedMessage('office-blurb-protectiondate')
else
return self:_getExpandedMessage('office-blurb-noprotectiondate')
end
end
end
end
Line 600: Line 568:
self:_getExpandedMessage('protection-log-display')
self:_getExpandedMessage('protection-log-display')
)
)
end
end

function Blurb:_makeResetBlurbParameter()
if self._protectionObj.protectionDate then
return self:_getExpandedMessage('reset-blurb-protectiondate')
else
return self:_getExpandedMessage('reset-blurb-noprotectiondate')
end
end
end
end