Aller au contenu

Module:Infobox/Film

Une page de Wikipédia, l'encyclopédie libre.
Ceci est une version archivée de cette page, en date du 11 septembre 2018 à 14:41 et modifiée en dernier par Simon Villeneuve (discuter | contributions) (+). 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 Film.


local localdata = require 'Module:Infobox/Localdata'
local general = require "Module:Infobox/Fonctions"
local person = require "Module:Infobox/Fonctions/Personne"
local wikidata = require "Module:Wikidata"
local linguistic = require "Module:Linguistique"
local convert = require "Module:Conversion"

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

return 
	{
	maincolor = "09C8BD",
	secondcolor = "5CF8F0",
	parts =
    	{
			general.title( "cinema"),
			general.mainimage{ 
				cat = "Article à illustrer Arts et culture",
				defaultimage = "Defaut 2.svg", 
				wikidata = {property = {"P3383", "P2716", "P18", "P10"}, numval = 1}
				},
		{type = "table", title = "Informations générales", rows = {
			{type = "row", label = "Titre original", value = "titre original", plurallabel = "Titres originaux" , wikidata = function ( item )
					return italics({entity = item, property = 'P1476', conjtype = 'new line' , showlang = true })--trouver un moyen de retirer lorsque le titre original est en français
				end
			},
			{type = "row", label = "Date de production", value = "date de production", plurallabel = "Dates de sortie" , wikidata = {property = 'P571' , sorttype = 'chronological' , numval = 1 }},
			{type = "row", label = "Date de sortie", value = "date de sortie", plurallabel = "Dates de sortie" , wikidata = {property = 'P577' , conjtype = 'new line' , sorttype = 'chronological' , showqualifiers = 'P291,P276' }},
			{type = "row", label = "Diffuseur", value = "diffuseur", plurallabel = "Diffuseurs" , property = 'P449'},
			{type = "row", label = "Durée", value = "durée", plurallabel = "Durées" , wikidata = {property = 'P2047' , showunit = 'long' }},
			{type = "row", label = "Langue", value = "langue originale" , plurallabel = "Langues", property = 'P364'},
			{type = "row", label = "Genre", value = "genre" , plurallabel = "Genres", property = 'P136'},
			{type = "row", label = "Basé sur", value = "basé sur" , wikidata = function ( item )
					return italics({entity = item, property = 'P144'})
				end
			},
			{type = "row", label = "Sujet", value = "sujet" , plurallabel = 'Sujets', property = 'P921'},
			{type = "row", label = "Pays", value = "pays d\'origine" , property = 'P495'}, -- ça serait bien d'afficher le drapeau avant le pays. Peut-être en pouvant mettre en forme la propriété ainsi : {{propriété}}.
			{type = "row", label = "Lieu de tournage", value = "lieu de tournage" , plurallabel = 'lieux de tournage' , property = 'P915'},
			--{type = "row", label = "Format", value = "format", plurallabel = "Formats" , property = 'P3803'}, plus détaillé que nécessaire pour l'infobox
			general.website
			}
		},
		{type = "table", title = "Équipe du film", rows = {
			{type = "row", label = "Scénario", value = "scénario", property = 'P58'},
			{type = "row", label = "Production", value = "production", property = 'P272,P162'},
			{type = "row", label = "Production déléguée", value = "production déléguée", property = 'P1431'},
			{type = "row", label = "Storyboard", value = "storyboard", property = 'P3275'},
			{type = "row", label = "Décors", value = "décors", property = 'P2554'},
			{type = "row", label = "Costumes", value = "costumes", property = 'P2515'},
			{type = "row", label = "Réalisation", value = "réalisation", property = 'P57'},
			{type = "row", label = "Photographie", value = "photographie", property = 'P344'},
			{type = "row", label = "Distribution", value = "distribution", wikidata = {property = 'P161' , conjtype = 'new line' , numval = 5}}, --problématique. Il y a presque toujours plus de 5 valeurs et les cinq premières ne sont pas nécessairement représentatives du poids dans l'oeuvre. Il faudrait une fonction qui place les 5 premiers noms par ordre décroissant d'interwikis existants (le plus grand nombre d'interwikis = les plus gros noms = les principaux remarqués) et place le reste en liste déroulante semblable à celle des distinctions. )
			{type = "row", label = "Musique", value = "musique", property = 'P86'},
			{type = "row", label = "Montage", value = "montage", property = 'P1040'},
			
		}
		},
		{type = "table", title = "Économie", rows = {
			--{type = "row", label = "Visa d'exploitation", value = "visa d'exploitation",  wikidata = {property = 'P2755', urlpattern="http://www.cnc.fr/web/fr/rechercher-une-oeuvre/-/visa/$1"}}, plus détaillé que nécessaire pour une infobox
			{type = "row", label = "Coût", value = "coût" , plurallabel = "Coûts", property = 'P2130'},
			{type = "row", label = "[[Box-office]]", value = "box-office" , wikidata = {property = 'P2142' , showunit = 'short'}},
			person.awards(),
			}
		},
	}
}