Aller au contenu

Module:Infobox/Usine

Une page de Wikipédia, l'encyclopédie libre.
Ceci est une version archivée de cette page, en date du 16 septembre 2017 à 16:05 et modifiée en dernier par Zolo (discuter | contributions) (ajustements). Elle peut contenir des erreurs, des inexactitudes ou des contenus vandalisés non présents dans la version actuelle.

 Documentation[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.


local building = require "Module:Infobox/Fonctions/Bâtiment"
local general = require "Module:Infobox/Fonctions"
local localdata = require "Module:Infobox/Localdata"
local linguistic = require "Module:Linguistique"
local convert = require "Module:Conversion"
local formatnum = require "Module:Format".do_formatnum

return 
	{
	parts =
    	{
			general.title(),
			building.mainimage(), 
			{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.displayvalue(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 (not localdata['effectif']) then
							return nil 
						end
						local n = localdata['effectif']
						if tonumber(n) then
							n = formatnum(n)
						end
						local dat = localdata['date effectif']
						return linguistic.conj({n, linguistic.inparentheses(dat)}, " ")
						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 = 'marques'},
				{type = 'row', label = "Modèles", value = "modèles"},
				{type = 'row', label = "Production",
					value = function()
						local val, dat = localdata['production'], localdata['date production']
						return linguistic.conj({val, linguistic.inparentheses(dat)}, " ")
					end
					},
				}
		},
		{type = 'table', title = 'Localisation', rows = {
				function()
					if localdata['localité'] then -- paramètre spécifique à ce module, à déprécier ?
						return {type = 'multi', rows = {
							{type = 'row', label = 'Situation', value = function() return localdata['localité'] .. ' ' .. (linguistic.inparentheses(localdata['région']) or '') end},
							building.country(),
							}
						}
					end
						return building.adminlocation()
					end,
				building.coordinates(),
				},
			},
		building.geoloc({pointtype = "usine", marker = 'industrial'}),
	}
}