Module:Protection banner/config: Difference between revisions
(add dmca reason) |
(fix parameter names for the banner data functions) |
||
| Line 114: | Line 114: | ||
description = 'For pages protected by the Wikimedia Foundation' | description = 'For pages protected by the Wikimedia Foundation' | ||
.. ' due to Digital Millennium Copyright Act takedown requests.', | .. ' due to Digital Millennium Copyright Act takedown requests.', | ||
explanation = function ( | explanation = function (protectionObj, args) | ||
local ret = 'Pursuant to a rights owner notice under the Digital' | local ret = 'Pursuant to a rights owner notice under the Digital' | ||
.. ' Millennium Copyright Act (DMCA) regarding some content' | .. ' Millennium Copyright Act (DMCA) regarding some content' | ||
| Line 120: | Line 120: | ||
.. ' applicable law and took down and restricted the content' | .. ' applicable law and took down and restricted the content' | ||
.. ' in question.' | .. ' in question.' | ||
if | if args.notice then | ||
ret = ret .. ' A copy of the received notice can be found here: ' | ret = ret .. ' A copy of the received notice can be found here: ' | ||
.. | .. args.notice .. '.' | ||
end | end | ||
ret = ret .. ' For more information, including websites discussing' | ret = ret .. ' For more information, including websites discussing' | ||
| Line 135: | Line 135: | ||
dispute = { | dispute = { | ||
description = 'For pages protected due to editing disputes.', | description = 'For pages protected due to editing disputes.', | ||
text = function (protectionObj, | text = function (protectionObj, args) | ||
-- Find the value of "disputes". | -- Find the value of "disputes". | ||
local display = 'disputes' | local display = 'disputes' | ||
local disputes | local disputes | ||
if | if args.section then | ||
disputes = string.format( | disputes = string.format( | ||
'[[%s:%s#%s|%s]]', | '[[%s:%s#%s|%s]]', | ||
mw.site.namespaces[protectionObj.title.namespace].talk.name, | mw.site.namespaces[protectionObj.title.namespace].talk.name, | ||
protectionObj.title.text, | protectionObj.title.text, | ||
args.section, | |||
display | display | ||
) | ) | ||
| Line 179: | Line 179: | ||
office = { | office = { | ||
description = 'For pages protected by the Wikimedia Foundation.', | description = 'For pages protected by the Wikimedia Foundation.', | ||
text = function ( | text = function (protectionObj, args) | ||
local ret = 'This ${PAGETYPE} is currently under the' | local ret = 'This ${PAGETYPE} is currently under the' | ||
.. ' scrutiny of the' | .. ' scrutiny of the' | ||
| Line 198: | Line 198: | ||
description = 'For pages protected by the Wikimedia Foundation and' | description = 'For pages protected by the Wikimedia Foundation and' | ||
.. ' "reset" to a bare-bones version.', | .. ' "reset" to a bare-bones version.', | ||
text = function (protectionObj, | text = function (protectionObj, args) | ||
local ret = '' | local ret = '' | ||
if protectionObj.protectionDate then | if protectionObj.protectionDate then | ||
| Line 277: | Line 277: | ||
.. ' [[Wikipedia:Vandalism|vandalism]].', | .. ' [[Wikipedia:Vandalism|vandalism]].', | ||
text = '${INTROBLURB} due to [[Wikipedia:Vandalism|vandalism]].', | text = '${INTROBLURB} due to [[Wikipedia:Vandalism|vandalism]].', | ||
explanation = function (protectionObj, | explanation = function (protectionObj, args) | ||
local ret = '' | local ret = '' | ||
if protectionObj.level == 'sysop' then | if protectionObj.level == 'sysop' then | ||
Revision as of 14:47, 6 July 2014
Documentation for this module may be created at Module:Protection banner/config/doc
-- This module provides configuration data for [[Module:Protection banner]].
return {
--------------------------------------------------------------------------------
-- BANNER DATA
--------------------------------------------------------------------------------
-- PARAMETERS
--
-- The values in the banner data can take parameters. These are specified
-- using ${TEXTLIKETHIS} (a dollar sign preceding a parameter name
-- enclosed in curly braces). Available parameters:
--
-- ${CURRENTVERSION} - a link to the page history or the move log, with the
-- display message "current-version-edit-display" or
-- "current-version-move-display".
--
-- ${EDITREQUEST} - a link to create an edit request for the current page.
--
-- ${EXPIRY} - the protection expiry date in the format DD Month YYYY. If
-- protection is indefinite or is not set, this is the blank string.
--
-- ${EXPLANATIONBLURB} - an explanation blurb, e.g. "Please discuss any changes
-- on the talk page; you may submit a request to ask an administrator to make
-- an edit if it is minor or supported by consensus."
--
-- ${IMAGELINK} - a link to set the image to, depending on the protection
-- action and protection level.
--
-- ${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
-- disabled until dd Month YYYY"
--
-- ${PAGETYPE} - the type of the page, e.g. "article" or "template".
-- Defined in the cfg.pagetypes table.
--
-- ${PROTECTIONBLURB} - a blurb explaining the protection level of the page, e.g.
-- "Editing of this page by new or unregistered users is currently disabled"
--
-- ${PROTECTIONDATE} - the protection date, if it has been supplied to the
-- template.
--
-- ${PROTECTIONLEVEL} - the protection level, e.g. "fully protected" or
-- "semi-protected".
--
-- ${PROTECTIONLOG} - a link to the protection log or the pending changes log,
-- depending on the protection action.
--
-- ${TALKPAGE} - a link to the talk page. If a section is specified, links
-- straight to that talk page section.
--
-- ${TOOLTIPBLURB} - uses the PAGETYPE, PROTECTIONTYPE and EXPIRY parameters to
-- create a blurb like "This template is semi-protected", or "This article is
-- move-protected until DD Month YYYY".
--
-- ${VANDAL} - links for the specified username (or the root page name)
-- using Module:Vandal-m.
--]]
--------------------------------------------------------------------------------
-- Banner defaults
--------------------------------------------------------------------------------
-- If no protection reason is specified, or no banner data exists for the
-- reason given, then this data will be used for the banner. Individual items
-- from this data will also be used if that item doesn't exist in the reason-
-- specific banner config.
masterBanner = {
text = '${INTROBLURB}.',
explanation = '${EXPLANATIONBLURB}',
tooltip = '${TOOLTIPBLURB}.',
link = '${IMAGELINK}',
alt = 'Page ${PROTECTIONLEVEL}'
},
defaultBanners = {
edit = {},
move = {},
autoreview = {
autoconfirmed = {
alt = 'Page protected with pending changes level 1',
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'
.. ' subject to review',
}
}
},
--------------------------------------------------------------------------------
-- Banner config
--------------------------------------------------------------------------------
banners = {
edit = {
blp = {
description = 'For pages protected to promote compliance with the'
.. ' [[Wikipedia:Biographies of living persons'
.. '|biographies of living persons]] policy.',
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',
},
dmca = {
description = 'For pages protected by the Wikimedia Foundation'
.. ' due to Digital Millennium Copyright Act takedown requests.',
explanation = function (protectionObj, args)
local ret = 'Pursuant to a rights owner notice under the Digital'
.. ' Millennium Copyright Act (DMCA) regarding some content'
.. ' in this article, the Wikimedia Foundation acted under'
.. ' applicable law and took down and restricted the content'
.. ' in question.'
if args.notice then
ret = ret .. ' A copy of the received notice can be found here: '
.. args.notice .. '.'
end
ret = ret .. ' For more information, including websites discussing'
.. ' how to file a counter-notice, please see'
.. " [[Wikipedia:Office actions]] and the article's ${TALKPAGE}."
.. "'''Do not remove this template from the article until the"
.