Skip to content

Commit

Permalink
Updated the date range filter branch with that of the document type f…
Browse files Browse the repository at this point in the history
…ilter branch.
  • Loading branch information
aunindadf committed Apr 11, 2016
2 parents 11ba05b + 92c394a commit 5c0fe1c
Show file tree
Hide file tree
Showing 15 changed files with 146 additions and 73 deletions.
56 changes: 28 additions & 28 deletions data/countries_operational_budgets.json
Original file line number Diff line number Diff line change
@@ -1,218 +1,218 @@
[
{
"country":"Afghanistan",
"code":"AF",
"code":"AFx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":178000000
},
{
"country":"Bangladesh",
"code":"BD",
"code":"BDx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":191000000
},
{
"country":"Burma",
"code":"MM",
"code":"MMx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":82000000
},
{
"country":"Congo, Democratic Republic",
"code":"CD",
"code":"CDx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":149000000
},
{
"country":"Ethiopia",
"code":"ET",
"code":"ETx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":303000000
},
{
"country":"Ghana",
"code":"GH",
"code":"GHx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":65000000
},
{
"country":"India",
"code":"IN",
"code":"INx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":160000000
},
{
"country":"Occupied Palestinian Territories",
"code":"PS",
"code":"PSx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":72000000
},
{
"country":"Kenya",
"code":"KE",
"code":"KEx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":160000000
},
{
"country":"Mozambique",
"code":"MZ",
"code":"MZx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":57000000
},
{
"country":"Nigeria",
"code":"NG",
"code":"NGx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":210000000
},
{
"country":"Somalia",
"code":"SO",
"code":"SOx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":105000000
},
{
"country":"Sudan",
"code":"SD",
"code":"SDx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":47000000
},
{
"country":"Uganda",
"code":"UG",
"code":"UGx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":96000000
},
{
"country":"Yemen",
"code":"YE",
"code":"YEx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":72000000
},
{
"country":"Zimbabwe",
"code":"ZW",
"code":"ZWx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":76000000
},
{
"country":"Zambia",
"code":"ZM",
"code":"ZMx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":51000000
},
{
"country":"Syria",
"code":"SY",
"code":"SYx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":144000000
},
{
"country":"Malawi",
"code":"MW",
"code":"MWx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":72000000
},
{
"country":"Tanzania",
"code":"TZ",
"code":"TZx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":208000000
},
{
"country":"Nepal",
"code":"NP",
"code":"NPx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":313000000
},
{
"country":"Vietnam",
"code":"VN",
"code":"VNx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":6000000
},
{
"country":"Pakistan",
"code":"PK",
"code":"PKx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":324000000
},
{
"country":"Jordan",
"code":"JO",
"code":"JOx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":37000000
},
{
"country":"Rwanda",
"code":"RW",
"code":"RWx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":66000000
},
{
"country":"Lebanon",
"code":"LB",
"code":"LBx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":69000000
},
{
"country":"South Sudan",
"code":"SS",
"code":"SSx",
"financialStartDate":"2015-04-01",
"financialEndDate":"2016-03-31",
"currency":"GBP",
"operationalBudget":98000000
}
]
]
27 changes: 18 additions & 9 deletions devtracker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@
budgetHigherBound: projectData['project_budget_higher_bound'],
countryAllProjectFilters: projectData['countryAllProjectFilters'],
actualStartDate: projectData['actualStartDate'],
plannedEndDate: projectData['plannedEndDate']
plannedEndDate: projectData['plannedEndDate'],
documentTypes: projectData['document_types']
}

end
Expand Down Expand Up @@ -192,7 +193,8 @@
highLevelSectorList: getRegionProjects['highLevelSectorList'],
budgetHigherBound: getRegionProjects['project_budget_higher_bound'],
actualStartDate: getRegionProjects['actualStartDate'],
plannedEndDate: getRegionProjects['plannedEndDate']
plannedEndDate: getRegionProjects['plannedEndDate'],
documentTypes: getRegionProjects['document_types']
}
end

Expand Down Expand Up @@ -224,7 +226,8 @@
highLevelSectorList: getRegionProjects['highLevelSectorList'],
budgetHigherBound: getRegionProjects['project_budget_higher_bound'],
actualStartDate: getRegionProjects['actualStartDate'],
plannedEndDate: getRegionProjects['plannedEndDate']
plannedEndDate: getRegionProjects['plannedEndDate'],
documentTypes: getRegionProjects['document_types']
}
end

Expand All @@ -251,7 +254,8 @@
highLevelSectorList: getRegionProjects['highLevelSectorList'],
budgetHigherBound: getRegionProjects['project_budget_higher_bound'],
actualStartDate: getRegionProjects['actualStartDate'],
plannedEndDate: getRegionProjects['plannedEndDate']
plannedEndDate: getRegionProjects['plannedEndDate'],
documentTypes: getRegionProjects['document_types']
}
end

Expand Down Expand Up @@ -290,7 +294,8 @@
highLevelSectorList: getRegionProjects['highLevelSectorList'],
budgetHigherBound: getRegionProjects['project_budget_higher_bound'],
actualStartDate: getRegionProjects['actualStartDate'],
plannedEndDate: getRegionProjects['plannedEndDate']
plannedEndDate: getRegionProjects['plannedEndDate'],
documentTypes: getRegionProjects['document_types']
}
end

Expand Down Expand Up @@ -476,7 +481,8 @@
actualStartDate: getSectorProjects['actualStartDate'],
plannedEndDate: getSectorProjects['plannedEndDate'],
locationCountryFilters: getSectorProjects['LocationCountries'],
locationRegionFilters: getSectorProjects['LocationRegions']
locationRegionFilters: getSectorProjects['LocationRegions'],
documentTypes: getSectorProjects['document_types']
}
end

Expand Down Expand Up @@ -519,7 +525,8 @@
actualStartDate: getSectorProjects['actualStartDate'],
plannedEndDate: getSectorProjects['plannedEndDate'],
locationCountryFilters: getSectorProjects['LocationCountries'],
locationRegionFilters: getSectorProjects['LocationRegions']
locationRegionFilters: getSectorProjects['LocationRegions'],
documentTypes: getSectorProjects['document_types']
}
end

Expand Down Expand Up @@ -550,7 +557,8 @@
actualStartDate: getSectorProjects['actualStartDate'],
plannedEndDate: getSectorProjects['plannedEndDate'],
locationCountryFilters: getSectorProjects['LocationCountries'],
locationRegionFilters: getSectorProjects['LocationRegions']
locationRegionFilters: getSectorProjects['LocationRegions'],
documentTypes: getSectorProjects['document_types']
}
end

Expand Down Expand Up @@ -612,7 +620,8 @@
dfidCountryBudgets: results['dfidCountryBudgets'],
dfidRegionBudgets: results['dfidRegionBudgets'],
actualStartDate: results['actualStartDate'],
plannedEndDate: results['plannedEndDate']
plannedEndDate: results['plannedEndDate'],
documentTypes: results['document_types']
}
end

Expand Down
3 changes: 3 additions & 0 deletions helpers/country_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,9 @@ def get_country_all_projects_data(countryCode)
unless allProjectsData['plannedEndDate']['results'][0].nil?
allProjectsData['plannedEndDate'] = allProjectsData['plannedEndDate']['results'][0]['activity_dates'][2]['iso_date']
end
oipa_document_type_list = RestClient.get settings.oipa_api_url + "activities/aggregations/?format=json&group_by=document_link_category&aggregations=count&reporting_organisation=GB-GOV-1&related_activity_recipient_country=#{countryCode}"
document_type_list = JSON.parse(oipa_document_type_list)
allProjectsData['document_types'] = document_type_list['results']
return allProjectsData
end

Expand Down
Loading

0 comments on commit 5c0fe1c

Please sign in to comment.