Modulo:Infobox/sandbox2: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Moroboshi (discussione | contributi)
r
Moroboshi (discussione | contributi)
meglio semplificare
 
(2 versioni intermedie di uno stesso utente non sono mostrate)
Riga 62:
 
local function renderTitle()
local subtitle = mw.html.create('')
if args.SottoTitolo then
subtitle
:tag('trbr'):done()
:tag('span')
:addClass('sinottico_sottotitolo')
:cssText(args.StileSottoTitolo or '')
:wikitext(args.SottoTitolo)
end
if args.TitoloEst then
root
Line 69 ⟶ 78:
:cssText(args.StileTitoloEst or '')
:wikitext(args.TitoloEst)
:node(subtitle)
elseif args.TitoloInt then
root
Line 77 ⟶ 87:
:cssText(args.StileTitoloInt or '')
:wikitext(args.TitoloInt)
:node(subtitle)
end
end
 
local function renderSubTitle()
if args.SottoTitolo then
root
:tag('tr')
:addClass('sinottico_sottotitolo')
:tag('th')
:attr('colspan', '2')
:cssText(args.StileSottoTitolo or '')
:wikitext(args.SottoTitolo)
end
end
 
 
local function renderImage()
Line 101 ⟶ 99:
:css('text-align', 'center')
:cssText(args.StileImmagine or '')
:wikitext(args.Immagine)
if args.Didascalia then
cell_immagine
:tag('br', {selfClosing = true})
:done()
:tag('span')
:cssText(args.StileDidascalia or '')
:wikitext(args.Didascalia)
end
root:tag('tr'):node(cell_immagine)
end
Line 115 ⟶ 105:
 
local function renderRows()
local rownums = getArgNums('Valore', 'GruppoOpzionale', 'Gruppo', 'GruppoStile')
for k, num in ipairs(rownums) do
local skip = false
Line 178 ⟶ 168:
:attr('summary', args.Summary or 'Tabella sinottica che riassume i principali dati del soggetto')
renderTitle()
renderSubTitle()
renderImage()
end