Module:Infobox/Catch (spectacles)
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 Catch (spectacles).
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'
local wikidata = require 'Module:Wikidata'
local function brands()
local statements = wikidata.getClaims{
entity = localdata.item,
property = 'P199',
sorttype = 'chronological'
}
if not statements then
return nil
end
local title
if #statements == 1 then
title = 'Division'
else
title = 'Divisions'
end
local values = {}
for i, statement in pairs(statements) do
local value = wikidata.formatStatement(statement)
if not values[value] then
values[value] = {}
end
local before = wikidata.formatStatement(statement, {showonlyqualifier = 'P580'})
if before then
local text = 'depuis ' .. before
local after = wikidata.formatStatement(statement, {showonlyqualifier = 'P582'})
if after then
if before == after then
text = before
else
text = before .. '-' .. after
end
end
table.insert(values[value], text)
end
end
local text = ''
for i, value in pairs(values) do
text = text .. i .. ' <small>('
for j, date in pairs(value) do
text = text .. date .. '; '
end
text = mw.text.trim(text, '; ') .. ')</small><br>'
end
text = mw.text.trim(text, '<br>') .. '>'
text = wikidata.addTrackingCat('P199') .. wikidata.addLinkBack(text, localdata.item, 'P199')
return {type = 'row', label = title, value = function() return text end}
end
local function website()
wd = {
property = 'P856',
conjtype = 'new line',
numval = 1,
displayformat =
function(snak)
return require 'Module:Weblink'.malelink(getId(snak), wikidata.getLabel(localdata.item))
end
}
return {type = 'row', label = 'Site web', wikidata = wd}
end
return {
maincolor = '#dfedff',
parts = {
general.title('catch'),
{type = 'images', imageparameters = 'image', captionparameter = 'légende'},
{type = 'table', rows = {
{type = 'row', label = 'Surnom', plurallabel = 'Surnoms', wikidata = {property = 'P1449', conjtype = 'new line'}}
}},
{type = 'table', title='Informations', rows = {
{type = 'row', label = 'Créé par', value = 'créer_par', wikidata = {property = 'P170', conjtype = 'new line'}},
{type = 'row', label = 'Date de création', wikidata = {property = 'P571', numval = 1}},
{type = 'row', label = '[[Fédération de catch|Fédération(s)]]', singularlabel = '[[Fédération de catch|Fédération]]', plurallabel = '[[Fédération de catch|Fédérations]]', wikidata = {property = 'P664', conjtype = 'new line'}},
brands(),
{type = 'row', label = '[[Type de match au catch|Match principal]]', value = 'match_principal', wikidata = {property = 'P793', numval = 1}},
website()
}}
}
}