Module:High-use: Difference between revisions

Jump to navigation Jump to search
no edit summary
en>GKFX
m (Tidy full stops)
imported>Compooper
No edit summary
 
(6 intermediate revisions by 2 users not shown)
Line 84: Line 84:
local sandbox_text =  ("%s's [[%s/sandbox|/sandbox]] or [[%s/testcases|/testcases]] subpages, or in your own [[%s]]. "):format(
local sandbox_text =  ("You may want to test changes and make sure they are approved by site staff before submitting them."):format(
(mw.title.getCurrentTitle().namespace == 828 and "module" or "template"),
(mw.title.getCurrentTitle().namespace == 828 and "module" or "template"),
title.fullText, title.fullText,
title.fullText, title.fullText,
Line 102: Line 102:
else
else
sandbox_text = (infoArg and ('.<br />' .. infoArg .. ' C') or ' and c') ..
sandbox_text = (infoArg and ('.<br />' .. infoArg .. ' C') or ' and c') ..
'hanges may be widely noticed. Test changes in the ' .. sandbox_text
'hanges may be widely noticed. ' .. sandbox_text
end
end


local discussion_text = systemMessages and 'Please discuss changes ' or 'Consider discussing changes '
local discussion_text = systemMessages and ' Please discuss changes ' or ' Consider discussing changes '
if frame.args["2"] and frame.args["2"] ~= "" and frame.args["2"] ~= "yes" then
if frame.args["2"] and frame.args["2"] ~= "" and frame.args["2"] ~= "yes" then
discussion_text = string.format("%sat [[%s]]", discussion_text, frame.args["2"])
discussion_text = string.format("%sat [[%s]]", discussion_text, frame.args["2"])
Line 113: Line 113:
end
end
return used_on_text .. sandbox_text .. discussion_text .. " before implementing them." .. bot_text
return used_on_text .. sandbox_text .. discussion_text .. "." .. bot_text
end
end


function p.main(frame)
function p.main(frame)
local count = _fetch(frame)
local count = _fetch(frame)
local image = "[[File:Ambox warning yellow.svg|40px|alt=Warning|link=]]"
local image = "[[File:Warning new icon.png|40px|alt=Warning|link=]]"
local type_param = "style"
local type_param = "style"
local epilogue = ''
local epilogue = ''
local style = "background:#f8f9fa;border: 0px solid #a2a9b1;border-left: 25px solid #ffa800;padding: 10px 0 10px 0.5em;"
if frame.args['system'] and frame.args['system'] ~= '' then
if frame.args['system'] and frame.args['system'] ~= '' then
image = "[[File:Ambox important.svg|40px|alt=Warning|link=]]"
image = "[[File:Warning new icon.png|40px|alt=Warning|link=]]"
type_param = "content"
type_param = "content"
local nocat = frame:getParent().args['nocat'] or frame.args['nocat']
local nocat = frame:getParent().args['nocat'] or frame.args['nocat']
Line 130: Line 131:
end
end
elseif (frame.args[1] == "risk" or (count and count >= 100000)) then
elseif (frame.args[1] == "risk" or (count and count >= 100000)) then
image = "[[File:Ambox warning orange.svg|40px|alt=Warning|link=]]"
image = "[[File:Warning new icon.png|40px|alt=Warning|link=]]"
type_param = "content"
type_param = "content"
end
end
Line 140: Line 141:
["image"] = image,
["image"] = image,
["text"] = p.text(frame, count),
["text"] = p.text(frame, count),
["expiry"] = (frame.args["expiry"] or "")
["expiry"] = (frame.args["expiry"] or ""),
["style"] = style
}
}
} .. epilogue
} .. epilogue
else
else
return require('Module:Message box').main('ombox', {
return require('Module:Message box').main('ambox', {
type = type_param,
type = type_param,
image = image,
image = image,
style = style,
text = p.text(frame, count),
text = p.text(frame, count),
expiry = (frame.args["expiry"] or "")
expiry = (frame.args["expiry"] or "")
Anonymous user

Navigation menu