Module:Protection banner/config: Difference between revisions

add an INTROFRAGMENT parameter to solve the problem of what punctuation to use in run-on sentences using INTROBLURB
Enwikipedia>Mr. Stradivarius
(use PAGETYPE variable with the reset reason)
Enwikipedia>Mr. Stradivarius
(add an INTROFRAGMENT parameter to solve the problem of what punctuation to use in run-on sentences using INTROBLURB)
Line 31:
-- ${INTROBLURB} - the PROTECTIONBLURB parameter, plus the expiry if an expiry
-- is set. E.g. "Editing of this page by new or unregistered users is currently
-- disabled until dd Month YYYY."
--
-- ${INTROFRAGMENT} - the same as ${INTROBLURB}, but without final punctuation
-- so that it can be used in run-on sentences.
--
-- ${PAGETYPE} - the type of the page, e.g. "article" or "template".
Line 70 ⟶ 73:
 
masterBanner = {
text = '${INTROBLURB}.',
explanation = '${EXPLANATIONBLURB}',
tooltip = '${TOOLTIPBLURB}.',
Line 104 ⟶ 107:
.. ' [[Wikipedia:Biographies of living persons'
.. '|biographies of living persons]] policy.',
text = '${INTROBLURBINTROFRAGMENT} to promote compliance with'
.. ' [[Wikipedia:Biographies of living persons'
.. "|Wikipedia's policy on the biographies"
Line 154 ⟶ 157:
local msg
if type(protectionObj.expiry) == 'number' then
msg = '${INTROBLURBINTROFRAGMENT}, or until editing %s have been resolved.'
else
msg = '${INTROBLURBINTROFRAGMENT} until editing %s have been resolved.'
end
return string.format(msg, disputes)
Line 235 ⟶ 238:
description = 'For pages protected due to'
.. ' [[Wikipedia:Sock puppetry|sock puppetry]].',
text = '${INTROBLURBINTROFRAGMENT} to prevent [[Wikipedia:Sock puppetry|sock puppets]] of'
.. ' [[Wikipedia:Blocking policy|blocked]] or'
.. ' [[Wikipedia:List of banned users|banned users]]'
Line 263 ⟶ 266:
description = 'For pages protected against disruptive edits by a'
.. ' particular user.',
text = '${INTROBLURBINTROFRAGMENT} to prevent ${VANDAL} from using it to make disruptive edits,'
.. ' such as abusing the'
.. ' {{[[Template:unblock|unblock]]}} template.',
Line 280 ⟶ 283:
description = 'For pages protected against'
.. ' [[Wikipedia:Vandalism|vandalism]].',
text = '${INTROBLURBINTROFRAGMENT} due to [[Wikipedia:Vandalism|vandalism]].',
explanation = function (protectionObj, args)
local ret = ''
Line 709 ⟶ 712:
 
--------------------------------------------------------------------------------
-- Intro blurb and intro fragment
--------------------------------------------------------------------------------
 
['intro-blurb-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY}.',
['intro-blurb-noexpiry'] = '${PROTECTIONBLURB}.',
['intro-fragment-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY},',
['intro-fragment-noexpiry'] = '${PROTECTIONBLURB}',
 
--------------------------------------------------------------------------------