Module:Protection banner/config: Difference between revisions

    From Nonbinary Wiki
    (Pp-template needs to be small by default)
    (templates shouldn't output a "needs expiry" category; also, update the comments)
    Line 637: Line 637:
    -- Expiry category config
    -- Expiry category config
    --------------------------------------------------------------------------------
    --------------------------------------------------------------------------------
    -- If any of the following reasons is passed to the module, it will not output
    -- the "pages without expiry" tracking category.
    reasonsWithoutExpiryCheck = {
    blp = true,
    },


    -- This table configures the expiry category behaviour for each protection
    -- This table configures the expiry category behaviour for each protection
    Line 649: Line 643:
    --  an expiry parameter is not set.
    --  an expiry parameter is not set.
    -- * If set to false, setting that action will never categorise the page.
    -- * If set to false, setting that action will never categorise the page.
    -- * If set to nil, the module will categorise the page if an expiry parameter
    -- * If set to nil, the module will categorise the page if:
    --  is not set, if a reason is provided, and if the specified reason is not
    --  1) an expiry parameter is not set, and
    --  blacklisted in the reasonsWithoutExpiryCheck table.
    --  2) a reason is provided, and
    --  3) the specified reason is not blacklisted in the reasonsWithoutExpiryCheck
    --      table.
     
    expiryCheckActions = {
    expiryCheckActions = {
    edit = nil,
    edit = nil,
    move = false,
    move = false,
    autoreview = true
    autoreview = true
    },
    reasonsWithoutExpiryCheck = {
    blp = true,
    template = true,
    },
    },



    Revision as of 12:29, 22 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."
    --
    -- ${INTROFRAGMENT} - the same as ${INTROBLURB}, but without final punctuation
    -- so that it can be used in run-on sentences.
    --
    -- ${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 = '${INTROFRAGMENT} 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"
    					.. " restrictions are withdrawn'''."
    				return ret
    			end,
    			image = 'Padlock-black.svg',
    		},
    		dispute = {
    			description = 'For pages protected due to editing disputes.',
    			text = function (protectionObj, args)
    				-- Find the value of "disputes".
    				local display = 'disputes'
    				local disputes
    				if args.section then
    					disputes = string.format(
    						'[[%s:%s#%s|%s]]',
    						mw.site.namespaces[protectionObj.title.namespace].talk.name,
    						protectionObj.title.text,
    						args.section,
    						display
    					)
    				else
    					disputes = display
    				end
    
    				-- Make the blurb, depending on the expiry.
    				local msg
    				if type(protectionObj.expiry) == 'number' then
    					msg = '${INTROFRAGMENT} or until editing %s have been resolved.'
    				else
    					msg = '${INTROFRAGMENT} until editing %s have been resolved.'
    				end
    				return string.format(msg, disputes)
    			end,
    			explanation = "This protection is '''not''' an endorsement of the"
    				.. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}',
    			tooltip = '${TOOLTIPBLURB} due to editing disputes',
    		},
    		mainpage = {
    			description = 'For pages protected for being displayed on the [[Main Page]].',
    			text = 'This file is currently'
    				.. ' [[Wikipedia:This page is protected|protected]] from'
    				.. ' editing because it is currently or will soon be displayed'
    				.. ' on the [[Main Page]].',
    			explanation = 'Images on the Main Page are protected due to their high'
    				.. ' visibility. Please discuss any necessary changes on the ${TALKPAGE}.'
    				.. '<br /><span style="font-size:90%;">'
    				.. "'''Administrators:''' Once this image is definitely off the Main Page,"
    				.. ' please unprotect this file, or reduce to semi-protection,'
    				.. ' as appropriate.</span>',
    		},
    		office = {
    			description = 'For pages protected by the Wikimedia Foundation.',
    			text = function (protectionObj, args)
    				local ret = 'This ${PAGETYPE} is currently under the'
    					.. ' scrutiny of the'
    					.. ' [[Wikipedia:Office actions|Wikimedia Foundation Office]]'
    					.. ' and is protected.'
    				if protectionObj.protectionDate then
    					ret = ret .. ' It has been protected since ${PROTECTIONDATE}.'
    				end
    				return ret
    			end,
    			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 = {
    			description = 'For pages protected by the Wikimedia Foundation and'
    				.. ' "reset" to a bare-bones version.',
     			text = 'This ${PAGETYPE} is currently under the'
    					.. ' scrutiny of the'
    					.. ' [[Wikipedia:Office actions|Wikimedia Foundation Office]]'
    					.. ' and is protected.',
    			explanation = function (protectionObj, args)
    				local ret = ''
    				if protectionObj.protectionDate then
    					ret = ret .. 'On ${PROTECTIONDATE} this ${PAGETYPE} was'
    				else
    					ret = ret .. 'This ${PAGETYPE} has been'
    				end
    				ret = ret .. ' reduced to a'
    				.. ' simplified, "bare bones" version so that it may be completely'
    				.. ' rewritten to ensure it meets the policies of'
    				.. ' [[WP:NPOV|Neutral Point of View]] and [[WP:V|Verifiability]].'
    				.. ' Standard Wikipedia policies will apply to its rewriting—which'
    				.. ' will eventually be open to all editors—and will be strictly'
    				.. ' enforced. The ${PAGETYPE} has been ${PROTECTIONLEVEL} while'
    				.. ' it is being rebuilt.\n\n'
    				.. 'Any insertion of material directly from'
    				.. ' pre-protection revisions of the ${PAGETYPE} will be removed, as'
    				.. ' will any material added to the ${PAGETYPE} that is not properly'
    				.. ' sourced. The associated talk page(s) were also cleared on the'
    				.. " same date.\n\n"
    				.. "If you can edit this page, please discuss all changes and"
    				.. " additions on the ${TALKPAGE} first. '''Do not override"
    				.. " this action, and do not remove protection from this page,"
    				.. " unless you are authorized by the Wikimedia Foundation"
    				.. " to do so. No editor may remove this notice.'''"
    
    				return ret
    			end,
    			image = 'Padlock-black.svg',
    		},
    		sock = {
    			description = 'For pages protected due to'
    				.. ' [[Wikipedia:Sock puppetry|sock puppetry]].',
    			text = '${INTROFRAGMENT} 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',
    		},
    		template = {
    			description = 'For [[Wikipedia:High-risk templates|high-risk]]'
    				.. ' templates and Lua modules.',
    			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'
    				.