Content deleted Content added
reads better |
transition code to check existence of category before using "pages" |
||
Line 398:
end
class = check_fallbacks(class, assessment_cat)
local category = (class=='' and 'Unassessed' or class..'-Class') .. ' ' .. assessment_cat -- .. ' ' .. (article and 'articles' or 'pages')
if not article and mw.title.new(category .. ' pages').exist then
category = category .. ' pages' -- use "pages" for non-articles if the category exists: temporary transition code
else
category = category .. ' articles'
end
if show then -- quality rating shown in banner
local rating
Line 448 ⟶ 453:
local importance_name = args.IMPN or (raw_args.priority and 'priority' or cfg.importance.default_name)
if importance then -- banner gives importance ratings
local category = importance .. '-' .. importance_name .. ' ' .. assessment_cat
if category = category .. ' pages' -- use "pages" for non-articles if the category exists: temporary transition code
else
category = category .. ' articles'
end
if importance~='NA' then -- display importance rating
local rating = importance=='Unknown' and cfg.importance.not_yet or cfg.importance.rated:format(importance, importance_name)
Line 538 ⟶ 548:
args[tf_prefix..'NAME']
)
local tf_importance, tf_importance_category
if raw_args['tf '..k..' importance'] then
tf_importance = importance_mask(raw_args['tf '..k..' importance'], args.IMPORTANCE_SCALE, banner_name, pagetype, class)
if tf_importance=='Unknown' and yesno(args.INHERIT_IMPORTANCE) then
tf_importance = importance
end
if tf_importance=='NA' and mw.title.new(tf_importance_category .. ' pages').exist then
category = category .. ' pages' -- use "pages" for non-articles if the category exists: temporary transition code
else
category = category .. ' articles'
end
end
Line 563 ⟶ 579:
and ' ' .. cfg.task_force.importance:format(
wikilink(
':Category:' .. tf_importance_category,
tf_importance .. '-' .. importance_name
)
Line 593 ⟶ 609:
if yesno(args[tf_prefix..'QUALITY']) and class then
local tf_class = check_fallbacks(class, tf_assessment_cat)
if not article and mw.title.new(category .. ' pages').exist then
category = category .. ' pages' -- use "pages" for non-articles if the category exists: temporary transition code
else
category = category .. ' articles'
end
add_category(category)
end
if tf_importance then
add_category(tf_importance_category)
▲ add_category(tf_importance .. '-' .. importance_name .. ' ' .. tf_assessment_cat .. ' articles')
end
if args[tf_prefix..'QII_FORMAT'] then
|