Module:Infobox/Usine
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 Usine.
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 building = require "Module:Infobox/Fonctions/Bâtiment"
local general = require "Module:Infobox/Fonctions"
local localdata = require "Module:Infobox/Localdata"
local wd = require "Module:Interface Wikidata".fromLua
local address = require "Module:Adresse"
local linguistic = require "Module:Linguistique"
local convert = require "Module:Conversion"
local formatnum = require "Module:Format".do_formatnum
return
{
maincolor = displayfrmat[3],
secondcolor = displayfrmat[4],
thirdcolor = displayfrmat[5],
parts =
{
general.title(),
building.mainimage(),
{type = 'table', title = 'Localisation', rows = {
{type = 'row', label = 'Situation', value = function()
-- adaptation de l'affichage de l'emplacement aux paramètres legacy "région" et "localité"
local item = localdata['item']
local country = localdata['pays']
local divstr
if localdata['localité'] or localdata['région']then
divstr =( localdata['localité'] or '') .. ' ' .. linguistic.parentheses(localdata['région'])
end
return address.fullAddress(item, country, nil, divstr) end
},
building.coordinates(),
building.geoloc({defaultmaps = "interactive", pointtype = "Usine sans toponyme", maptype = "relief"})
}
},
{type = 'table', title = 'Installations', rows = {
{type = 'row', label = "Type d'usine", value = "type d'usine"},
{type = 'row', label = "Superficie",
value = function() if localdata['superficie'] then return convert.convertvalue(localdata['superficie'], 'ha') end end,
wikidata = {property = 'P2046', targetunit = 'hectare'}
},
}
},
{type = 'table', title = 'Fonctionnement', rows = {
{type = 'row', label = 'Opérateur', value = 'opérateur', wikidata = {property = 'P137'}},
{type = 'row', label = 'Effectif', value =
function()
if localdata['effectif'] then
return formatnum(localdata['effectif']) .. ' ' .. linguistic.inparentheses(locadata['date effectif']) end
end
}, -- wikidata : P1128 ? mais distinction ouvrier, personnes qui travaillent sur le lieu
{type = 'row', label = "Date d'ouverture", value = "date d'ouverture", wikidata = {property = 'P1619'}},
{type = 'row', label = "Date de fermeture", value = "date de fermeture", wikidata = {property = 'P3999'}},
{type = 'row', label = "Destination actuelle", value = 'destination actuelle'},
},
},
{type = 'table', title = 'Production', rows = {
{type = 'row', label = 'Produits', value = 'produits'},
{type = 'row', label = 'Marques', value = 'marque'},
{type = 'row', label = "Modèles", value = "modèles"},
{type = 'row', label = "Production",
value = function()
if localdata['production'] then
return localdata['production'] .. localdata.inparentheses(localdata['date production'])
end
end
},
}
}
}
}