Jump to content

Module:Protection banner/config: Difference between revisions

more conversion of the data to the bannerConfig table
Enwikipedia>Mr. Stradivarius
(use a new approach to the banner config, allowing more fine-grained control and less hopping around between parameter definitions)
Enwikipedia>Mr. Stradivarius
(more conversion of the data to the bannerConfig table)
Line 4:
 
--------------------------------------------------------------------------------
-- BANNER DATA
-- Banner data
--------------------------------------------------------------------------------
 
Line 84:
--
--
-- PARAMETERS
--
-- The values in the banner data can take parameters. These are specified
Line 93:
-- Defined in the cfg.pagetypes table.
--
-- ${PROTECTIONLEVEL} - the protection level, e.g. "fully protected" or
-- "semi-protected".
--
-- ${EXPIRY} - the protection expiry date in the format DD Month YYYY. If
-- protection is indefinite or is not set, this is the blank string.
--
-- ${EDITREQUEST} - a link to create an edit request for the current page.
--
-- ${TALKPAGELINK} - a link to the talk page. If a section is specified, links
-- straight to that talk page section.
--
-- ${DELETIONREASONSBLURB} - a blurb about why the page was deleted. For
-- example, "Please see the deletion discussion or the protection log for
-- details of why this page was deleted." Uses the message
-- "deletion-discussion-blurb-xfd" if a link to a deletion discussion is
-- present, or "deletion-discussion-blurb-noxfd" if not.
--]]
 
Line 110 ⟶ 125:
[ 4] = 'project',
[ 6] = 'file',
[ 8] = 'mediawiki',
[ 10] = 'template',
[ 12] = 'project',
Line 116 ⟶ 132:
}
 
--------------------------------------------------------------------------------
cfg.bannerData = {
-- Intro text
-- The key strings follow this format:
--------------------------------------------------------------------------------
-- type, level, ns, reason, expiry
 
['all-all-all-all-all'] = {
-- Shared intro text for the bannerData table.
text = '',
 
explanation = '',
local introText = {}
tooltip = '',
introText.full = 'This ${PAGETYPE} is currently [[Help:Protection|protected]]'
alt = '',
.. ' from editing'
category = 'Wikipedia protected pages',
introText.semi = 'Editing of this ${PAGETYPE} by [[Wikipedia:User access levels'
},
.. '#New users|new]] or [[Wikipedia:User access levels#Unregistered users'
['all-all-office-all-all'] = {
.. '|unregistered]] users is currently [[Help:Protection|disabled]]'
category = 'Wikipedia Office-protected pages',
introText.move = 'This ${PAGETYPE} is currently [[Help:Protection|protected]]'
},
.. ' from [[Help:Moving a page|page moves]]'
['all-all-reset-all-all'] = {
introText.create = '[[Help:Starting a new page|Recreation]] of this ${PAGETYPE}'
category = 'Wikipedia Office-protected pages',
.. ' [[Help:Protection|has been disabled]]'
},
['all-template-all-all-edit'] = {
--------------------------------------------------------------------------------
category = 'Wikipedia protected templates',
-- Banner data table
},
--------------------------------------------------------------------------------
['all-all-all-autoconfirmed-edit'] = {
 
category = 'Wikipedia semi-protected pages',
cfg.bannerData = {}
},
 
['indef-all-all-autoconfirmed-edit'] = {
-- Set the defaults for all protection types.
category = 'Wikipedia indefinitely semi-protected pages',
cfg.bannerData['all-all-all-all-all'] = {
},
text = introText.full .. '.',
['all-all-blp-autoconfirmed-edit'] = {
explanation = 'Please discuss any changes on the ${TALKPAGELINK}; you'
category = 'Wikipedia indefinitely semi-protected biographies of living people',
.. ' may ${EDITREQUEST} to ask an'
},
.. ' [[Wikipedia:Administrators|administrator]] to make an edit if it'
['temp-all-blp-autoconfirmed-edit'] = {
.. ' is [[Help:Minor edit#When to mark an edit as a minor edit'
category = 'Wikipedia temporarily semi-protected biographies of living people',
.. '|uncontroversial]] or supported by [[Wikipedia:Consensus'
},
.. '|consensus]]. You may also [[Wikipedia:Requests for'
['all-all-dispute-autoconfirmed-edit'] = {
.. ' page protection#Current requests for reduction in protection level'
category = 'Wikipedia pages semi-protected due to dispute',
.. '|request]] that this page be unprotected.',
},
tooltip = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}.',
['all-all-sock-autoconfirmed-edit'] = {
alt = 'Page ${PROTECTIONLEVEL}',
category = 'Wikipedia pages semi-protected from banned users',
image = 'Transparent.gif',
},
category = 'Wikipedia protected pages'
['all-all-vandalism-autoconfirmed-edit'] = {
category = 'Wikipedia pages semi-protected against vandalism',
},
['all-category-all-autoconfirmed-edit'] = {
category = 'Wikipedia semi-protected categories',
},
['all-file-all-autoconfirmed-edit'] = {
category = 'Semi-protected images',
},
['all-portal-all-autoconfirmed-edit'] = {
category = 'Semi-protected portals',
},
['all-project-all-autoconfirmed-edit'] = {
category = 'Semi-protected project pages',
},
['all-talk-all-autoconfirmed-edit'] = {
category = 'Semi-protected talk pages',
},
['all-template-all-autoconfirmed-edit'] = {
category = 'Wikipedia semi-protected templates',
},
['all-template-all-autoconfirmed-edit'] = {
category = 'Wikipedia semi-protected templates',
},
['all-user-all-autoconfirmed-edit'] = {
category = 'Wikipedia semi-protected user and user talk pages',
},
['all-all-blp-sysop-edit'] = {
category = 'Wikipedia indefinitely protected biographies of living people',
},
['temp-all-blp-sysop-edit'] = {
category = 'Wikipedia temporarily protected biographies of living people',
},
['all-all-dispute-sysop-edit'] = {
category = 'Wikipedia pages protected due to dispute',
},
['all-all-sock-sysop-edit'] = {
category = 'Wikipedia pages protected from banned users',
},
['all-all-vandalism-sysop-edit'] = {
category = 'Wikipedia pages protected against vandalism',
},
['all-category-all-sysop-edit'] = {
category = 'Wikipedia protected categories',
},
['all-file-all-sysop-edit'] = {
category = 'Protected images',
},
['all-project-all-sysop-edit'] = {
category = 'Protected project pages',
},
['all-talk-all-sysop-edit'] = {
category = 'Protected talk pages',
},
['all-template-all-sysop-edit'] = {
category = 'Wikipedia protected templates',
},
['all-user-all-sysop-edit'] = {
category = 'Wikipedia protected user and user talk pages',
},
['all-all-all-sysop-move'] = {
category = 'Wikipedia move-protected pages',
},
['indef-all-all-sysop-move'] = {
category = 'Wikipedia indefinitely move-protected pages',
},
['all-all-dispute-sysop-move'] = {
category = 'Wikipedia pages move-protected due to dispute',
},
['all-all-vandalism-sysop-move'] = {
category = 'Wikipedia pages move-protected due to vandalism',
},
['all-portal-all-sysop-move'] = {
category = 'Wikipedia move-protected portals',
},
['all-portal-all-sysop-move'] = {
category = 'Wikipedia move-protected portals',
},
['all-project-all-sysop-move'] = {
category = 'Wikipedia move-protected project pages',
},
['all-talk-all-sysop-move'] = {
category = 'Wikipedia move-protected talk pages',
},
['all-template-all-sysop-move'] = {
category = 'Wikipedia move-protected templates',
},
['all-user-all-sysop-move'] = {
category = 'Wikipedia move-protected user and user talk pages',
},
['all-all-all-autoconfirmed-autoreview'] = {
category = 'Wikipedia pending changes protected pages (level 1)',
},
['all-all-all-reviewer-autoreview'] = {
category = 'Wikipedia pending changes protected pages (level 2)',
},
}
 
-- Move-protection defaults.
cfg.bannerData['all-all-all-all-move'] = {
explanation = 'The page may still be edited but cannot be moved'
.. ' until unprotected. Please discuss any suggested moves on the'
.. ' ${TALKPAGELINK} or at [[Wikipedia:Requested moves]]. You can also'
.. ' [[Wikipedia:Requests for page protection|request]] that the page be'
.. ' unprotected.',
}
 
-- Create-protection defaults.
cfg.bannerData['all-all-all-all-create'] = {
explanation = '${DELETIONBLURB} If you would like to create a page'
.. ' at this title, you must first'
.. ' [[Wikipedia:Requests for page protection|request]] for it to be'
.. ' unprotected, or contact the administrator who deleted the page for the'
.. ' deleted material to be restored. If unsuccessful, you can use'
.. ' [[Wikipedia:Deletion review|deletion review]].',
}
 
-- Don't make an unprotection request link for pages in the MediaWiki namespace.
cfg.bannerData['all-mediawiki-all-all-all'] = {
text = introText.full .. '.',
explanation = 'Please discuss any changes on the ${TALKPAGELINK}; you'
.. ' may ${EDITREQUEST} to ask an'
.. ' [[Wikipedia:Administrators|administrator]] 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]].',
}
 
-- Set defaults for temporarily-protected pages.
cfg.bannerData['temp-all-all-all-all'] = {
text = introText.full .. ' until ${EXPIRY}.',
tooltip = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY}.'
}
 
cfg.bannerData['all-all-all-autoconfirmed-edit'] = {
text = introText.semi .. '.'
}
 
cfg.bannerData['temp-all-all-autoconfirmed-edit'] = {
text = introText.semi .. ' until ${EXPIRY}.'
}
 
--------------------------------------------------------------------------------
-- Protection categories
--------------------------------------------------------------------------------
 
local bannerDataCategories = {
['all-all-office-all-all'] = 'Wikipedia Office-protected pages',
['all-all-reset-all-all'] = 'Wikipedia Office-protected pages',
['all-template-all-all-edit'] = 'Wikipedia protected templates',
['all-all-all-autoconfirmed-edit'] = 'Wikipedia semi-protected pages',
['indef-all-all-autoconfirmed-edit'] = 'Wikipedia indefinitely semi-protected pages',
['all-all-blp-autoconfirmed-edit'] = 'Wikipedia indefinitely semi-protected biographies of living people',
['temp-all-blp-autoconfirmed-edit'] = 'Wikipedia temporarily semi-protected biographies of living people',
['all-all-dispute-autoconfirmed-edit'] = 'Wikipedia pages semi-protected due to dispute',
['all-all-sock-autoconfirmed-edit'] = 'Wikipedia pages semi-protected from banned users',
['all-all-vandalism-autoconfirmed-edit'] = 'Wikipedia pages semi-protected against vandalism',
['all-category-all-autoconfirmed-edit'] = 'Wikipedia semi-protected categories',
['all-file-all-autoconfirmed-edit'] = 'Semi-protected images',
['all-portal-all-autoconfirmed-edit'] = 'Semi-protected portals',
['all-project-all-autoconfirmed-edit'] = 'Semi-protected project pages',
['all-talk-all-autoconfirmed-edit'] = 'Semi-protected talk pages',
['all-template-all-autoconfirmed-edit'] = 'Wikipedia semi-protected templates',
['all-template-all-autoconfirmed-edit'] = 'Wikipedia semi-protected templates',
['all-user-all-autoconfirmed-edit'] = 'Wikipedia semi-protected user and user talk pages',
['all-all-blp-sysop-edit'] = 'Wikipedia indefinitely protected biographies of living people',
['temp-all-blp-sysop-edit'] = 'Wikipedia temporarily protected biographies of living people',
['all-all-dispute-sysop-edit'] = 'Wikipedia pages protected due to dispute',
['all-all-sock-sysop-edit'] = 'Wikipedia pages protected from banned users',
['all-all-vandalism-sysop-edit'] = 'Wikipedia pages protected against vandalism',
['all-category-all-sysop-edit'] = 'Wikipedia protected categories',
['all-file-all-sysop-edit'] = 'Protected images',
['all-project-all-sysop-edit'] = 'Protected project pages',
['all-talk-all-sysop-edit'] = 'Protected talk pages',
['all-template-all-sysop-edit'] = 'Wikipedia protected templates',
['all-user-all-sysop-edit'] = 'Wikipedia protected user and user talk pages',
['all-all-all-sysop-move'] = 'Wikipedia move-protected pages',
['indef-all-all-sysop-move'] = 'Wikipedia indefinitely move-protected pages',
['all-all-dispute-sysop-move'] = 'Wikipedia pages move-protected due to dispute',
['all-all-vandalism-sysop-move'] = 'Wikipedia pages move-protected due to vandalism',
['all-portal-all-sysop-move'] = 'Wikipedia move-protected portals',
['all-portal-all-sysop-move'] = 'Wikipedia move-protected portals',
['all-project-all-sysop-move'] = 'Wikipedia move-protected project pages',
['all-talk-all-sysop-move'] = 'Wikipedia move-protected talk pages',
['all-template-all-sysop-move'] = 'Wikipedia move-protected templates',
['all-user-all-sysop-move'] = 'Wikipedia move-protected user and user talk pages',
['all-all-all-autoconfirmed-autoreview'] = 'Wikipedia pending changes protected pages (level 1)',
['all-all-all-reviewer-autoreview'] = 'Wikipedia pending changes protected pages (level 2)',
}
 
for key, cat in pairs(bannerDataCategories) do
local t = cfg.bannerData[key] or {}
t.category = cat
cfg.bannerData[key] = t
end
 
--------------------------------------------------------------------------------
Line 617 ⟶ 636:
msg['edit-request-semi-display'] = 'request an edit'
 
msg['request-unprotection-blurb'] = ' You may also [[Wikipedia:Requests for'
.. ' page protection#Current requests for reduction in protection level'
.. '|request]] that this page be unprotected.'
msg['semi-subject-page-links'] = ' $12, discuss changes on the $11,'
 
Line 628 ⟶ 644:
msg['deletion-discussion-blurb-noxfd'] = 'Please see the $17 for'
.. ' details of why this page was deleted.'
 
msg['explanation-text-semi'] = 'If you cannot edit this $4 and you wish to make'
.. ' a change, you can$14 [[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]].'
msg['explanation-text-move'] = 'The page may still be edited but cannot be moved'
.. ' until unprotected. Please discuss any suggested moves on the $11 or at'
.. ' [[Wikipedia:Requested moves]]. You can also [[Wikipedia:Requests for'
.. ' page protection|request]] that the page be unprotected.'
msg['explanation-text-create'] = '$15 If you would like to create a page at this title,'
.. ' you must first [[Wikipedia:Requests for page protection|request]] for'
.. ' it to be unprotected, or contact the administrator who deleted the'
.. ' page for the deleted material to be restored. If unsuccessful, you can'
.. ' use [[Wikipedia:Deletion review|deletion review]].'
msg['explanation-text-default'] = 'Please discuss any changes on the $11; you'
.. ' may $12 to ask an [[Wikipedia:Administrators|administrator]] 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]].$13'
 
--------------------------------------------------------------------------------
Cookies help us deliver our services. By using our services, you agree to our use of cookies.