Module:Infobox/Gratte-ciel
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 Gratte-ciel.
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 wikidata = require "Module:Wikidata"
local address = require "Module:Adresse"
local localdata = require "Module: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(),
{type = 'table', title = 'Histoire', rows = {
{type = 'mixed', label = 'Ancien(s) nom(s)', value = 'anciens noms'},
building.creator(),
{type = 'mixed', label = 'Développeur', value = 'développeur'},
{type = 'mixed', label = 'Conception', value = 'conception'},
building.complex(),
building.construction(),
building.opening(),
{type = 'mixed', label = 'Coût', value = 'coût'},
{type = 'mixed', label = 'Rénovation', value = 'rénovation', wikidata = function ( item ) return keydate('Q2144402', item) end},
{type = 'mixed', label = 'Restructuration', value = 'restructuration', }, -- 'Q1376796'?
building.closure(),
building.demolition(),
{type = 'mixed', label = 'Statut', value = 'statut'}, --= en construction / construit
building.usage(),
}},
{type = 'table', title = 'Architecture', rows = {
{type = 'mixed', label = 'Type', value = 'type'}, --property = 'P31',
building.archistyle(),
building.material(),
building.protection(),
{type = 'mixed', label = 'Hauteur', value = 'hauteur', value = function() -- wikidata pour 'hauteur' en général seulement s'il n'y a pas de valeur pour des infos plus précises (hauteur du toôt, de la flèche, etc.)
if wikidata.getClaims{entity = item, property = 'P2048', qualifier = 'P518', qualifiervalue = {'Q131214','Q852590', 'Q83180'} } then
return nil
end
return wikidata.formatStatements{pentity = item, property = 'P2048', targetunit = 'm', showqualifiers = 'P518'}
end
},
{type = 'mixed', label = 'Hauteur de lʼantenne' , value = 'antenne flèche', wikidata = {property = 'P2048', targetunit = 'm', qualifier = 'P518', qualifiervalue = {'Q131214','Q852590'}}},
{type = 'mixed', label = 'Hauteur du toit', value = 'toit', wikidata = {property = 'P2048', targetunit = 'm', qualifier = 'P518', qualifiervalue = 'Q83180'}},
{type = 'mixed', label = 'Hauteur du dernier étage', value = 'dernier étage' },
{type = 'mixed', label = 'Étages', value = 'étages', wikidata =
{
property = 'P1101',
showqualifiers = {'P518'}, --= partie concernée
qualifdisplayformat = function(snak) return wikidata.formatSnak(snak) end, --pour éviter d'être formaté comme le mainsnak
displayformat =
function(snak)
if (snak.snaktype == 'value') then
local v = snak.datavalue.value.amount - 1 -- on ne compte pas le rez-de-chaussée
if v == 0 then
return 'aucun'
else
return tostring(v)
end
end
return wikidata.formatSnak(snak)
end
}
},
{type = 'mixed', label = 'Sous-sols', value = 'sous-sol', property = 'P1139'},
{type = 'mixed', label = 'Chambres', value = 'chambres'},
{type = 'mixed', label = 'Appartements', value = 'appartements'},
{type = 'mixed', label = 'Superficie', value = 'superficie', wikidata = {property = 'P2046', targetunit = 'square metre', conjtype = ' ou ', rounding = '1', numval = '2', displayformat =
function(snak)
return wikidata.formatSnak(snak) --Utilisé pour afficher l'unité
end
}},
{type = 'mixed', label = 'Volume', value = 'volume'},
{type = 'mixed', label = 'Nombre dʼascenseurs', value = 'ascenseurs', property = 'P1301'},
}
},
{type = 'table', title = 'Administration', rows = {
{type = 'mixed', label = 'Contracteur' , value = 'contracteur', property = 'P193'},
{type = 'mixed', label = 'Occupant', value = 'occupant', property = 'P466' },
building.owner(),
building.website()
}},
{type = 'table', title = 'Localisation', rows = {
building.adminlocation(),
building.coordinates(),
}},
building.geoloc({defaultmaps = "interactive"}),
}
}