Module:Infobox/Télescope
[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 Télescope.
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 item = require "Module:Infobox/Localdata".item
return {
maincolor = '#E6E3CF',
parts = {
general.title(),
general.logo(),
building.mainimage(),
{type = 'table', title = 'Présentation', rows = {
{
type = 'row',
label = 'Type',
value = 'type',
wikidata = {
property = 'P31',
}
},
{type = 'row', label = 'Comprend', value = 'comprend', wikidata = {property = 'P527' , conjtype = 'new line'} },
{type = 'row', label = 'Organisation', value = 'organisation', property = 'P1268'},
{
type = 'row',
label = 'Observatoire',
value = 'observatoire',
wikidata = {
property = 'P361', -- affiche la valeur de P361 si c'est un instance d'observatoire
condition = function(claim)
local v = wd.getMainId(claim)
return wd.isInstance('Q62832', v, 2)
end,
}
},
building.operator(),
building.construction(),
building.opening(),
{type= 'row', label = 'Mise en service', value = 'ouverture', property = 'P729'},
building.renovation(),
building.closure(),
building.demolition(),
{type = 'row', label = 'Remplace', value = 'remplace', property = 'P1365'},
{type = 'row', label = 'Remplacé par', value = 'remplace', property = 'P1366' },
building.website(),
}
},
{type = 'table', title = 'Données techniques', rows = {
{
type = 'row',
label = 'Diamètre',
value = 'diamètre',
wikidata = {
property = 'P2386',
targetunit = 'm',
excludequalifier = {'P518'},
excludequalifiervalue = {'Q1395645', 'Q29531156'} -- exclut les miroirs secondaires et tertaires
}
},
{
type = 'row',
label = 'Diamètre secondaire',
value = 'diamètre secondaire',
wikidata = {
property = 'P2386',
targetunit = 'm',
qualifier = 'P518',
qualifiervalue = {'Q1395645'}
}
},
{
type = 'row',
label = 'Diamètre tertiaire',
value = 'diamètre tertiaire',
wikidata = {
property = 'P2386',
qualifier = 'P518',
targetunit = 'm',
qualifiervalue = {'Q29531156'}
}
},
{
type = 'row',
label = '[[Pouvoir de résolution|Résolution]]',
value = 'résolution',
wikidata = {
property = 'P3439',
}
},
{
type = 'row',
label = '[[Longueur focale]]',
value = 'longueur focale',
wikidata = {
property = 'P2151',
}
},
{
type = 'row',
label = '[[Longueur d\'onde]]',
value = 'longueur d\'onde',
wikidata = function()
local minlength = wd.formatAndCat{entity = item, property = 'P3738', showunit = "-", linkback = '-'}
local maxlength = wd.formatAndCat{entity = item, property = 'P3737'}
if (minlength and maxlength) then
return minlength .. ' - ' .. maxlength
elseif maxlength then
return "jusqu'à " .. maxlength
elseif minlength then
return "à partir de ".. minlength -- à intégrer à module:Linguistique ?
end
return wd.formatAndCat{entity = item, property = 'P2808', targetunit = 'nm'}
end
},
{
type = 'row',
label = '[[Fréquence]]',
value = 'fréquence',
wikidata = {
property = 'P2144',
}
},
{
type = 'row',
label = 'Monture',
value = 'monture',
wikidata = {
property = 'P2670',
showonlyqualifier = {'P31'},
targetvalue = 'Q1205231',
labelformat = function(id) -- évide de répéter "Monture"
local label = mw.wikibase.label(id)
return mw.ustring.gsub(label, "monture ", "")
end
}
},
},
},
{type = 'table', title = 'Géographie', rows = {
{type = 'row', label = 'Temps d\'observation disponible', value = 'temps d\'observation disponible', wikidata = {property = 'P3891', showunit = 'long'}},
building.elevation(),
{type = 'row', label = 'Lieu', value = 'lieu', property = 'P706'}, -- position géographique, utile dans les endroits isolés, mais à mieux intéger linguistiquement avec "adminlocation"
building.historicalregion(),
building.mountainrange(),
building.adminlocation({"lieu"}), --localisation Wikidata, désactivée si "lieu" est rempli localement
building.protectedarea(),
building.coordinates(),
}
},
building.geoloc({marker='star',default_zoom = 10}),
}
}