Module:Protection banner/config: Difference between revisions

    From Nonbinary Wiki
    (use PAGETYPE variable with the reset reason)
    (add an INTROFRAGMENT parameter to solve the problem of what punctuation to use in run-on sentences using INTROBLURB)
    Line 31: Line 31:
    -- ${INTROBLURB} - the PROTECTIONBLURB parameter, plus the expiry if an expiry
    -- ${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  
    -- is set. E.g. "Editing of this page by new or unregistered users is currently  
    -- disabled until dd Month YYYY"
    -- 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".
    -- ${PAGETYPE} - the type of the page, e.g. "article" or "template".
    Line 70: Line 73:


    masterBanner = {
    masterBanner = {
    text = '${INTROBLURB}.',
    text = '${INTROBLURB}',
    explanation = '${EXPLANATIONBLURB}',
    explanation = '${EXPLANATIONBLURB}',
    tooltip = '${TOOLTIPBLURB}.',
    tooltip = '${TOOLTIPBLURB}.',
    Line 104: Line 107:
    .. ' [[Wikipedia:Biographies of living persons'
    .. ' [[Wikipedia:Biographies of living persons'
    .. '|biographies of living persons]] policy.',
    .. '|biographies of living persons]] policy.',
    text = '${INTROBLURB} to promote compliance with'
    text = '${INTROFRAGMENT} to promote compliance with'
    .. ' [[Wikipedia:Biographies of living persons'
    .. ' [[Wikipedia:Biographies of living persons'
    .. "|Wikipedia's policy on the biographies"
    .. "|Wikipedia's policy on the biographies"
    Line 154: Line 157:
    local msg
    local msg
    if type(protectionObj.expiry) == 'number' then
    if type(protectionObj.expiry) == 'number' then
    msg = '${INTROBLURB}, or until editing %s have been resolved.'
    msg = '${INTROFRAGMENT} or until editing %s have been resolved.'
    else
    else
    msg = '${INTROBLURB} until editing %s have been resolved.'
    msg = '${INTROFRAGMENT} until editing %s have been resolved.'
    end
    end
    return string.format(msg, disputes)
    return string.format(msg, disputes)
    Line 235: Line 238:
    description = 'For pages protected due to'
    description = 'For pages protected due to'
    .. ' [[Wikipedia:Sock puppetry|sock puppetry]].',
    .. ' [[Wikipedia:Sock puppetry|sock puppetry]].',
    text = '${INTROBLURB} to prevent [[Wikipedia:Sock puppetry|sock puppets]] of'
    text = '${INTROFRAGMENT} to prevent [[Wikipedia:Sock puppetry|sock puppets]] of'
    .. ' [[Wikipedia:Blocking policy|blocked]] or'
    .. ' [[Wikipedia:Blocking policy|blocked]] or'
    .. ' [[Wikipedia:List of banned users|banned users]]'
    .. ' [[Wikipedia:List of banned users|banned users]]'
    Line 263: Line 266:
    description = 'For pages protected against disruptive edits by a'
    description = 'For pages protected against disruptive edits by a'
    .. ' particular user.',
    .. ' particular user.',
    text = '${INTROBLURB} to prevent ${VANDAL} from using it to make disruptive edits,'
    text = '${INTROFRAGMENT} to prevent ${VANDAL} from using it to make disruptive edits,'
    .. ' such as abusing the'
    .. ' such as abusing the'
    .. ' {{[[Template:unblock|unblock]]}} template.',
    .. ' {{[[Template:unblock|unblock]]}} template.',
    Line 280: Line 283:
    description = 'For pages protected against'
    description = 'For pages protected against'
    .. ' [[Wikipedia:Vandalism|vandalism]].',
    .. ' [[Wikipedia:Vandalism|vandalism]].',
    text = '${INTROBLURB} due to [[Wikipedia:Vandalism|vandalism]].',
    text = '${INTROFRAGMENT} due to [[Wikipedia:Vandalism|vandalism]].',
    explanation = function (protectionObj, args)
    explanation = function (protectionObj, args)
    local ret = ''
    local ret = ''
    Line 709: Line 712:


    --------------------------------------------------------------------------------
    --------------------------------------------------------------------------------
    -- Intro blurb
    -- Intro blurb and intro fragment
    --------------------------------------------------------------------------------
    --------------------------------------------------------------------------------


    ['intro-blurb-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY}',
    ['intro-blurb-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY}.',
    ['intro-blurb-noexpiry'] = '${PROTECTIONBLURB}',
    ['intro-blurb-noexpiry'] = '${PROTECTIONBLURB}.',
    ['intro-fragment-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY},',
    ['intro-fragment-noexpiry'] = '${PROTECTIONBLURB}',


    --------------------------------------------------------------------------------
    --------------------------------------------------------------------------------

    Revision as of 06:09, 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"