<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://wikiromandie.org/index.php?action=history&amp;feed=atom&amp;title=Module%3ADatabox</id>
	<title>Module:Databox - Historique des versions</title>
	<link rel="self" type="application/atom+xml" href="https://wikiromandie.org/index.php?action=history&amp;feed=atom&amp;title=Module%3ADatabox"/>
	<link rel="alternate" type="text/html" href="https://wikiromandie.org/index.php?title=Module:Databox&amp;action=history"/>
	<updated>2026-04-13T05:30:51Z</updated>
	<subtitle>Historique des versions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wikiromandie.org/index.php?title=Module:Databox&amp;diff=18165&amp;oldid=prev</id>
		<title>AdrianoRutz : Page créée avec « local property_blacklist = {     &#039;P360&#039;, --is a list of     &#039;P4224&#039;, --category contains     &#039;P935&#039;, -- Commons gallery     &#039;P1472&#039;, -- Commons Creator page     &#039;P1612&#039;, -- Commons Institution page     &#039;P373&#039;, -- Commons category     &#039;P3722&#039;, -- Commons maps category     &#039;P1151&#039;, -- topic&#039;s main Wikimedia portal     &#039;P1424&#039;, -- topic&#039;s main template     &#039;P910&#039;, -- topic&#039;s main category     &#039;P1200&#039;, -- bodies of water basin category     &#039;P1792&#039;, -- category of ass... »</title>
		<link rel="alternate" type="text/html" href="https://wikiromandie.org/index.php?title=Module:Databox&amp;diff=18165&amp;oldid=prev"/>
		<updated>2026-04-12T21:24:09Z</updated>

		<summary type="html">&lt;p&gt;Page créée avec « local property_blacklist = {     &amp;#039;P360&amp;#039;, --is a list of     &amp;#039;P4224&amp;#039;, --category contains     &amp;#039;P935&amp;#039;, -- Commons gallery     &amp;#039;P1472&amp;#039;, -- Commons Creator page     &amp;#039;P1612&amp;#039;, -- Commons Institution page     &amp;#039;P373&amp;#039;, -- Commons category     &amp;#039;P3722&amp;#039;, -- Commons maps category     &amp;#039;P1151&amp;#039;, -- topic&amp;#039;s main Wikimedia portal     &amp;#039;P1424&amp;#039;, -- topic&amp;#039;s main template     &amp;#039;P910&amp;#039;, -- topic&amp;#039;s main category     &amp;#039;P1200&amp;#039;, -- bodies of water basin category     &amp;#039;P1792&amp;#039;, -- category of ass... »&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local property_blacklist = {&lt;br /&gt;
    &amp;#039;P360&amp;#039;, --is a list of&lt;br /&gt;
    &amp;#039;P4224&amp;#039;, --category contains&lt;br /&gt;
    &amp;#039;P935&amp;#039;, -- Commons gallery&lt;br /&gt;
    &amp;#039;P1472&amp;#039;, -- Commons Creator page&lt;br /&gt;
    &amp;#039;P1612&amp;#039;, -- Commons Institution page&lt;br /&gt;
    &amp;#039;P373&amp;#039;, -- Commons category&lt;br /&gt;
    &amp;#039;P3722&amp;#039;, -- Commons maps category&lt;br /&gt;
    &amp;#039;P1151&amp;#039;, -- topic&amp;#039;s main Wikimedia portal&lt;br /&gt;
    &amp;#039;P1424&amp;#039;, -- topic&amp;#039;s main template&lt;br /&gt;
    &amp;#039;P910&amp;#039;, -- topic&amp;#039;s main category&lt;br /&gt;
    &amp;#039;P1200&amp;#039;, -- bodies of water basin category&lt;br /&gt;
    &amp;#039;P1792&amp;#039;, -- category of associated people&lt;br /&gt;
    &amp;#039;P1464&amp;#039;, -- category for people born here&lt;br /&gt;
    &amp;#039;P1465&amp;#039;, -- category for people who died here&lt;br /&gt;
    &amp;#039;P1791&amp;#039;, -- category of people buried here&lt;br /&gt;
    &amp;#039;P1740&amp;#039;, -- category for films shot at this location&lt;br /&gt;
    &amp;#039;P2033&amp;#039;, -- Category for pictures taken with camera&lt;br /&gt;
    &amp;#039;P2517&amp;#039;, -- category for recipients of this award&lt;br /&gt;
    &amp;#039;P4195&amp;#039;, -- category for employees of the organization&lt;br /&gt;
    &amp;#039;P1754&amp;#039;, -- category related to list&lt;br /&gt;
    &amp;#039;P301&amp;#039;, -- category&amp;#039;s main topic&lt;br /&gt;
    &amp;#039;P971&amp;#039;, -- category combines topics&lt;br /&gt;
    &amp;#039;P3876&amp;#039;, -- category for alumni of educational institution&lt;br /&gt;
    &amp;#039;P1753&amp;#039;, -- list related to category&lt;br /&gt;
    &amp;#039;P3921&amp;#039;, -- Wikidata SPARQL query equivalent&lt;br /&gt;
    &amp;#039;P1204&amp;#039;, -- Wikimedia portal&amp;#039;s main topic&lt;br /&gt;
    &amp;#039;P1423&amp;#039;, -- template&amp;#039;s main topic&lt;br /&gt;
    &amp;#039;P1709&amp;#039;, -- equivalent class&lt;br /&gt;
    &amp;#039;P3950&amp;#039;, -- narrower external class&lt;br /&gt;
    &amp;#039;P2888&amp;#039;, -- exact match&lt;br /&gt;
    &amp;#039;P1382&amp;#039;, -- coincident with&lt;br /&gt;
    &amp;#039;P527&amp;#039;, -- has part&lt;br /&gt;
    &amp;#039;P2670&amp;#039;, -- has parts of the class&lt;br /&gt;
    &amp;#039;P3113&amp;#039;, -- does not have part&lt;br /&gt;
    &amp;#039;P2737&amp;#039;, -- union of&lt;br /&gt;
    &amp;#039;P2738&amp;#039;, -- disjoint union of&lt;br /&gt;
    &amp;#039;P2445&amp;#039;, -- metasubclass of&lt;br /&gt;
    &amp;#039;P1963&amp;#039;, -- properties for this type&lt;br /&gt;
    &amp;#039;P3176&amp;#039;, -- uses property&lt;br /&gt;
    &amp;#039;P1889&amp;#039;, -- different from&lt;br /&gt;
    &amp;#039;P460&amp;#039;, -- said to be the same as&lt;br /&gt;
    &amp;#039;P2959&amp;#039;, -- permanent duplicated item&lt;br /&gt;
    &amp;#039;P2860&amp;#039;, -- cites&lt;br /&gt;
    &amp;#039;P5125&amp;#039;, -- wikimedia outline&lt;br /&gt;
    &amp;#039;P5008&amp;#039;, -- on focus list of Wikimedia project&lt;br /&gt;
    &amp;#039;P2559&amp;#039;, -- Wikidata usage instructions&lt;br /&gt;
    &amp;#039;P1343&amp;#039;, -- described by source&lt;br /&gt;
    &amp;#039;P972&amp;#039;, --  catalogu&lt;br /&gt;
    &amp;#039;P1282&amp;#039;, -- OSM tag or key&lt;br /&gt;
    &amp;#039;P4839&amp;#039;, -- Wolfram Language entity code&lt;br /&gt;
    &amp;#039;P6104&amp;#039;, -- Maintained by Wikiproject&lt;br /&gt;
    &amp;#039;P5996&amp;#039;, -- Category for films in this language&lt;br /&gt;
    &amp;#039;P2357&amp;#039;, -- Code Classification of Instructional Program&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function valuesToKeys(array)&lt;br /&gt;
	local result = {}&lt;br /&gt;
	for _, v in pairs(array) do&lt;br /&gt;
		result[v] = true&lt;br /&gt;
	end&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.formatBlackList(frame)&lt;br /&gt;
	local template = frame.args[1]&lt;br /&gt;
	local res = &amp;quot;&amp;quot;&lt;br /&gt;
	for i, prop in ipairs(property_blacklist) do&lt;br /&gt;
		res = res .. &amp;quot;* &amp;quot; .. frame:expandTemplate{title=template,args = { prop  }} .. &amp;quot;\n&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	return res&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getLegend(image_statement, lang)&lt;br /&gt;
&lt;br /&gt;
	if image_statement.qualifiers and image_statement.qualifiers[&amp;quot;P2096&amp;quot;] then&lt;br /&gt;
&lt;br /&gt;
		for k, v in pairs (image_statement.qualifiers[&amp;quot;P2096&amp;quot;]) do&lt;br /&gt;
			if v.datavalue.value.language == lang then&lt;br /&gt;
				return mw.wikibase.formatValue(v)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.databox(frame)&lt;br /&gt;
    local args = frame:getParent().args&lt;br /&gt;
    local itemId = nil&lt;br /&gt;
    if args.item then&lt;br /&gt;
        itemId = args.item&lt;br /&gt;
    end&lt;br /&gt;
    local lang = mw.language.getContentLanguage()&lt;br /&gt;
    local item = mw.wikibase.getEntity(itemId)&lt;br /&gt;
&lt;br /&gt;
    if item == nil then&lt;br /&gt;
        mw.addWarning(&amp;quot;Wikidata item not found&amp;quot;)&lt;br /&gt;
        return &amp;quot;&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local classes = mw.getCurrentFrame():expandTemplate{ title = &amp;#039;Classes début infobox&amp;#039;, args = { version = &amp;#039;3&amp;#039; } }&lt;br /&gt;
    classes = classes .. &amp;#039; large&amp;#039;&lt;br /&gt;
&lt;br /&gt;
    local databoxRoot = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
        :addClass(classes)&lt;br /&gt;
        :css({&lt;br /&gt;
            float = &amp;#039;right&amp;#039;,&lt;br /&gt;
            border = &amp;#039;1px solid var(--border-color-base, #a2a9b1)&amp;#039;,&lt;br /&gt;
            [&amp;#039;max-width&amp;#039;] = &amp;#039;300px&amp;#039;,&lt;br /&gt;
            padding = &amp;#039;0 0.4em&amp;#039;,&lt;br /&gt;
            margin = &amp;#039;0 0 0.4em 0.4em&amp;#039;,&lt;br /&gt;
        })&lt;br /&gt;
&lt;br /&gt;
	local label = item:getLabel()&lt;br /&gt;
    --Title&lt;br /&gt;
    databoxRoot:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
        :css({&lt;br /&gt;
            [&amp;#039;text-align&amp;#039;] = &amp;#039;center&amp;#039;,&lt;br /&gt;
            [&amp;#039;background-color&amp;#039;] = &amp;#039;var(--couleur-fond-boite-grise, #f9f9f9)&amp;#039;,&lt;br /&gt;
			color = &amp;#039;inherit&amp;#039;,&lt;br /&gt;
            padding = &amp;#039;0.5em 0&amp;#039;,&lt;br /&gt;
            margin = &amp;#039;0.5em 0&amp;#039;,&lt;br /&gt;
            [&amp;#039;font-size&amp;#039;] = &amp;#039;120%&amp;#039;,&lt;br /&gt;
            [&amp;#039;font-weight&amp;#039;] = &amp;#039;bold&amp;#039;,&lt;br /&gt;
        })&lt;br /&gt;
        :wikitext(&lt;br /&gt;
        	  (label and lang:ucfirst(label))&lt;br /&gt;
        	  or mw.title.getCurrentTitle().text&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
     --Image&lt;br /&gt;
    local images = item:getBestStatements(&amp;#039;P18&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
    if #images == 1 then&lt;br /&gt;
&lt;br /&gt;
    	local caption = getLegend(images[1], lang:getCode())&lt;br /&gt;
    	local captionobj&lt;br /&gt;
&lt;br /&gt;
    	local image_wikitext = &amp;#039;[[File:&amp;#039; .. images[1].mainsnak.datavalue.value .. &amp;#039;|frameless|300px]]&amp;#039;&lt;br /&gt;
&lt;br /&gt;
		local imageobj = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
			:addClass(&amp;quot;images&amp;quot;)&lt;br /&gt;
			:css(style or {padding =&amp;#039;2px 0&amp;#039;,})&lt;br /&gt;
			:wikitext(image_wikitext)&lt;br /&gt;
			:done()&lt;br /&gt;
&lt;br /&gt;
    	if caption then&lt;br /&gt;
    		captionobj = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
    			:addClass(&amp;quot;legend&amp;quot;)&lt;br /&gt;
				:wikitext(caption)&lt;br /&gt;
				:done()&lt;br /&gt;
    	end&lt;br /&gt;
		databoxRoot&lt;br /&gt;
           	:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
           	:node(imageobj)&lt;br /&gt;
           	:node(captionobj)&lt;br /&gt;
           	:done()&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    --Table&lt;br /&gt;
    local dataTable = databoxRoot&lt;br /&gt;
        :tag(&amp;#039;table&amp;#039;)&lt;br /&gt;
        :css({&lt;br /&gt;
            [&amp;#039;text-align&amp;#039;] = &amp;#039;left&amp;#039;,&lt;br /&gt;
            -- [&amp;#039;font-size&amp;#039;] = &amp;#039;90%&amp;#039;,&lt;br /&gt;
            [&amp;#039;word-break&amp;#039;] = &amp;#039;break-word&amp;#039;,&lt;br /&gt;
            [&amp;#039;width&amp;#039;] = &amp;#039;100%&amp;#039;,&lt;br /&gt;
            [&amp;#039;table-layout&amp;#039;] = &amp;#039;fixed&amp;#039;,&lt;br /&gt;
        })&lt;br /&gt;
&lt;br /&gt;
    dataTable:tag(&amp;#039;caption&amp;#039;)&lt;br /&gt;
             :css({&lt;br /&gt;
             	[&amp;#039;background-color&amp;#039;] = &amp;#039;var(--couleur-fond-boite-grise, #f9f9f9)&amp;#039;,&lt;br /&gt;
				color = &amp;#039;inherit&amp;#039;,&lt;br /&gt;
             	[&amp;#039;font-weight&amp;#039;] = &amp;#039;bold&amp;#039;,&lt;br /&gt;
             	[&amp;#039;margin-top&amp;#039;] = &amp;#039;0.2em&amp;#039;,&lt;br /&gt;
             })&lt;br /&gt;
    		 :wikitext(item:formatStatements(&amp;#039;P31&amp;#039;).value)&lt;br /&gt;
&lt;br /&gt;
    local properties = mw.wikibase.orderProperties(item:getProperties())&lt;br /&gt;
    local property_blacklist_hash = valuesToKeys(property_blacklist)&lt;br /&gt;
    property_blacklist_hash[&amp;#039;P31&amp;#039;] = true --Special property&lt;br /&gt;
&lt;br /&gt;
	local edit_message = mw.message.new(&amp;#039;vector-view-edit&amp;#039;):plain()&lt;br /&gt;
    for _, property in pairs(properties) do&lt;br /&gt;
        local datatype = item.claims[property][1].mainsnak.datatype&lt;br /&gt;
        if datatype ~= &amp;#039;commonsMedia&amp;#039; and datatype ~= &amp;#039;external-id&amp;#039; and datatype ~= &amp;#039;quantity&amp;#039; and datatype ~= &amp;#039;wikibase-property&amp;#039; and datatype ~= &amp;#039;geo-shape&amp;#039; and datatype ~= &amp;#039;tabular-data&amp;#039; and not property_blacklist_hash[property] and #item:getBestStatements(property) &amp;lt;= 5 then&lt;br /&gt;
            local propertyValue = item:formatStatements(property)&lt;br /&gt;
            dataTable:tag(&amp;#039;tr&amp;#039;)&lt;br /&gt;
                :tag(&amp;#039;th&amp;#039;)&lt;br /&gt;
                    :attr(&amp;#039;scope&amp;#039;, &amp;#039;row&amp;#039;)&lt;br /&gt;
                    :wikitext(lang:ucfirst(propertyValue.label)):done()&lt;br /&gt;
                :tag(&amp;#039;td&amp;#039;)&lt;br /&gt;
                    :wikitext(frame:preprocess(propertyValue.value))&lt;br /&gt;
                    :wikitext(&amp;#039;&amp;amp;nbsp;[[File:OOjs UI icon edit-ltr.svg|&amp;#039; .. edit_message .. &amp;#039;|12px|baseline|class=noviewer noprint skin-invert|link=https://www.wikidata.org/wiki/&amp;#039; .. item.id .. &amp;#039;#&amp;#039; .. property .. &amp;#039;]]&amp;#039;)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
     --Map&lt;br /&gt;
    local coordinates_statements = item:getBestStatements(&amp;#039;P625&amp;#039;)&lt;br /&gt;
    if #coordinates_statements == 1 and coordinates_statements[1].mainsnak.datavalue and coordinates_statements[1].mainsnak.datavalue.value.globe == &amp;#039;http://www.wikidata.org/entity/Q2&amp;#039; then&lt;br /&gt;
        --We build the call to mapframe&lt;br /&gt;
        local latitude = coordinates_statements[1].mainsnak.datavalue.value.latitude&lt;br /&gt;
        local longitude = coordinates_statements[1].mainsnak.datavalue.value.longitude&lt;br /&gt;
        local geojson = {&lt;br /&gt;
            type = &amp;#039;Feature&amp;#039;,&lt;br /&gt;
            geometry = {&lt;br /&gt;
                type = &amp;#039;Point&amp;#039;,&lt;br /&gt;
                coordinates = { longitude, latitude }&lt;br /&gt;
            },&lt;br /&gt;
            properties = {&lt;br /&gt;
                title = item:getLabel() or mw.title.getCurrentTitle().text,&lt;br /&gt;
                [&amp;#039;marker-symbol&amp;#039;] = &amp;#039;marker&amp;#039;,&lt;br /&gt;
                [&amp;#039;marker-color&amp;#039;] =  &amp;#039;#224422&amp;#039;,&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        databoxRoot:wikitext(frame:extensionTag(&amp;#039;mapframe&amp;#039;, mw.text.jsonEncode(geojson), {&lt;br /&gt;
            height = 300,&lt;br /&gt;
            width = 300,&lt;br /&gt;
            frameless = &amp;#039;frameless&amp;#039;,&lt;br /&gt;
            align = &amp;#039;center&amp;#039;,&lt;br /&gt;
            latitude = latitude,&lt;br /&gt;
            longitude = longitude,&lt;br /&gt;
            zoom = zoom&lt;br /&gt;
        }))&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
     return tostring(databoxRoot)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>AdrianoRutz</name></author>
	</entry>
</feed>