Aller au contenu

Module:Tableau MH/Bac à sable

Une page de Wikipédia, l'encyclopédie libre.
Ceci est une version archivée de cette page, en date du 18 mai 2014 à 03:58 et modifiée en dernier par Zebulon84 (discuter | contributions) (Préparation pour Argentine ; séparation fonction « noticeFrance » ; utilisation directe de _coord ; mef). 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

-- frame : objet frame,
-- 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( frame, 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', nom, ... ) }
		}
		return '\n|style="text-align:center; width:9em;"|' .. Coordinates._coord( argsCoord )
	else
		return '\n|style="text-align:center;"|à géolocaliser'
	end
end

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 },
			campain = wikilove,
		}
		_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)
	if args.pays then
		wiki.minsert( '\n| ', args.pays )
	end
	if args.subdivision then
		wiki.minsert( colonneAvecTri( args.subdivision, args['tri subdivision'] ) )
	end
	if args.subdivision2 then
		wiki.minsert( colonneAvecTri( args.subdivision2, args['tri subdivision2'] ) )
	end
	local commune = validArg( 'commune', 'municipalité' )
	if commune then
		wiki.minsert( colonneAvecTri( commune, validArg('tri commune', 'tri municipalité' ) ) )
	end
	if args.adresse then
		wiki.minsert( colonneAvecTri( args.adresse, args['tri adresse'] ) )
	end

	-- coordonées
	wiki.minsert( colonneCoord( frame, validArg, args['code pays'] or '', 'monument' ) )
	
	-- 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 = args.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, situation, Ville, Partie
	wiki.minsert( colonneAvecTri(args.Description or args.description , args['tri Description'] or args['tri description'] ) )
	wiki.minsert( '\n| ', args.Situation or args.situation )
	wiki.minsert( '\n| ', args.Ville or args.ville )
	wiki.minsert( '\n| ', args.Partie or args.partie )

	-- coordonées
	wiki.minsert( colonneCoord( frame, validArg, 'DZ', 'monument' ) )

	-- image
	wiki.minsert( colonneImage{ args, 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.subdivision = args.province
	args['tri subdivision'] = args['tri province']
	args['code pays'] = 'ar'
	args['lien notice'] = '[http://www.monumentosysitios.gov.ar/ficha.php?idMonumento=' .. args.notice .. ' ' .. args.notice .. ']'
	args.protection = args['catégorie']
	
	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
	wiki.minsert( colonneAvecTri( validArg('nom_objet', 'nom objet'), args.tri ) )
	-- suppression du {{nl}} pour les utilisation ultérieures
	args['nom objet'] = string.gsub( validArg('nom_objet', 'nom objet') or '',  '<span class="indicateur%-langue">%(<abbr class="abbr" title="Langue : néerlandais">nl</abbr>%)</span>', '')
	
	-- 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(frame, validArg, 'BE', 'nom objet' ) )

	-- id
	wiki.minsert( '\n|[http://inventaris.vioe.be/dibe/relict/', args.id, ' ', args.id, ']' )
	
	-- image
	wiki.minsert( colonneImage{ args,
		['taille image'] = 120, 
		nom = validArg( 'titre coordonnées', 'nom objet' ), 
		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
	wiki.minsert( colonneAvecTri( validArg('nom_objet', 'nom objet'), 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(frame, validArg, 'BE', 'nom_objet', 'nom objet' ) )

	-- 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, 
		nom = validArg( 'titre coordonnées', 'nom_objet', 'nom objet' ), 
		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| ', args.nom )
	
	-- description, id, region, ville
	wiki.minsert( '\n| ', args.description )
	wiki.minsert( '\n| ', args.id )
	wiki.minsert( '\n| ', args.region )
	wiki.minsert( '\n| ', args.ville )
	
	-- coordonées
	wiki.minsert( colonneCoord(frame, validArg, 'CM', 'nom' ) )
	
	-- image
	wiki.minsert( colonneImage{ args, nom = validArg( 'titre coordonnées', 'nom'), 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( frame, 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( frame, 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 )
	local validArg = function ( ... ) return Outils.validTextArg( args, ... ) end
	local wiki = TableBuilder.new( '|-' )
	
	-- id 
	if validArg( 'id' ) then
		wiki.minsert( 'id="', args.id, '"' )
	end
	
	-- monument
	wiki.minsert( colonneAvecTri( args.monument, args.tri ) )
	
	-- département, municipalité (colonnes facultatives)
	if validArg( 'département' ) then
		wiki.minsert( colonneAvecTri( args['département'], args['tri département'] ) )
	end
	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(frame, validArg, 'CO', 'monument' ) )

	-- date
	wiki.minsert( '\n| ', args.date )
	
	-- image
	wiki.minsert( colonneImage{ args, ['taille image'] = 100, categorie2 = args.commune } )
	
	return wiki.concat()
end



--
-- France
--
Monument.noticeFrance = function( notice, base )
	local noticeTab
	local result
	
	if 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(frame, validArg, 'FR', 'monument' ) )
 
	-- 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(frame, validArg, 'LU', 'monument' ) )

	-- 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( frame, 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( frame, validArg, 'TN', 'monument' ) )

	-- 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



return Monument