Modulo:Tassobox/sandbox: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Moroboshi (discussione | contributi)
typo
Moroboshi (discussione | contributi)
avevo modificato una vecchia versione
 
(11 versioni intermedie di uno stesso utente non sono mostrate)
Riga 8:
 
local function check_value(valore)
return valore orand cfg.missing_table[mw.ustring.lower(valore)]
end
 
Riga 20:
local missing_link
-- testa in ordine dal più specifico al più generico la classificazione di un essere vivente
for _,test in ipairs(cfg.param_to_check) do
missing_link = args[test] and check_value(args[test])
if missing_link then break end
end
-- se ha non trovato il valore nella tabella ricade nell'immagine di default
missing_link = missing_link or "File:Unknown missing 1.png"
return mw.ustring.format('[[' .. missing_link ..'%s|220px|Immagine di %s mancante]]', missing_link, .. mw.title.getCurrentTitle().text .. ' mancante]]')
end
 
Riga 83:
return '<strong class=\"error\">Parametro statocons non valido</div>' .. cat_error
end
local immagine = ''
if row_stato.versioneimage then
if row_stato.versione then
local versione = args.statocons_versione or ''
versione = (iucn[versione] and versione) or (statocons == 'ex' and 'none') or 'iucn3.1'
if versione == 'none' then
immagine = 'Status_none_EX.svg'
else
immagine = mw.ustring.format(row_stato.image, versione)
end
else
immagine = mw.ustring.format(row_stato.image, versione)
end
immagine = '<div>\[\[Image:' .. immagine .. '|200px\]\]</div>'
else
immagine = row_stato.image
end
local ref = args.statocons_ref
Line 99 ⟶ 102:
local dataestinzione = ''
if row_stato.data then
dataestinzione = (row_stato.text_datapre_data orand ' ' .. row_stato.pre_data) or dataestinzione
ifdataestinzione = (args.dataestinzione ~=and nilmw.ustring.format(row_stato.data, thenargs.dataestinzione)) or dataestinzione
dataestinzione = dataestinzione .. '(' .. args.dataestinzione or '' .. ')'
end
dataestinzione = mw.ustring.format('<span style="color:%s;">%s</span>', row_stato.color_data or row_stato.color, dataestinzione)
end
local base_msg =
'<div style="margin:0 auto; text-align:center; background:white;%s">'..
'%s<div>\[\[Image style="color:%s|200px\]\];font-weight:bold;">%s%s%s</span></div>' ..
'<div style="color:%s;font-weight:bold;font-size:80%%;">%s%s%s</span></div>' ..
'</div>'
return mw.ustring.format(base_msg, ((immagine and 'background:white;') or ''), immagine, row_stato.color, row_stato.text, dataestinzione, ref)
end