Jump to content

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
(use PAGETYPE variable with the reset reason)
(add an INTROFRAGMENT parameter to solve the problem of what punctuation to use in run-on sentences using INTROBLURB)
Line 31: Line 31:
-- ${INTROBLURB} - the PROTECTIONBLURB parameter, plus the expiry if an expiry
-- ${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  
-- is set. E.g. "Editing of this page by new or unregistered users is currently  
-- disabled until dd Month YYYY"
-- 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".
-- ${PAGETYPE} - the type of the page, e.g. "article" or "template".
Line 70: Line 73:


masterBanner = {
masterBanner = {
text = '${INTROBLURB}.',
text = '${INTROBLURB}',
explanation = '${EXPLANATIONBLURB}',
explanation = '${EXPLANATIONBLURB}',
tooltip = '${TOOLTIPBLURB}.',
tooltip = '${TOOLTIPBLURB}.',
Line 104: Line 107:
.. ' [[Wikipedia:Biographies of living persons'
.. ' [[Wikipedia:Biographies of living persons'
.. '|biographies of living persons]] policy.',
.. '|biographies of living persons]] policy.',
text = '${INTROBLURB} to promote compliance with'
text = '${INTROFRAGMENT} to promote compliance with'
.. ' [[Wikipedia:Biographies of living persons'
.. ' [[Wikipedia:Biographies of living persons'
.. "|Wikipedia's policy on the biographies"
.. "|Wikipedia's policy on the biographies"
Line 154: Line 157:
local msg
local msg
if type(protectionObj.expiry) == 'number' then
if type(protectionObj.expiry) == 'number' then
msg = '${INTROBLURB}, or until editing %s have been resolved.'
msg = '${INTROFRAGMENT} or until editing %s have been resolved.'
else
else
msg = '${INTROBLURB} until editing %s have been resolved.'
msg = '${INTROFRAGMENT} until editing %s have been resolved.'
end
end
return string.format(msg, disputes)
return string.format(msg, disputes)
Line 235: Line 238:
description = 'For pages protected due to'
description = 'For pages protected due to'
.. ' [[Wikipedia:Sock puppetry|sock puppetry]].',
.. ' [[Wikipedia:Sock puppetry|sock puppetry]].',
text = '${INTROBLURB} to prevent [[Wikipedia:Sock puppetry|sock puppets]] of'
text = '${INTROFRAGMENT} to prevent [[Wikipedia:Sock puppetry|sock puppets]] of'
.. ' [[Wikipedia:Blocking policy|blocked]] or'
.. ' [[Wikipedia:Blocking policy|blocked]] or'
.. ' [[Wikipedia:List of banned users|banned users]]'
.. ' [[Wikipedia:List of banned users|banned users]]'
Line 263: Line 266:
description = 'For pages protected against disruptive edits by a'
description = 'For pages protected against disruptive edits by a'
.. ' particular user.',
.. ' particular user.',
text = '${INTROBLURB} to prevent ${VANDAL} from using it to make disruptive edits,'
text = '${INTROFRAGMENT} to prevent ${VANDAL} from using it to make disruptive edits,'
.. ' such as abusing the'
.. ' such as abusing the'
.. ' {{[[Template:unblock|unblock]]}} template.',
.. ' {{[[Template:unblock|unblock]]}} template.',
Line 280: Line 283:
description = 'For pages protected against'
description = 'For pages protected against'
.. ' [[Wikipedia:Vandalism|vandalism]].',
.. ' [[Wikipedia:Vandalism|vandalism]].',
text = '${INTROBLURB} due to [[Wikipedia:Vandalism|vandalism]].',
text = '${INTROFRAGMENT} due to [[Wikipedia:Vandalism|vandalism]].',
explanation = function (protectionObj, args)
explanation = function (protectionObj, args)
local ret = ''
local ret = ''
Line 709: Line 712:


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Intro blurb
-- Intro blurb and intro fragment
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------


['intro-blurb-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY}',
['intro-blurb-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY}.',
['intro-blurb-noexpiry'] = '${PROTECTIONBLURB}',
['intro-blurb-noexpiry'] = '${PROTECTIONBLURB}.',
['intro-fragment-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY},',
['intro-fragment-noexpiry'] = '${PROTECTIONBLURB}',


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Cookies help us deliver our services. By using our services, you agree to our use of cookies.