Module:Infobox/Saison d'équipe cycliste

 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 Saison d'équipe cycliste.


local wikidata = require "Module:Wikidata"
local general = require "Module:Infobox/Fonctions"
local linktopic = '-'

return {
	maincolor = '#FFDF80',
	parts = {
		
		general.title('cyclisme'),
		general.logo('1.1'),
		{type = 'table', title = 'Généralités', rows = {
			{type = 'row', label = 'Équipe', value = 'article principal', property = 'P5138'},
			{type = 'row', label = 'Code UCI', wikidata = {property = 'P1998', sorttype = 'chronological', showdate = true, textformat = 'minimum', linktopic = linktopic}},
			{type = 'row', label = 'Statut', value = 'catégorie', property = 'P2094'},
			general.country(),
			{type = 'row', label = 'Sport', value = 'sport', property = 'P641'},
			{
				type = 'row',
				label = 'Effectif',
				value = 'effectif',
				wikidata = function ( item ) -- suppose que P527 ne contienne que des coureurs, et contienne toutes les coureurs
					local cyclists = wikidata.getClaims{entity = item, property = 'P527'}
					if not cyclists then
						return nil
					end
					local str = tostring(#cyclists)
					local trainees =  wikidata.getClaims{entity = item, property = 'P527', qualifier = 'P39', qualifiervalue = 'Q2328847' }					
					if trainees then
						if #trainees == 1 then
							str = str .. ' (dont 1 stagiaire)'
						else
							str = str .. ' (dont ' .. tostring(#trainees) .. ' stagiaires)'
						end
					end
					str = wikidata.addLinkBack(str, item, 'P527')
					str = str .. wikidata.addTrackingCat('P527')
					return str
				end
			},
			{type = 'row', label = 'Manager général', value = 'manager', property = 'P505'},
			{
				type = 'row',
				label = 'Directeur(s) sportif(s)',
				singularlabel = 'Directeur sportif',
				plurallabel = 'Directeurs sportifs',
				wikidata = {entity = item, property = 'P286', separator = '<br />', showdate = true, linktopic = linktopic}
			},
			{type = 'row', label = 'Budget', value = 'budget', property = 'P2769'},
			{type = 'row', label = 'Sponsor', singularlabel = 'Sponsor', plurallabel = 'Sponsors', property = 'P859'},
		}},
		
		{type = 'table', title = 'Palmarès', rows = {
			{
				type = 'row',
				label = 'Nombre de victoires',
				value = 'victoires',
				wikidata = function() -- suppose que P2522 ne contienne que des victoires, et contienne toutes les victoires
					local victories = wikidata.getClaims{entity = item, property = 'P2522'}
					if not victories then
						return nil
					end
					local str = tostring(#victories)
					str = wikidata.addLinkBack(str, item, 'P2522')
					return str
				end
			},
			{type = 'row', label = 'Meilleur coureur UCI', value = 'coureur UCI'},
			{type = 'row', label = 'Classement UCI', value = 'classement UCI'},
		}},
		
		{type = 'navigator',
			previousparameter = "saison précédente",
			previousproperty = "P155",
			nextparameter = "saison suivante",
			nextproperty = "P156",
			separator = true,
			class = 'bordered',
		},
	}
}