Module:WikiProject banner/sandbox: Difference between revisions

Content deleted Content added
m add space
move namespace warning
Tag: Reverted
Line 264:
if demo then parameters.unknown = '' end
parameter_check = require('Module:Check for unknown parameters')._check(parameters, parent_args)
end
---------------------------
-- Location warning -------
---------------------------
local show_namespace_warning = not (current_title.isTalkPage or demo)
if show_namespace_warning then
local text = cfg.namespace_warning.text:format(
pagetype,
current_title.talkPageTitle.fullText,
parameter_format('category', 'no')
)
local sortkey = current_title.namespace==10 and cfg.namespace_warning.sortkey_on_template_page or cfg.namespace_warning.sortkey
if current_title.namespace==10 then -- on the Template namespace
text = text .. ' ' .. cfg.namespace_warning.on_template_page:format(
parameter_format('BANNER_NAME'),
current_title.prefixedText
)
end
warning = mbox('ombox', {
image = '[[File:' .. cfg.namespace_warning.image .. '|40px]]',
type = cfg.namespace_warning.type_,
text = text
})
if not current_title.subjectPageTitle:inNamespace(2) then
add_category(cfg.namespace_warning.categories, sortkey)
end
end
---------------------------
Line 790 ⟶ 764:
frame:extensionTag ('templatestyles', '', {src = 'Module:WikiProject banner' .. (sandbox or '') .. '/styles.css'})
return parameter_check .. warning .. tstyle .. tostring(banner) .. table.concat(categories), note_count, #taskforce_output, assessment_link
end
 
local location_warning = function()
---------------------------
-- Location warning -------
---------------------------
local text = cfg.namespace_warning.text:format(
'page',
current_title.talkPageTitle.fullText,
parameter_format('category', 'no')
)
local sortkey = current_title.namespace==10 and cfg.namespace_warning.sortkey_on_template_page or cfg.namespace_warning.sortkey
if current_title.namespace==10 then -- on the Template namespace
text = text .. ' ' .. cfg.namespace_warning.on_template_page:format(
parameter_format('BANNER_NAME'),
current_title.prefixedText
)
end
warning = mbox('ombox', {
image = '[[File:' .. cfg.namespace_warning.image .. '|40px' .. cfg.namespace_warning.size .. ']]',
type = cfg.namespace_warning.type_,
text = text
})
if not current_title.subjectPageTitle:inNamespace(2) then
add_category(cfg.namespace_warning.categories, sortkey)
end
end
 
Line 804:
return templatepage(args, raw_args, invoke, inactive)
else
local warning = ''
return p._main(args, raw_args, demo or inactive, banner_name, invoke), nil -- nil to disregard subsequent returned values
local show_namespace_warning = if not (current_title.isTalkPage or demo) then
warning = location_warning(current_title, pagetype)
end
 
return warning .. p._main(args, raw_args, demo or inactive, banner_name, invoke), nil -- nil to disregard subsequent returned values
end
end