Module:WikiProject banner/sandbox: Difference between revisions

Content deleted Content added
read parent arguments for demo_page
Tag: Reverted
demo_page
Tag: Reverted
Line 97:
end
 
p._main = function(args, raw_args, demo, demo_page, banner_name)
---------------------------
-- 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({page = demo_page})
page = args.demo_page
})
local rows, nested_ratings, task_forces, notes, categories, taskforce_categories = {}, {}, {}, {}, {}, {}
local add_category = function(category, key)
Line 238 ⟶ 237:
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 655 ⟶ 654:
---------------------------
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 728 ⟶ 727:
and not 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