« Module:Infobox monument » : différence entre les versions
De WikiPerche
Aucun résumé des modifications |
Aucun résumé des modifications Balise : Révocation manuelle |
||
(4 versions intermédiaires par le même utilisateur non affichées) | |||
Ligne 10 : | Ligne 10 : | ||
else | else | ||
headerStyle = 'background-color:#8a6b23;' | headerStyle = 'background-color:#8a6b23;' | ||
end | |||
local titleStyle | |||
if args.titleStyle and args.titleStyle ~= '' then | |||
titleStyle = string.format('background-color:%s;', args.titleStyle) | |||
else | |||
titleStyle= 'background-color:#8a6b23;' | |||
end | end | ||
local retval = capiunto.create( { | local retval = capiunto.create( { | ||
title = args.title, | title = args.title, | ||
titleStyle = titleStyle, | |||
headerStyle = headerStyle, | headerStyle = headerStyle, | ||
} ) | } ) | ||
:addImage( args.image, args.caption ) | :addImage( args.image, args.caption ) | ||
:addRow( 'Construction', args.construction) | :addRow( 'Construction', args.construction) | ||
:addRow( 'Visite possible', args.visitable) | |||
:addRow( 'Propriété', args.propriete) | :addRow( 'Propriété', args.propriete) | ||
:addHeader( 'Protection au titre des Monuments Historiques' ) | :addHeader( 'Protection au titre des Monuments Historiques' ) |
Dernière version du 20 août 2025 à 09:00
La documentation pour ce module peut être créée à Module:Infobox monument/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:#8a6b23;'
end
local titleStyle
if args.titleStyle and args.titleStyle ~= '' then
titleStyle = string.format('background-color:%s;', args.titleStyle)
else
titleStyle= 'background-color:#8a6b23;'
end
local retval = capiunto.create( {
title = args.title,
titleStyle = titleStyle,
headerStyle = headerStyle,
} )
:addImage( args.image, args.caption )
:addRow( 'Construction', args.construction)
:addRow( 'Visite possible', args.visitable)
:addRow( 'Propriété', args.propriete)
:addHeader( 'Protection au titre des Monuments Historiques' )
:addRow( 'Classé', args.mhclasse)
:addRow( 'Inscrit', args.mhinscrit)
:addRow( 'Objet de la protection', args.mhobjet)
return retval
end
return p