Module:Infobox/Espace public
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 Espace public.
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 localdata = require "Module:Infobox/Localdata"
local wd = require "Module:Wikidata"
local formats = {
--{icône carte, icône entete, couleur titre, couleur sous-titre, couleur texte)
default = {'monument', nil, '#ECE5CA', '#ECE5CA', '#000000', 'defaut'}
}
local function wdformat() --retourne une table contenant la couleur principale de l'infobox et l'icône de titre
local wtypes = wd.stringTable{ -- récupère les Qid des professions
entity = localdata.item,
property = 'P31',
displayformat = 'raw',
excludespecial = true
}
local default = formats.default
wtypes = wd.addVals(wtypes or {}, {property = 'P279'}, 1) -- on utilise en plus les sous-classe
for i, item in pairs(wtypes or {}) do
if formats[item] then
return formats[item]
end
end
return default
end
local function setcharte()
if localdata['charte'] then
charte = localdata['charte']
for i, j in pairs(formats) do
if j[2] == charte then
return j
end
end
end
return wdformat()
end
local displayformat = setcharte()
return
{
maincolor = displayformat[3],
secondcolor = displayformat[4],
thirdcolor = displayformat[5],
parts =
{
general.title(displayformat[2], nil, 'nom local', nil),
general.logo(),
building.mainimage('Article à illustrer Monument'),
{type = 'table', title = 'Présentation', rows = {
{type = 'row', label = 'Noms précédents', value = 'noms précédents'},
{type = 'row', label = 'Surnom(s)', value = 'surnom'},
{type = 'row', label = 'Nom complet', value = 'nom complet'},
{type = 'row', label = 'Culte', value = 'culte'},
{type = 'row', label = 'Type', value = 'type', blockers = {'destination initiale', 'destination finale'}, wikidata = {property = 'P31', excludevalues = {'Q41176', 'Q811979' }}},
{type = 'row', label = 'Civilisation', plurallabel = 'Civilisations', value = 'civilisation', property = 'P2596'},
{type = 'row', label = 'Destination initiale', value = 'destination initiale'},
{type = 'row', label = 'Destination actuelle', value = 'destination actuelle'},
{type = 'row', label = 'Rattachement', value = 'rattachement'},
{type = 'row', label = 'Diocèse', value = 'diocèse', property = 'P708'},
{type = 'row', label = 'Dédicataire', plurallabel = 'Dédicataires', value = 'dédicataire', property = 'P825'},
{type = 'row', label = 'Commémore', value = 'commémore', property = 'P547'},
building.archistyle(),
building.creator(),
building.material(),
building.construction(),
building.opening(),
building.reconstruction(),
building.relocation(),
building.renovation(),
building.demolition(),
{type = 'row', label = 'Commanditaire', value = 'commanditaire', property = 'P88'},
building.dimensions(),
building.religion(),
{type = 'row', label = 'Occupant', plurallabel = 'Occupants', value = 'occupant', wikidata = {property = 'P466', showdate = true}},
building.owner(),
building.usage(),
{type = 'row', label = 'Franchit', property = 'P177'},
{type = 'row', label = 'Précédent franchissement en amont', property = 'P2673'},
{type = 'row', label = 'Prochain franchissement en aval', property = 'P2674'},
{type = 'row', label = 'Permet de faire passer', property = 'P2505'},
building.operator(),
building.protection(),
{type = 'row', label = "[[Office de tourisme|Informations]]", value = "informations", wikidata = {property = 'P2872', numval = '3'}},
building.visitors(),
building.website('site'),
}
},
building.unesco(),
{type = 'table', title = 'Localisation', rows = {
building.adminlocation(),
{type = 'row', label = 'Altitude', value = 'altitude', wikidata = {property = 'P2044', targetunit = 'metre', conjtype = ' ou ', rounding = '0'} },
{type = 'row', label = 'Emplacement', value = 'emplacement', wikidata = {property = 'P706', numval = '1'}},
building.mountainrange(),
building.onshoreof(),
building.watershed(),
building.protectedarea(),
}
},
{type = 'table', title = 'Accès et transport', rows = {
building.transport(),
},
},
{type = 'table', rows = {
building.coordinates(),
}
},
general.geoloc({marker=displayformat[1], default_zoom=13}),
}
}