Modulo:Progetti interessati: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
m +categoria di servizio |
+messaggio di errore con progetti non esistenti |
||
Riga 61:
local errcat = {}
local projects = {}
local nonexistingProjects = {}
local errmsg
local importanceParams = { 'importanza' }
local projectParams = { 'progetto' }
Riga 106 ⟶ 108:
else
table.insert(errcat, '[[Categoria:Pagine con template Progetti interessati con progetto non esistente]]')
table.insert(nonexistingProjects, name)
end
end
Riga 114 ⟶ 117:
end
-- messaggio d'errore con progetti non esistenti
return args, projects, errcat▼
if #nonexistingProjects > 0 then
local descr = #nonexistingProjects > 1 and 'non esistono i progetti' or 'non esiste il progetto'
errmsg = string.format('<span class="error" style="margin:5px 10%%">Errore: %s %s</span>',
descr, mw.text.listToText(nonexistingProjects))
end
▲ return args, projects, errcat, errmsg
end
Riga 519 ⟶ 529:
-- Entry-point per il template {{Progetti interessati}}
function p.main(frame)
local args, projects, errcat, errmsg = parseArgs(getArgs(frame, {parentOnly = true}))
if hasMonitoraggio(projects) then
local livello = getLivello(args)
local categories = mw.title.getCurrentTitle().namespace == 1 and
(table.concat(getCategories(livello, args, projects)) .. table.concat(errcat)) or ''
return (errmsg or '') ..
ProjectsTable:new(projects):getHTML() .. MonitoraggioTable:new(livello, args):getHTML() ..
categories
else
return (errmsg or '') ..
ProjectsTable:new(projects):getHTML() .. table.concat(errcat)
end
|