Différences entre versions de « Module:Lieu »

De Gregorius 3.0
Sauter à la navigation Sauter à la recherche
Ligne 4 : Ligne 4 :
 
     local capiunto = require 'capiunto'
 
     local capiunto = require 'capiunto'
 
     local linkedwiki = require 'linkedwiki'
 
     local linkedwiki = require 'linkedwiki'
    linkedwiki.setCurrentFrame(mw.getCurrentFrame()) -- added by hand
+
    linkedwiki.setCurrentFrame(mw.getCurrentFrame()) -- added by hand
  
 
local endpointUpsud = 'http://opendata1.opendata.u-psud.fr/sparql'
 
local endpointUpsud = 'http://opendata1.opendata.u-psud.fr/sparql'

Version du 29 octobre 2021 à 08:48

La documentation pour ce module peut être créée à Module:Lieu/doc

local p = {}
 
function p.infobox(f)
    local capiunto = require 'capiunto'
    local linkedwiki = require 'linkedwiki'
    linkedwiki.setCurrentFrame(mw.getCurrentFrame()) -- added by hand

	local endpointUpsud = 'http://opendata1.opendata.u-psud.fr/sparql'
 
   local rdfs = 'http://www.w3.org/2000/01/rdf-schema#'
   local daapProp = 'http://gregorius.dsi.universite-paris-saclay.fr/wiki/Property:'
   local geo = 'http://www.w3.org/2003/01/geo/wgs84_pos#'
   local vcard = 'http://www.w3.org/2006/vcard/ns#'
 
  local subject = linkedwiki.getCurrentIRI(); -- read the iri of the current page
  local object =  linkedwiki.new(subject)
 
	return capiunto.create( {
	    bodyStyle = 'max-width : 20px',
	    bodyClass = 'gregoriusLieu',
		title =  object:checkLink(subject, rdfs..'label',f.args.Title)  ,
        top = 'Lieu',
		topStyle = 'background:#99FFCC;font-size:larger',		
		bottom = object:checkExternLink('Website',rdfs..'seeAlso',f.args.Website)
	} )
	:addImage(object:checkImage(daapProp..'picture',f.args.Picture),"", "bodyStyle" )
	:addRow('Nom original', object:checkString(daapProp..'nom original',f.args.NomOriginal))
	:addRow('Pays', object:checkString(daapProp..'pays',f.args.Pays))
	:addRow('Maire', object:checkString(daapProp..'maire',f.args.Maire))
	:addRow('Code postal', object:checkString(daapProp..'code postal',f.args.CodePostal))
	:addRow('Gentilé', object:checkString(daapProp..'gentile',f.args.Gentile))	
	:addWikitext( object:getMaintenanceCategory() ..  "[[Category:Interdisciplinary Unit]]"
				.."[[Category:Lieu]]" )
end
 
return p