Module:WikiProject banner/sandbox: Difference between revisions

Content deleted Content added
mNo edit summary
add demo_page parameter
Line 68:
if custom_mask.exists and #custom_mask:getContent()>1 then -- pass to custom importance mask
importance = mw.text.trim(frame:expandTemplate{
title = custom_mask.prefixedText,
args = {importance=raw_importance or '¬', class=class}
})
end
else
importance = frame:expandTemplate{
title = 'Template:Importance mask',
args = {raw_importance or '¬', class=class}}
end
if importance=='¬' then
Line 103 ⟶ 105:
local project_name = args.PROJECT_NAME or 'WikiProject ' .. project
local project_link = mw.title.new(args.PROJECT_LINK or 'Wikipedia:' .. project_name)
local pagetype = demo and not args.demo_page and 'article' or require('Module:Pagetype')._main({})
page = args.demo_page
})
local rows, nested_ratings, task_forces, notes, categories, taskforce_categories = {}, {}, {}, {}, {}, {}
local add_category = function(category, key)
Line 249 ⟶ 253:
else
local classmask_args = {FQS = 'yes', [1] = class}
local title = args.demo_page and mw.title.new(args.demo_page) or current_title
class = class_mask(classmask_args, current_title)
local article_class = p.readarticleclass({ignore_subtemplates=true}, current_titletitle.prefixedText)
article_class = article_class and class_mask({article_class}, current_titletitle)
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}, current_titletitle.prefixedText)
if classparam=='' then -- no class parameters defined, display as globally unassessed
show_quality = false -- hide quality class in project banner
Line 676 ⟶ 681:
local project_name = args.PROJECT_NAME or 'WikiProject ' .. (args.PROJECT or 'PROJECT')
local banner_name = mw.title.new(args.BANNER_NAME or 'Template:WikiProject ' .. (args.PROJECT or 'PROJECT'))
local demo = not yesno(args.category or true, true) or args.demo_page
local on_template_page = not demo and current_title.rootPageTitle==banner_name.rootPageTitle
local unknown_parameters = banner_name.exists and not demo and parameter_check(frame, banner_name, project_name) or ''