Content deleted Content added
No edit summary |
m Izno moved page Module:WikiProject Higher education task force test2 to Module:Higher education task force/sandbox without leaving a redirect: somewhat of a bold close of Wikipedia:Templates for discussion/Log/2025 August 17#Module:WikiProject Higher education task force test2 |
||
(22 intermediate revisions by one other user not shown) | |||
Line 334:
local check_fallbacks = function(class, category)
if article or args.QUALITY_CRITERIA=='custom' then -- no fallbacks for articles or projects with custom quality scales
return class
else -- check fallbacks for non-article classes
local new_class = class
local category_exists = function(class)
local cat = mw.title.new(cfg.quality.assessment_category:format(class, category .. ' ' .. (article and 'articles' or 'pages')))
return cat.exists and #cat:getContent()>0
end
if class=='FM' and not category_exists('FM') then
new_class = 'File' -- fall back to File-class if FM category does not exist
end
if not category_exists(new_class) then
new_class = 'NA' -- use NA for non-article pages if category does not exist
end
return new_class
end
end
local check_defallbacks = function(class, category)
if article or args.QUALITY_CRITERIA=='custom' then -- no fallbacks for articles or projects with custom quality scales
return class .. category
else -- check fallbacks for non-article classes
local new_class = class
local category_exists = function(class)
local cat = mw.title.new(cfg.quality.assessment_category:format(class, category .. ' ' .. (article and 'articles' or 'pages')))
return cat.exists and #cat:getContent()>0
end
if class=='FM' and not category_exists('FM') then
Line 351 ⟶ 369:
end
local class = raw_args.class
local mclass= raw_args.class
if class then -- banner gives quality ratings
article_class = article_class and p.class_mask(article_class, title, false, pagetype, article)
Line 386 ⟶ 405:
end
end
mclass=class
local show = false -- hide quality class in project banner by default
if article_class then -- banner shell exists
if class=='' then -- local class is blank
class = check_fallbacks(article_class, assessment_cat)
check_redundant()
elseif class==article_class then -- local class matches article class
Line 414 ⟶ 434:
show = true
end
local category = (class=='' and 'Unassessed' or class..'-
if show then -- quality rating shown in banner
local rating
Line 556 ⟶ 576:
if yesno(args[tf_prefix..'QUALITY']) and class then
local tf_class = check_fallbacks(class, tf_assessment_cat)
add_category((tf_class=='' and 'Unassessed' or tf_class..'-
end
local tf_importance, tf_importance_category
Line 912 ⟶ 932:
local raw_args = args_module.getArgs(frame, {frameOnly = true, removeBlanks = false})
local i=initialise(args, raw_args)
-- local a=p.printargs(frame)
return i
end
|