Module:Tableau MH
De Wikipedia, l'encyclopédie encyclopedia
local Monument = { }
local Outils = require( 'Module:Outils' ) local TableBuilder = require( 'Module:TableBuilder' ) local Coordinates = require( 'Module:Coordinates' ) local Delink = require( 'Module:Delink' ) local lienWeb -- = require( 'Module:Biblio/Lien web' ).lienWeb ne sera chargé que si necessaire local yesno -- = require( 'Module:Yesno' ) ne sera chargé que si necessaire
--
-- Fonctions prédéfinies pour les lignes fréquentes
--
local function colonneAvecTri( valeur, tri ) local sort = if type(tri) == 'string' and tri ~= then return '\n|data-sort-value="' .. tri .. '"|' .. ( valeur or ) else return '\n|' .. ( valeur or ) end
end
-- Ajoute une ligne avec la class with/without_image local function ligneAvecClasse( image ) if type(image) == 'string' and image ~= then
return '|- class="with_image" '
else
return '|- class="without_image" '
end
end
-- validArg : fonction renvoyant le contenu du premier paramètre non vide,
-- nom : nom du paramètre du nom principal du monument,
-- region : code ISO 3166-1 du pays.
local function colonneCoord( validArg, region, nom, ... )
local latitude = validArg( 'latitude', 'lat' )
local longitude = validArg( 'longitude', 'lon' )
if latitude and longitude then
local globedata = 'type:landmark'
if type( region ) == 'string' then
globedata = 'type:landmark_region:' .. region
end
local argsCoord = {
latitude = latitude,
longitude = longitude,
extraparams = globedata,
format = 'dms long',
name = Delink.delink{ validArg( 'titre coordonnées', 'monument', nom, ... ) }
}
return '\n|style="text-align:center; width:9em;"|' .. Coordinates._coord( argsCoord )
else
return '\n|style="text-align:center;"|à géolocaliser'
end
end
-- prépare une cellule avec une image ou avec un lien vers commons pour téléverser une image (avec quelque champs préremplis) -- va chercher ses données soit directement dans args, soit à défaut dans args[1], les paramètres du modèle. -- la taille de l'image est soit args['taille image'], soit upright = 0.55 local function colonneImage( args ) -- metatable qui va chercher dans la table en argument 1 (paramètre du modèle) si la valeur n'est pas directement dans args. local function getArg( t, Key ) if type( t[1] ) == 'table' then return t[1][ Key ] end end setmetatable( args, { __index = getArg } )
-- clarificatiion des paramètres local image = args.image local taille = args['taille image'] local portrait = args.portrait or args.upright local wikilove = args.wikilove -- paramètre à modifier dans le modèle d'appel au module local nom = Delink.delink{ args[ 'titre coordonnée' ] or args.nom or args.monument or } local noupload = args.noupload and args.noupload ~= or image == "Bâtiment droit d'auteur.svg" or image == "bâtiment droit d'auteur.svg" local style = args.style or
-- fonction renvoyant l'url de l'upload wizard sur commons, avec quelque champs pré-remplis local _url local function uploadUrl() local identifier = args.id if _url then return _url end if args.notice then identifier = args.notice end if args.palissy then identifier = args.palissy end local category = Delink.delink{ args['catégorie commons'] or args.categorie2 } local encoded_category = string.gsub( category, '[<|>]', ) local query = { id = identifier, descriptionlang = 'fr', description = nom, lat = args.latitude or args.lat, lon = args.longitude or args.lon, categories = encoded_category, } if Outils.trim( wikilove ) then query.campaign = wikilove end _url = tostring( mw.uri.fullUrl( 'commons:Special:UploadWizard', query ) ) return _url end
-- préparation d'un lien d'upload en cas de campagne wikilove local lienWikilove = if type( wikilove ) == 'string' and wikilove ~= and wikilove ~= 'non' and not noupload then
lienWikilove = '
'
end
if type( image ) == 'string' and image ~= then -- Il y a une image ; on prépare la taille d'affichage. en pixel si taille image est défini, en upright sinon. local size if tonumber( taille ) and tonumber( taille ) > 10 then -- taille en pixels size = '|' .. taille .. 'x' .. taille ..'px' else -- taille en upright avec paramètre portrait local yesno = require( 'Module:Yesno' ) if yesno( portrait ) then if tonumber( portrait ) and portrait < 1 then size = '|frameless|upright=' .. portrait else size = '|frameless|upright=0.37' end else size = '|frameless|upright=0.55' end end
if style ~= then style = 'style=' .. style .. '|' end
return '\n|' .. style .. '
' .. lienWikilove
else -- il n'y a pas d'image. retourne 'image manquante' avec un bouton pour uploader l'image (saus si noupload) if (not noupload) or (noupload == ) then return '\n|style="text-align:center; font-size:0.9em; font-weight:bold;' .. (style or ) .. '"|\nImage manquante' .. '\n\n[' .. uploadUrl() .. ' Téléverser]' else return '\n|' end end end
-- -- Global --
Monument.ligneMonument = function ( frame ) local args = Outils.extractArgs( frame ) local validArg = function ( ... ) return Outils.validTextArg( args, ... ) end local wiki = TableBuilder.new( '|-' )
-- ancre if validArg( 'ancre' ) then wiki.minsert( 'id="', mw.uri.anchorEncode( args.ancre), '"' ) end
-- monument wiki.minsert( colonneAvecTri( args.monument, args.tri ) )
-- pays, subdivision, subdivision2, commune, adresse (colonnes facultatives) local pays = args.pays or args['état'] if pays then wiki.minsert( '\n|', pays ) end local subdivision = args.subdivision or args.province or args['département'] if subdivision then wiki.minsert( colonneAvecTri( subdivision, args['tri subdivision'] or args['tri province'] or args['tri département'] ) ) end local subdivision2 = args.subdivision2 or args['municipalité'] if subdivision2 then wiki.minsert( colonneAvecTri( subdivision2, args['tri subdivision2'] or args['tri municipalité'] ) ) end local commune = args.commune or args.ville if commune then wiki.minsert( colonneAvecTri( commune, validArg('tri commune', 'tri ville' ) ) ) end if args.adresse then wiki.minsert( colonneAvecTri( args.adresse, args['tri adresse'] ) ) end
-- coordonnées wiki.minsert( colonneCoord( validArg, args['code pays'] or ) )
-- loi if args.loi then wiki.minsert( '\n|', args.loi ) end
-- notice local notice = args.notice local lienNotice = args['lien notice'] if notice or lienNotice then -- spécifique pour la France, notice de la base Mérimée ou Palissy if not lienNotice and ( validArg('base') or string.match( notice, '^[PIE]A%d%d%d%d%d%d%d%d$' ) or string.match( notice, '^[PIE]A%d%d%d%d%d%d%d%d%s*/' ) ) then lienNotice = Monument.noticeFrance( notice, args.base ) end
wiki.minsert( '\n|', lienNotice or notice ) end
-- protection, date if args.protection then wiki.minsert( '\n|', args.protection ) end if args.date then wiki.minsert( '\n|', args.date ) end
-- image wiki.minsert( colonneImage{ args, ['taille image'] = args['taille image'] or 120, id=args.notice, categorie2 = commune } )
return wiki.concat() end
--
-- Algérie
--
Monument.ligneAlgerie = function ( frame )
local args = Outils.extractArgs( frame )
local validArg = function ( ... ) return Outils.validTextArg( args, ... ) end
local wiki = TableBuilder.new( '|-' )
-- id wiki.minsert( '\n|', args.id )
-- monument wiki.minsert( colonneAvecTri( args.monument, args.tri ) )
-- description, ville, adresse wiki.minsert( colonneAvecTri(args.Description or args.description, args['tri description'] ) ) wiki.minsert( '\n|', args.Ville or args.ville ) wiki.minsert( '\n|', args.adresse )
-- coordonées wiki.minsert( colonneCoord( validArg, 'dz' ) )
-- image wiki.minsert( colonneImage{ args, ['taille image'] = 150; categorie2 = validArg( 'commonscat', 'Ville', 'ville' ), style = 'border-right:none;', wikilove = 0 } )
-- commonscat & upload wiki.minsert( '\n|style="border-left:none; width:16px; text-align:center; vertical-align:top;" class="noprint"|' ) if validArg( 'commonscat' ) then wiki.minsert( '" ) end local query = { id = args.id, descriptionlang = 'fr', description = args.monument or , lat = args.latitude, lon = args.longitude, categories = args.commonscat or args.Ville or args.ville, campaign = args.wikilove, } local url = tostring( mw.uri.fullUrl( 'commons:Special:UploadWizard', query ) ) wiki.minsert( '' )
return wiki.concat()
end
--
-- Andorre
--
Monument.ligneAndorre = function ( frame )
local args = Outils.extractArgs( frame )
local validArg = function ( ... ) return Outils.validTextArg( args, ... ) end
args['code pays'] = 'ad'
-- construction, utilise pays puisque inutile
local debut = args['début constr'] or args['début construction']
if debut then
args.pays = debut
local fin = validArg( 'fin const', 'fin construction' )
if fin then
args.pays = args.pays .. '
' .. fin
end
end
-- implicite : subdivision1 et 2, commune
-- fiches
local function notice( fiche )
fiche = Outils.trim( fiche )
if fiche then
return '[http://www.cultura.ad/banc/article.php?id=' .. fiche ..
' no ' .. fiche ..
']'
else return
end
end
if args.fiche then
local fiche = mw.text.split(args.fiche or , '/')
args['lien notice'] = notice( fiche[1] )
if fiche[2] then
args['lien notice'] = args['lien notice'] .. '
' .. notice( fiche[2] )
end
end
return Monument.ligneMonument( args ) end
-- -- Argentine -- Monument.ligneArgentine = function ( frame ) local args = Outils.extractArgs( frame ) local validArg = function ( ... ) return Outils.validTextArg( args, ... ) end
args['code pays'] = 'ar' -- implicite : province, commune args.adresse = args.adresse or args.loi = args.loi or args.notice = args.notice or args['lien notice'] = '.. args.notice .. ' ' .. args.notice .. '' args.protection = args['catégorie'] or args.date = args.date or
return Monument.ligneMonument( args ) end
--
-- Belgique
--
Monument.ligneBelgiqueFla = function ( frame )
local args = Outils.extractArgs( frame )
local validArg = function ( ... ) return Outils.validTextArg( args, ... ) end
local wiki = TableBuilder.new( '|-' )
-- monument local monument = validArg( 'monument', 'nom_objet', 'nom objet' ) wiki.minsert( colonneAvecTri( monument, args.tri ) ) -- suppression du (nl) pour les utilisation ultérieures args.monument = string.gsub( monument or , '%(nl%) *', , 1 )
-- classement wiki.minsert( '\n|') if validArg( 'classement' ) then wiki.minsert( '', args.classement ) end
-- construction, architecte wiki.minsert( '\n|', args['année_construction'] or args['année construction'], ' ', args.architecte )
-- section communale, adresse wiki.minsert( '\n|', args['section_communale'] or args['section communale'] ) wiki.minsert( colonneAvecTri(args.adresse, args['tri adresse'] ) )
-- coordonées wiki.minsert( colonneCoord( validArg, 'BE' ) )
-- id wiki.minsert( '\n|args.id, ' ', args.id, '' )
-- image wiki.minsert( colonneImage{ args, ['taille image'] = 120, categorie2 = validArg( 'section_communale', 'section communale' ), } )
return wiki.concat() end
Monument.ligneBelgiqueWal = function ( frame ) local args = Outils.extractArgs( frame ) local validArg = function ( ... ) return Outils.validTextArg( args, ... ) end local wiki = TableBuilder.new( '|-' )
-- monument args.monument = validArg( 'monument','nom_objet', 'nom objet' ) wiki.minsert( colonneAvecTri( args.monument, args.tri ) )
-- construction, architecte, adresse, section communale wiki.minsert( '\n|', args['année_construction'] or args['année construction'] ) wiki.minsert( '\n|', args.architecte ) wiki.minsert( colonneAvecTri(args.adresse, args['tri adresse'] ) ) wiki.minsert( '\n|', args['section_communale'] or args['section communale'] )
-- coordonées wiki.minsert( colonneCoord( validArg, 'BE' ) )
-- id local id = ( validArg( 'id_commune', 'id commune') or ) .. '-' .. ( args['CLT/PEX'] or ) .. '-' .. ( validArg('id_objet', 'id objet') or ) local thema if args['CLT/PEX'] == 'PEX' then thema = '&thema=pat_exc' else thema = '&thema=bc_pat' end wiki.minsert( '\n|id, thema, ' ', id, '' )
-- image wiki.minsert( colonneImage{ args, ['taille image'] = 120, categorie2 = validArg( 'commune', 'section_communale', 'section communale' ), } )
return wiki.concat() end
--
-- Cameroun
--
Monument.ligneCameroun = function ( frame )
local args = Outils.extractArgs( frame )
local validArg = function ( ... ) return Outils.validTextArg( args, ... ) end
local wiki = TableBuilder.new( '|-' )
-- nom wiki.minsert( '\n|', validArg( 'nom', 'monument' ) )
-- description, id, region, ville wiki.minsert( '\n|', args.description ) wiki.minsert( '\n|', args.id ) wiki.minsert( '\n|', validArg( 'region', 'région' ) ) wiki.minsert( '\n|', args.ville )
-- coordonées wiki.minsert( colonneCoord( validArg, 'CM', 'nom' ) )
-- image wiki.minsert( colonneImage{ args, nom = validArg( 'titre coordonnées', 'nom', 'monument' ), categorie2 = args.ville } )
return wiki.concat() end
--
-- Canada
--
Monument.ligneCanadaLPC = function ( frame )
local args = Outils.extractArgs( frame )
local validArg = function ( ... ) return Outils.validTextArg( args, ... ) end
local wiki = TableBuilder.new( '|-' )
-- id if validArg( 'id' ) then wiki.minsert( 'id="', args.id, '"' ) end
-- niveau wiki.minsert( '\n|style="text-align:center;"|', args.niveau )
-- lieu wiki.minsert( colonneAvecTri( args.lieu, args.tri ) )
-- image wiki.minsert( colonneImage{ args, ['taille image'] = 150, nom = ( validArg( 'titre coordonnées', 'lieu') or ) .. (args['municipalité'] or '(Canada).' ) .. , id = args['numéro'], categorie2 = args['municipalité'], } )
-- municipalité (colonne facultative) if validArg( 'municipalité' ) then wiki.minsert( colonneAvecTri( args['municipalité'], args['tri municipalité'] ) ) end
-- adresse wiki.minsert( colonneAvecTri( args.adresse, args['tri adresse'] ) )
-- coordonées wiki.minsert( colonneCoord( validArg, 'CA', 'lieu' ) )
-- numéro wiki.minsert( '\n|class="plainlinks" style="text-align:center;"|[http://www.historicplaces.ca/fr/rep-reg/place-lieu.aspx?id=' , args['numéro'], ' ', args['numéro'], ']' )
-- construction, protection, reconnaissance, notes wiki.minsert( '\n|style="text-align:center;"|', args.construction ) wiki.minsert( '\n|style="text-align:center;"|', args.protection ) wiki.minsert( '\n|style="text-align:center;"|', args.reconnaissance ) wiki.minsert( '\n|style="text-align:center;"|', args.notes )
return wiki.concat() end
Monument.ligneCanadaRPCQ = function ( frame ) local args = Outils.extractArgs( frame ) local validArg = function ( ... ) return Outils.validTextArg( args, ... ) end local wiki = TableBuilder.new( '|-' )
-- id if validArg( 'id' ) then wiki.minsert( 'id="', args.id, '"' ) end
-- bien wiki.minsert( colonneAvecTri( args.bien, args.tri ) )
-- image wiki.minsert( colonneImage{ args, ['taille image'] = 150, nom = ( validArg( 'titre coordonnées', 'lieu') or ) .. (args['municipalité'] or '(Canada).' ) .. , id = args['numéro'], categorie2 = args['municipalité'], } )
-- municipalité (colonne facultative) if validArg( 'municipalité' ) then wiki.minsert( colonneAvecTri( args['municipalité'], args['tri municipalité'] ) ) end
-- adresse wiki.minsert( colonneAvecTri( args.adresse, args['tri adresse'] ) )
-- coordonées wiki.minsert( colonneCoord( validArg, 'CA', 'bien' ) )
-- numéro wiki.minsert( '\n|class="plainlinks" style="text-align:center;"|[http://www.patrimoine-culturel.gouv.qc.ca/rpcq/detail.do?methode=consulter&id=' , args['numéro'], '&type=bien ', args['numéro'], ']' )
-- construction, catégorie, reconnaissance, notes wiki.minsert( '\n|style="text-align:center;"|', args.construction ) wiki.minsert( '\n|', args['catégorie'] ) wiki.minsert( '\n|style="text-align:center;"|', args.reconnaissance ) wiki.minsert( '\n|style="text-align:center;"|', args.notes )
return wiki.concat() end
--
-- Colombie
--
Monument.ligneColombie = function ( frame )
local args = Outils.extractArgs( frame )
args['code pays'] = 'co' -- implicite : Département, municipalité args.adresse = args.adresse or args.date = args.date or
local validArg = function ( ... ) return Outils.validTextArg( args, ... ) end local wiki = TableBuilder.new( '|-' )
-- ancre if validArg( 'ancre' ) then wiki.minsert( 'id="', mw.uri.anchorEncode( args.ancre), '"' ) end
-- code national (!= code pays) code = args.code or wiki.minsert( '\n|', args.code )
-- monument wiki.minsert( colonneAvecTri( args.monument, args.tri ) )
-- pays, subdivision, subdivision2, commune, adresse (colonnes facultatives) local pays = args.pays or args['état'] if pays then wiki.minsert( '\n|', pays ) end local subdivision = args.subdivision or args.province or args['département'] if subdivision then wiki.minsert( colonneAvecTri( subdivision, args['tri subdivision'] or args['tri province'] or args['tri département'] ) ) end local subdivision2 = args.subdivision2 or args['municipalité'] if subdivision2 then wiki.minsert( colonneAvecTri( subdivision2, args['tri subdivision2'] or args['tri municipalité'] ) ) end local commune = args.commune or args.ville if commune then wiki.minsert( colonneAvecTri( commune, validArg('tri commune', 'tri ville' ) ) ) end if args.adresse then wiki.minsert( colonneAvecTri( args.adresse, args['tri adresse'] ) ) end
-- coordonnées wiki.minsert( colonneCoord( validArg, args['code pays'] or ) )
-- loi if args.loi then wiki.minsert( '\n|', args.loi ) end
-- notice local notice = args.notice local lienNotice = args['lien notice'] if notice or lienNotice then -- spécifique pour la France, notice de la base Mérimée ou Palissy if not lienNotice and ( validArg('base') or string.match( notice, '^[PIE]A%d%d%d%d%d%d%d%d$' ) or string.match( notice, '^[PIE]A%d%d%d%d%d%d%d%d%s*/' ) ) then lienNotice = Monument.noticeFrance( notice, args.base ) end
wiki.minsert( '\n|', lienNotice or notice ) end
-- protection, date if args.protection then wiki.minsert( '\n|', args.protection ) end if args.date then wiki.minsert( '\n|', args.date ) end
-- image wiki.minsert( colonneImage{ args, ['taille image'] = args['taille image'] or 120, id=args.notice, categorie2 = commune } )
return wiki.concat() end
-- -- Espagne -- Monument.ligneEspagne = function ( frame ) local args = Outils.extractArgs( frame ) local validArg = function ( ... ) return Outils.validTextArg( args, ... ) end local wiki = TableBuilder.new( '|-' )
-- ancre if validArg( 'ancre' ) then wiki.minsert( 'id="', mw.uri.anchorEncode( args.ancre), '"' ) end
-- monument wiki.minsert( colonneAvecTri( validArg( 'monument', 'nombre', 'nom' ), args.tri ) )
-- commune, adresse
local commune = validArg( 'commune', 'municipio', 'municipi' )
local adresse = validArg( 'adresse', 'lugar', 'lloc' )
if commune and adresse then
commune = commune .. '
' .. adresse
end
wiki.minsert( colonneAvecTri( commune or adresse, args['tri commune'] ) )
-- coordonées args['titre coordonnée'] = validArg( 'titre coordonnée', 'nombrecoor', 'nomcoor' ) wiki.minsert( colonneCoord( validArg, 'es' ) )
-- bic et son lien, protection
local protection = validArg( 'protection', 'type de bic', 'tipobic', 'prot' )
local url
local typeUrl, idurl = (args.idurl or ):match('^(.-)/(.*)$')
typeUrl = typeUrl and typeUrl:lower()
idurl = idurl and mw.uri.encode( idurl )
if typeUrl == 'spica' then
url = 'http://www.sipca.es/censo/' .. idurl .. '/.html'
elseif typeUrl == 'gencat' then
url = 'http://cultura.gencat.cat/invarquit/Fitxa.asp?idregistre=' .. idurl
elseif typeUrl == 'gva' then
if protection and protection:lower() == 'brl' then
url = 'http://www.cult.gva.es/dgpa/brl/Detalles_brl.asp%7Cbics/Detalles_bics.asp?IdInmueble=' .. idurl
else
url = 'http://www.cult.gva.es/dgpa/?IdInmueble=' .. idurl
end
end
if url and args.bic then
wiki.minsert( '\n|', '[' .. url .. ' ' .. args.bic .. ']' )
else
wiki.minsert( '\n|', args.bic )
end
local type = validArg( 'type', 'tipo', 'tipus', 'estil' )
wiki.minsert( '\n|', protection, protection and type and '
', type )
-- date wiki.minsert( '\n|', validArg( 'date', 'fecha' ) )
-- image args.image = validArg( 'image', 'imagen', 'imatge' ) args['catégorie commons'] = validArg( 'catégorie commons', 'commonscat', 'commune', 'municipio', 'municipi' ) wiki.minsert( colonneImage{ args, ['taille image'] = 120, id=args.bic, wikilove = 0 } )
return wiki.concat() end
-- -- France -- Monument.noticeFrance = function( notice, base ) local noticeTab local result
if Outils.trim( notice ) then noticeTab = mw.text.split( notice, '/' ) else return end
lienWeb = lienWeb or require( 'Module:Biblio/Lien web' ).lienWeb
for i = 1, #noticeTab do
-- adresse de Modèle {{Lien web}} : paramètre « titre
» manquant. http://www2.culture.gouv.fr/public/mistral/_fr?ACTION=CHERCHER&FIELD_1=REF&VALUE_1=, , ministère français de la Culture, il faudrait faire une fonction dédiée.
local url = 'https://www.pop.culture.gouv.fr/notice/' .. ( base or 'merimee/' )
.. '/' .. mw.uri.encode( noticeTab[i] )
-- appel du modèle Modèle {{Lien web}} : paramètres « url
» et « titre
» manquants.
local texteLienWeb = lienWeb{ url = url, titre = noticeTab[i], }
if result then
result = result .. '
' .. texteLienWeb
else
result = texteLienWeb
end
end
return result or end
Monument.ligneFrance = function ( frame ) local args = Outils.extractArgs( frame ) local validArg = function ( ... ) return Outils.validTextArg( args, ... ) end local wiki = TableBuilder.new( ligneAvecClasse( args.image ) )
-- id if validArg( 'id', 'tri' ) then wiki.minsert( 'id="', validArg( 'id', 'tri' ), '"' ) end
-- monument wiki.minsert( colonneAvecTri( args.monument, args.tri ) )
-- département, commune (colonnes facultatives) if validArg( 'département' ) then wiki.minsert( colonneAvecTri(args['département'], args['tri département'] ) ) end if validArg( 'commune' ) then wiki.minsert( colonneAvecTri(args.commune, args['tri commune'] ) ) end
-- adresse wiki.minsert( colonneAvecTri(args.adresse, args['tri adresse'] ) )
-- coordonées wiki.minsert( colonneCoord( validArg, 'FR' ) )
-- notice wiki.minsert( '\n|', Monument.noticeFrance( args.notice, args.base ) )
-- protection, date wiki.minsert( '\n|', args.protection ) wiki.minsert( '\n|', args.date )
-- image
wiki.minsert( colonneImage{ args, ['taille image'] = 120, categorie2 = args.commune, wikilove = args.wikilove } )
return wiki.concat() end
Monument.ligneObjetFrance = function ( frame )
local args = Outils.extractArgs( frame ) local validArg = function ( ... ) return Outils.validTextArg( args, ... ) end local wiki = TableBuilder.new( '|-' )
wiki.minsert( colonneAvecTri(args.commune, args['tri commune'] ) ) wiki.minsert( colonneAvecTri(args.lieu, args['tri lieu']) )
-- description, type, protection, date wiki.minsert( '\n|', args.description ) wiki.minsert( '\n|', args.type ) wiki.minsert( '\n|', args.protection ) wiki.minsert( '\n|', args.date )
-- notice wiki.minsert( '\n|', Monument.noticeFrance( args.palissy, 'palissy' ) )
-- image wiki.minsert( colonneImage{ args, ['taille image'] = 120, categorie2 = args.commune, wikilove = args.wikilove } )
return wiki.concat()
end
-- -- Luxembourg -- Monument.ligneLuxembourg = function ( frame ) local args = Outils.extractArgs( frame ) local validArg = function ( ... ) return Outils.validTextArg( args, ... ) end local wiki = TableBuilder.new( '|-' )
-- id if validArg( 'id', 'tri' ) then wiki.minsert( 'id="', validArg( 'id', 'tri' ), '"' ) end
-- monument wiki.minsert( colonneAvecTri( args.monument, args.tri ) )
-- commune, section, adresse wiki.minsert( colonneAvecTri( args.commune, args['tri commune'] ) ) wiki.minsert( colonneAvecTri( args.section, args['tri section'] ) ) wiki.minsert( colonneAvecTri( args.adresse, args['tri adresse'] ) )
-- coordonées wiki.minsert( colonneCoord( validArg, 'LU' ) )
-- protection, date wiki.minsert( '\n|', args.protection ) wiki.minsert( '\n|', args.date )
-- image wiki.minsert( colonneImage{ args, ['taille image'] = 150, categorie2 = args.commune } )
return wiki.concat() end
-- -- Pakistan -- Monument.lignePakistan = function ( frame ) local args = Outils.extractArgs( frame ) local validArg = function ( ... ) return Outils.validTextArg( args, ... ) end local wiki = TableBuilder.new( ligneAvecClasse( args.image ) )
-- id
if validArg( 'id', 'tri' ) then wiki.minsert( 'id="', validArg( 'id', 'tri' ), '"' ) end
-- identifiant if validArg( 'monument national' ) then if validArg('tri') then wiki.minsert( colonneAvecTri( args.identifiant, args.tri .. '" color="#FCC200' ) ) else wiki.minsert( colonneAvecTri( args.identifiant, '" color="#FCC200' ) ) end else wiki.minsert( colonneAvecTri( args.identifiant, args.tri ) ) end -- monument, type wiki.minsert( colonneAvecTri( args.monument, args.tri ) ) wiki.minsert( colonneAvecTri( args.type, args.tri ) )
-- province, district, ville (colonnes facultatives) if validArg( 'province' ) then wiki.minsert( colonneAvecTri(args.province, args['tri province'] ) ) end if validArg( 'district' ) then wiki.minsert( colonneAvecTri(args.district, args['tri district'] ) ) end
wiki.minsert( '\n|', args.Adresse or args.adresse )
-- description wiki.minsert( colonneAvecTri(args.Description or args.description, args['tri description'] ) )
-- coordonées wiki.minsert( colonneCoord( validArg, 'PK' ) )
-- image wiki.minsert( colonneImage{ args, ['taille image'] = 120, categorie2 = args.commune, wikilove = 0 } )
return wiki.concat() end -- -- Suisse -- Monument.ligneSuisse = function ( frame ) local args = Outils.extractArgs( frame ) local validArg = function ( ... ) return Outils.validTextArg( args, ... ) end local wiki = TableBuilder.new( '|-' )
-- image wiki.minsert( colonneImage{ args, ['taille image'] = 100, image = validArg( 'Photo', 'photo', 'image' ), nom = validArg( 'titre coordonnées', 'objet'), categorie2 = validArg( 'Commune', 'commune' ), } )
-- Objet wiki.minsert( '\n|', args.Objet or args.objet )
-- A, Arch, B, E, M, O, S wiki.minsert( '\n|', args.A ) wiki.minsert( '\n|', args.Arch ) wiki.minsert( '\n|', args.B ) wiki.minsert( '\n|', args.E ) wiki.minsert( '\n|', args.M ) wiki.minsert( '\n|', args.O ) wiki.minsert( '\n|', args.S )
-- adresse, commune
wiki.minsert( colonneAvecTri( args.Adresse or args.adresse, args['tri adresse'] ) )
wiki.minsert( '\n|', args.Commune or args.commune )
-- coordonées wiki.minsert( colonneCoord( validArg, validArg('region-iso') or 'CH', 'Objet', 'objet' ) )
return wiki.concat() end
--
-- Tunisie
--
Monument.ligneTunisie = function ( frame )
local args = Outils.extractArgs( frame )
local validArg = function ( ... ) return Outils.validTextArg( args, ... ) end
local wiki = TableBuilder.new( '|-' )
-- id, site wiki.minsert( '\n|', args.id ) wiki.minsert( '\n|', args.site )
-- monument wiki.minsert( colonneAvecTri( args.monument, args['tri monument'] ) )
-- adresse, date, decret wiki.minsert( colonneAvecTri( args.adresse, args['tri adresse'] ) ) wiki.minsert( '\n|', args.date ) wiki.minsert( '\n|', args.decret )
-- coordonées wiki.minsert( colonneCoord( validArg, 'TN' ) )
-- image wiki.minsert( colonneImage{ args, ['taille image'] = 150, categorie2 = validArg( 'commonscat', 'site' ), style = 'border-right:none;', wikilove = 0, } )
-- commonscat & upload wiki.minsert( '\n|style="border-left:none; width:16px; text-align:center; vertical-align:top;" class="noprint"|' ) if validArg( 'commonscat' ) then wiki.minsert( '" ) end local query = { id = args.id, descriptionlang = 'fr', description = args.monument or , lat = args.latitude, lon = args.longitude, categories = args.commonscat or args.site, campaign = args.wikilove, } local url = tostring( mw.uri.fullUrl( 'commons:Special:UploadWizard', query ) ) wiki.minsert( '' )
return wiki.concat()
end
--
-- Venezuela
--
Monument.ligneVenezuela = function ( frame )
local args = Outils.extractArgs( frame )
args['code pays'] = 've' -- implicite : état, municipalité, ville args.adresse = args.adresse or args.date = args.date or
return Monument.ligneMonument( args ) end
return Monument