Module:WikiProject banner/sandbox: Difference between revisions

Content deleted Content added
misplaced
try this logic
Line 228:
assessment_link = nil
end
 
local class_mask = require('Module:Class mask' .. (sandbox or ''))._main
local check_exists = function(class, assessment_cat) -- check if category exists and is not blank
Line 251 ⟶ 250:
args = raw_args
})
if class=article_class and article_class~='' then -- unassessedarticle class exists, seecheck if thereit iscan an articlebe assessmentinherited
classarticle_class = mw.text.trim(frame:expandTemplate{
if article_class and article_class~='' then -- article class exists, check if it can be inherited
title = custom_mask.prefixedText,
class = mw.text.trim(frame:expandTemplate{
titleargs = custom_mask.prefixedText,{class = article_class}
})
args = {class = article_class}
})
show_quality = false
end
end
end
else
local classmask_argsclass = class_mask({FQS = 'yes', [1] = class}, title)
end
class = class_mask(classmask_args, title)
if article_class then -- banner shell exists
if article_class=='' then -- no article class defined
if class=='' then -- local class also does not exist, check whether any other class parameters are defined inside the shell
local classparam = p.readarticleclass({ignore_blank=true, only_subtemplates=true}, title.prefixedText)
if classparam=='' then -- no class parameters defined, display as globally unassessed
show_quality = false -- hide quality class in project banner
end
end
end
elseif class=='' or class==article_class then -- local class matches article class or is blank
show_quality = false -- hide quality class in project banner
class = article_class
args = {class = article_class}
elseif (article_class=='NA') and not isarticle(class) then -- article class and local class are both non-article classes
show_quality = false
show_quality = false
else -- article class exists and differs from local class
if args.QUALITY_CRITERIA~='custom' then
conflict = true
add_category('Articles with conflicting quality ratings')
end
end
end
if not isarticle(class) then
if not isarticle(class) then
local cat = mw.title.new('Category:' .. class .. '-Class' .. ' ' .. assessment_cat)
if not (cat.exists and #cat:getContent()>0) then --check if category exists and is not blank
class = 'NA' -- automatically use NA for non-article pages if category does not exist
end
end
end