Module:Infobox/Stade
Apparence
[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 Stade.
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 building = require "Module:Infobox/Fonctions/B�timent"
local general = require "Module:Infobox/Fonctions"
local wd = require "Module:Wikidata"
local address = require "Module:Adresse"
local localdata = require "Module:Infobox/Localdata"
local formats = {
--{ic�ne carte, ic�ne entete, couleur titre, couleur sous-titre, couleur texte)
Q37025296 = {'pitch', 'athl�tisme', '#D7877B', 'defaut', 'defaut', 'defaut'}, -- stade d'athl�tisme
Q2488656 = {'tennis', 'badminton', '#FFBFC2', 'defaut', 'defaut', 'defaut'}, -- court de badminton
Q595452 = {'baseball', 'baseball', '#408080', 'defaut', '#FFFFFF', 'defaut'}, -- stade de baseball
Q682943 = {'cricket', 'cricket', '#F5F5DC', 'defaut', 'defaut', 'defaut'}, -- terrain de cricket
Q1154710 = {'soccer', 'football', '#99CC99', 'defaut', 'defaut', 'defaut'}, -- stade de football
Q1048525 = {'golf', 'golf', '#99CC99', 'defaut', '#FFFFFF', 'defaut'}, -- terrain de golf
Q1501 = {'swimming', 'defaut', '#318CE7', 'defaut', '#FFFFFF', 'defaut'}, -- piscine
Q130003 = {'skiing', 'defaut', '#DFEDFF', 'defaut', 'defaut', 'defaut'}, -- station de sports d'hiver
Q741118 = {'tennis', 'tennis', '#FFAA77', 'defaut', 'defaut', 'defaut'}, -- court de tennis
Q830528 = {'bicycle-share', 'defaut', '#FFDF80', 'defaut', 'defaut', 'defaut'}, -- v�lodrome
default = {'stadium', nil, '#EFEFEF', 'defaut', 'defaut', 'defaut'}
}
local function wdformat() --retourne une table contenant la couleur principale de l'infobox et l'ic�ne de titre
local wtypes = wd.stringTable{ -- r�cup�re les Qid des professions
entity = localdata.item,
property = 'P31',
displayformat = 'raw',
excludespecial = true
}
local default = formats.default
wtypes = wd.addVals(wtypes or {}, {property = 'P279'}, 1) -- on utilise en plus les sous-classe
for i, item in pairs(wtypes or {}) do
if formats[item] then
return formats[item]
end
end
return default
end
local function setcharte()
local charte = localdata['charte']
if charte then
for i, j in pairs(formats) do
if j[2] == charte then
return j
end
end
end
return wdformat()
end
local displayformat = setcharte()
return
{
maincolor = displayformat[3],
secondcolor = displayformat[4],
thirdcolor = displayformat[5],
parts = {
general.title(),
general.logo(),
building.mainimage('Article � illustrer Stade'),
{type = 'table', title = 'G�n�ralit�s', rows = {
{type = 'mixed', label = 'Noms pr�c�dents', value = 'noms pr�c�dents'},
{type = 'mixed', label = 'Surnom', value = 'surnom'},
{type = 'mixed', label = 'Nom complet', value = 'nom complet'},
{type = 'mixed', label = 'Adresse', value = 'adresse', wikidata = function ( item ) return address.fullAddress(item) end}
}},
{type = 'table', title = "Construction et ouverture", rows = {
building.construction(),
building.opening(),
building.creator(),
building.renovation(),
{type = 'mixed', label = 'Co�t de construction', value = 'cout construction'},
building.closure(),
building.demolition(),
}},
{type = 'table', title = 'Utilisation', rows = {
{type = 'mixed', label = 'Clubs r�sidents', value = 'clubs r�sidents', property = 'P466'},
{type = 'mixed', label = 'Propri�taire', value = 'propri�taire', property = 'P127'},
{type = 'mixed', label = 'Administration', value = 'administration', property = 'P137'},
}},
{type = 'table', title = '�quipement', rows = {
{type = 'mixed', label = 'Surface', value = 'surface', property = 'P765'},
{type = 'mixed', label = 'Capacit�', value = 'capacit�'}, -- , property = 'P1083' mais voir les qualificatifs � utiliser pour �viter les trucs bizarres
{type = 'mixed', label = 'Tribunes', value = 'tribunes'},
{type = 'mixed', label = 'Affluence record', value = 'affluence_record'},
{type = 'mixed', label = 'Dimensions', value = 'dimensions'},
building.protection()
}},
{type = 'table', title = 'Localisation', rows = {
building.protectedarea(),
building.coordinates(),
}},
building.geoloc({marker=displayformat[1], default_zoom=11}),
}
}