Content deleted Content added
No edit summary |
No edit summary |
||
(14 intermediate revisions by the same user not shown) | |||
Line 15:
function p.printargs(frame)
local str=args_module.getArgs(frame,{wrappers = {"Module:WikiProject banner shell","banner shell",'Template:Banner holder'}})
local s=""
for k,v in pairs(str) do
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
add_category("Rupter"..class.."hi")
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
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 ⟶ 433:
show = true
end
local category = (class=='' and 'Unassessed' or class..'-
if show then -- quality rating shown in banner
local rating
Line 556 ⟶ 575:
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 911 ⟶ 930:
local args = args_module.getArgs(frame, {frameOnly = true})
local raw_args = args_module.getArgs(frame, {frameOnly = true, removeBlanks = false})
local
-- local a=p.printargs(frame)
return a .. initialise(args, raw_args)▼
return i
end
p.pinitialise = function(args, raw_args, inactive_status)
end
---------------------------
|