Module:Protection banner/config: Difference between revisions
more conversion of the data to the bannerConfig table
(use a new approach to the banner config, allowing more fine-grained control and less hopping around between parameter definitions) |
(more conversion of the data to the bannerConfig table) |
||
| Line 4: | Line 4: | ||
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
-- | -- BANNER DATA | ||
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
| Line 84: | Line 84: | ||
-- | -- | ||
-- | -- | ||
-- | -- PARAMETERS | ||
-- | -- | ||
-- The values in the banner data can take parameters. These are specified | -- The values in the banner data can take parameters. These are specified | ||
| Line 93: | Line 93: | ||
-- Defined in the cfg.pagetypes table. | -- 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: | Line 125: | ||
[ 4] = 'project', | [ 4] = 'project', | ||
[ 6] = 'file', | [ 6] = 'file', | ||
[ 8] = 'mediawiki', | |||
[ 10] = 'template', | [ 10] = 'template', | ||
[ 12] = 'project', | [ 12] = 'project', | ||
| Line 116: | Line 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' | |||
['all-all-office-all-all'] | .. '#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]]' | |||
['all-all-reset-all-all'] | .. ' from [[Help:Moving a page|page moves]]' | ||
introText.create = '[[Help:Starting a new page|Recreation]] of this ${PAGETYPE}' | |||
.. ' [[Help:Protection|has been disabled]]' | |||
['all-template-all-all-edit'] | |||
-------------------------------------------------------------------------------- | |||
-- Banner data table | |||
['all-all-all-autoconfirmed-edit'] | -------------------------------------------------------------------------------- | ||
cfg.bannerData = {} | |||
['indef-all-all-autoconfirmed-edit'] | |||
-- Set the defaults for all protection types. | |||
cfg.bannerData['all-all-all-all-all'] = { | |||
['all-all-blp-autoconfirmed-edit'] | text = introText.full .. '.', | ||