Content deleted Content added
m Removed protection from "Module:WikiProject banner/sandbox" |
m Removed protection from "Module:WikiProject banner/sandbox" |
||
(50 intermediate revisions by 4 users not shown) | |||
Line 153:
page = demo_page,
dab = 'disambiguation page',
sia = 'set index article',
draft = 'draft'
})
local article = pagetype=='article' or pagetype=='set index article'
Line 323 ⟶ 324:
end
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
Line 382 ⟶ 383:
class = check_fallbacks(article_class, assessment_cat) -- check fallbacks again now that class may have changed
check_redundant()
elseif class==article_class then -- local class matches article class
check_redundant()
elseif article_class=='' then -- local class defined and no article class defined
show = true
add_category(cfg.banner_shell.category.no_quality_rating)
if args.QUALITY_CRITERIA~='custom' then
Line 390 ⟶ 392:
end
elseif article_class=='FM' and args.QUALITY_CRITERIA~='custom' then
class = check_fallbacks('FM', assessment_cat)
check_redundant()
elseif not article and class~='FM' then -- article class and local class are both non-article classes
Line 397 ⟶ 400:
else -- article class exists and differs from local class
show = 'conflict'
add_category(
end
else -- banner shell does not exist
Line 482 ⟶ 485:
add_category(category)
end
page_assessment(project, class, importance)
if args.HOOK_IMPORTANCE then
table.insert(rows, args.HOOK_IMPORTANCE)
Line 542 ⟶ 547:
args[tf_prefix..'NAME']
)
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..'-Class') .. ' ' .. tf_assessment_cat .. ' ' .. (article and 'articles' or 'pages'))▼
end
local tf_importance, tf_importance_category
if raw_args['tf '..k..' importance'] then
Line 548 ⟶ 557:
tf_importance = importance
end
tf_importance_category = tf_importance .. '-' .. importance_name .. ' ' .. tf_assessment_cat .. ' ' .. (
add_category(tf_importance_category)
end
Line 596 ⟶ 605:
if args[tf_prefix..'HOOK'] then
table.insert(taskforce_output, args[tf_prefix..'HOOK'])
▲ end
▲ 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..'-Class') .. ' ' .. tf_assessment_cat .. ' ' .. (article and 'articles' or 'pages'))
end
if args[tf_prefix..'QII_FORMAT'] then
add_category(require(auxiliary).quality_importance_insection(args, class, tf_importance, importance_name,
end
if args[tf_prefix..'NAME'] then
Line 858 ⟶ 863:
local category = parent_args.category or args.category or true
local demo_page = parent_args.demo_page
local config, project
if args.project then -- check for config page
project = args.project
local config_file = mw.title.new('Template:WikiProject ' .. args.project .. '/config')
if config_file.exists then
config = mw.loadJsonData(config_file.fullText)
else
return nil
end
end
if config then -- use config file
if parent_args.taskforce then -- split comma-separated list
for taskforce in mw.text.gsplit(parent_args.taskforce, ',%s*') do
parent_args[taskforce] = 'yes'
end
end
args, raw_args = require(auxiliary).map_config(config, parent_args) -- map parameters from config page
args.PROJECT = project
end
local on_template_page = false
local banner_name = mw.title.new(args.BANNER_NAME or 'Template:WikiProject ' .. (args.PROJECT or 'PROJECT'))
Line 889 ⟶ 913:
if on_template_page then
local templatepage = require('Module:WikiProject banner/templatepage' .. (sandbox or '')).templatepage
return templatepage(args, raw_args, inactive_status, config)
else
return unknown_parameters
|