Aller au contenu

Module:Tableau MH

Une page de Wikipédia, l'encyclopédie libre.
Ceci est une version archivée de cette page, en date du 26 juillet 2014 à 17:38 et modifiée en dernier par Zebulon84 (discuter | contributions) (ligneEspagne : municipalité → commune et groupement avec adresse ; suppression des espaces en début de ligne, pour gagner quelques caractères sur les pages avec beaucoup de lignes). Elle peut contenir des erreurs, des inexactitudes ou des contenus vandalisés non présents dans la version actuelle.

 Documentation[voir] [modifier] [historique] [purger]

Ce modèle crée des ligne de tableau de monument historique, comme {{Ligne de tableau Monument}}.

Utilisation

Fonctions exportables :

  • noticeFrance(frame) – fait un ou des lien(s) vers la base Mérimée ou une autre base du ministère de la Culture français.

Autres fonctions :

  • colonneAvecTri() – génère une colonne avec éventuellement un data-sort-value pour qu'elle soit triée correctement.
  • colonneCoord – génère une colonne avec les coordonnées géographique. Paramètres :
    • validArg
    • region
    • nom
    • ...
  • colonneImage() – génère une colonne avec une image, ou un lien pour en téléverser une.
    • image
    • taille image
    • portrait
    • catégorie commons
    • categorie2
    • noupload
    • wikilove
    • style
    • 1

Modules externes et autres éléments dont ce module a besoin pour fonctionner :

  • Outils – Pour les fonctions extractArgs, validTextArg et trim.
  • TableBuilder – Pour la fonction minsert qui permet de simplifier l'ajout dans les tables.
  • Coordinates – Fonction _coord.
  • Delink – Permet de supprimer les liens sur les liens GeoHack et upload Commons
  • Biblio/Lien web – Affiche les notice française.
  • Yesno – Pour évaluer le paramètre portrait si taille image n'est pas défini.


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


-- 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
	local nom = Delink.delink{ args[ 'titre coordonnée' ] or args.nom or args.monument or '' }
	local noupload = args.noupload
	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()
		if _url then 
			return _url
		end
		local query = { 
			id = args.id, 
			descriptionlang = 'fr', 
			description = nom,
			lat = args.latitude or args.lat,
			lon = args.longitude or args.lon,
			categories = Delink.delink{ args['catégorie commons'] or args.categorie2 },
		}
		if Outils.trim( wikilove ) then
			query.campain = 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' then
		lienWikilove = '<div style="background-color:#EFEFEF; padding: 2px; font-size: 0.8em;" class="plainlinks">'
				.. '[[File:Wiki Loves Monuments Logo notext.svg|x20px|left|sub|Téléverser une photographie de ce monument|link=WP:Wiki loves Monuments]]'
				.. '[' .. uploadUrl() .. ' Proposez votre photo]</div>'
	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 .. '[[Fichier:' .. image .. size ..'|center|alt=' .. nom .. ']]' .. 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[[File:Small upload photo button-fr.png|frameless|upright=0.55|alt=Téléverser|link=' .. uploadUrl() .. ']]'
		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

	-- coordoné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( '[[File:Commons-logo.svg|x16px|sub|alt=|link=Commons:Category:', args.commonscat, "|D'autres photos sur Wikimedia Commons]]" )
	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( '[[File:Camera-photo Upload.svg|x16px|sub|alt=Télécharger une image|Télécharger ma propre photo|link=', url, ']]' )
	
	
	return wiki.concat()
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'] = '[http://www.monumentosysitios.gov.ar/ficha.php?idMonumento=' .. 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 '',  '<span class="indicateur%-langue">%(<abbr class="abbr" title="Langue : néerlandais">nl</abbr>%)</span> *', '', 1 )
	
	-- classement
	wiki.minsert( '\n|')
	if validArg( 'classement' ) then
		wiki.minsert( '[[File:Distinctive emblem for cultural property.svg|18px|link=]]', 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|[http://inventaris.vioe.be/dibe/relict/', 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|[http://lampspw.wallonie.be/dgo4/index.php?details=', 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 '([[w:fr:Canada|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 ''
	
	return Monument.ligneMonument( args )
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 ) )
	
	-- type
	wiki.minsert( '\n|', validArg( 'type', 'tipo', 'tipus', 'estil' ) )
	
	-- commune, adresse
	local commune = validArg( 'commune', 'municipio', 'municipi' )
	local adresse = validArg( 'adresse', 'lugar', 'lloc' )
	if commune and adresse then
		commune = commune .. '<br>' .. 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|bics/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
	wiki.minsert( '\n|', protection )
	
	-- 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 } )
	
	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 {{Méta base Culture}}, il faudrait faire une fonction dédiée.
		local url = 'http://www.culture.gouv.fr/public/mistral/' .. ( base or 'merimee' )
			.. '_fr?ACTION=CHERCHER&FIELD_1=REF&VALUE_1=' .. mw.uri.encode( noticeTab[i] )
			
		-- appel du modèle {{Lien web}}
		local texteLienWeb = lienWeb{ url = url, titre = noticeTab[i], }
		if result then
			result = result .. '<br />' .. 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( '|-' )
 
	-- 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 } )
 
	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


--
-- 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( '[[File:Commons-logo.svg|x16px|sub|alt=|link=Commons:Category:', args.commonscat, "|D'autres photos sur Wikimedia Commons]]" )
	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( '[[File:Camera-photo Upload.svg|x16px|sub|alt=Télécharger une image|Télécharger ma propre photo|link=', url, ']]' )
	
	
	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