Module:Infobox/Fiction/Personnage

 Documentation[voir] [modifier] [historique] [purger]

Cette page définit un module d'infobox.


local general = require "Module:Infobox/Fonctions"
local person = require "Module:Infobox/Fonctions/Personne"
local wikidata = require "Module:Wikidata"
local linguistic = require "Module:Linguistique"

local function italics(query)
	local val = wikidata.formatAndCat(query)
	if val then
		return '<i>' .. val .. '</i>'
	end
end

return {
	maincolor = '#DFDFDF',
	parts = {
		general.title(),
		general.mainimage(), --rajouter upright
		{type = 'table', title = 'Univers de fiction', rows = {
			{type = 'row', label = 'Univers', value = 'univers', property = 'P1080'},
			{type = 'row', label = 'Nom original', value = 'nom original', property = 'P1448'}, -- propriété à vérifier
			{
				type = 'row',
				label = 'Présent dans lʼœuvre',
				value = 'œuvre' or 'oeuvre',
				wikidata = function ( item )
					return italics({entity = item, property = 'P1441', rank = preferred})
				end
			},
			--{type = 'row', label = 'Présent dans lʼœuvre', value = 'oeuvre'}, --sale à voir comment gérer ATTENTION
			{type = 'row', label = 'Créateur', value = 'créateur', property = 'P170'}, -- créateur de l'œuvre
			{type = 'row', label = 'Éditeur', value = 'éditeur'}, -- éditeur de l'œuvre, aller chercher P123 dans l'œuvre
			{
				type = 'row',
				label = 'Première apparition',
				value = 'première apparition',
				wikidata = function ( item )
					return italics{
						entity = item,
						property = 'P1441',
						qualifier = 'P585',
						sorttype = 'chronological',
						numval = 1,
						showdate = 1
					}
				end -- récupère la première œuvre selon la chronologie des qualifieurs date sur P1441 dans Wikidata 
			},
			--[[ {
				type = 'row',
				label = 'Dernière apparition ',
				value = 'dernière apparition',
				wikidata = function ( item )
					return '<i>' ..  wikidata._formatStatements{
						entity = item,
						property = 'P1441',
						qualifier = 'P585',
						sorttype = 'inverted',
						numval = 1
					} .. '</i>
				end
			}, ]] -- pas de propriété Wikidata correspondant, jongler avec P1441 ?
			--{type = 'row', label = 'Première apparition ', value = 'première apparition'}, -- pas de propriété Wikidata correspondant, jongler avec P1441 ?
			{type = 'row', label = 'Dernière apparition ', value = 'dernière apparition'}, -- pas de propriété Wikidata correspondant, jongler avec P1441 ?
			{type = 'row', label = 'Roman', value = 'roman'}, 
			{type = 'row', label = 'Film', value = 'film'}, 
			{type = 'row', label = 'Pièce', value = 'pièce'}, 
			{type = 'row', label = 'Série', value = 'série'}, 
			{type = 'row', label = 'Album', value = 'album'},
			{type = 'row', label = 'Saison', value = 'saison'}, 
			{type = 'row', label = 'Épisode', value = 'épisode'}, 
		}},
		{type = 'table', title = 'Identité', rows = {
			{type = 'row', label = 'Nom original', value = 'nom original'},
			{type = 'row', label = 'Alias', value = 'nom alias' or 'alias'}, -- aka
			--{type = 'row', label = 'Alias', value = 'nom alias'}, -- doublon pour conserver la rétrocompatibité avec l'ancien nom du paramètre SALE
			{type = 'row', label = 'Alias original', value = 'alias original'},
			person.birth(),
			{	type = 'row',
				label = 'Origine',
				value = 'origine',
				wikidata = { property = { 'P17', 'P1165' } }-- récupère pays et monde d'origine, normalement un seul
			},
			person.death(),
			{type = 'row', label = 'Sexe', value = 'sexe', property = 'P21'},
			{type = 'row', label = 'Espèce', value = 'espèce', property = 'P31'}, --quelques doutes sur P31
			{type = 'row', label = 'Cheveux', value = 'cheveux', property = 'P1884'},
			{type = 'row', label = 'Yeux', value = 'yeux', property = 'P1340'},
			person.occupation(),
			{type = 'row', label = 'Caractéristique', value = 'caractéristique'},
			{type = 'row', label = 'Arme(s)', value = 'arme' or 'armes'},
			{type = 'row', label = 'Pouvoir(s)', value = 'pouvoirs' or 'pouvoir' , property = 'P21'},
			{type = 'row', label = 'Adresse', value = 'adresse', property = 'P551'},
			person.family(),--gérer autres liens de parenté !
			
			{type = 'row', label = 'Affiliation', value = 'affiliation', property = 'P463'},
			{type = 'row', label = 'Entourage', value = 'entourage'},
			{type = 'row', label = 'Ennemi', value = 'ennemi'},
			{type = 'row', label = 'Membre(s)', value = 'membre', property = 'P527'},
			{type = 'row', label = 'Signe astrologique', value = 'signe astrologique'}, -- que la postérité sache que c'était contre ma volonté
			{type = 'row', label = 'Groupe sanguin', value = 'groupe sanguin', property = 'P1853'},
			{type = 'row', label = 'Taille', value = 'taille'},
			{type = 'row', label = 'Poids', value = 'poids'},
		}},
		{type = 'table', title = 'Interprétation', rows = {
			{type = 'row', label = 'Interprète', value = 'interprète', property = 'P175'},
			{type = 'row', label = 'Voix', value = 'voix'},
		}},
		{type = 'table', title = 'Autres', rows = {
			{type = 'row', label = function ( localdata ) return localdata['libellé libre'] end, value = 'libre'},
			{type = 'row', label = function ( localdata ) return localdata['libellé libre 2'] end, value = 'libre 2'}, 
			{type = 'row', label = function ( localdata ) return localdata['libellé libre 3'] end, value = 'libre 3'}, 
		}},
	}
}