Module:Infobox/Compétition de sport électronique

 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 Compétition de sport électronique.


local jeu = require "Module:Infobox/Fonctions"
local wd = require( 'Module:Wikidata' )
local localdata = require( 'Module:Infobox/Localdata' )

-- Fonction permettant l'affichage de la partie succession
local function buildsuccession ()
	localdata["précédent"] = localdata["précédent"] or wd.formatStatements{property = 'P179', showonlyqualifier = 'P155'}
	localdata["suivant"] = localdata["suivant"] or wd.formatStatements{property = 'P179', showonlyqualifier = 'P156'}

if localdata["précédent"] or localdata["suivant"] then
	return {
				type	= 'table',
                    separator=true,
	            rows ={ 
{
						type = 'succession',
	                    color = transparent,
	                    value = {before=localdata["précédent"], after=localdata["suivant"]}
					}
				}
			}
	end
end

return {
	maincolor = '#004080',
	parts = {
		{
			type = 'title',
			value = 'titre',
			icon = 'jeuvideo',
			style = {['color'] = 'white'},
		},
		{
			type = 'images',
			imageparameters = 'logo',
			captionparameter = 'légende',
			sizeparameter = {'taille','taille logo'},
                        altparameter = 'alternative'
		},
		{
			type = 'images',
			imageparameters = {'image'},
			captionparameter = 'légende2',
			sizeparameter = {'taille2','taille image2'},
                        altparameter = 'alternative2',
		},
{
			type	= 'table', separator=true,
			rows	= {
                {
					type = 'row',
					label = 'Autre nom',
					value = 'autre nom'
				},
				{
					type = 'row',
					label = 'Ancien nom',
					value = 'ancien nom'
				},
				{
					type		= 'row',
					label		= '[[Jeu vidéo|Jeu]]',
					value		= function(localdata) if localdata['jeu'] then return '<i>'..localdata['jeu']..'</i>' end end,
				},
{
					type		= 'row',
					label		= 'Organisateur',
					value		= 'organisateur',
					property	= 'P664'
				},
{
					type		= 'row',
					label		= 'Sponsor',
					value		= 'sponsor',
					property	= 'P859'
				},
{
					type		= 'row',
					label		= 'Type',
					value		= 'type'
				},
{
					type		= 'row',
					label		= 'Périodicité',
					value		= 'périodicité',
					property	= 'P2896'
				},
{
					type		= 'row',
					label		= 'Nombre d\'éditions',
					value		= 'nombre éditions'
				},
{
					type		= 'row',
					label		= 'Lieu',
					value		= 'lieu',
					property	= 'P276'
				},
{
					type		= 'row',
					label		= 'Date',
					value		= 'date'
				},
{
					type		= 'row',
					label		= 'Création',
					value		= 'création',
					property	= 'P571'
				},
{
					type		= 'row',
					label		= 'Disparition',
					value		= 'disparition',
					property	= 'P746'
				},
{
					type		= 'row',
					label		= 'Participants',
					value		= 'participants',
					property	= 'P710'
				},
			{
					type = 'row',
					label = 'Statut participants',
					value = 'statut participants'
				},
{
					type		= 'row',
					label		= 'Gains',
					value		= 'gains',
					property	= 'P2121'
				},
{
					type		= 'row',
					label		= 'Plus titré',
					value		= 'plus titré'
				},
},
},
{
			type	= 'table', separator=true,
			rows	= {
				{
					type		= 'row',
					label		= 'Vainqueur',
					value		= 'vainqueur',
					property	= 'P1346'
				},
{
					type		= 'row',
					label		= 'Finaliste',
					value		= 'finaliste'
				},
{
					type		= 'row',
					label		= 'Tenant du titre',
					value		= {'tenant','tenant du titre'}
				},
},
},
{
			type	= 'table', separator=true,
			rows	= {
				{
					type		= 'row',
					label		= 'Site web',
					value		= 'site web',
					property	= 'P856'
				},
},
},
buildsuccession ()
},
}