Anonymous user
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
--------------------------------------------------------------------------------
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:
}
--------------------------------------------------------------------------------
-- Intro text
--------------------------------------------------------------------------------
-- Shared intro text for the bannerData table.
local introText = {}
introText.full = 'This ${PAGETYPE} is currently [[Help:Protection|protected]]'
.. ' from editing'
introText.semi = '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]]'
introText.move = 'This ${PAGETYPE} is currently [[Help:Protection|protected]]'
.. ' from [[Help:Moving a page|page moves]]'
introText.create = '[[Help:Starting a new page|Recreation]] of this ${PAGETYPE}'
.. ' [[Help:Protection|has been disabled]]'
--------------------------------------------------------------------------------
-- Banner data table
--------------------------------------------------------------------------------
cfg.bannerData = {}
-- Set the defaults for all protection types.
cfg.bannerData['all-all-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]]. You may also [[Wikipedia:Requests for'
.. ' page protection#Current requests for reduction in protection level'
.. '|request]] that this page be unprotected.',
tooltip = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}.',
alt = 'Page ${PROTECTIONLEVEL}',
image = 'Transparent.gif',
category = 'Wikipedia protected pages'
}
-- 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['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.'
--------------------------------------------------------------------------------
|