« Module:Infobox commune » : différence entre les versions
De WikiPerche
Aucun résumé des modifications Balise : Révoqué |
Aucun résumé des modifications |
||
(20 versions intermédiaires par le même utilisateur non affichées) | |||
Ligne 9 : | Ligne 9 : | ||
headerStyle = string.format('background-color:%s;', args.headerstyle) | headerStyle = string.format('background-color:%s;', args.headerstyle) | ||
else | else | ||
headerStyle = 'background-color: | headerStyle = 'background-color:firebrick;' | ||
end | end | ||
local retval = capiunto.create( { | local retval = capiunto.create( { | ||
title = args.title, | title = args.title, | ||
headerStyle = headerStyle, | headerStyle = headerStyle, | ||
} ) | } ) | ||
Ligne 19 : | Ligne 18 : | ||
:addRow( 'Nombre d\'habitants', args.habitants ) | :addRow( 'Nombre d\'habitants', args.habitants ) | ||
:addRow( 'Gentilé', args.gentile ) | :addRow( 'Gentilé', args.gentile ) | ||
:addRow( 'Site web', args.siteweb ) | |||
:addHeader( 'Géographie' ) | :addHeader( 'Géographie' ) | ||
:addRow( 'Superficie', args.superficie ) | :addRow( 'Superficie', args.superficie ) | ||
Ligne 26 : | Ligne 26 : | ||
:addHeader( 'Informations administratives' ) | :addHeader( 'Informations administratives' ) | ||
:addRow( 'Maire', args.maire ) | :addRow( 'Maire', args.maire ) | ||
:addRow( 'Intercommunalité', args.cdc ) | |||
:addRow( 'Département', args.departement ) | |||
:addRow( 'Région', args.region ) | :addRow( 'Région', args.region ) | ||
:addRow( 'Code postal', args.codepostal ) | :addRow( 'Code postal', args.codepostal ) | ||
:addRow( 'Code INSEE', args.codeinsee ) | :addRow( 'Code INSEE', args.codeinsee ) | ||
return retval | return retval | ||
end | end | ||
return p | return p |
Dernière version du 2 août 2024 à 18:21
La documentation pour ce module peut être créée à Module:Infobox commune/doc
local capiunto = require 'capiunto'
local p = {}
function p.main(frame)
local args = frame:getParent().args
local headerStyle
if args.headerstyle and args.headerstyle ~= '' then
headerStyle = string.format('background-color:%s;', args.headerstyle)
else
headerStyle = 'background-color:firebrick;'
end
local retval = capiunto.create( {
title = args.title,
headerStyle = headerStyle,
} )
:addImage( args.image, args.caption )
:addRow( 'Nombre d\'habitants', args.habitants )
:addRow( 'Gentilé', args.gentile )
:addRow( 'Site web', args.siteweb )
:addHeader( 'Géographie' )
:addRow( 'Superficie', args.superficie )
:addRow( 'Densité de population', args.densite )
:addRow( 'Altitude', args.altitude )
:addRow( 'Bassin de vie', args.bassin )
:addHeader( 'Informations administratives' )
:addRow( 'Maire', args.maire )
:addRow( 'Intercommunalité', args.cdc )
:addRow( 'Département', args.departement )
:addRow( 'Région', args.region )
:addRow( 'Code postal', args.codepostal )
:addRow( 'Code INSEE', args.codeinsee )
return retval
end
return p