Module:Infobox/Art
Apparence
[voir] [modifier] [historique] [purger]
Cette page définit un module d'infobox. Pour les conseils sur l'usage de ce module, voyez Modèle:Infobox Art.
La documentation de ce module est générée par le modèle {{Documentation module}}.
Elle est incluse depuis la page Modèle:Documentation module d'infobox. Veuillez placer les catégories sur cette page-là.
Les éditeurs peuvent travailler dans le bac à sable (modifier).
Voir les statistiques d'appel depuis le wikicode sur l'outil wstat et les appels depuis d'autres modules.
local geoloc = require 'Module:Infobox/Fonctions/Géolocalisation'
local general = require 'Module:Infobox/Fonctions'
local owner = require 'Module:Propriétaire'
local material = require 'Module:Matériau'
local linguistic = require 'Module:Linguistique'
return {
maincolor = '#F9F9F9',
parts = {
general.mainimage(),
{type = 'table', rows = {
{
type = 'row',
label = 'Artiste',
value = 'artiste',
property = 'P170'
},
{
type = 'row',
label = 'Date',
value = 'année',
property = 'P571'
},
{
type = 'row',
label = 'Type',
value = 'type',
wikidata = function(item)
if localdata['type'] or localdata['technique'] then -- le matériau peut-être stocké soit dans type, soit dans technique
return nil
end
return material.formatFromItem(item)
end
},
{
type = 'row',
label = 'Technique',
value = 'technique',
},
{
type = 'row',
label = 'Style',
value = 'style',
property = 'P135',
},
{
type = 'row',
label = function(localdata, item)
local label = 'Dimensions'
local height, depth, width
if localdata['hauteur'] then
height = 'H'
end
if localdata['largeur'] then
width = 'L'
end
if localdata['profondeur'] then
depth = 'l'
end
if height or width or depth then
label = label .. '<br />' .. linguistic.conj({height, width, depth}, ' × ')
end
return label
end,
value = function(localdata, item)
local unit = localdata['unit'] or 'cm'
local height, width, depth = localdata['hauteur'], localdata['largeur'], localdata['profondeur']
if not(height or depth or width or diameter) then
return nil
end
local standarddims = linguistic.conj({height, width, depth}, ' × ' )
if standarddims then
standarddims = standarddims .. ' ' .. unit
end
if diameter then diameter =
diameter .. ' ' .. unit .. ' de diamètre'
end
return linguistic.conj({standarddims, diameter})
end
},
{
type = 'row',
label = 'Format',
value = 'format'
},
{
type = 'row',
label = 'Localisation',
value = function(localdata, item)
local museum, city, location, country = localdata['musée'], localdata['ville'], localdata['localisation'], localdata['pays']
location = linguistic.conj({museum, location, city}, 'comma')
country = linguistic.inparentheses(country)
if location or country then
return (location or '') .. ' ' .. (country or '')
end
return nil
end
},
{
type = 'row',
label = 'Propriétaire',
value = 'propriétaire',
wikidata = function(item) return owner.formatFromItem(item) end
},
{
type = 'row',
label = 'Numéro d’inventaire',
property = 'P217'
},
{ type = 'row',
label = 'Commentaire',
value = 'commentaire',
},
geoloc.coordinates('Œuvre d\'art géolocalisable sans coordonnées paramétrées'),
}
},
geoloc.geoloc(),
}
}