Aller au contenu

Module:Infobox/Technopôle

Une page de Wikipédia, l'encyclopédie libre.
Ceci est une version archivée de cette page, en date du 2 avril 2018 à 20:58 et modifiée en dernier par Tomo8 5 (discuter | contributions) (WD). 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 Technopôle.


local general = require "Module:Infobox/Fonctions"
local location = require "Module:Infobox/Fonctions/Géolocalisation"
local wikidata = require "Module:Wikidata"
local localdata = require "Module:Infobox/Localdata"
local fun = require "Module:Format" -- Ne fonctionne pas, utiliser 'Convert' à néant
local displayformat = {nil, 'entete entreprise', '#4169E1', '#FFFFFF', '#FFFFFF', 'defaut'}
local convert = require "Module:Conversion"

return 
{
	maincolor = displayformat[3],
	secondcolor = displayformat[4],
	thirdcolor = displayformat[5],
   parts =
   	{
	general.title(displayformat[2], nil, 'nom local', nil),
	general.logo('100px'),
	general.mainimage('Article à illustrer', 'Defaut 2.svg'),
	{type = 'table',
		rows = 	{
			{type = 'row', label = 'Pays', value = 'pays', property = 'P17'},
			{type = 'row', label = 'Titre autorité', value = 'titre autorité'},
			{type = 'row', label = 'Autorité', value = 'autorité'},
			{type = 'row', label = 'URL', value = 'url'},
				}
	},
	{type = 'table', title = 'Chiffres-clé',
		rows = 	{
			{type = 'row', 
				label = 'Revenu', 
				value = function ( localdata )
						return convert.displayvalue( localdata['revenu'], 'euros', {showunit = 'short'} )
					end
			},
			{type = 'row', label = 'Date de création', plurallabel = 'Dates de création', value = 'date de création', property = 'P571'},
			{type = 'row', 
				label = "Nombre d'entreprises", 
				value = function ( localdata )
						return convert.displayvalue( localdata["nombre d'entreprises"])
					end
			},
			{type = 'row', label = "Liste d'entreprises", value = "liste d'entreprises"},
			{type = 'row', 
				label = "Nombre d'emplois", 
				value = function ( localdata )
						return convert.displayvalue( localdata["nombre d'emplois"])
					end
			},
			}
	},
	{type = 'table', title = 'Transports',
		rows = 	{
			{type = 'row', label = 'Métro', value = 'métro'},
			{type = 'row', label = 'Tramway', value = 'tram'},
			{type = 'row', label = 'Bus', value = 'bus'},
			{type = 'row', label = 'Auto', value = 'auto'},
			{type = 'row', label = 'Vélo', value = 'vélo'},
			}
	},
	{type = 'table', title = 'Géographie',
		rows = 	{
			{type = 'row', label = 'Code postal', value = 'cp', property = 'P281'},
			{type = 'row', label = 'Latitude', plurallabel ="Latitudes", value = 'latitude'},
			{type = 'row', label = 'Longitude', plurallabel ="Longitudes", value = 'longitude'},
			{type = 'row', label = 'Altitude', plurallabel ="Altitudes", 	
				value = function ( localdata )
						return convert.displayvalue( localdata['altitude'], 'm', {showunit = 'true'} )
					end
			},
			{type = 'row', 
				label = 'Superficie', 
				plurallabel ="Superficies", 
				value = function ( localdata )
						return convert.displayvalue( localdata['superficie'], 'hectare', {showunit = 'long'} )
					end,
				wikidata = {property = 'P2046', targetunit = 'ha',  rounding = '0'}},
			{type = 'row', label = 'Eau', plurallabel ="Eaux", value = 'eau'},
			location.coordinates(),
			}
		},
	location.geoloc({default_zoom=7}),
	
}
}