Skip to content

Commit 7b850d1

Browse files
committed
Made a few changes.
1 parent 4a65492 commit 7b850d1

4 files changed

Lines changed: 32 additions & 25 deletions

File tree

data/country_ISO3166_mapping.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@
202202
"SV":"SLV",
203203
"SM":"SMR",
204204
"SO":"SOM",
205+
"-99SOM": "-99SOM",
205206
"PM":"SPM",
206207
"RS":"SRB",
207208
"SS":"SSD",

data/world.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

helpers/common_helpers.rb

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,23 +1394,22 @@ def hasSpecialCharacter(input_string)
13941394

13951395
def generateCountryDatav7()
13961396
###
1397-
filename = "data/cache/dumped-data.csv"
1398-
new_file = !File.exist?(filename)
1399-
FileUtils.touch(filename) if new_file
1400-
puts new_file ? "Created new file: #{filename}" : "File already exists: #{filename}"
1401-
File.open(filename, 'a') do |file|
1402-
# Write headers if it's a new file
1403-
if new_file
1404-
headers = "countryCode,percentileBudget,totalBudget,iati_identifier\n"
1405-
file.write(headers)
1406-
end
1397+
# filename = "data/cache/dumped-data.csv"
1398+
# new_file = !File.exist?(filename)
1399+
# FileUtils.touch(filename) if new_file
1400+
# File.open(filename, 'a') do |file|
1401+
# # Write headers if it's a new file
1402+
# if new_file
1403+
# headers = "countryCode,percentileBudget,totalBudget,iati_identifier\n"
1404+
# file.write(headers)
1405+
# end
14071406

1408-
# 3.times do
1409-
# # Generate a random line (you can customize this)
1410-
# random_line = "#{rand(1..100)},#{rand(1..50)},#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}\n"
1411-
# file.write(random_line)
1412-
# end
1413-
end
1407+
# # 3.times do
1408+
# # # Generate a random line (you can customize this)
1409+
# # random_line = "#{rand(1..100)},#{rand(1..50)},#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}\n"
1410+
# # file.write(random_line)
1411+
# # end
1412+
# end
14141413
####
14151414
totalB = 0
14161415
totalB_s = 0
@@ -1489,10 +1488,10 @@ def generateCountryDatav7()
14891488
end
14901489
countryBudget = tempTotalBudget*countryPercentage/100
14911490
totalB = totalB + countryBudget
1492-
File.open(filename, 'a') do |file|
1493-
row = "#{c},#{countryBudget},#{tempTotalBudget},#{element['iati_identifier']}\n"
1494-
file.write(row)
1495-
end
1491+
# File.open(filename, 'a') do |file|
1492+
# row = "#{c},#{countryBudget},#{tempTotalBudget},#{element['iati_identifier']}\n"
1493+
# file.write(row)
1494+
# end
14961495
#budgetTracker = budgetTracker - countryBudget
14971496
if(projectDataHash.has_key?(c))
14981497
# if(isNewProgramme)
@@ -1519,6 +1518,14 @@ def generateCountryDatav7()
15191518
end
15201519
end
15211520
end
1521+
if(projectDataHash.has_key?('SO'))
1522+
projectDataHash['-99SOM'] = {}
1523+
projectDataHash['-99SOM']["id"] = 'SO'
1524+
projectDataHash['-99SOM']["country"] = projectDataHash['SO']["country"]
1525+
projectDataHash['-99SOM']["projects"] = projectDataHash['SO']["projects"]
1526+
projectDataHash['-99SOM']["budget"] = projectDataHash['SO']["budget"]
1527+
projectDataHash['-99SOM']["flag"] = projectDataHash['SO']["flag"]
1528+
end
15221529
finalOutput = Array.new
15231530
finalOutput.push(projectDataHash.to_s.gsub("[", "").gsub("]", "").gsub("=>",":").gsub("}}, {","},"))
15241531
finalOutput.push(projectDataHash)

public/javascripts/countrypagemap_new.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ $(document).ready(function () {
8787
"coordinates": window.coordinates
8888
}
8989
};
90-
if(window.countryCode != 'SO') {
91-
countryList.push(mapBorder);
92-
}
90+
// if(window.countryCode != 'SO') {
91+
// countryList.push(mapBorder);
92+
// }
9393
}
9494
else if (mapType == 'location') {
9595
map = new L.Map('countryMap', {
@@ -104,7 +104,6 @@ $(document).ready(function () {
104104
// calculatedOpacity = 0;
105105
// fOpacity = 0;
106106
// }
107-
108107
var tempMapBorder = {
109108
"type": "Feature",
110109
"properties": {

0 commit comments

Comments
 (0)