Content deleted Content added
not ready for this |
|||
Line 97:
end
p._main = function(args, raw_args, demo
---------------------------
-- Initialise parameters --
Line 104:
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({
})
local rows, nested_ratings, task_forces, notes, categories, taskforce_categories = {}, {}, {}, {}, {}, {}
local add_category = function(category, key)
Line 237 ⟶ 238:
local class = raw_args.class
if class then -- banner gives quality ratings
local title = args.demo_page and mw.title.new(args.demo_page) or current_title
local article_class = p.readarticleclass({ignore_subtemplates=true}, title.prefixedText)
article_class = article_class and class_mask({article_class}, title)
Line 654 ⟶ 655:
---------------------------
local categories_formatted = ''
if args.demo_page then -- for testing purposes
local category_list = mw.html.create('div')
:css('background-color', '#F5F5F5'):css('border-width', '1px')
Line 698 ⟶ 699:
end
local parameter_check = function(frame, banner_name, project_name
---------------------------
-- Unknown parameters -----
---------------------------
local template_code = banner_name:getContent()
local parameters = {}
Line 710 ⟶ 712:
local unknown_category = cfg.unknown_parameters.tracking:format(project_name)
parameters.unknown = mw.title.new(unknown_category).exists and '[[' .. unknown_category .. '|_VALUE_]]' or ''
return require('Module:Check for unknown parameters')._check(parameters,
end
local initialise = function(args, raw_args, inactive)
▲ local parent_args = args_module.getArgs(frame, {parentOnly = true})
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
if on_template_page then
local templatepage = require('Module:WikiProject banner/templatepage' .. (sandbox or '')).templatepage
return templatepage(args, raw_args, inactive)
else
return unknown_parameters .. p._main(args, raw_args, demo
▲ and parameter_check(frame, banner_name, project_name, parent_args) or ''
▲ return unknown_parameters .. p._main(args, raw_args, demo, demo_page or inactive, banner_name), nil -- nil to disregard subsequent returned values
end
end
|