Module:Class mask/sandbox: Difference between revisions

Content deleted Content added
support for global unassessed
try this
Line 1:
local p = {}
 
local readarticleclass = function() -- look for article_class in page content
local get_parameter_value = require("Module:Template parameter value").getValue
local WPBSredirects = {'WikiProject banner shell','WikiProject banner shell/sandbox','Bannershell','Multiple wikiprojects','Project shell','Scope shell','WPB','WPBS','WPBannerShell','WP Banner Shell','WP banner shell','WikiProjectBannerShell','WikiProjectBanner Shell','WikiProjectBanners','WikiProject BannerShell','WikiProject Banner Shell','WikiProject Banners','WikiProject Banners Shell','WikiProject Shell','WikiProject banner','WikiProject banner shell/redirect','WikiProject shell','WikiprojectBannerShell','Wikiproject banner holder','Wikiproject banner shell','Wikiprojectbanners','Wikiprojectbannershell','Wpb','Wpbannershell','Wpbsgclass'}
local target = mw.title.getCurrentTitle().prefixedText
local success, result = get_parameter_value(target, WPBSredirects, "class", {ignoreSubtemplates=true})
return success and result
end
 
local isarticle = function(class)
Line 208 ⟶ 200:
class = '¬'
elseif frame.args.QUALITY_CRITERIA ~= 'custom' then -- project uses standard scale and will inherit article class if needed
local get_parameter_value = require("Module:Template parameter value").getValue
local targetcurrentpage = mw.title.getCurrentTitle().prefixedText
local readarticleclass = function() -- look for article_class in page content
local WPBSredirects = {'WikiProject banner shell','WikiProject banner shell/sandbox','Bannershell','Multiple wikiprojects','Project shell','Scope shell','WPB','WPBS','WPBannerShell','WP Banner Shell','WP banner shell','WikiProjectBannerShell','WikiProjectBanner Shell','WikiProjectBanners','WikiProject BannerShell','WikiProject Banner Shell','WikiProject Banners','WikiProject Banners Shell','WikiProject Shell','WikiProject banner','WikiProject banner shell/redirect','WikiProject shell','WikiprojectBannerShell','Wikiproject banner holder','Wikiproject banner shell','Wikiprojectbanners','Wikiprojectbannershell','Wpb','Wpbannershell','Wpbsgclass'}
local success, result = get_parameter_value(targetcurrentpage, WPBSredirects, "class", {ignoreSubtemplates=true})
return success and result
end
local article_class = frame.args.article_class or readarticleclass() -- checks parameter for testing purposes
article_class = article_class and p._main{article_class, ignorenamespace=frame.args.ignorenamespace} or '¬' -- normalise if not false
if local_classarticle_class == '' then -- localarticle isclass does not specifiedexist, display quality class in project banner as normal
local _,classparam = get_parameter_value(currentpage, WPBSredirects, "class", {ignore_blank=true})
if not classparam then -- no class parameters defined, display as globally unassessed
prefix = 'H' -- hide quality class in project banner
end
elseif local_class == '' then -- local is not specified
prefix = 'H' -- hide quality class in project banner
class = article_class
-- Need to pass bclasschecklist params through mask with article_class
elseif article_class == '' then -- article class does not exist, display quality class in project banner as normal
elseif local_class == article_class then -- article class and local class are the same
prefix = 'H' -- hide quality class in project banner