6565
6666# Server Machine: set global settings to use varnish cache
6767#set :oipa_api_url, 'http://127.0.0.1:6081/search/'
68-
68+ set :prod_api_url , 'https://fcdo.iati.cloud'
69+ set :dev_api_url , 'https://fcdo-staging.iati.cloud'
6970
7071
7172#ensures that we can use the extension html.erb rather than just .erb
149150 oipa_api_url : settings . oipa_api_url ,
150151 whatWeDoTotal : whatWeDoTotal ,
151152 top5CountryTotal : top5CountryTotal ,
152- activiteProjectCount : activiteProjectCount ,
153+ activiteProjectCount : activiteProjectCount
153154 }
154155end
155156
@@ -231,6 +232,13 @@ def getCacheData(fileName)
231232 # Get a list of map markers
232233 mapMarkers = getCountryMapMarkers ( n )
233234 settings . devtracker_page_title = 'Country ' + country [ 'name' ] + ' Summary Page'
235+ json_link = ''
236+ if request . url . start_with? ( 'https://devtracker.' )
237+ json_link = json_link + settings . prod_api_url
238+ else
239+ json_link = json_link + settings . dev_api_url
240+ end
241+ json_link = json_link + '/search/activity/?q=recipient_country_code:' +n +' AND reporting_org_ref:GB-GOV-* AND hierarchy:1&format='
234242 erb :'countries/country' ,
235243 :layout => :'layouts/layout' ,
236244 :locals => {
@@ -242,7 +250,8 @@ def getCacheData(fileName)
242250 countryGeoJsonData : geoJsonData ,
243251 mapMarkers : mapMarkers ,
244252 active_link : 'aidByLoc' ,
245- active_sub_link : 'countrySummary'
253+ active_sub_link : 'countrySummary' ,
254+ json_url_link : json_link
246255 }
247256end
248257## country summary page related api calls
@@ -422,6 +431,14 @@ def getCacheData(fileName)
422431 end
423432 end
424433 end
434+ if ( !project [ 'reporting_org_ref' ] . to_s == 'GB-GOV-1' )
435+ if ( project . has_key? ( 'activity_aggregation_incoming_funds_value_gbp' ) )
436+ programmeBudget = programmeBudget + project [ 'activity_aggregation_incoming_funds_value_gbp' ] . to_f
437+ end
438+ if ( project . has_key? ( 'activity_aggregation_commitment_value_gbp' ) )
439+ programmeBudget = programmeBudget + project [ 'activity_aggregation_commitment_value_gbp' ] . to_f
440+ end
441+ end
425442 #get project sectorwise graph data
426443 projectSectorGraphData = get_project_sector_graph_datav2 ( n )
427444 settings . devtracker_page_title = 'Programme ' +project [ 'iati_identifier' ]
@@ -834,7 +851,7 @@ def getCacheData(fileName)
834851# SOLR BASED PAGES
835852#####################################################################
836853
837- get '/search /?' do
854+ get '/search_p /?' do
838855 if ( !params [ 'query' ] )
839856 query = ''
840857 filters = [ ]
@@ -878,7 +895,7 @@ def getCacheData(fileName)
878895 }
879896end
880897
881- post '/search /?' do
898+ post '/search_p /?' do
882899 #query = params['query']
883900 query = sanitize_input ( params [ 'query' ] , "newId" )
884901 isIncludeClosedProjects = sanitize_input ( params [ 'includeClosedProject' ] , "newId" )
0 commit comments