Mòdul:Infobox cycling race report
Documentació del mòdul [ mostra ] [ modifica el codi ] [ mostra l'historial ] [ refresca ]
A continuació es mostra la documentació transclosa de la subpàgina /ús. [salta a la caixa de codi]
local wikidata = require "Module:Utilitaire Wikidata"
local general = require "Module:Infobox/Fonctions"
local outils = require "Module:Outils"
local function race(name, edition)
if not(name or edition) then
return nil
end
return (edition or '') .. ' ' .. (name or ' edició')
end
return
{
maincolor = '#FFDF80',
parts =
{
{
type = 'title',
value = 'nom',
icon = 'entete cyclisme',
},
general.mainimage(),
{type = 'table', title = 'Detalls de la cursa', rows = {
{ type = 'row',
label = 'Cursa',
value = function() return race(localdata['Cursa'], localdata['Edició']) end,
wikidata = function()
local edition = wikidata._formatStatements{property = 'P393', entity = item, displayformat = function(snak) return outils.ordinal(snak.datavalue.value) end}
local name = wikidata.formatAndCat{property = 'P31', entity = item}
if edition then
edition = edition .. wikidata.addtrackingcat('P393')
end
return race(name, edition)
end
},
{type = 'row', label = 'Nom oficial', value = 'nom oficial', property = 'P1448'},
{type = 'row', label = 'Competència', value = 'competència', property = 'P361'},
{type = 'row', label = 'Etapes', value = 'etapes', wikidata =
function() -- suppose que P527 ne contienne que des étapes, et contienne toutes les étapes
local stages = wikidata.getClaims{entity = item, property = 'P527'}
if not stages then
return nil
end
local str = tostring(#stages)
str = wikidata.addLinkback(str, item, 'P527')
str = str .. wikidata.addtrackingcat('P527')
return str
end
},
{type = 'row', label = 'Data', value = 'data', wikidata = function() return wikidata.maindate(item) end},
{type = 'row', label = 'Distància', value = 'distància'}, -- remplissage manuel en attendant la possibilité d'utiliser des unités sur Wikidata
general.country(),
{type = 'row', label = 'País', value = 'països'}, -- paramètre obsolète, ne plus utiliser
{type = 'row', label = 'Sortida', value = 'sortida', property = 'P1427'},
{type = 'row', label = 'Arribada', value = 'arribada', property = 'P1444'},
{type = 'row', label = 'Inscrits', wikidata =
function()
return wikidata.formatAndCat({entity = item, property = 'P1132', qualifier = 'P276', qualifiervalue = 'Q15053706'})
end
},
{type = 'row', label = 'Equips', value = 'nombre_équipes', wikidata =
function() -- suppose que P1923 ne contienne que des équipes, et contienne toutes les équipes
local teams = wikidata.getClaims{entity = item, property = 'P1923'}
if not teams then
return nil
end
local str = tostring(#teams)
str = wikidata.addLinkback(str, item, 'P1923')
str = str .. wikidata.addtrackingcat('P1923')
return str
end
},
{type = 'row', label = 'Finalitzen', wikidata = function() return wikidata.formatAndCat({entity = item, property = 'P1132', qualifier = 'P276', qualifiervalue = 'Q15053716'}) end },
{type = 'row', label = 'Inscrits', value = 'inscrits'}, -- paramètre obsolète, ne plus utiliser
{type = 'row', label = 'Finalitzen', value = 'finalitzen'}, -- paramètre obsolète, ne plus utiliser
},
},
{type = 'table', title = 'Palmarès', rows = {
{type = 'row', label = 'Vencedor', value = 'vencedor', property = 'P1346'}, -- solution provisoire, il faudra aller chercher le premier du classement général lorsque la propriété aura été créée
{type = 'row', label = ' ', value = 'tempsvencedor'}, -- remplissage manuel en attendant la possibilité d'utiliser des unités sur Wikidata
{type = 'row', label = 'Segon', value = 'segon'}, -- même commentaire que pour le champ du vainqueur
{type = 'row', label = 'Tercer', value = 'tercer'}, -- même commentaire que pour le champ du vainqueur
{type = 'row', label = 'Punts', value = 'millorpunts'}, -- solution provisoire dans l'attente de la création d'une nouvelle propriété
{type = 'row', label = 'Muntanya', value = 'millorescalador'}, -- solution provisoire dans l'attente de la création d'une nouvelle propriété
{type = 'row', label = 'Meilleur sprinteur', value = 'meilleur_sprinteur'}, -- solution provisoire dans l'attente de la création d'une nouvelle propriété
{type = 'row', label = 'Joves', value = 'millorjoves'}, -- solution provisoire dans l'attente de la création d'une nouvelle propriété
{type = 'row', label = 'Combativitat', value = 'millorcombativitat'}, -- solution provisoire dans l'attente de la création d'une nouvelle propriété
{type = 'row', label = 'Combinada', value = 'millorcombinada'}, -- solution provisoire dans l'attente de la création d'une nouvelle propriété
{type = 'row', label = 'Equip', value = 'millorequip'}, -- solution provisoire dans l'attente de la création d'une nouvelle propriété
},
},
{type = 'images',
imageparameters = {'mapa'},
property = 'P242',
numval = 1
},
{type = 'navbox',
previousparameter = "any anterior",
previousproperty = "P155",
nextparameter = "any posterior",
nextproperty = "P156",
class = 'bordered',
},
}
}