Module:Infobox/Trait
Ce module contient le paramétrage de l'infobox {{Infobox trait}}.
local localdata = require('Module:Infobox/Localdata')
local abb = require('Module:Abréviation')
function buildGamesTable(localdata, index)
local row = { type = 'text' } --fake
if localdata['jeux'..index] then
if abb.links({ localdata['jeux'..index] }) then
row = { type = 'table', title = abb.links({ localdata['jeux'..index], 'Traits' }), rows = {
{ type = 'row', label = 'Exigences', value = 'requiert'..index },
{ type = 'row', label = 'Bénéfices', value = 'bonus'..index },
{ type = 'row', label = 'Pénalités', value = 'malus'..index },
{ type = 'row', label = '[[Form ID]]', value = 'formid'..index }
}}
end
end
return row
end
return {
parts = {
{ type = 'title', value = 'nom', subtitle = 'sous-titre', icon = 'icône', subhead = { games = 'jeux', subject = 'Trait', link = 'Trait' }},
{ type = 'images', imageparameters = { 'image', 'image2', 'image3', 'image4', 'image5' }, captionparameter = { 'légende', 'image desc' }},
buildGamesTable(localdata, '1'),
buildGamesTable(localdata, '2'),
buildGamesTable(localdata, '3'),
buildGamesTable(localdata, '4'),
buildGamesTable(localdata, '5'),
buildGamesTable(localdata, '6'),
buildGamesTable(localdata, '7'),
buildGamesTable(localdata, '8'),
{ type = 'text', value = 'pied' }
}
}