Módulo:Infobox/Estrutura alta

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

Descrição

Este módulo implementa a predefinição {{Info/Estrutura alta}}

Uso

Outra documentação:

local building = require "Módulo:Infobox/Funções/Edifício"
local general = require "Módulo:Infobox/Funções"
local wikidata = require "Módulo:Infobox/Wikidata"
local address = require "Módulo:Endereço"
local localdata = require "Módulo:Infobox/Localdata"

local function keydate(event, item)
    return  wikidata.getTheDate{property = 'P793', targetvalue = event, addcat = true, entity = item}
end


return {
    maincolor = '#E6E3CF',
    parts = {

        general.title(),
        general.logo(),
        building.mainimage('!Artigos de arquitetura sem imagem'),
        {type = 'images', imageparameters =  'imagem2',
                uprightparameter = 'upright2',
                -- maintenancecat = '-',
                captionparameter = 'legenda2',
                altparameter = 'altparameter2',
        },
        {type = 'table', title = 'História', rows = {
            {type = 'mixed', label = 'Nome(s) antigo(s)', value = 'nomes antigos'},
            {type = 'mixed', label = 'Nome(s) Alternativo(s)', value = 'nomes alternativos'},
            building.creator(),
            {type = 'mixed', label = 'Desenvolvedor', value = 'desenvolvedor'},
            {type = 'mixed', label = 'Concepção', value = 'concepção'},
            {type = 'mixed', label = 'Gestor', value = 'gestor'},
            {type = 'navbox', separated = true, color = 'default',
            previousparameter = 'precedido',
            previouswikidata = {property = 'P155', excludespecial = true},
            nextparameter = 'ultrapassado', nextwikidata = {property = 'P156', excludespecial = true}},
        {type = 'navbox', separated = true, color = 'default',
            previousparameter = 'ano_maior',
            nextparameter = 'ano_final' },
        building.complex(),
        {type = 'mixed', label = 'Em construção', value = 'em_completagem'},
            building.construction(),
            {type = 'mixed', label = '[[Primeira pedra]]', value = 'primeira_pedra'},
            {type = 'mixed', label = '[[Pedra fundamental]]', value = 'pedra_fundamental'},
            building.opening(),
            {type = 'mixed', label = 'Custo', value = 'custo'},
            {type = 'mixed', label = 'Renovação', value = 'renovação', wikidata = function ( item ) return keydate('Q2144402', item) end},
            {type = 'mixed', label = 'Restruturação', value = 'reestruturação', }, -- 'Q1376796'?
            building.closure(),
            building.demolition(),
            {type = 'mixed', label = 'Status', value = 'status'}, --= em construção / construido
        {type = 'mixed', label = 'Restaurado', value = 'restaurado'},
            building.usage(),
        }},
  
        {type = 'table', title = 'Arquitetura', rows = {
            {type = 'mixed', label = 'Type', value = 'type'}, --property = 'P31',
            building.archistyle(),
            building.material(),
            building.protection(),
            building.dimensions(),
            {type = 'mixed', label = 'Pisos', value = {'pisos', 'andares'}, wikidata =
                {
                    property = 'P1101',
                    showqualifiers = {'P518'}, --= partes relacionadas
                    qualifdisplayformat = function(snak) return wikidata.formatSnak(snak) end, --para evitar ser formatado como o mainsnak
                    displayformat =
                        function(snak)
                        if (snak.snaktype == 'value') then
                            local v = snak.datavalue.value.amount - 1 -- nós não contamos o andar térreo
                            if v == 0 then
                                return 'vazio'
                            else
                                return tostring(v)
                            end
                        end
                        return wikidata.formatSnak(snak)
                    end
                }
            },
            {type = 'mixed', label = 'Caves', value = 'caves', property = 'P1139'},
            {type = 'mixed', label = 'Quartos', value = 'quartos'},
            {type = 'mixed', label = 'Apartamentos', value = 'apartamentos'},
            {type = 'mixed', label = 'Volume', value = 'volume'},
            {type = 'mixed', label = 'Elevador', value = {'elevador', 'contagem_elevador'}, property = 'P1301'},
            }
        },
        {type = 'table', title = 'Administração', rows = {
            {type = 'mixed', label = 'Contratante' , value = 'contratante', property = 'P193'},
            {type = 'mixed', label = 'Ocupante', value = 'ocupante', property = 'P466' },
            building.owner(),
            building.website(),
                {type = 'mixed', label = 'Referências', value = 'referências'}

        }},
  
        {type = 'table', title = 'Localização', rows = {
        {type = 'mixed', label = 'Localização', value = 'localização'},
            building.adminlocation(),
            building.coordenadas(),
        }},
  
        building.geoloc({marker = 'city', default_zoom= 13}),
    }
}