Jump to content

Module:Protection banner/config: Difference between revisions

build the whole config all at once, and combine cfg and msg
(construct msg all at once)
(build the whole config all at once, and combine cfg and msg)
Line 1: Line 1:
-- This module provides configuration data for [[Module:Protection banner]].
-- This module provides configuration data for [[Module:Protection banner]].


local cfg = {}
return {


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Line 89: Line 89:
-- specific banner config.
-- specific banner config.


cfg.masterBanner = {
masterBanner = {
text = '${INTROBLURB}.',
text = '${INTROBLURB}.',
explanation = '${EXPLANATIONBLURB}',
explanation = '${EXPLANATIONBLURB}',
Line 95: Line 95:
link = '${IMAGELINK}',
link = '${IMAGELINK}',
alt = 'Page ${PROTECTIONLEVEL}'
alt = 'Page ${PROTECTIONLEVEL}'
}
},


cfg.defaultBanners = {
defaultBanners = {
edit = {},
edit = {},
move = {},
move = {},
create = {},
create = {},
autoreview = {}
autoreview = {
}
autoconfirmed = {
 
alt = 'Page protected with pending changes level 1',
cfg.defaultBanners.autoreview.autoconfirmed = {
tooltip = 'All edits by unregistered and new users are subject to review',
alt = 'Page protected with pending changes level 1',
image = 'Padlock-silver-light.svg'
tooltip = 'All edits by unregistered and new users are subject to review',
},
image = 'Padlock-silver-light.svg'
default = {
}
alt = 'Page protected with pending changes level 2',
 
tooltip = 'All edits by users who are not reviewers or administrators are'
cfg.defaultBanners.autoreview.default = {
.. ' subject to review',
alt = 'Page protected with pending changes level 2',
}
tooltip = 'All edits by users who are not reviewers or administrators are'
}
.. ' subject to review',
},
}


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Line 120: Line 119:
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------


cfg.banners = {
banners = {
edit = {},
edit = {
move = {},
blp = {
text = '${INTROBLURB} to promote compliance with'
.. ' [[Wikipedia:Biographies of living persons'
.. "|Wikipedia's policy on the biographies"
.. ' of living people]].',
tooltip = '${TOOLTIPBLURB} to promote compliance with the policy on biographies of'
.. ' living people',
},
dispute = {
text = '${DISPUTEBLURB}',
explanation = "This protection is '''not''' an endorsement of the"
.. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}',
tooltip = 'due to editing disputes',
},
template = {
text = 'This is a permanently [[Help:Protection|protected]] ${PAGETYPE},'
.. ' as it is [[Wikipedia:High-risk templates|high-risk]].',
explanation = 'Please discuss any changes on the ${TALKPAGE}; you may'
.. ' ${EDITREQUEST} to ask an'
.. ' [[Wikipedia:Administrators|administrator]] or'
.. ' [[Wikipedia:Template editor|template editor]] to make an edit if'
.. ' it is [[Help:Minor edit#When to mark an edit as a minor edit'
.. '|uncontroversial]] or supported by'
.. ' [[Wikipedia:Consensus|consensus]]. You can also'
.. ' [[Wikipedia:Requests for page protection|request]] that the page be'
.. ' unprotected.',
tooltip = 'This high-risk ${PAGETYPE} is permanently ${PROTECTIONLEVEL}'
.. ' to prevent vandalism',
alt = 'Permanently protected ${PAGETYPE}',
},
office = {
text = '${OFFICEBLURB}',
explanation = "If you can edit this page, please discuss all changes and"
.. " additions on the ${TALKPAGE} first. '''Do not remove protection from this"
.. " page unless you are authorized by the Wikimedia Foundation to do"
.. " so.'''",
image = 'Padlock-black.svg',
},
reset = {
text = '${RESETBLURB}'
.. ' Standard Wikipedia policies will apply to its rewriting—which'
.. ' will eventually be open to all editors—and will be strictly'
.. ' enforced. The article has been placed under a level of'
.. ' semi-protection temporarily during the rebuilding of this'
.. ' article.\n\nAny insertion of material directly from'
.. ' pre-protection revisions of the article will be removed, as'
.. ' will any material added to the article that is not properly'
.. ' sourced. The associated talk page(s) were also cleared on the'
.. " same date.\n\n'''Administrators may not override this action"
.. ' without approval from someone from the [[WP:OFFICE|Office]].'
.. " No editor may remove this notice.'''",
explanation = "If you can edit this page, please discuss all changes and"
.. " additions on the ${TALKPAGE} first. '''Do not remove protection from this"
.. " page unless you are authorized by the Wikimedia Foundation to do"
.. " so.'''",
image = 'Padlock-black.svg',
},
sock = {
text = '${INTROBLURB} to prevent [[Wikipedia:Sock puppetry|sock puppets]] of'
.. ' [[Wikipedia:Blocking policy|blocked]] or'
.. ' [[Wikipedia:List of banned users|banned users]]'
.. ' from editing it',
tooltip = '${TOOLTIPBLURB} to prevent sock puppets of blocked or banned users from'
.. ' editing it',
},
usertalk = {
text = '${INTROBLURB} to prevent ${VANDAL} from using it to make disruptive edits,'
.. ' such as abusing the'
.. ' {{[[Template:unblock|unblock]]}} template',
explanation = 'If you cannot edit this user talk page and you need to'
.. ' make a change or leave a message, you can'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for edits to a protected page'
.. '|request an edit]],'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for reduction in protection level'
.. '|request unprotection]],'
.. ' [[Special:Userlogin|log in]],'
.. ' or [[Special:UserLogin/signup|create an account]].',
},
vandalism = {
text = '${INTROBLURB} due to [[Wikipedia:Vandalism|vandalism]].',
tooltip = '${TOOLTIPBLURB} due to vandalism',
}
},
move = {
dispute = {
explanation = "This protection is '''not''' an endorsement of the"
.. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}',
image = 'Padlock-olive.svg'
},
vandalism = {
}
},
create = {},
create = {},
autoreview = {}
autoreview = {}
}
},
 
cfg.banners.edit.blp = {
text = '${INTROBLURB} to promote compliance with'
.. ' [[Wikipedia:Biographies of living persons'
.. "|Wikipedia's policy on the biographies"
.. ' of living people]].',
tooltip = '${TOOLTIPBLURB} to promote compliance with the policy on biographies of'
.. ' living people',
}
 
cfg.banners.edit.dispute = {
text = '${DISPUTEBLURB}',
explanation = "This protection is '''not''' an endorsement of the"
.. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}',
tooltip = 'due to editing disputes',
}
 
cfg.banners.edit.template = {
text = 'This is a permanently [[Help:Protection|protected]] ${PAGETYPE},'
.. ' as it is [[Wikipedia:High-risk templates|high-risk]].',
explanation = 'Please discuss any changes on the ${TALKPAGE}; you may'
.. ' ${EDITREQUEST} to ask an'
.. ' [[Wikipedia:Administrators|administrator]] or'
.. ' [[Wikipedia:Template editor|template editor]] to make an edit if'
.. ' it is [[Help:Minor edit#When to mark an edit as a minor edit'
.. '|uncontroversial]] or supported by'
.. ' [[Wikipedia:Consensus|consensus]]. You can also'
.. ' [[Wikipedia:Requests for page protection|request]] that the page be'
.. ' unprotected.',
tooltip = 'This high-risk ${PAGETYPE} is permanently ${PROTECTIONLEVEL}'
.. ' to prevent vandalism',
alt = 'Permanently protected ${PAGETYPE}',
}
 
cfg.banners.edit.office = {
text = '${OFFICEBLURB}',
explanation = "If you can edit this page, please discuss all changes and"
.. " additions on the ${TALKPAGE} first. '''Do not remove protection from this"
.. " page unless you are authorized by the Wikimedia Foundation to do"
.. " so.'''",
image = 'Padlock-black.svg',
}
 
cfg.banners.edit.reset = {
text = '${RESETBLURB}'
.. ' Standard Wikipedia policies will apply to its rewriting—which'
.. ' will eventually be open to all editors—and will be strictly'
.. ' enforced. The article has been placed under a level of'
.. ' semi-protection temporarily during the rebuilding of this'
.. ' article.\n\nAny insertion of material directly from'
.. ' pre-protection revisions of the article will be removed, as'
.. ' will any material added to the article that is not properly'
.. ' sourced. The associated talk page(s) were also cleared on the'
.. " same date.\n\n'''Administrators may not override this action"
.. ' without approval from someone from the [[WP:OFFICE|Office]].'
.. " No editor may remove this notice.'''",
explanation = "If you can edit this page, please discuss all changes and"
.. " additions on the ${TALKPAGE} first. '''Do not remove protection from this"
.. " page unless you are authorized by the Wikimedia Foundation to do"
.. " so.'''",
image = 'Padlock-black.svg',
}
 
cfg.banners.edit.sock = {
text = '${INTROBLURB} to prevent [[Wikipedia:Sock puppetry|sock puppets]] of'
.. ' [[Wikipedia:Blocking policy|blocked]] or'
.. ' [[Wikipedia:List of banned users|banned users]]'
.. ' from editing it',
tooltip = '${TOOLTIPBLURB} to prevent sock puppets of blocked or banned users from'
.. ' editing it',
}
 
cfg.banners.edit.usertalk = {
text = '${INTROBLURB} to prevent ${VANDAL} from using it to make disruptive edits,'
.. ' such as abusing the'
.. ' {{[[Template:unblock|unblock]]}} template',
explanation = 'If you cannot edit this user talk page and you need to'
.. ' make a change or leave a message, you can'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for edits to a protected page'
.. '|request an edit]],'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for reduction in protection level'
.. '|request unprotection]],'
.. ' [[Special:Userlogin|log in]],'
.. ' or [[Special:UserLogin/signup|create an account]].',
}
 
cfg.banners.edit.vandalism = {
text = '${INTROBLURB} due to [[Wikipedia:Vandalism|vandalism]].',
tooltip = '${TOOLTIPBLURB} due to vandalism',
}
 
cfg.banners.move.dispute = {
explanation = "This protection is '''not''' an endorsement of the"
.. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}',
image = 'Padlock-olive.svg'
}
 
cfg.banners.move.vandalism = {
}


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Line 232: Line 223:
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------


cfg.protectionBlurbs = {
protectionBlurbs = {
edit = {},
edit = {
move = {},
default = 'This ${PAGETYPE} is currently [[Help:Protection|'
create = {},
.. 'protected]] from editing',
autoreview = {}
autoconfirmed = 'Editing of this ${PAGETYPE} by [[Wikipedia:User access'
}
.. ' levels#New users|new]] or [[Wikipedia:User access levels#Unregistered'
 
.. ' users|unregistered]] users is currently [[Help:Protection|disabled]]'
cfg.protectionBlurbs.edit.default = 'This ${PAGETYPE} is currently [[Help:Protection|'
},
.. 'protected]] from editing'
move = {
 
default = 'This ${PAGETYPE} is currently [[Help:Protection|protected]]'
cfg.protectionBlurbs.edit.autoconfirmed = 'Editing of this ${PAGETYPE} by [[Wikipedia:User access'
.. ' from [[Help:Moving a page|page moves]]'
.. ' levels#New users|new]] or [[Wikipedia:User access levels#Unregistered'
},
.. ' users|unregistered]] users is currently [[Help:Protection|disabled]]'
create = {
 
default = '[[Help:Starting a new page|Recreation]] of this ${PAGETYPE}'
cfg.protectionBlurbs.move.default = 'This ${PAGETYPE} is currently [[Help:Protection|protected]]'
.. ' [[Help:Protection|has been disabled]]'
.. ' from [[Help:Moving a page|page moves]]'
},
 
autoreview = {
cfg.protectionBlurbs.create.default = '[[Help:Starting a new page|Recreation]] of this ${PAGETYPE}'
autoconfirmed = 'All edits made to this ${PAGETYPE} by'
.. ' [[Help:Protection|has been disabled]]'
.. ' [[Wikipedia:User access levels#New users|new]] or'
 
.. ' [[Wikipedia:User access levels#Unregistered users|unregistered]]'
cfg.protectionBlurbs.autoreview.autoconfirmed = 'All edits made to this ${PAGETYPE} by'
.. ' users are currently'
.. ' [[Wikipedia:User access levels#New users|new]] or'
.. ' [[Wikipedia:Pending changes|subject to review]]',
.. ' [[Wikipedia:User access levels#Unregistered users|unregistered]]'
default = 'All edits made to this ${PAGETYPE} by users who are not'
.. ' users are currently'
.. ' [[Wikipedia:Reviewing|reviewers]] or'
.. ' [[Wikipedia:Pending changes|subject to review]]'
.. ' [[Wikipedia:Administrators|administrators]] are currently'
 
.. ' [[Wikipedia:Pending changes|subject to review]]'
cfg.protectionBlurbs.autoreview.default = 'All edits made to this ${PAGETYPE} by users who are not'
}
.. ' [[Wikipedia:Reviewing|reviewers]] or'
},
.. ' [[Wikipedia:Administrators|administrators]] are currently'
.. ' [[Wikipedia:Pending changes|subject to review]]'


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Line 267: Line 256:
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------


cfg.protectionLevels = {
protectionLevels = {
edit = {},
edit = {
move = {},
default = 'protected',
create = {},
templateeditor = 'template-protected',
autoreview = {}
autoconfirmed = 'semi-protected',
}
},
 
move = {
cfg.protectionLevels.edit.default = 'protected'
default = 'move-protected'
cfg.protectionLevels.edit.templateeditor = 'template-protected'
},
cfg.protectionLevels.edit.autoconfirmed = 'semi-protected'
create = {
cfg.protectionLevels.move.default = 'move-protected'
default = 'creation-protected'
cfg.protectionLevels.create.default = 'creation-protected'
},
autoreview = {
}
},


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Line 284: Line 276:
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------


cfg.images = {
images = {
edit = {},
edit = {
move = {},
sysop = 'Padlock.svg',
create = {},
templateeditor = 'Padlock-pink.svg',
autoreview = {}
autoconfirmed = 'Padlock-silver.svg'
}
},
 
move = {
cfg.images.edit.sysop = 'Padlock.svg'
sysop = 'Padlock-olive.svg',
cfg.images.edit.templateeditor = 'Padlock-pink.svg'
templateeditor = 'Padlock-olive.svg'
cfg.images.edit.autoconfirmed = 'Padlock-silver.svg'
},
cfg.images.move.sysop = 'Padlock-olive.svg'
create = {
cfg.images.move.templateeditor = 'Padlock-olive.svg'
default = 'Padlock-skyblue.svg',
cfg.images.create.default = 'Padlock-skyblue.svg'
},
cfg.images.autoreview.autoconfirmed = 'Padlock-silver-light.svg'
autoreview = {
cfg.images.autoreview.reviewer = 'Padlock-orange.svg'
autoconfirmed = 'Padlock-silver-light.svg',
reviewer = 'Padlock-orange.svg'
}
},


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Line 304: Line 299:
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------


cfg.imageLinks = {
imageLinks = {
edit = {},
edit = {
move = {},
default = 'Wikipedia:Protection policy#full',
create = {},
templateeditor = 'Wikipedia:Protection policy#template',
autoreview = {}
autoconfirmed = 'Wikipedia:Protection policy#semi'
}
},
 
move = {
cfg.imageLinks.edit.default = 'Wikipedia:Protection policy#full'
default = 'Wikipedia:Protection policy#move'
cfg.imageLinks.edit.templateeditor = 'Wikipedia:Protection policy#template'
},
cfg.imageLinks.edit.autoconfirmed = 'Wikipedia:Protection policy#semi'
create = {
cfg.imageLinks.move.default = 'Wikipedia:Protection policy#move'
default = 'Wikipedia:Protection policy#create'
cfg.imageLinks.create.default = 'Wikipedia:Protection policy#create'
},
cfg.imageLinks.autoreview.autoconfirmed = 'Wikipedia:Protection policy#pc1'
autoreview = {
cfg.imageLinks.autoreview.reviewer = 'Wikipedia:Protection policy#pc2'
autoconfirmed = 'Wikipedia:Protection policy#pc1',
reviewer = 'Wikipedia:Protection policy#pc2'
}
},


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Line 388: Line 386:
--]]
--]]


cfg.reasonsWithNamespacePriority = {
reasonsWithNamespacePriority = {
-- If the reason specified to the template is listed in this table,
-- If the reason specified to the template is listed in this table,
-- namespace data will take priority over reason data in the protectionCategories
-- namespace data will take priority over reason data in the protectionCategories
-- table.
-- table.
vandalism = true,
vandalism = true,
}
},


cfg.categoryNamespaceKeys = {
categoryNamespaceKeys = {
-- The string to use as a namespace key for the protectionCategories table for each
-- The string to use as a namespace key for the protectionCategories table for each
-- namespace number.
-- namespace number.
Line 407: Line 405:
[ 14] = 'category',
[ 14] = 'category',
[100] = 'portal',
[100] = 'portal',
}
},


cfg.protectionCategories = {
protectionCategories = {
['all-all-all-all-all']                  = 'Wikipedia protected pages',
['all-all-all-all-all']                  = 'Wikipedia protected pages',
['all-all-office-all-all']              = 'Wikipedia Office-protected pages',
['all-all-office-all-all']              = 'Wikipedia Office-protected pages',
Line 452: Line 450:
['all-all-all-autoconfirmed-autoreview'] = 'Wikipedia pending changes protected pages (level 1)',
['all-all-all-autoconfirmed-autoreview'] = 'Wikipedia pending changes protected pages (level 1)',
['all-all-all-reviewer-autoreview']      = 'Wikipedia pending changes protected pages (level 2)',
['all-all-all-reviewer-autoreview']      = 'Wikipedia pending changes protected pages (level 2)',
}
},


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Line 460: Line 458:
-- If any of the following reasons is passed to the module, it will not output
-- If any of the following reasons is passed to the module, it will not output
-- the "pages without expiry" tracking category.
-- the "pages without expiry" tracking category.
cfg.reasonsWithoutExpiryCheck = {
reasonsWithoutExpiryCheck = {
blp = true,
blp = true,
}
},


-- The module will only output the "pages without expiry" tracking category
-- The module will only output the "pages without expiry" tracking category
-- for the actions set to true in the following table.
-- for the actions set to true in the following table.
cfg.expiryCheckActions = {
expiryCheckActions = {
edit = true,
edit = true,
move = false,
move = false,
create = false,
create = false,
autoreview = true
autoreview = true
}
},


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Line 477: Line 475:
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------


cfg.pagetypes = {
pagetypes = {
[0] = 'article',
[0] = 'article',
[6] = 'file',
[6] = 'file',
Line 484: Line 482:
[828] = 'module',
[828] = 'module',
default = 'page'
default = 'page'
}
},


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Line 490: Line 488:
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------


cfg.indefStrings = {
indefStrings = {
['indef'] = true,
['indef'] = true,
['indefinite'] = true,
['indefinite'] = true,
['indefinitely'] = true,
['indefinitely'] = true,
['infinite'] = true,
['infinite'] = true,
}
},


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Line 503: Line 501:
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------


local msg = {
msg = {


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Line 679: Line 677:
['image-filename-default'] = 'Transparent.gif',
['image-filename-default'] = 'Transparent.gif',


--------------------------------------------------------------------------------
-- End messages
--------------------------------------------------------------------------------
}
}


Line 684: Line 685:
-- End configuration
-- End configuration
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
return {
cfg = cfg,
msg = msg
}
}
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.