Saltar para o conteúdo

Módulo:Infobox/Queda de água

Permanently protected module
Origem: Wikipédia, a enciclopédia livre.
Documentação do módulo[ver] [editar] [histórico] [purgar]

Descrição

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

Uso

Outra documentação:

local building = require "Módulo:Infobox/Funções/Edifício"
local general = require "Módulo:Infobox/Funções"
local l = require "Módulo:Infobox/Funções/Localidade"
local convert = require "Módulo:Conversão"

local function auxMapa()
          local value = function(localdata)
                if localdata['mapa'] then
                        return mw.getCurrentFrame():expandTemplate{title = 'Info/AuxMapa', args = { localdata['latd'], localdata['latm'], localdata['lats'], localdata['latNS'], localdata['longd'], localdata['longm'], localdata['longs'], localdata['longEW'], mapa = localdata['mapa'], mapa_alt = localdata['mapa_alt'], nome = localdata['nome'], legenda1 = localdata['mapa_legenda'], tamanho = localdata['mapa_tamanho']  }}
            else
            return nil
        end
        end
   
    return {type = 'images' , value = value}
end

local function coorDms() -- mostras as coordenadas se estão informadas com coor dms
        local value = function(localdata)
                local sufixo
        if localdata['coord_sufixo'] then
                       sufixo = localdata['coord_sufixo']
            else
            local escala = localdata['coord_escala'] or '10000000'
                    sufixo = 'type:landmark_scale:' .. escala
            end
            if localdata['latd'] then
                       local  coordenadas = mw.getCurrentFrame():expandTemplate{title = 'Coor dms', args = { localdata['latd'], localdata['latm'], localdata['lats'], localdata['latNS'], localdata['longd'], localdata['longm'], localdata['longs'], localdata['longEW'], sufixo }}
                return coordenadas
        else
            building.coordenadas()
            -- return nil para não mostrar coordenadas e coordms
            end
        end
        return {type = 'mixed' , label = '[[Coordenadas geográficas|Coordenadas]]', value = value}
end

local function posicao() -- a posição mais alta do mundo
          local value = function(localdata)
                if not localdata['posição'] then
                       return nil
            elseif not localdata['ref_posição'] then
                        local posicao = localdata['posição'] .. 'ª <small>mais alta do mundo </small>'
                    return posicao
            else
            local posicao = localdata['posição'] .. 'ª <small>mais alta do mundo ' .. localdata['ref_posição'] .. '</small>'
                    return posicao
            end
        end
 
    return {type = 'row', label = '[[Lista de cataratas mais altas da Terra|Posição]]', value = value}

end

return {
    maincolor = '#80B0E0',
    thirdcolor = 'white',
    parts = {

        general.title("mapa",nil,"outro_nome"),
        l.mainimage(),

	{type = 'table', rows = {
                        {type = 'row', label = 'Nome local', value = {'nome local', 'nome na língua original'}, wikidata = {property = 'P1705', showlang = true} },
			{type = 'row', label = 'Nome oficial', plurallabel = 'Nomes oficiais', value = 'nome oficial', property = 'P1448'},
--                  	{type = 'row', label = 'Outros nomes', value = 'outro_nome'},
                    	{type = 'row', label = 'Identificador [[World Waterfall Database|WWD]]', value = 'WWD', wikidata = {property = 'P3326', urlpattern='http://www.worldwaterfalldatabase.com/waterfall/$1'}},
            	}},
	    
		{type = 'table', title = 'Localização', rows = {
                        {type = 'row', label = 'Continente', plurallabel = 'Continentes', value = 'continente', property = 'P30'},
--                  	{type = 'row', label = 'País', plurallabel = 'Países', value = {'países', 'país'}},
                    	building.adminlocation(),
                    	{type = 'row', label = 'Rio', plurallabel = 'Rios', value = 'rio', property = 'P706'},
                    	{type = 'row', label = 'Região', value = 'região'},
                    	{type = 'row', label = function ( localdata ) return localdata ['local_rótulo'] or 'Local' end,  value = 'local'},
                	{type = 'row', label = function ( localdata )
 			return localdata['local1_rótulo'] end, value = 'local1'},
                	{type = 'row', label = function ( localdata )
 			return localdata['local2_rótulo'] end, value = 'local2'},
			{type = 'row', label = 'Localização', value = 'localização'},
                    	{type = 'row', label = 'Localidades mais próximas', value = 'localidades'},
                    	building.island(),
                    	building.mountainrange(),
                    	building.protectedarea(),
			{type = 'row', label = 'Altitude', wikidata = {property = 'P2044', targetunit = 'metro', conjtype = ' ou ', rounding = '0'}},
                    	{type = 'row', label = 'Clima', plurallabel = 'Climas', value = 'clima', property = 'P2564'},
                    	coorDms,
            	}},
            	{type = 'table', title = 'Características', rows = {
                       {type = 'row', label = '[[Altura (medida)|Altura]]', value = function ( localdata )
		       return convert.displayvalue( localdata['altura'], 'metro', {showunit = 'short'} ) end,
		       wikidata = {property = 'P2048', targetunit = 'm', rounding = '0', excludequalifier = {'P518', targetvalue = 'Q46868895'}}},
 			posicao,
			{type = 'row', label = 'Nº de quedas', value = 'nº_quedas'},
                    	{type = 'row', label = 'Queda livre', wikidata = {property = 'P2670', showonlyqualifier = 'P1114', targetvalue = 'Q46867411'}},
                     	{type = 'row', label = 'Queda mais alta', value = function ( localdata )
			return convert.displayvalue( localdata['maior_queda'], 'metro', {showunit = 'short'} ) end }, wikidata = {property = 'P2048', qualifier = {'P518', targetvalue = 'Q46868895'}, targetunit = 'm', rounding = '0'},
			{type = 'row', label = 'Largura', wikidata = {property = 'P2049', targetunit = 'm', rounding = '0'}},
                    	{type = 'row', label = 'Largura no top', value = function ( localdata )
			return convert.displayvalue( localdata['largura_topo'], 'metro', {showunit = 'short'} ) end },
                    	{type = 'row', label = 'Largura no fundo', value = function ( localdata )
			return convert.displayvalue( localdata['largura_fundo'], 'metro', {showunit = 'short'} ) end },
                    	{type = 'row', label = 'Largura média', value = function ( localdata )
			return convert.displayvalue( localdata['largura_média'], 'metro', {showunit = 'short'} ) end },
           	}},
            	{type = 'table', maincolor = '#E1E1E1', title = 'Hidrografia', rows = {
                        {type = 'row', label = 'Tipo', value = 'tipo', wikidata = {property = 'P31', excludevalues = 'Q34038'}},
                    	{type = 'row', label = 'Débito', wikidata = {property = 'P2225', targetunit = 'm3/s', rounding = '0'}},
                    	{type = 'row', label = '[[Vazão|Caudal]] médio', value = function ( localdata )
			return convert.displayvalue( localdata['caudal_méd'], 'm³/s', {showunit = 'short'} ) end , wikidata = {property = 'P2225', targetunit = 'm3/s', rounding = '0'}},
                    	{type = 'row', label = '[[Vazão|Caudal]] máximo', value = function ( localdata )
			return convert.displayvalue( localdata['caudal_máx'], 'm³/s', {showunit = 'short'} ) end },
                    	{type = 'row', label = 'Altitude', value = function ( localdata )
			return convert.displayvalue( localdata['altitude'], 'metro', {showunit = 'short'} ) end,
                	wikidata = {property = 'P2044', targetunit = 'm', conjtype = ' ou ', rounding = '0'}},
                    	{type = 'row', label = 'Curso de água', value = {'curso de água', 'rio'}, property = 'P361'},
                    	{type = 'row', label = 'Desagua', value = 'desagua', property = 'P403'},
                    	building.watershed(),
            	}},
        	{type = 'table', maincolor = '#E1E1E1', title = 'História', rows = {
                        {type = 'row', label = 'Origem do nome', value = 'origem do nome', property = 'P138'},
                	{type = 'row', label = 'Eventos chave', plurallabel = 'Eventos chaves', value = 'eventos chave', property = 'P793'},
                	building.owner(),
                	{type = 'row', label = 'Problema ambiental', plurallabel = 'Problemas ambientais', value = 'problema ambiental', property = 'P3643'},
                	{type = 'row', label = 'Estatuto patrimonial', value = 'estatuto patrimonial', property = 'P1435'},
                	{type = 'row', label = 'Distinction', plurallabel = 'Distinções', value = 'distinções', property = 'P166'},
        	}},
            	{type = 'table', rows = {
                        {type = 'row', label = 'Outros', value = 'campo_vazio'},
                	{type = 'row', label = 'Notas', value = 'notas'},
                	auxMapa,
            	}},
            	building.geoloc({pointtype = 'lago', maptype = 'relief', marker = 'wetland', markercolor = '#778BA5', default_zoom ='13'}),
        }
}