Modulo:Progetti interessati: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
m margin
aggiornamento aspetto grafico riquadro monitoraggio
Riga 342:
 
return table.concat(links, ' ')
end
 
-------------------------------------------------------------------------------
-- classe PreMonitoraggioTable
-------------------------------------------------------------------------------
 
local PreMonitoraggioTable = {}
 
function PreMonitoraggioTable:new(livello, args)
local self = {}
setmetatable(self, { __index = PreMonitoraggioTable })
self.livello = livello
self.args = args
return self
end
 
function PreMonitoraggioTable:getHTML()
local tableStyle = {
margin = self.livello and '5px 10% 0 10%' or '5px 10% 5px 10%',
width = '80%',
border = '1px solid #a7d7f9',
['background-color'] = cfg.bgcolor,
}
local tableNode = mw.html.create('table'):css(tableStyle)
local text = self.livello and cfg.monitoraggio.text or cfg.monitoraggio.text_nc
tableNode
:tag('tr')
:tag('td')
:css('width', '52px')
:css('text-align', 'center')
:wikitext(self.livello and cfg.monitoraggio.icon or cfg.monitoraggio.icon_nc)
:done()
:tag('td')
:wikitext(mw.getCurrentFrame():preprocess(text))
:done()
 
return tostring(tableNode)
end
 
Line 397 ⟶ 360:
function MonitoraggioTable:getHTML()
local tableStyle = {
margin = '05px 10% 5px 10%',
width = '80%',
border = '1px solid #a7d7f9',
['background-color'] = cfg.bgcolor,
['border-top'] = '0',
}
local tableNode = mw.html.create('table')
Line 435 ⟶ 397:
self.args.note:match('^[#*]') and '\n' or '',
self.args.note))
end
-- data
if self.args.data = argsthen
tableNode
:tag('tr')
:tag('td')
:css('text-align', 'centerright')
:css('widthfont-size', '52px80%')
:css('widthline-height', '80px1')
:attr('colspan', '3')
:wikitext('Monitoraggio effettuato nel ' .. self:getTextData())
end
 
Line 441 ⟶ 414:
 
function MonitoraggioTable:getNodeLivello()
local selftext, = {}icon
local url = mw.title.getCurrentTitle():fullUrl( { action = 'edit' } )
if self.livello = livellothen
if self.livello:sub(1, 1) == '0' then
icon, text = cfg.monitoraggio.icon_pc, cfg.monitoraggio.text_pc
else
:wikitext(self.livelloicon, andtext = cfg.monitoraggio.icon or, cfg.monitoraggio.icon_nc)text
text = string.format('%s<br />Ha ottenuto una valutazione di livello %s <small>(%s)</small>.',
text, self:getWlinkLivello(), self:getTextData())
end
else
local icon, text = self.livello and cfg.monitoraggio.text oricon_nc, cfg.monitoraggio.text_nc
end
return mw.html.create('tr')
:tag('td')
:css('background-colorwidth', 'none52px')
:css('widthtext-align', '90pxcenter')
:wikitext(''icon)
:node(self:getWlinkLivello())
:done()
:tag('td')
:wikitext(self.livello and cfg.livello[self.livello].msg .. ' ' .. self:getTextData() or
'<div class="plainlinks">La voce non è stata ancora valutata, [' .. url .. ' fallo ora]!</div>')
:done()
:tag('td')
:wikitext(mw.getCurrentFrame():preprocess(text))
:css('width', '80px')
:wikitext('')
:done()
end
Line 461 ⟶ 440:
local codeStyle = {
['font-weight'] = 'bold',
['font-size'] = '125%',
['padding-left'] = '.4em',
['padding-right'] = '.4em',
border = '1px solid lightsteelblue',
background = (self.livello and cfg.livello[self.livello].color) and cfg.livello[self.livello].color or 'white',
color = 'blue'
}
local text = string.format('[[:Categoria:Voci monitorate - %s|%s]]',
cfg.livello[self.livello].cat, cfg.livello[self.livello].label)
local codeNode = mw.html.create('code')
codeNode:css(codeStyle)
local text
if self.livello and cfg.livello[self.livello].label then
text = string.format('[[:Categoria:Voci monitorate - %s|%s]]',
cfg.livello[self.livello].cat, cfg.livello[self.livello].label)
elseif not self.livello then
text = '[[:Categoria:Voci monitorate - non compilate|NC]]'
end
if text then
codeNode:css(codeStyle)
else
text = '[[File:Symbol stub class.svg|25px|center]]'
end
codeNode:wikitext(text)
return tostring(tableNodecodeNode)
 
return codeNode
end
 
Line 491 ⟶ 459:
local cat = string.format('Categoria:Voci monitorate - %s', self.args.data)
if titleExists(cat) then
ret = string.format('<small>(%s)</small>', self.args.data)
end
end
return ret or "(<span style=\"color:red;\"><small>'''''mese e anno'''''</small></span>)"
end
 
function MonitoraggioTable:getNodeGrade(param)
return mw.html.create('tr')
:css('background-color', 'white')
:css('border', 'thin solid #D8D8D8')
Line 551 ⟶ 519:
(table.concat(getCategories(livello, args, projects)) .. table.concat(errcat)) or ''
return ProjectsTable:new(projects):getHTML() ..
PreMonitoraggioTableMonitoraggioTable:new(livello, args):getHTML() ..
(livello and MonitoraggioTable:new(livello, args):getHTML() or '') ..
categories
else