« Module:Infobox/Monument » : différence entre les versions

De Lagny-sur-Marne Wiki
Aller à la navigation Aller à la recherche
0x010D (discussion | contributions)
mAucun résumé des modifications
0x010D (discussion | contributions)
passe certaines lignes vers Module:Infobox/Fonctions/Bâtiment, ajout d'une ligne "ingénieur"
Ligne 2 : Ligne 2 :
local general = require "Module:Infobox/Fonctions"
local general = require "Module:Infobox/Fonctions"
local wikidata = require "Module:Wikidata"
local wikidata = require "Module:Wikidata"
local logos = require('Module:Logos classement')


local function protectionline(localdata, item)
 
local claims = wikidata.getClaims({item=item, property = 'P1435', exludespecial = true})
 
if not claims then return nil end
for i, j in pairs(claims) do
local val = wikidata.getmainid(j)
local logo = logos[val]
logostr = ''
if logo then
logostr = '[[File:' .. logo .. '|x18px]] '
end
claims[i] = logostr .. wikidata.formatStatement(j)
end
return table.concat(claims, '<br />') .. '[[Catégorie:Page utilisant des données de Wikidata/P1435]]'
end




Ligne 33 : Ligne 20 :
{type = 'mixed', label = 'Surnom(s)', value = 'surnom'},
{type = 'mixed', label = 'Surnom(s)', value = 'surnom'},
{type = 'mixed', label = 'Nom complet', value = 'nom complet'},
{type = 'mixed', label = 'Nom complet', value = 'nom complet'},
{type = 'mixed', label = 'Période ou style', value = 'style', property = 'P149'},
building.archistyle(),
{type = 'mixed', label = 'Type', value = 'type'}, -- property = 'P31' ?
{type = 'mixed', label = 'Type', value = 'type'}, -- property = 'P31' ?
{type = 'mixed', label = function(localdata, item) return localdata['titre architecte'] or 'Architecte' end, value = 'architecte',  
building.architect(),
wikidata = wikidata.formatAndCat{item = item, property = 'P84', showqualifiers = 'P518'}
building.engineer(),
},
{type = 'mixed', label = 'Date de construction', value = 'date de construction',
{type = 'mixed', label = 'Date de construction', value = 'date de construction',
wikidata = wikidata.getTheDate{property = 'P793', targetvalue = 'Q385378', addcat = true}
wikidata = wikidata.getTheDate{property = 'P793', targetvalue = 'Q385378', addcat = true}
Ligne 49 : Ligne 35 :
wikidata = wikidata.getTheDate{property = 'P793', targetvalue = 'Q331483', addcat = true}
wikidata = wikidata.getTheDate{property = 'P793', targetvalue = 'Q331483', addcat = true}
},
},
{type = 'mixed', label = 'Protection', value = 'classement',
building.protection(),
wikidata = protectionline(localdata, item)
},
building.website(),
building.website(),
}
}

Version du 26 décembre 2014 à 22:15

local building = require "Module:Infobox/Fonctions/Bâtiment" local general = require "Module:Infobox/Fonctions" local wikidata = require "Module:Wikidata"



return { maincolor = '#E6E3CF', parts =

   	{

general.title(), general.logo(), building.mainimage(), {type = 'table', title = 'Présentation', rows = { {type = 'mixed', label = 'Nom local', value = 'nom local'}, {type = 'mixed', label = 'Noms précédents', value = 'noms précédents'}, {type = 'mixed', label = 'Surnom(s)', value = 'surnom'}, {type = 'mixed', label = 'Nom complet', value = 'nom complet'}, building.archistyle(), {type = 'mixed', label = 'Type', value = 'type'}, -- property = 'P31' ? building.architect(), building.engineer(), {type = 'mixed', label = 'Date de construction', value = 'date de construction', wikidata = wikidata.getTheDate{property = 'P793', targetvalue = 'Q385378', addcat = true} }, {type = 'mixed', label = 'Commanditaire', value = 'commanditaire', property = 'P88'}, {type = 'mixed', label = 'Dimensions', value = 'hauteur'}, {type = 'mixed', label = 'Destination initiale', value = 'destination initiale'}, {type = 'mixed', label = 'Propriétaire', value = 'propriétaire', property = 'P127'}, {type = 'mixed', label = 'Destination actuelle', value = 'destination actuelle'}, {type = 'mixed', label = 'Date de démolition', value = 'date de démolition', wikidata = wikidata.getTheDate{property = 'P793', targetvalue = 'Q331483', addcat = true} }, building.protection(), building.website(), } }, {type = 'table', title = 'Géographie', rows = { building.country(), {type = 'mixed', label = 'Région', value = 'région'}, {type = 'mixed', label = function(localdata, item) return localdata['intitulé subdivision'] or 'Subdivision administrative' end, value = 'subdivision'}, {type = 'mixed', label = function(localdata, item) return localdata['intitulé subdivision2'] or 'Subdivision administrative' end, value = 'subdivision2'}, {type = 'mixed', label = function(localdata, item) return localdata['intitulé commune'] or 'Commune' end, value = 'commune'}, building.address() } }, {type = 'table', title = 'Accès et transport', rows = { {type = 'mixed', label = 'Stationnement', value = 'stationnement'}, {type = 'mixed', label = 'Gare', value = 'gare'}, {type = 'mixed', label = 'Métro', value = 'métro'}, {type = 'mixed', label = 'Tramway', value = 'bus'}, {type = 'mixed', label = 'Autobus', value = 'gare'}, }, }, {type = 'table', title = 'Localisation', rows = { building.coordinates(), } }, building.geoloc(), } }