Source: Statistics on International Development +
Source: Statistics on International Development 2023 diff --git a/views/index.html.erb b/views/index.html.erb index efa0ac5a..ada1f2d7 100644 --- a/views/index.html.erb +++ b/views/index.html.erb @@ -165,10 +165,10 @@ layout: cw_landing
UK ODA spend by government department
+UK ODA spend by government department (Source, Statistics on International Development 2023)
<% odas.each do |oda| %>Found a match in field: <%=item['highlightedKey']%> - <%=item['highlightedValue']%>
+ <%rescue%> + <%end%> + + <%end%><%begin%> <%=item['description_narrative'].first%> @@ -633,6 +640,12 @@ var prepareContainer = ''; $.each(response.output.docs,function(i, result){ var startDate = new Date(result.activity_date_start_common); + var highlightedKey = ''; + var highlightedVal = ''; + if (result.hasOwnProperty('highlightedKey')) { + highlightedKey = result.highlightedKey; + highlightedVal = result.highlightedValue; + } if (result.reporting_org_narrative[0] != 'UK - Department for International Development (DFID)') { var reporting_org = result.reporting_org_narrative[0]; } @@ -640,10 +653,10 @@ var reporting_org = 'UK - Foreign, Commonwealth and Development Office'; } if(typeof result.description_narrative === 'undefined'){ - prepareContainer = prepareContainer + '
' + reporting_org + '
' + 'No description available' + '
' + reporting_org + '
Found a match in field: '+highlightedKey+' - '+highlightedVal+'
' + 'No description available' + '
' + reporting_org + '
' + result.description_narrative[0] + '
' + reporting_org + '
Found a match in field: '+highlightedKey+' - '+highlightedVal+'
' + result.description_narrative[0] + '