Module:Infobox/Obélisque

 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 Obélisque.


local functions = require 'Module:Infobox/Fonctions'
local localdata = require 'Module:Infobox/Localdata'

function unit(label, value, unit, property)
	return {
		type = 'row',
		label = label,
		value = function()
			if localdata[value] then
				local val = tonumber(localdata[value])
				if val then
					return mw.getContentLanguage():formatNum(val) .. ' ' .. unit
				else
					return localdata[value] .. ' ' .. unit
				end
			end
		end,
		property = property
	}
end

return {
	maincolor = '#CCCCAA',
	parts = {
			functions.title('egypte-antique'),
			functions.mainimage('Article à illustrer Obélisque'),
			{type = 'table', title = '[[Obélisque]]s', rows = {
				{type = 'row', label = 'Autre nom', value = 'autre nom'},
				{type = 'row', label = 'Commanditaire', value = 'commanditaire', property = 'P88'},
				{type = 'row', label = 'Construction', value = 'date construction', property = 'P571'},
				{type = 'row', label = 'Matériau', plurallabel = 'Matériaux', value = 'matériau', wikidata = require('Module:Matériau').formatFromItem(localdata.item)},
				{type = 'row', label = 'Inscriptions', value = 'inscriptions'},
				unit('Poids', 'poids', 't', 'P2067'),
				unit('Hauteur d’origine', 'hauteur origine', 'm'),
				unit('Hauteur actuelle', 'hauteur actuelle', 'm', 'P2048'),
				unit('Hauteur avec piédestal', 'hauteur totale', 'm'),
				{type = 'row', label = 'Emplacement d’origine', value = 'emplacement origine'},
				{type = 'row', label = 'Emplacement actuel', value = 'emplacement actuel', property = 'P276'},
				{type = 'row', label = 'Ordonnateur', value = 'ordonnateur'},
				{type = 'row', label = 'Date d’installation', value = 'date installation'},
				{type = 'row', label = 'Classement', value = 'protection'},
				functions.coordinates()
			}},
			functions.geoloc({marker='monument', default_zoom=14})
	}
}