Aller au contenu

Module:Infobox/Musée

Cette page fait l’objet d’une mesure de semi-protection étendue.
Une page de Wikipédia, l'encyclopédie libre.
Ceci est une version archivée de cette page, en date du 24 septembre 2017 à 11:34 et modifiée en dernier par Zolo (discuter | contributions) (dirigeant après la date d'ouverture, et valeur WIkidata qui ne s'affiche que sur demande explicite). 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 Musée.


local building = require "Module:Infobox/Fonctions/Bâtiment"
local general = require "Module:Infobox/Fonctions"
local localdata = require "Module:Infobox/Localdata"
local wd = require "Module:Wikidata"

local buildingitem = localdata.item -- assuming same item for building and organization, but should not be the case, so checks the following:
local buildingcandidates = wd.stringTable{entity = localdata.item, property = 'P276', displayformat = 'raw', excludespecial = true}
if buildingcandidates and (#buildingcandidates == 1) and wd.isInstance('Q41176', buildingcandidates[1]) then
	buildingitem =  buildingcandidates[1]
end

local function architects(item)
	local architects = wd.getClaims{entity = item, property = 'P84'}
	if (not architects) then
		return nil
	end
	if #architects > 3 then
		return wd.formatAndCat{property = 'P84', entity = item, value = 'Divers'}, 2
	end
	return wd.formatAndCat{entity = item, property = 'P84', claims = architects}
end


return 
	{
	maincolor = 'C8D8FF',
	parts =
    	{
			general.title('entete musee'),
			general.logo(),
			building.mainimage(),
			{type = 'table', title = 'Informations générale', rows = {
				{type = 'row', label = 'Type', value = 'type'},
				building.opening(),
				building.closure(),
				{type = 'row', label = 'Dirigeant', plurallabel = 'Dirigeants', value = {'conservateur', 'dirigeant'}, wikidata = {property = 'P1037', showqualifiers = {'P794'}, showdate = true, precision = 'year', stilltrue = true, expl = true}}, -- TODO : forme féminine
				{type = 'row', label = 'Président', plurallabel = 'Présidents', blockers = {'dirigeant', 'conservateur'}, value = 'président', wikidata = {property = 'P488', showdate = true, precision = 'year', stilltrue = true}},-- TODO : forme féminine
				{type = 'row', label = 'Surface', value = 'superficie', wikidata = {property = 'P2046', targetunit = 'square meter'}},
				{type = 'row', label = 'Visiteurs par an', value = 'visiteurs', wikidata = {property = 'P1174', sorttype = 'inverted', numval = 1, showdate = true}},
				building.website(),
				}
			 },
			{type = 'table', title = 'Collections', rows = {
				{type = 'row', label = 'Collections', value = 'collections'}, --  liste des grandes collections du musée ;
				{type = 'row', label = 'Genre', value = 'genre collections'},
				{type = 'row', label = 'Provenance', value = 'provenance collections'},
				{type = 'row', label = 'Époque', value = 'époque collections'},
				{type = 'row', label = localdata['libellé nombre objets'] or "Nombre d'objets", value = {"nombre d'objets", "œuvres"}},
				{type = 'row', label = localdata['libellé objets exposés'] or "Objets exposés", value = "objets exposés"}
				}
			 },			 				 
			{type = 'table', title = 'Bâtiment', rows = {

				-- pourrait utiliser les fonction de Module:Infobox/Fonctions/Bâtiment si elles étaient adaptées pour utiliser un autre item que l'item principal de l'infobox
				{type = 'row', label = 'Article dédié', value = 'article bâtiment', wikidata =
						function()
						if (buildingitem ~= item) and wd.siteLink(buildingitem) then
							return wd.formatEntity(buildingitem)
						end
						end
				},
				{type = 'row', label = 'Construction', value = 'construction', wikidata = function() return wd.keyDate('Q385378', buildingitem) end},
				{type = 'row', label = 'Architecte', plurallabel = 'Architectes', value = 'architecte', wikidata = function() return architects(buildingitem) end},
				{type = 'row', label = 'Protection', value = 'protection', wikidata = function() return require('Module:Classement').formattedList(buildingitem) end}, 
				}
			 },
			{type = 'table', title = 'Sites', rows = {
				{type = 'row', value = 'Site'} -- alternative à "site" pour les institutions multi-implantations
				}
			},
			{type = 'table', title = 'Localisation', rows = {
				building.adminlocation(),
				building.coordinates(),
				}
			 },
			general.geoloc({default_zoom=16}),
	}
}