Modulo:RichiestaCU: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
semplifico link
aggiorno come da discussione
Riga 1:
local p = {}
 
local coloriicons = {
function colore(arg1, arg2)
positivo = 'Symbol confirmed.svg',
local colori = {
probabile = 'Symbol support vote.svg',
positivo = 'F0B090',
incerto = 'Symbol possible vote.svg',
probabile = 'F0D050',
negativo = 'Symbol unrelated.svg',
incerto = 'F0F0E0',
negativo respinto = 'C0E090No sign2',
altro = 'Symbol unsupport vote.svg',
respinto = 'AEAEAE',
altro in_attesa = 'E0F0FFTime2wait'
}
if arg1 ~= nil and arg1 ~= '' then
if colori[arg1] ~= nil then
return colori[arg1]
end
elseif colori[arg2] ~= nil then
return colori[arg2]
else
return 'FFFFFF'
end
return ''
end
 
local function p.signlistUsers(framegroup, sign)
local iconepattern = {'[[File:%s.svg|20px|link=]] %s'
local label = sign:gsub('^.', string.upper):gsub('_', ' ')
positivo = 'Symbol confirmed.svg',
local div = mw.html.create('div')
probabile = 'Symbol support vote.svg',
div
incerto = 'Symbol possible vote.svg',
:addClass('cu-request-block')
negativo = 'Symbol unrelated.svg',
:tag('div')
respinto = 'No sign2.svg',
:addClass('cu-request-symbol')
altro = 'Symbol unsupport vote.svg'
:wikitext(string.format(pattern, icons[sign], label))
}
:done()
return '[[File:'..(icone[frame:getParent().args.RISULTATOSIGN] or 'Time2wait.svg')..'|80px]]'
:tag('div')
:addClass('cu-request-list')
return :wikitext(table.concat(resgroup, '\n<br />'))
:done()
:done()
return tostring(div)
end
 
local function rigagetLinks(utente, risultato, signuser)
local links = {
string.format('[[Utente:%s$1|%s$1]] <small class="plainlinks">[[Speciale:Contributi/%s$1|contributi]]', utente, utente, utente),
string.format('[[Speciale:DeletedContributions/%s$1|(cancellati)]]', utente),
string.format('[[luxo:%s$1|(CW)]]', utente),
'[' .. tostring(mw.uri.fullUrl('Speciale:Log', { ['type'] = 'block', page = 'Utente:' .. mw.uri.encode(utenteuser, 'WIKI') })) .. ' blocchi]',
string.format('[[Wikipedia:Check user/Richieste/Archivio/Utenti/%s$1|Prec]]</small>', utente),
string.format('[[Speciale:CU/%s$1|CU]]', utente)
}
return '|-\n| bgcolor=#'mw.message.colorenewRawMessage(risultato, sign)..' | '..table.concat(links, ' · '), user):plain()
end
 
function p.righemain(frame)
local args = frame:getParent().args
local signusers = args.RISULTATOSIGN or ''{}
local resret = {}
local numeroi = 1
while true do
iflocal user = args['UTENTE' ..numero i] thenor ''
if colori[arg1]user ~= nil'' then
local utente = mw.text.trim(args['UTENTE'..numero])
table.insert(res,local riga(utente,result = args['RISULTATO_UTENTE' ..numero i], sign))or ''
if utenteresult ~== '' then
table.insert(res, riga(utente, args['RISULTATO_UTENTE'..numero], sign))
numeroresult = numero + 1args.RISULTATOSIGN
elseif numero == 1 then
return '<small><span class="error">ERRORE#1: Richiesta non valida: non è stata indicata alcuna utenza.</span></small>'
elseif numero == 2 then
return '<small><span class="error">ERRORE#2: Non è possibile accogliere la richiesta: devono essere indicate almeno due utenze.</span></small>'
else
break
end
local group = icons[result] and result or 'in_attesa'
if not users[group] then users[group] = {} end
table.insert(users[group], getLinks(user))
i = i + 1
elseif colori[arg2]i ~<= nil2 then
return '<small><span class="error">ERRORE#1: Richiesta non valida: nonindicare èalmeno statadue indicata alcuna utenzautenze.</span></small>'
else
break
end
end
if users[args.RISULTATOSIGN] then
return table.concat(res, '\n')
table.insert(ret, listUsers(users[args.RISULTATOSIGN], args.RISULTATOSIGN))
end
for k in pairs(icons) do
if users[k] and k ~= args.RISULTATOSIGN then
table.insert(ret, listUsers(users[k], k))
end
end
return table.concat(ret, '\n')
end