<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://staging.twogpedia.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ALocationsSearch%2FCountries</id>
	<title>Module:LocationsSearch/Countries - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://staging.twogpedia.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ALocationsSearch%2FCountries"/>
	<link rel="alternate" type="text/html" href="https://staging.twogpedia.com/index.php?title=Module:LocationsSearch/Countries&amp;action=history"/>
	<updated>2026-05-13T05:03:26Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://staging.twogpedia.com/index.php?title=Module:LocationsSearch/Countries&amp;diff=9277&amp;oldid=prev</id>
		<title>Couchor: Created page with &quot;local getArgs = require(&#039;Module:Arguments&#039;).getArgs local cargo = mw.ext.cargo local CountryData = mw.loadData(&#039;Module:Localisation/Data&#039;)  local p = {}  function p.main(frame) 	local args = getArgs(frame) 	 	local tables = &#039;Locations&#039; 	local fields = &#039;country&#039; 	local cargoArgs = { 		groupBy = &#039;Locations.country&#039; 	} 	local results = cargo.query(tables, fields, cargoArgs) 	 	local container = mw.html.create(&#039;div&#039;):addClass(&#039;dropdown__content&#039;):attr(&#039;id&#039;, &#039;country--dropdow...&quot;</title>
		<link rel="alternate" type="text/html" href="https://staging.twogpedia.com/index.php?title=Module:LocationsSearch/Countries&amp;diff=9277&amp;oldid=prev"/>
		<updated>2024-02-12T18:38:43Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local getArgs = require(&amp;#039;Module:Arguments&amp;#039;).getArgs local cargo = mw.ext.cargo local CountryData = mw.loadData(&amp;#039;Module:Localisation/Data&amp;#039;)  local p = {}  function p.main(frame) 	local args = getArgs(frame) 	 	local tables = &amp;#039;Locations&amp;#039; 	local fields = &amp;#039;country&amp;#039; 	local cargoArgs = { 		groupBy = &amp;#039;Locations.country&amp;#039; 	} 	local results = cargo.query(tables, fields, cargoArgs) 	 	local container = mw.html.create(&amp;#039;div&amp;#039;):addClass(&amp;#039;dropdown__content&amp;#039;):attr(&amp;#039;id&amp;#039;, &amp;#039;country--dropdow...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local getArgs = require(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
local cargo = mw.ext.cargo&lt;br /&gt;
local CountryData = mw.loadData(&amp;#039;Module:Localisation/Data&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	&lt;br /&gt;
	local tables = &amp;#039;Locations&amp;#039;&lt;br /&gt;
	local fields = &amp;#039;country&amp;#039;&lt;br /&gt;
	local cargoArgs = {&lt;br /&gt;
		groupBy = &amp;#039;Locations.country&amp;#039;&lt;br /&gt;
	}&lt;br /&gt;
	local results = cargo.query(tables, fields, cargoArgs)&lt;br /&gt;
	&lt;br /&gt;
	local container = mw.html.create(&amp;#039;div&amp;#039;):addClass(&amp;#039;dropdown__content&amp;#039;):attr(&amp;#039;id&amp;#039;, &amp;#039;country--dropdown&amp;#039;)&lt;br /&gt;
	&lt;br /&gt;
	if #results &amp;gt; 0 then&lt;br /&gt;
		local countries = {}&lt;br /&gt;
		for _, result in ipairs(results) do&lt;br /&gt;
		    table.insert(countries, result.country)&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		local uniqueCountries = {}&lt;br /&gt;
		for _, country in ipairs(countries) do&lt;br /&gt;
		    if not uniqueCountries[country] then&lt;br /&gt;
		        uniqueCountries[country] = true&lt;br /&gt;
		    end&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		-- Convert unique country values to a list&lt;br /&gt;
		local uniqueCountriesList = {}&lt;br /&gt;
		for country, _ in pairs(uniqueCountries) do&lt;br /&gt;
		    table.insert(uniqueCountriesList, country)&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if #uniqueCountriesList &amp;gt; 0 then &lt;br /&gt;
			for i = 1, #uniqueCountriesList do&lt;br /&gt;
				local country = CountryData[string.upper(uniqueCountriesList[i])]&lt;br /&gt;
				container:node(mw.html.create(&amp;#039;div&amp;#039;):addClass(&amp;#039;dropdown__item&amp;#039;):attr(&amp;#039;data-country&amp;#039;, uniqueCountriesList[i]):wikitext(country))&lt;br /&gt;
			end&lt;br /&gt;
			return container&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Couchor</name></author>
	</entry>
</feed>