Module:Protection banner: Difference between revisions

    From Nonbinary Wiki
    (add some more categories)
    (change category table scheme)
    Line 2: Line 2:
    -- {{pp-dispute}}, {{pp-vandalism}} and {{pp-sock}}.
    -- {{pp-dispute}}, {{pp-vandalism}} and {{pp-sock}}.


    local categories = {}
    local categories = {
    -- The naming scheme is: protection type - protection level - namespace - reason
    {
    categories['edit-semi-user-all'] = 'Wikipedia semi-protected user and user talk pages'
    name = 'Wikipedia semi-protected user and user talk pages',
    categories['edit-semi-project-all'] = 'Semi-protected project pages'
    type = 'edit',
    categories['edit-semi-file-all'] = 'Semi-protected images'
    level = 'semi',
    categories['edit-semi-template-all'] = 'Wikipedia semi-protected templates'
    ns = {[2] = true, [3] = true}, -- User and user talk
    categories['edit-semi-portal-all'] = 'Semi-protected portals'
    reason - 'all'
    categories['edit-semi-talk-all'] = 'Semi-protected talk pages'
    },
    categories['edit-semi-other-vandalism'] = 'Wikipedia pages semi-protected against vandalism'
    {
    categories['edit-full-user-all'] = 'Wikipedia protected user and user talk pages'
    name = 'Semi-protected project pages',
    categories['edit-full-file-all'] = 'Protected images'
    type = 'edit',
    categories['edit-full-project-all'] = 'Protected project pages'
    level = 'semi',
    categories['edit-full-template-all'] = 'Wikipedia protected templates'
    ns = {[4] = true}, -- Project
    categories['edit-full-talk-all'] = 'Protected talk pages'
    reason = 'all'
    categories['edit-full-all-vandalism'] = 'Wikipedia pages protected against vandalism'
    },
    categories['edit-semi-all-dispute'] = 'Wikipedia pages semi-protected due to dispute'
    {
    categories['edit-full-all-dispute'] = 'Wikipedia pages protected due to dispute'
    name = 'Semi-protected images',
    categories['move-full-all-dispute'] = 'Wikipedia pages move-protected due to dispute'
    type = 'edit',
    categories['move-full-user-all'] = 'Wikipedia move-protected user and user talk pages'
    level = 'semi',
    categories['move-full-project-all'] = 'Wikipedia move-protected project pages'
    ns = {[6] = true}, -- File
    categories['move-full-portal-all'] = 'Wikipedia move-protected portals'
    reason = 'all'
     
    },
    {
    name = 'Wikipedia semi-protected templates',
    type = 'edit',
    level = 'semi',
    ns = {[10] = true}, -- Template
    reason = 'all'
    },
    {
    name = 'Semi-protected portals',
    type = 'edit',
    level = 'semi',
    ns = {[100] = true}, -- Portal
    reason = 'all'
    },
    {
    name = 'Semi-protected talk pages',
    type = 'edit',
    level = 'semi',
    ns = 'talk',
    reason = 'all'
    },
    {
    name = 'Wikipedia pages semi-protected against vandalism',
    type = 'edit',
    level = 'semi',
    ns = 'all',
    reason = 'vandalism'
    },
    {
    name = 'Wikipedia protected user and user talk pages',
    type = 'edit',
    level = 'full',
    ns = {[2] = true, [3] = true}, -- User and user talk
    reason = 'all'
    },
    {
    name = 'Protected images',
    type = 'edit',
    level = 'full',
    ns = 'file',
    reason = 'all'
    },
    {
    name = 'Protected project pages',
    type = 'edit',
    level = 'full',
    ns = {[6] = true}, -- File
    reason = 'all'
    },
    {
    name = 'Wikipedia protected templates',
    type = 'edit',
    level = 'full',
    ns = {[10] = true}, -- Template
    reason = 'all'
    },
    {
    name = 'Protected talk pages',
    type = 'edit',
    level = 'full',
    ns = 'talk',
    reason = 'all'
    },
    {
    name = 'Wikipedia pages protected against vandalism',
    type = 'edit',
    level = 'full',
    ns = 'all',
    reason = 'vandalism'
    },
    {
    name = 'Wikipedia pages semi-protected due to dispute',
    type = 'edit',
    level = 'semi',
    ns = 'all',
    reason = 'dispute'
    },
    {
    name = 'Wikipedia pages protected due to dispute',
    type = 'edit',
    level = 'full',
    ns = 'all',
    reason = 'dispute'
    },
    {
    name = 'Wikipedia pages move-protected due to dispute',
    type = 'move',
    level = 'full',
    ns = 'all',
    reason = 'dispute'
    },
    {
    name = 'Wikipedia move-protected user and user talk pages',
    type = 'move',
    level = 'full',
    ns = {[2] = true, [3] = true}, -- User and user talk
    reason = 'all'
    },
    {
    name = 'Wikipedia move-protected project pages',
    type = 'move',
    level = 'full',
    ns = {[4] = true}, -- Project
    reason = 'all'
    },
    {
    name = 'Wikipedia move-protected portals',
    type = 'move',
    level = 'full',
    ns = {[100] = true}, -- Portal
    reason = 'all'
    },
    }
    local error_categories = {
    local error_categories = {
    incorrect = 'Wikipedia pages with incorrect protection templates',
    incorrect = 'Wikipedia pages with incorrect protection templates',

    Revision as of 12:00, 2 March 2014

    Documentation for this module may be created at Module:Protection banner/doc

    -- This module implements {{pp-meta}} and its daughter templates such as
    -- {{pp-dispute}}, {{pp-vandalism}} and {{pp-sock}}.
    
    local categories = {
    	{
    		name = 'Wikipedia semi-protected user and user talk pages',
    		type = 'edit',
    		level = 'semi',
    		ns = {[2] = true, [3] = true}, -- User and user talk
    		reason - 'all'
    	},
    	{
    		name = 'Semi-protected project pages',
    		type = 'edit',
    		level = 'semi',
    		ns = {[4] = true}, -- Project
    		reason = 'all'
    	},
    	{
    		name = 'Semi-protected images',
    		type = 'edit',
    		level = 'semi',
    		ns = {[6] = true}, -- File
    		reason = 'all'
    	},
    	{
    		name = 'Wikipedia semi-protected templates',
    		type = 'edit',
    		level = 'semi',
    		ns = {[10] = true}, -- Template
    		reason = 'all'
    	},
    	{
    		name = 'Semi-protected portals',
    		type = 'edit',
    		level = 'semi',
    		ns = {[100] = true}, -- Portal
    		reason = 'all'
    	},
    	{
    		name = 'Semi-protected talk pages',
    		type = 'edit',
    		level = 'semi',
    		ns = 'talk',
    		reason = 'all'
    	},
    	{
    		name = 'Wikipedia pages semi-protected against vandalism',
    		type = 'edit',
    		level = 'semi',
    		ns = 'all',
    		reason = 'vandalism'
    	},
    	{
    		name = 'Wikipedia protected user and user talk pages',
    		type = 'edit',
    		level = 'full',
    		ns = {[2] = true, [3] = true}, -- User and user talk
    		reason = 'all'
    	},
    	{
    		name = 'Protected images',
    		type = 'edit',
    		level = 'full',
    		ns = 'file',
    		reason = 'all'
    	},
    	{
    		name = 'Protected project pages',
    		type = 'edit',
    		level = 'full',
    		ns = {[6] = true}, -- File
    		reason = 'all'
    	},
    	{
    		name = 'Wikipedia protected templates',
    		type = 'edit',
    		level = 'full',
    		ns = {[10] = true}, -- Template
    		reason = 'all'
    	},
    	{
    		name = 'Protected talk pages',
    		type = 'edit',
    		level = 'full',
    		ns = 'talk',
    		reason = 'all'
    	},
    	{
    		name = 'Wikipedia pages protected against vandalism',
    		type = 'edit',
    		level = 'full',
    		ns = 'all',
    		reason = 'vandalism'
    	},
    	{
    		name = 'Wikipedia pages semi-protected due to dispute',
    		type = 'edit',
    		level = 'semi',
    		ns = 'all',
    		reason = 'dispute'
    	},
    	{
    		name = 'Wikipedia pages protected due to dispute',
    		type = 'edit',
    		level = 'full',
    		ns = 'all',
    		reason = 'dispute'
    	},
    	{
    		name = 'Wikipedia pages move-protected due to dispute',
    		type = 'move',
    		level = 'full',
    		ns = 'all',
    		reason = 'dispute'
    	},
    	{
    		name = 'Wikipedia move-protected user and user talk pages',
    		type = 'move',
    		level = 'full',
    		ns = {[2] = true, [3] = true}, -- User and user talk
    		reason = 'all'
    	},
    	{
    		name = 'Wikipedia move-protected project pages',
    		type = 'move',
    		level = 'full',
    		ns = {[4] = true}, -- Project
    		reason = 'all'
    	},
    	{
    		name = 'Wikipedia move-protected portals',
    		type = 'move',
    		level = 'full',
    		ns = {[100] = true}, -- Portal
    		reason = 'all'
    	},
    }
    	
    local error_categories = {
    	incorrect = 'Wikipedia pages with incorrect protection templates',
    	no_expiry = 'Wikipedia protected pages without expiry'
    }
    
    local template_types = {
    	vandalism = {
    		namespaces = false, -- defaults to all namespaces
    		editLevels = false, -- all edit protection levels
    		moveLevels = false, -- all move protection levels
    		createLevels = false, -- all create protection levels
    		header = false,
    		reason = 'due to [[Wikipedia:Vandalism|vandalism]]',
    		icon_reason = 'due to vandalism',
    	}
    }