Module:Infobox/Fonctions/Bâtiment : Différence entre versions

De Lagny-sur-Marne Wiki
Aller à : navigation, rechercher
m (Orthographe)
Ligne 6 : Ligne 6 :
 
--Titre
 
--Titre
 
function p.title()
 
function p.title()
-- local class = entete par défaut à définir ici ?
+
-- local class = en-tête par défaut à définir ici ?
 
return general.title()
 
return general.title()
 
end
 
end

Version du 23 septembre 2014 à 11:39

La documentation pour ce module peut être créée à Module:Infobox/Fonctions/Bâtiment/doc

local p = {}
local wikidata = require('Module:Wikidata')
local general = require('Module:Infobox/Fonctions')
local coordinates = require('Module:Coordinates')

--Titre
function p.title()
--	local class = en-tête par défaut à définir ici ?
	return general.title()
end

--Image
function p.mainimage()
	return  general.mainimage()
end

function p.coordinates()
	return {
		type = 'mixed',
		label = 'Coordonnées',
		value = function(localdata, item)
			if localdata["géolocalisation"] == 'pas pertinent' or localdata['géolocalisation'] == 'non' then
				return nil
			end
			local displayformat = displaycoords
			local displaytitle = 'title'
			if localdata['displaytitle'] == 'non' then
				displaytitle = ''
			elseif 'coords en titre' == 'non' then
				displaytitle = ''
			end
			local displayinline = 'inline'
			if localdata['displayinline'] == 'non' then
				displayinline = ''
			elseif 'coords en ligne' == 'non' then
				displayinline = ''
			end
			local displayplace = displaytitle .. ',' .. displayinline
			local latitude = localdata['latitude']
			local longitude = localdata['longitude']
			local globe = localdata['globe']
			return coordinates._coord({latitude = latitude, longitude = longitude, displayformat = displayformat, globe = globe, wikidata = true})
			end
		}
end

function p.architect()
	return {
		type = 'mixed',
		label = 'Architecte',
		value = 'architecte',
		property = 'P84'
	}
end

function p.geoloc()
	return   {
		type = 'map',
		latitude = function() return localdata['latitude'] end, -- pas bien
		longitude = function() return localdata['longitude'] end,
		maps = function(localdata, item) return mw.text.split( localdata['géolocalisation'], '/', true ) end
        }
 
end
return p