Aller au contenu

Module:Infobox/Archives

Une page de Wikipédia, l'encyclopédie libre.
Ceci est une version archivée de cette page, en date du 29 décembre 2018 à 23:00 et modifiée en dernier par Tomo8 5 (discuter | contributions) (Améliorations). 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 Archives/Bac à sable.


local general = require "Module:Infobox/Fonctions"
local wikidata = require "Module:Wikidata"
local localdata = require "Module:Infobox/Localdata"
local loc = require "Module:Infobox/Fonctions/Géolocalisation"
local p = {}

-- Insérer ici les fonctions

-- Titres programmables

-- Fonctions wikidata


--local function batiment() -- Fonction de choix entre bâtiment et lieu
	--if localdata['bâtiment'] then
		--return 'bâtiment' else 
		--if 


-- Fin des fonctions

return 
	{
	maincolor = 'E9C6B0',
    parts =
    {
    	general.title('archives2', nil, 'sous-titre', nil), -- Titre
    	general.logo(), -- Logo
    	general.mainimage('Article à illustrer', 'Defaut 2.svg'), -- Image
    	
-- Partie 1 - Informations générales

		{type = 'table', title='Informations générales',
			rows =	{
					{type = 'row', label = 'Autre nom', plurallabel = 'Autres noms', value = 'autre nom'},
					{type = 'row', label = 'Type', plurallabel = 'Types', value = 'type', property = 'P31'},
					{type = 'row', label = 'Création', value = 'création', property = 'P571'},
					{type = 'row', label = 'Dissolution', value = 'dissolution', property = 'P576'},
					{type = 'row', label = 'Affiliation', plurallabel = 'Affiliations', value = 'affiliation', property = 'P1416'},
					{type = 'row', label = 'Forme juridique', value = 'forme juridique', property = 'P1454'},
					{type = 'row', label = function ( localdata )
						if localdata['titre dirigeant'] then
							return localdata['titre dirigeant'] else return 'Dirigeant'
						end
					end, plurallabel = 'Dirigeants', value = 'dirigeant', property = 'P1037'},
					
					{type = 'row', label = function ( localdata )
						if localdata['titre dirigeant2'] then
							return localdata['titre dirigeant2'] else return 'Dirigeant'
						end
					end, value = 'dirigeant2'}, -- Pour la compatibilité avec l'ancienne infobox
					
					{type = 'row', label = 'Ampleur', value = 'ampleur', property = 'P1436'},
					{type = 'row', label = 'Période', plurallabel = 'Périodes', value = 'période'}, -- Propriété Wikidata manquante
					{type = 'row', label = 'Collaborateurs', value = 'personnel', property = 'P1128'},
					{type = 'row', label = 'Protection', plurallabel = 'Protections', value = 'protection', property = 'P1435'}, 
					{type = 'row', label = '[[ISO 15511|ISIL]]', value = 'ISIL', property = 'P791'},
					{type = 'row', label = 'Nom principal', plurallabel = 'Noms principaux', value = 'nomISIL', property = 'P791'}, 
					{type = 'row', label = 'Siège', plurallabel = 'Sièges', value = 'siège', property = 'P159'}, 
					{type = 'row', label = 'Membre de', value = 'membre', property = 'P463'},

--Collection à laquelle appartient un fonds	(P361 : Partie de)				
					{type = 'row', label = 'Collection', plurallabel = 'Collections', value = 'collection', wikidata = {
						property = 'P361',
						condition = function(claim)
							local v = wikidata.getMainId(claim)
							return wikidata.isInstance('Q2668072', v, 2)					
							end,
						}
					},

--Institution conservant un fonds	(P126 : Maintenance assurée par)				
					{type = 'row', label = 'Conservateur', plurallabel = 'Conservateurs', value = 'conservateur', wikidata = {
						property = 'P126',
						condition = function(claim)
							local v = wikidata.getMainId(claim)
							return wikidata.isInstance('Q1497649', v, 2)					
							end,
						}
					},
				
--Fonds d'une collection				
					{type = 'row', label = 'Fonds', plurallabel = 'Fonds', value = 'fonds', wikidata = {
						property = 'P527',
						condition = function(claim)
							local v = wikidata.getMainId(claim)
							return wikidata.isInstance('Q3052382', v, 2)					
							end,
						}
					},

--Institutions hébergées				
					{type = 'row', label = 'Institution hébergée', plurallabel = 'Institutions hébergées', value = 'institutions', wikidata = {
						property = 'P466',
						condition = function(claim)
							local v = wikidata.getMainId(claim)
							return wikidata.isInstance('Q1497649', v, 2)					
							end,
						}
					},

					{type = 'row', label = '', plurallabel = '', value = ''}, -- Propriété Wikidata manquante
					}
		},
	
	-- Partie 2 - Bâtiment
	
		{type = 'table', title='Bâtiment',
			rows =	{
					{type = 'row', label = 'Bâtiment', plurallabel = 'Bâtiment', value = 'bâtiment', property = 'P276'},
					{type = 'row', label = 'Type de bâtiment', plurallabel = 'Types de bâtiments', value = ''}, -- Requête à écrire pour obtenir les données WD du bâtiment
					{type = 'row', label = 'Construction', value = 'date de construction'}, -- Requête à écrire pour obtenir les données WD du bâtiment
					{type = 'row', label = 'Architecte', plurallabel = 'Architectes', value = 'architecte'}, -- Requête à écrire pour obtenir les données WD du bâtiment
					{type = 'row', label = 'Destination initiale', plurallabel = 'Destination initiales', value = 'destination initiale'}, -- Requête à écrire pour obtenir les données WD du bâtiment
					{type = 'row', label = 'Classement', plurallabel = 'Classements', value = 'classement'}, -- Requête à écrire pour obtenir les données WD du bâtiment
					{type = 'row', label = function ( localdata )
						if localdata['titre autre bâtiment'] then
							return localdata['titre autre bâtiment'] else return 'Autre bâtiment'
						end
					end, plurallabel = 'Autres bâtiments', value = 'autre bâtiment'}, -- Propriété Wikidata manquante
					}
		},
	
	-- Partie 3 - Géolocalisation

		{type = 'table', title='Informations géographiques',
			rows =	{
					loc.country(),
					{type = 'row', label = function ( localdata )
						if localdata['intitulé subdivision'] then
							return localdata['intitulé subdivision'] else return ''
						end
					end, value = 'subdivision'}, -- Propriété Wikidata manquante
					
					{type = 'row', label = function ( localdata )
						if localdata['intitulé subdivision2'] then
							return localdata['intitulé subdivision2'] else return ''
						end
					end, value = 'subdivision2'}, -- Propriété Wikidata manquante
					{type = 'row', label = 'Ville', plurallabel = 'Villes', value = 'ville'}, -- Propriété Wikidata manquante
					{type = 'row', label = 'Adresse', plurallabel = 'Adresses', value = 'adresse'}, -- Propriété Wikidata manquante
					loc.coordinates(),
					{type = 'row', label = 'Site web', plurallabel = 'Site web', value = 'site', property = 'P856'}, 
					}
		},
		loc.geoloc({default_zoom=7}),
	}
	}