Content deleted Content added
Deryck Chan (talk | contribs) build it all up... |
m Protected "Module:RfD close": Highly visible module ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite)) |
||
(10 intermediate revisions by one other user not shown) | |||
Line 1:
local rfd = {}
function rfd.
end▼
end▼
if (argIsSet('result')) then▼
--define function to check whether arguments are defined
local args = frame.args
Line 57 ⟶ 25:
--sufficiently complicated (there is no built-in "or" in Lua string
--patterns) so I'll just lay it flat.
if (parameter_lower:find('keep') or parameter_lower:find('withdraw') or parameter_lower:find('refine')) then
result_match = 'Keep'
icon_filename = 'File:White check mark in dark green rounded square.svg'
Line 69 ⟶ 37:
end
if (parameter_lower:find('retarget'
result_match = 'Retarget'
icon_filename = 'File:Right-pointing white arrow in blue rounded square.svg'
Line 75 ⟶ 43:
end
if (parameter_lower:find('
result_match = 'Disambiguate'
icon_filename = 'File:
find_count = find_count + 1
end
if (parameter_lower:find('no consensus') and find_count
--This catches instances of "no consensus" that isn't qualified by "default to [keep/delete]"
result_match = 'Multiple decisions'▼
result_match = 'No consensus'
icon_filename = 'File:White equals sign on grey rounded square.svg'
find_count = 1
▲ end
icon_filename = 'File:White i in purple rounded square.svg'
elseif find_count <= 0 then
result_match = 'No
icon_filename = 'File:50% grey rounded square.svg'
end
Line 92 ⟶ 67:
end
--Detect result first, default to "no
local result_match = 'No
local icon_filename = 'File:50% grey rounded square.svg'
local result_string = ''
if (argIsSet('result')) then
result_string = ' Result was: '
result_match, icon_filename = match_result(args['result'])
end
--Build wikitext for result icon
local message_string1 = '<includeonly>
--then dump the icon
.. '[[' .. icon_filename
.. '|16px|link=|alt=' .. result_match .. "]] '''Closed discussion''', see [["
Line 116 ⟶ 93:
--Put it all together and return from Lua
return message_string1 .. link_string .. message_string2 .. result_string .. end_string
function rfd.rfdt_show_result(frame)
return '</noinclude>' .. frame.args['result'] .. '<includeonly></div></includeonly><noinclude>'
end
|