Module:Infobox/Commanderie
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 Commanderie.
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 = {
--{charte, icône carte, icône entete, couleur titre, couleur sous-titre, couleur texte)
Q3024331 = {'templière' , nil, 'chateau', '#E00000', '#E00000', '#FFFFFF', 'defaut'}, -- commanderie templière
Q174981 = {'hospitalière' , nil, 'chateau', '#E00000', '#E00000', '#FFFFFF', 'defaut'}, -- commanderie hospitalière
Q106371459 = {'teutonique' , nil, 'chateau', '#000000', '#000000', '#FFFFFF', 'defaut'}, -- commanderie teutonique
default = {'défaut' , nil, 'chateau', '#E1E1E1', '#E1E1E1', '#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
}
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 formats.default
end
local function setcharte()
local charte = localdata['charte']
if charte then
for i, j in pairs(formats) do
if j[1] == charte then
return j
end
end
end
return wdformat()
end
local function closure() -- évite les doublons, building.demolition() et building.closure() prennent en compte la propriété P576
if not wd.formatStatements{property = 'P576'} or localdata['fermeture'] or localdata['date de fermeture'] then
return building.closure()
end
end
local displayformat = setcharte()
return
{
maincolor = displayformat[4],
secondcolor = displayformat[5],
thirdcolor = displayformat[6],
parts =
{
general.title(displayformat[3], nil, 'nom local', nil),
general.logo(),
building.mainimage('Article à illustrer Commanderie'),
{type = 'table', title = 'Présentation', rows = {
-- {type = 'row', label = 'Type', value = 'type', blockers = {'destination initiale', 'destination finale'}, wikidata = {property = 'P31', defaultlinkquery = 'P279', excludevalues = {'Q41176', 'Q811979' }, showqualifiers = "P580"}},
{type = 'row', label = 'Partie de', value = 'partie de', wikidata = {property = 'P361', defaultlinkquery = 'P279', excludevalues = {}, showqualifiers = "P580"}},
{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 = '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 = 'Paroisse', value = 'paroisse', property = 'P5607'},
{type = 'row', label = 'Dédicataire', plurallabel = 'Dédicataires', value = 'dédicataire', property = 'P825'},
{type = 'row', label = 'Commémore', value = 'commémore', property = 'P547'},
building.orientation(),
building.archistyle(),
building.creator(),
building.material(),
building.cornerstonelaying(),
building.fondation(),
building.opening(),
building.reconstruction(),
building.relocation(),
building.renovation(),
closure(),
building.demolition(),
-- {type = 'row', label = 'Commanditaire', value = 'commanditaire', property = 'P88'},
building.dimensions(),
building.religion(),
{type = 'row', label = 'Ordre religieux', plurallabel = 'Ordres religieux', value = 'ordre religieux', wikidata = {property = 'P611', showdate = true}},
{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(),
{type = "row", label = "Direction des fouilles", value = "fouilles", property = "P4345"},
building.protection(),
{type = 'row', label = '[[Trinomial Smithsonian|Smithsonian]]', value = 'Smithsonian', property = 'P3518'},
{type = 'row', label = "[[Office de tourisme|Informations]]", value = "informations", wikidata = {property = 'P2872', numval = '3'}},
building.visitors(),
{type = 'row', label = 'État de conservation', value = 'état de conservation', property = 'P5816'},
building.website('site'),
}
},
building.unesco(),
{type = 'table', title = 'Localisation', rows = {
building.adminlocation(),
{type = 'row', label = 'Région historique', value = 'région historique', wikidata = {property = 'P6885', numval = '1'}},
{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[2], default_zoom=13}),
}
}