Modulo:Tassobox/sandbox: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Moroboshi (discussione | contributi)
Nessun oggetto della modifica
Moroboshi (discussione | contributi)
avevo modificato una vecchia versione
 
(21 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 68:
--===================================================================
function p.stato_conservazione(frame)
 
local args = getArgs(frame, {wrapper = 'template:Tassobox'})
local statocons = args.statocons
if statocons == nil then return end
local iucn = { ['iucn2.3'] = true, ['iucn3.1'] = true}
statocons = mw.ustring.lower(statocons)
statocons = cfg.stato_alias[statocons] or statocons
local row_stato = cfg.stato[statocons]
if row_stato == nil then
local base_msgcat_error = [[''
return '<span class="errore">parametro statocons non valido</span>[[Categoria:Errori di compilazione del template Tassobox]]'
if mw.title.getCurrentTitle().namespace == 0 then
return cat_error '<span class="errore">parametro statocons non valido</span>'[[Categoria:Errori di compilazione del template Tassobox]]'
end
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 ''
immagine versione = mw.message.newRawMessage(row_stato.base_image, (row_statoiucn[versione] and versione) or row_stato.default(statocons == 'ex' and 'none') or 'iucn3.1'
if versione == 'none' then
else
immagine = row_stato'Status_none_EX.base_imagesvg'
else
immagine = mw.ustring.format(row_stato.image, versione)
end
else
immagine = row_stato.image
end
immagine = '<div>\[\[Image:%s' .. immagine .. '|200px\]\]</div>'
end
local ref = args.statocons_ref
ref = (ref and ( '<span style=font-size:80%>' .. ref .. '</span>') or ''
local dataestinzione = ''
if row_stato.data_coloredata then
dataestinzione = args(row_stato.pre_data and ' ' .. row_stato.pre_data) or dataestinzione
dataestinzione = (args.dataestinzione and mw.ustring.format('(<span style="color:%s;">%s</span>)'row_stato.data, args.dataestinzione)) or ''dataestinzione
local txt dataestinzione = mw.ustring.format(base_msg,'<span immaginestyle="color:%s;">%s</span>', row_stato.colore,color_data or row_stato.text_data, refcolor, dataestinzione)
end
local base_msg =
 
'<div style="margin:0 auto; text-align:center;%s">'..
local base_msg = [[
'%s<div style="margincolor:0 auto%s; textfont-alignweight:center; background:whitebold;">%s%s%s</span></div>' ..
'</div>]]'
<div>\[\[Image:%s|200px\]\]</div
return mw.ustring.format(base_msg, ((immagine and 'background:white;') or ''), immagine, row_stato.color, row_stato.text, dataestinzione, ref)
<div style="color:%s;font-weight: bold;font-size:80%;">%s%s%s</span></div>
</div>]]
local txt = mw.ustring.format(base_msg, immagine, row_stato.colore, row_stato.text_data, ref, dataestinzione)
end