« Module:Infobox/Addiction » : différence entre les versions
mAucun résumé des modifications |
mAucun résumé des modifications |
||
(Une version intermédiaire par le même utilisateur non affichée) | |||
Ligne 6 : | Ligne 6 : | ||
if localdata['jeux'..index] then | if localdata['jeux'..index] then | ||
if | if abb.links({ localdata['jeux'..index] }) then | ||
row = { type = 'table', title = abb.links({ localdata['jeux'..index], 'Addictions' }), rows = { | row = { type = 'table', title = abb.links({ localdata['jeux'..index], 'Addictions' }), rows = { | ||
{ type = 'row', label = 'Cause', value = 'cause'..index }, | { type = 'row', label = 'Cause', value = 'cause'..index }, | ||
Ligne 29 : | Ligne 29 : | ||
buildGamesTable(localdata, '4'), | buildGamesTable(localdata, '4'), | ||
buildGamesTable(localdata, '5'), | buildGamesTable(localdata, '5'), | ||
buildGamesTable(localdata, '6') | buildGamesTable(localdata, '6'), | ||
{ type = 'text', value = 'pied' } | { type = 'text', value = 'pied' } | ||
} | } | ||
} | } |
Dernière version du 29 juillet 2021 à 14:38
Ce module contient le paramétrage de l'infobox {{Infobox addiction}}.
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], 'Addictions' }), rows = {
{ type = 'row', label = 'Cause', value = 'cause'..index },
{ type = 'row', label = 'Risque', value = 'risque'..index },
{ type = 'row', label = 'Durée avant apparition', value = 'durée avant apparition'..index },
{ type = 'row', label = 'Durée', value = 'durée'..index },
{ type = 'row', label = 'Effet', value = 'effets'..index }
}}
end
end
return row
end
return {
parts = {
{ type = 'title', value = 'nom', subtitle = 'sous-titre', icon = 'icône', subhead = { subject = 'Addiction', link = 'Addiction' }},
{ 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'),
{ type = 'text', value = 'pied' }
}
}