Content deleted Content added
fix blanking g10 |
add summary |
||
Line 2:
local getArgs = require('Module:Arguments').getArgs
-- Construct a table of CSDs and any arguments passed in per CSD
local function constructCsdTable(args)
local tbl = {}
Line 13 ⟶ 14:
else
local arg = mw.text.split(v, '=')
tbl[current][string.lower(arg[1])] = arg[2]
end
end
Line 21 ⟶ 22:
local function build(frame, args)
local passThruArgs = {'rationale', 'xfd', 'user', 'blanked', 'url', 'url2', 'url3', 'source', 'article', '___location', 'filename', 'criterion'}
local constructed = constructCsdTable(args)
local csds = constructed[1]
Line 26 ⟶ 28:
local requestedReasons = {}
local summary = ""
-- Loop through CSDs (eg G1, G2)
for k,v in pairs(csdList) do
local csdArgs = {
table.insert(requestedReasons, frame:expandTemplate{ title = 'Db-'..k, args = {▼
['raw'] = 'yes',
}
summary = summary .. string.upper(k) .. (#v > 0 and ' (' or '')
-- add in any custom params we got, eg Rationale, URL
for _,arg in ipairs(passThruArgs) do
if v[arg] then
csdArgs[arg] = v[arg]
summary = summary .. arg .. ': ' .. v[arg] .. (#v > _ and ', ' or '')
end
end
summary = summary .. (#v > 0 and ')' or '')
end
-- Construct Db-meta wrapper
local dbTemplate = frame:expandTemplate{ title = 'Db-meta', args = {
[1] = ' for the following reasons:</b><ul><li>'..table.concat(requestedReasons, '</li><li>') .. '</li></ul> <b>The page may be deleted under any criterion that is valid',
Line 41 ⟶ 57:
['temp'] = 'Db-notice-multiple',
['temp2'] = '|'..table.concat(csds, '|'),
['summary'] = 'Multiple reasons: ' .. summary,
-- forward given params to Db-meta
|