Content deleted Content added
make version for calling from lua |
allow title to be specified for testing purposes |
||
Line 194:
end
p.readarticleclass = function(target, options)
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", options)
return success and result
Line 203 ⟶ 202:
p._quality = function(args)
local local_class = getclass(args)
local prefix, class = 'Y', local_class
Line 208:
class = '¬'
elseif args.QUALITY_CRITERIA ~= 'custom' then -- project uses standard scale and will inherit article class if needed
local article_class = args.article_class or p.readarticleclass(title,{ignore_subtemplates=true}) or ''
article_class = p._main{article_class, ignorenamespace=args.ignorenamespace} -- normalise
if article_class == '' then -- article class does not exist
if local_class == '' then -- local class also does not exist, check whether any other class parameters are defined inside the shell
local classparam = p.readarticleclass(title,{ignore_blank=true, only_subtemplates=true})
if classparam == '' then -- no class parameters defined, display as globally unassessed
prefix = 'H' -- hide quality class in project banner
|