Module:Infobox/Collection de livre-jeu

 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 Collection de livre-jeu.


local objet = require 'Module:Infobox/Fonctions'
local wd = require 'Module:Wikidata'
return {
	maincolor = "##BFD7FF",
	parts = {
		objet.title(),
		objet.mainimage("Article à illustrer Collection de livre-jeu", "Defaut 2.svg"),
		{type = "table", rows = {
			{type = "mixed", label = "Type", value = "type", property = "P2561"},
			},
		},
		{type = "table", title = "Caractéristiques", rows = {

			{type = "mixed", label = "Légende", value = "legende", property	= "P2096"},
			{type = "mixed", label = "Support de publication", value = "support"},
			{type = "mixed", label = "Genre", value = "genre", property = "P136"},
			{type = "mixed", label = "Langue originale", value = "langueVO", property	= "P364"},
			{type = "mixed", label = "Pays d'origine", value = "paysVO", property	= "P495"},
			{type = "mixed", label = "Titre en VO", value = "titreVO"},
	 		{type = "mixed", label = "Traducteur", value = "traducteur", property = "P655", showdate = true},
			{type = 'mixed', label = 'Séries composant la collection', value = 'serie', 
				wikidata = {property = 'P527', 	conjtype = 'new line', rank = 'valid',
					statementformat = function(statement)
								local operator = wd.formatSnak(statement.mainsnak)
								local nbtitre = wd.getFormattedQualifiers(statement, 'P1114')
								local nbtitre1 = tonumber (nbtitre) 
								local str = operator
								if not nbtitre then
								str = str .. "<small> (inconnu)</small>"
								elseif (nbtitre1 >= 2) then
									str = str .. "<small> (" .. tostring(nbtitre).. " titres)</small>"
								elseif (nbtitre1 == 1) then
									str = str .. "<small> (" .. tostring(nbtitre).. " titre)</small>"
								end
						return str
					end
				},
			},
			{type = "mixed", label = "Nombre de titres", value = "nbtitres", property = "P2635"},
			{type = "mixed", label = "Directeur de collection", plurallabel = "Directeurs de collection", value = "dirigeant",  wikidata = {property = "P1037", conjtype = 'new line', showdate = true}},
			{type = 'row', label = 'Date de parution', value = 'parution', wikidata = {property = "P577", conjtype = 'new line', showdate = false}},
			{type = "mixed", label = "Éditeur", plurallabel = "Éditeurs", value = "editeur", wikidata = {property = "P123", conjtype = 'new line', showdate = true}},
			{type = "mixed", label = "Distinction reçue", plurallabel = "Distinctions reçues", value = "distinction", 
				wikidata = {property = 'P166', 	conjtype = 'new line',rank = 'valid',
					statementformat = function(statement)
						local operator = wd.formatSnak(statement.mainsnak)
						local annee = wd.getFormattedQualifiers(statement, 'P585') -- année de réception du prix
						local pour = wd.getFormattedQualifiers(statement, 'P1686') -- reçu pour
						local str = operator
						if not annee and not pour then
							str = str .. "<small> (inconnu)</small>"
						elseif (annee and not pour) then
							str = str .. " " .. tostring(annee) 
						elseif (pour and not annee) then
							str = str .. " <small>(" .. pour  .. ")</small>"
						elseif (annee and pour) then
							str = str .. " " .. tostring(annee) .. "  <small>(pour " .. pour .. ")</small>"
					end
					return "&bull; " .. str
					end
				},
			},
			{type = "mixed", label = "Système de règles", value = "regles", property = "P4151"},
			{type = 'mixed', label = 'Auteur', plurallabel = 'Auteurs', value = 'Auteurs', 
				wikidata = {property = 'P50', 	conjtype = 'new line', rank = 'valid',
					statementformat = function(statement)
								local operator = wd.formatSnak(statement.mainsnak)
								local nbtitre = wd.getFormattedQualifiers(statement, 'P3740')
								local nbtitre1 = tonumber (nbtitre) 
								local str = operator
								if not nbtitre then
									str = str .. "<small> (inconnu)</small>"
								elseif (nbtitre1 >= 2) then
									str = str .. "<small> (" .. tostring(nbtitre).. " titres)</small>"
								elseif (nbtitre1 == 1) then
									str = str .. "<small> (" .. tostring(nbtitre).. " titre)</small>"
								end
						return str
					end
				},
			},
			{type = 'mixed', label = 'Illustrateur des couvertures', plurallabel = 'Illustrateurs des couvertures', value = 'Illustrateur des couvertures',
				wikidata = {property = 'P736', 	conjtype = 'new line', rank = 'valid', showdate = true,
					statementformat = function(statement)
								local operator = wd.formatSnak(statement.mainsnak)
								local nbtitre = wd.getFormattedQualifiers(statement, 'P3740')
								local nbtitre1 = tonumber (nbtitre) 
								local str = operator
								if not nbtitre then
									str = str .. "<small> (inconnu)</small>"
								elseif (nbtitre1 >= 2) then
									str = str .. "<small> (" .. tostring(nbtitre).. " titres)</small>"
								elseif (nbtitre1 == 1) then
									str = str .. "<small> (" .. tostring(nbtitre).. " titre)</small>"
								end
						return str
					end
				},
			},
			{type = 'mixed', label = 'Illustrateur intérieur', plurallabel = 'Illustrateurs intérieur', value = 'Illustrateurs intérieur',
				wikidata = {property = 'P110', 	conjtype = 'new line', rank = 'valid', showdate = true,
					statementformat = function(statement)
								local operator = wd.formatSnak(statement.mainsnak)
								local nbtitre = wd.getFormattedQualifiers(statement, 'P3740')
								local nbtitre1 = tonumber (nbtitre) 
								local str = operator
								if not nbtitre then
									str = str .. "<small> (inconnu)</small>"
								elseif (nbtitre1 >= 2) then
									str = str .. "<small> (" .. tostring(nbtitre).. " titres)</small>"
								elseif (nbtitre1 == 1) then
									str = str .. "<small> (" .. tostring(nbtitre).. " titre)</small>"
								end
						return str
					end
				},
			},
			{type = "mixed", label = "ISSN", value = "ISSN", property = "P236"},
			{type = "mixed", label = "Fiche planete-ldvelh", value = "planete", property = "P2720"},
			},
		}
	}
}