Módulo:Infobox/Temporada de equipa ciclista

Documentação do módulo[ver] [editar] [histórico] [purgar]

Descrição editar

Este módulo implementa a predefinição {{Info/Época de equipa ciclista}}

Uso editar

Outra documentação:

local wikidata = require "Módulo:Infobox/Wikidata"
local general = require "Módulo:Infobox/Funções"
local linktopic = '-'

return {
    maincolor = '#FFDF80',
    parts = {
        
        general.title('desporto'),
        general.logo('1.1'),
        {type = 'table', title = 'Generalidades', rows = {
            {type = 'row', label = 'Equipa', value = 'artigo principal', property = 'P5138'},
            {type = 'row', label = 'Código UCI', wikidata = {property = 'P1998', sorttype = 'chronological', showdate = true, textformat = 'minimum', linktopic = linktopic}},
            {type = 'row', label = 'Estatuto', value = 'categoria', property = 'P31'},
            general.country(),
            {type = 'row', label = 'Desporto', value = {'desporto', 'esporte'}, property = 'P641'},
            {
                type = 'row',
                label = 'Elenco',
                value = 'elenco',
                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 .. ' (com 1 estagiário)'
                        else
                            str = str .. ' (com ' .. tostring(#trainees) .. ' estagiários)'
                        end
                    end
                    str = wikidata.addLinkBack(str, item, 'P527')
                    str = str .. wikidata.addTrackingCat('P527')
                    return str
                end
            },
            {type = 'row', label = 'Director geral', value = 'director geral', property = 'P505'},
            {
                type = 'row',
                label = 'Director(es) desportivo(s)',
                singularlabel = 'Director desportivo',
                plurallabel = 'Directores desportivos',
                wikidata = {entity = item, property = 'P286', separator = '<br />', showdate = true, linktopic = linktopic}
            },
            {type = 'row', label = 'Orçamento', value = 'orçamento', property = 'P2769'},
            {type = 'row', label = 'Patrocinador', singularlabel = 'Patrocinador', plurallabel = 'Patrocinadores', property = 'P859'},
        }},
        
        {type = 'table', title = 'Palmarés', rows = {
            {
                type = 'row',
                label = 'Número de vitórias',
                value = 'vitórias',
                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 = 'Melhor corredor UCI', value = 'corredor UCI'},
            {type = 'row', label = 'Classificação UCI', value = 'classificação UCI'},
        }},
        
        {type = 'navbox',
            previousparameter = "época anterior",
            previousproperty = "P155",
            nextparameter = "época seguinte",
            nextproperty = "P156",
            separator = true,
            class = 'bordered',
        },
    }
}