Module:Infobox/Cinéma (personnalité)

 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 Cinéma (personnalité).


local person = require "Module:Infobox/Fonctions/Personne"
local wd = require "Module:Wikidata"
local localdata = require "Module:Infobox/Localdata"

local function genderedlabel(id)
	return wd.genderedlabel(id, wd.getgender(localdata.item))
end

return 
	{
	maincolor = '#09c8bd',
	parts =
    	{
			person.title('cinema'),
			person.mainimage(),
			{type = 'table', title = 'Biographie', rows = {
				person.othernames(),
				person.birth(),
				person.nationality(),
				person.death(),
				{
					type = 'row',
					label = 'Parenté',
					value = 'parenté',
					wikidata = {
						property = {'P22', 'P25', 'P3373', 'P26', 'P40', 'P1038'},
						withlink = true,
						rank = 'valid'
					}
				}
			}},
			{type = 'table', title = 'Vie professionnelle', rows = {
				{
					type = 'row', 
					value = {'activité', 'activités', 'profession', 'profession(s)'},
					wikidata = {
						property = 'P106',
						defaultlink = '-',
						defaultlinkquery = {property = 'P425'},
						labelformat = genderedlabel,
						removedupes = true
					},
					label = 'Activité',
					plurallabel = 'Activités'
				},
				person.floruit(),
				{
					type = 'row',
					label = 'Films notables',
					value = 'films notables',
					wikidata = {
						property = 'P800',
						numval = 5,
						showdate = true,
						conjtype = 'new line',
						condition = function(claim)
							local v = wd.getMainId(claim)
							return wd.isInstance('Q11424', v, 2)					
						end,
						labelformat = function(id)
							local label =  wd.getLabel(id)
							return '<i>' .. label .. '</i>'
						end,
					}
				},
				{
					type = 'row',
					label = 'Séries notables',
					value = 'séries notables',
					wikidata = {
						property = 'P800',
						numval = 5,
						showdate = true,
						conjtype = 'new line',
						condition = function(claim)
							local v = wd.getMainId(claim)
							return wd.isInstance('Q5398426', v, 2)					
						end,
						labelformat = function(id)
							local label =  wd.getLabel(id)
							return '<i>' .. label .. '</i>'
						end,
					}
				},
				{
					type = 'row',
					label = 'Prix notable',
					plurallabel = 'Prix notables',
					value = 'prix notables',
					wikidata = {
						property = 'P166',
						numval = 4,
						sorttype = 'inverted',
						showdate = true,
						conjtype = 'new line',
						condition = function(claim)
							local v = wd.getMainId(claim)
							return wd.isInstance('Q19020', v, 1) -- Oscars
								or wd.isInstance('Q174389', v, 1) -- Césars
								or wd.inTransitiveVals('Q967577', v, {property = 'P361'}, 1) -- Molières
								or v == 'Q179808' -- Palme d'or
								or wd.isInstance('Q1011547', v, 1) -- Golden Globes
						end,
					}
				},
				person.website()
			}},
			person.signature()
		}
	}