local p =
local isarticle = function(class) local nonarticleclasses = -- these classes will not be identified as conflicting with NA-class local article = true for _,v in ipairs(nonarticleclasses) do if class
local ucfirst = function(s) -- Returns the given string with the first character in upper case. -- Should not be used with non-ascii strings. return s:sub(1, 1):upper .. s:sub(2, -1)end
local resolveFQSgrade = function(grade, args) if (args[grade] or args.FQS)
p._main = function(args, title) title = title or mw.title.getCurrentTitle local out = local grade = args[1] if not grade or grade
1 then -- Talk if require('Module:Disambiguation').isDisambiguation(title.subjectPageTitle:getContent) then out = resolveFQSgrade('disambig',args) else if grade
'stub' then -- Ucfirst if args[grade]~='no' then out = ucfirst(grade) end elseif grade
'c' or grade
'fl' or grade
'ga' then -- Upper-case if args[grade]~='no' then out = grade:upper end elseif args[grade:upper] then -- Upper-case syntax out = args[grade:upper] elseif args[grade:lower]
'list' or grade
'si' or grade
'dab' or grade
'disambiguation' or grade
7 or ns
'fm' and (args.fm or args.FQS)
15 then -- Category talk out = resolveFQSgrade('category', args) elseif ns
11 or ns
5 then -- Wikipedia talk out = resolveFQSgrade('project', args) elseif ns
13 and args['help']
3 and args['user']
p.main = function(frame) local getArgs = require('Module:Arguments').getArgs local args = getArgs(frame,) return p._main(args)end
local getclass = function(args, title) local class = '¬' if args.QUALITY_SCALE
'subpage' then if mw.title.new(args.BANNER_NAME..'/class').exists then local frame = mw.getCurrentFrame class = frame:expandTemplate end else args.FQS = (args.QUALITY_SCALE
p.readarticleclass = function(options, page) -- used by p._quality and Module:Banner shell page = page or mw.title.getCurrentTitle.prefixedText local get_parameter_value = require("Module:Template parameter value").getValue local WPBSredirects = local success, result = get_parameter_value(page, WPBSredirects, "class", options) return success and result -- returns FALSE if banner shell template does not exist on page -- returns BLANK if class parameter is not defined or is defined blank -- otherwise returns class parameterend
p._quality = function(args) local title = args.page and mw.title.new(args.page) or mw.title.getCurrentTitle local local_class = getclass(args, title) local prefix, class = 'Y', local_class if local_class
then -- no article class defined if local_class
then -- no class parameters defined, display as globally unassessed prefix = 'H' -- hide quality class in project banner end end elseif local_class
article_class then -- local class matches article class or is blank prefix = 'H' -- hide quality class in project banner class = article_class elseif (article_class
p.quality = function(frame) -- used by WPBM to check global quality and compare with local parameter return p._quality(frame.args)end
return p