Module:Infobox/Gratte-ciel
Wikimedia module / De Wikipedia, l'encyclopédie encyclopedia
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 local function wikidatasubtitle() local data = wikidata.formatAndCat({property = 'P1705', conjtype = 'new line', showlang = true}) if (data == nil) or (data == "") then return nil else return '' .. data .. '' end end
return { maincolor = '#eef8ff', parts = {
general.title(nil,nil,'nom local',wikidatasubtitle), general.logo(), building.mainimage('Article à illustrer Gratte-ciel'), {type = 'table', title = 'Histoire', rows = { {type = 'mixed', label = 'Ancien(s) nom(s)', value = 'anciens noms'}, {type = 'mixed', label = 'Nom(s) Alternatif(s)', value = 'noms alternatifs'}, 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(), building.dimensions(), building.recordheld(), {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 = '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({marker = 'city', default_zoom= 13}), } }