Module:Infobox/Technopôle

 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, 'projet', '#6e77ef', '#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 Technopôle', 'Defaut 2.svg'),
	{type = 'table',
		rows = 	{
			general.country(),
			{type = 'row', label = 'Localisation', value = 'localisation', property = 'P131'},
			{type = 'row', 
				label = function ( localdata )
						if localdata['titre autorité'] then
							return localdata['titre autorité']
						end
					end,
				value = 'autorité'},
			general.website(),
				}
	},
	{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', showunit = 'long'}},
			{type = 'row', label = 'Eau', plurallabel ="Eaux", value = 'eau'},
			general.coordinates(),
			}
		},
	general.geoloc({default_zoom=7, marker='star'}),
	
}
}