Modulo:Discendenza: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
risistemazione con utilizzo mw.html |
m modulo no globals obsoleto |
||
(5 versioni intermedie di 2 utenti non mostrate) | |||
Riga 1:
require('
local getArgs = require('Module:Arguments').getArgs
local errorCategory = '[[Categoria:Errori di compilazione del template Discendenza]]'
Line 219 ⟶ 220:
local xx, xp
local stileDiv = { ['width'] = largo..'px', ['padding'] = '3px', ['background'] = '#FFF', ['border'] = '1px solid #C8CCD1' }
local stileTabella = { ['border-collapse'] = 'separate', ['text-align'] = 'center', ['font-size'] = '95%', ['line-height'] = '105%', ['margin'] = '
local xy = massimoXY(pid, {0, 0})
local lg = math.floor(100/(xy[1]+2))
if (lg == 0) then lg = 1 end
local bDiv = mw.html.create('div'):attr({['style']='overflow:auto'})
if (allinea == 'destra') then
bDiv:css(stileDiv):addClass('floatright')
stileTabella['margin'] = '
end
local bTabella = mw.html.create('table')
Line 246 ⟶ 247:
if (n==1) then
for m=1,(xy[1]+2) do
end
else
:css('border-right','1px solid #000')
:cssIf(n1 == xp,'border-top','1px solid #000')
:attrIf(xx-posx[1]>0,'colspan',xx+1-posx[1])
:wikitext(' ')
)
n1 = xp
posx[1] = xx + 1
end
if (xx-posx[2]>0) then
:attrIf(xx-posx[2]>1,'colspan',xx-posx[2])
:wikitext(' ')
end
:attr('colspan','2')
:wikitextIf(pers[v].nota=='-', pers[v].testo, string.format('%s<br/><span style="font-size:90%%"><i>%s</i></span>',pers[v].testo,pers[v].nota))
)
posx[2] = xx + 2
if (n<xy[2]) then
if (#pers[v].figli > 0) then
:css('border-right','1px solid #000')
:attrIf(xx-posx[3]>0,'colspan',xx+1-posx[3])
:wikitext(' ')
)
posx[3] = xx + 1
end
end
Riga 289:
bDiv:node(bTabella)
if (allinea == 'destra' and not (dida=='')) then
:css({['font-size'] = '87%', ['font-style'] = 'normal', ['border-top'] = '1px solid #c8ccd1', ['margin'] = '8px 2px 3px'})
:wikitext(dida)
)
end
return tostring(bDiv)
Riga 324:
)
end
riga1
:node(mw.html.create('td') :css('width','6px'))
:css({['border-left']='1px solid #666',['border-bottom']='1px solid #666',['width']='10px',['line-height']='3px',['height']='12px'}))
:
riga1:node(mw.html.create('td')▼
:
:wikitextIf(pers[pid].nota=='', pers[pid].testo, pers[pid].testo..' - '..pers[pid].nota))▼
▲ :wikitextIf(pers[pid].nota=='', pers[pid].testo, pers[pid].testo..' - '..pers[pid].nota))
riga2
:node(mw.html.create('td'))
Riga 340:
bTabella:node(riga1):node(riga2)
else
▲ :attr('colspan',2*a-1)
:
:css('padding','0px 0px 2px 2px')
:wikitextIf(pers[pid].nota=='',pers[pid].testo,pers[pid].testo..' - '..pers[pid].nota )
▲ bTabella:node(riga1)
)
end
if (pers[pid].sp > 0) then
|