Module:Infobox/Comic book

Cette page définit un module d'infobox. Pour les conseils sur l'usage de ce module, voyez Modèle:Infobox Comic book.


local general = require 'Module:Infobox/Fonctions'
local localdata = require 'Module:Infobox/Localdata'

return {
	maincolor = '#800000',
	secondcolor = '#800000',
	thirdcolor = '#FFF',
	parts = {
		{
			type = 'title',
			icon = 'bd',
			value = function()
				if localdata['titre'] ~= nil and localdata['titre'] ~= '' then
					if localdata['langue du titre'] == 'fr' or localdata['langue du titre'] then
						return localdata['titre']
					else
						return '<em>' .. localdata["titre"] .. '</em>'
					end
				end
			end,
			italic = function(localdata) if localdata["titre en italique"] then return false else return true end end,
			setdisplaytitle = true,
		},
		general.mainimage('Article à illustrer Comic book'),
		{
			type = 'table',
			rows = {
				{
					type = 'mixed',
					label = function() return mw.getCurrentFrame():preprocess('[[:Catégorie:Maison d\'édition de comics|Éditeur]]') end,
					value = function() return localdata['éditeur'] or localdata['editeur'] end,
				},
				{
					type = 'mixed',
					label = 'Fréquence',
					value = function() return localdata['fréquence'] or localdata['frequence'] end,
				},
				{
					type = 'mixed',
					label = 'Format',
					value = 'format',
				},
				{
					type = 'mixed',
					label = 'Date de publication',
					plurallabel = 'Dates de publication',
					value = 'date',
				},
				{
					type = 'mixed',
					label = 'Numéros',
					value = function() return localdata['numéros'] or localdata['numeros'] end,
				},
				{
					type = 'mixed',
					label = 'Personnages principaux',
					value = function() return localdata['perso_principaux'] or localdata['perso_principaux'] end,
					wikidata = {
						property = 'P674',
						rank = valid,
						showqualifiers = {'P518'},
						conjtype = 'new line',
					}
				}
			},
		},
		{
			type = 'table',
            separator = true,
			rows = {
				{
					type = 'mixed',
					label = 'Scénariste(s)',
					plurallabel = 'Scénaristes',
					value = function() return localdata['scénaristes'] or localdata['scenaristes'] end,
					wikidata = {
						property = 'P50',
						rank = valid,
						showqualifiers = {'P518'},
					}
				},
				{
					type = 'mixed',
					label = 'Dessinateur(s)',
					plurallabel = 'Dessinateurs',
					value = 'dessinateurs',
					wikidata = {
						property = 'P10837',
						rank = valid,
						showqualifiers = {'P518'},
					}
				},
				{
					type = 'mixed',
					label = 'Coloriste(s)',
					plurallabel = 'Coloristes',
					value = 'coloriste',
					wikidata = {
						property = 'P6338',
						rank = valid,
						showqualifiers = {'P518'},
					}
				},
				{
					type = 'mixed',
					label = 'Lettreur(s)',
					plurallabel = 'Lettreurs',
					value = 'lettreur',
					wikidata = {
						property = 'P9191',
						rank = valid,
						showqualifiers = {'P518'},
					},
				},
				{
					type = 'mixed',
					label = 'Encrage',
					value = 'encrage',
					wikidata = {
						property = 'P10836',
						rank = valid,
						showqualifiers = {'P518'},
					},
				},
				{
					type = 'mixed',
					label = 'Créateur(s)',
					plurallabel = 'Créateurs',
					value = function() return localdata['créateurs'] or localdata['createurs'] end,
					wikidata = {
						property = 'P170',
						rank = valid,
						showqualifiers = {'P518'},
					}
				},
			},
		}
	}
}