Module:Infobox/Tournoi de golf
Cette page définit un module d'infobox. Pour les conseils sur l'usage de ce module, voyez Modèle:Infobox Tournoi de golf.
La documentation de ce module est générée par le modèle {{Documentation module}}.
Elle est incluse depuis la page Modèle:Documentation module d'infobox. Veuillez placer les catégories sur cette page-là.
Les éditeurs peuvent travailler dans le bac à sable (créer).
Voir les statistiques d'appel depuis le wikicode sur l'outil wstat et les appels depuis d'autres modules.
local general = require 'Module:Infobox/Fonctions'
local localdata = require 'Module:Infobox/Localdata'
return {
maincolor = '#99CC99',
parts = {
{
type = 'title',
icon = 'golf',
value = function() return localdata['nom du tournoi'] or mw.title.getCurrentTitle() end,
},
general.mainimage('Article à illustrer Tournoi de golf'),
{
type = 'table',
title = 'Informations sur le tournoi',
rows = {
{
type = 'mixed',
label = 'Lieu',
value = 'lieu',
wikidata = {
property = 'P276',
rank = valid,
},
},
{ type = 'mixed',
label = 'Fondation',
value = 'fondation',
wikidata = {
property = 'P571',
rank = valid,
},
},
{ type = 'mixed',
label = 'Défunt',
value = 'défunt',
wikidata = {
property = { 'P576', 'P582' },
rank = valid,
},
},
{ type = 'mixed', label = 'Parcours', value = 'parcours' },
{
type = 'mixed',
label = '[[Par (golf)|Par]]',
value = 'par'
},
{ type = 'mixed', label = 'Longueur', value = 'longueur' },
{ type = 'mixed', label = 'Tour', value = 'tour' },
{ type = 'mixed', label = 'Format', value = 'format' },
{
type = 'mixed',
label = 'Dotation',
value = 'bourse',
wikidata = {
property = 'P2121',
rank = valid
}
},
{
type = 'mixed',
label = 'Mois disputé',
value = 'mois disputé',
wikidata = {
property = 'P2922',
rank = valid,
}
},
}
},
{
type = 'table',
title = 'Record de pointage du tournoi',
rows = {
{ type = 'mixed', label = 'Officialisé', value = 'officialisé' },
{ type = 'mixed', label = 'Au-par', value = 'au-par' },
}
},
{ type = 'text',
value = function()
local champion = localdata['champion actuel']
local titre = 'Champion actuel'
if champion == nil or champion == '' then
champion = localdata['championne actuelle']
titre = 'Championne actuelle'
end
if champion ~= nil and champion ~= '' then
return '<div style="padding:4px; text-align:center; font-weight: bold; background-color:#99CC99; color:#000000">'
.. titre ..
'</div><div style="text-align: center; padding-top: 4px">'
.. champion ..
'</div>'
end
end
},
}
}