Aller au contenu

Module:Infobox/Gare

Une page de Wikipédia, l'encyclopédie libre.
Ceci est une version archivée de cette page, en date du 3 mars 2015 à 17:01 et modifiée en dernier par Zolo (discuter | contributions) (début de conversion de Modèle:Infobox Gare). Elle peut contenir des erreurs, des inexactitudes ou des contenus vandalisés non présents dans la version actuelle.
(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)

 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 Gare.


local building = require "Module:Infobox/Fonctions/Bâtiment"
local general = require "Module:Infobox/Fonctions"
local wikidata = require "Module:Wikidata"

return 
	{
	maincolor = '#E0E0E0',
	parts = {
		general.title(),
		general.image(),
		{type = 'table', title = 'Localisation', rows = {
			building.country(),
			building.adminlocation(),
			building.coordinates(),
			}
		},
		{type = 'table', title = ' Gestion et exploitation', rows = {
			building.owner(),
			{type = mixed, label = 'Exploitant', value = 'exploitant', property = 'P137'},
			{type = mixed, label = 'Exploitant', value = function(localdata, item) return localdata['titre services'] or 'Services' end},
			}
		},
		{type = 'table', title = 'Caractéristiques', rows = {
			{type = 'mixed', label = 'Ligne(s)', value = 'lignes', property = 'P81'},
			{type = 'mixed', label = 'Voie', value = 'voies', property = 'P1103'}, -- P1103: nombre de quais
			{type = 'mixed', label = 'Hauteur', value = 'hauteur'},
			{type = 'mixed', label = 'Transit annuel', value = 'transit'},
			{type = 'mixed', label = 'Zone', value = function(localdata, item)
				local rawstring = localdata[zone]
				-- format du paramètre : "nom de la région/numméro de zone"
				local splitted = mw.text.split( rawstring, '/', true )
				if not splitted or #splitted < 1 then
					return rawstring
				end
				--Île de-France
				if split[1] == 'IDF' then
					local zone = tonumber(split[2] or '')
					if not zone or (zone > 8) then
						return '[[Tarification des transports en commun d’Île-de-France|Tarification Île-de-France]] non applicable[[Catégorie:Hors zone des transports en commun d\'Île-de-France]]'
					end
					return tostring(zone) .. ' ([[tarification des transports en commun d\'Île-de-France|tarification Île-de-France]])'
				end
				return rawstring
			end
			},
			{type = 'mixed', label = 'Altitude', value = 'altitude'},
			}
		},
		{type = 'table', title = 'Historique', rows = {
			{type = 'mixed', label = 'Mise en service', value = 'mise en service'},
			building.opening(),
			{type = 'mixed', label = 'Fermeture', value = 'fermeture'},
			building.architect(),
			building.protection(),
			}
		},
		{type = 'table', title = 'Correspondances', rows = {
			{type = 'mixed', label = function(localdata, item) return localdata['titre corresp1'] or 'corresp1' end, value = 'corresp 1'},
			{type = 'mixed', label = function(localdata, item) return localdata['titre corresp2'] or 'corresp1' end, value = 'corresp 2'},
			{type = 'mixed', label = function(localdata, item) return localdata['titre corresp3'] or 'corresp1' end, value = 'corresp 3'},
			{type = 'mixed', label = function(localdata, item) return localdata['titre corresp4'] or 'corresp1' end, value = 'corresp 4'},
			{type = 'mixed', label = function(localdata, item) return localdata['titre corresp5'] or 'corresp1' end, value = 'corresp 5'},
			{type = 'mixed', label = function(localdata, item) return localdata['titre corresp6'] or 'corresp1' end, value = 'corresp 6'},
			{type = 'mixed', label = function(localdata, item) return localdata['titre corresp7'] or 'corresp1' end, value = 'corresp 7'},
			{type = 'mixed', label = 'Métro', value = 'métro'},
			{type = 'mixed', label = 'Tramway', value = 'tramway'},
			{type = 'mixed', label = 'Bus', value = 'bus'},
			{type = 'mixed', value = 'Schéma'},
			}
		},
		building.geoloc(),
	}
}