Skip to content

Commit ffb1511

Browse files
committed
Updated some country names and fixed 404 error around routing.
1 parent 3a5201e commit ffb1511

3 files changed

Lines changed: 37 additions & 13 deletions

File tree

data/countries.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2395,7 +2395,7 @@
23952395
},
23962396
{
23972397
"code": "LY",
2398-
"name": "Libya",
2398+
"name": "State of Libya",
23992399
"description": "The UK is working in partnership with Libya to achieve prosperity, security and human rights for all. Areas of focus include: \n\u2022 Promoting political processes, participation, and human rights \n\u2022 Progress towards an inclusive political process, leading to a political settlement which reflects the rights and needs of all, including elections, a constitution, reconciliation and transitional justice. Development of a strong, independent media. Human rights embedded throughout Libyan institutions. \n\u2022 Strengthening security, justice and defence \n\u2022 Improved security for Libyans, with access to justice, and border control. Development of capable Ministries of Interior, Justice and Defence. Development of a community-based policing service, a functional criminal justice system and professional armed forces under democratic control. Management of arms and ammunition, and disarmament of militias. \n\u2022 Strengthening governance and strategic communications \n\u2022 Progress towards the establishment of credible public sector institutions with effective leadership, capacity and capability to deliver public services, effective strategic communications and good governance. Effective public financial management. \n\u2022 Diversifying the economy and promoting prosperity \n\u2022 Progress towards an open economy, with increased employment opportunities and reduced reliance on the public sector. Increased incentives for outside investment.",
24002400
"Region": "Middle East & North Africa",
24012401
"iso3c": "LBY",
@@ -2737,7 +2737,7 @@
27372737
},
27382738
{
27392739
"code": "FM",
2740-
"name": "Micronesia",
2740+
"name": "Federated States of Micronesia",
27412741
"description": "",
27422742
"Region": "East Asia & Pacific",
27432743
"iso3c": "FSM",
@@ -4314,7 +4314,7 @@
43144314
},
43154315
{
43164316
"code": "TN",
4317-
"name": "Tunisia",
4317+
"name": "Republic of Tunisia",
43184318
"description": "",
43194319
"Region": "Middle East & North Africa",
43204320
"iso3c": "TUN",

devtracker.rb

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,32 @@ def getCacheData(fileName)
404404
# PROJECTS PAGES
405405
#####################################################################
406406

407+
get '/projects/*' do
408+
wildCardData = params['splat'][0]
409+
if request.url.end_with? ('/summary')
410+
getProgID = wildCardData.gsub('/summary', '')
411+
redirect '/programme/'+getProgID+'/summary'
412+
elsif request.url.end_with? ('/documents')
413+
getProgID = wildCardData.gsub('/documents', '')
414+
redirect '/programme/'+getProgID+'/documents'
415+
elsif request.url.end_with? ('/transactions')
416+
getProgID = wildCardData.gsub('/transactions', '')
417+
redirect '/programme/'+getProgID+'/transactions'
418+
elsif request.url.end_with? ('/components')
419+
getProgID = wildCardData.gsub('/components', '')
420+
redirect '/programme/'+getProgID+'/projects'
421+
elsif request.url.end_with? ('/partners')
422+
getProgID = wildCardData.gsub('/partners', '')
423+
redirect '/programme/'+getProgID+'/partners'
424+
else
425+
getProgID = wildCardData.gsub('/components', '')
426+
redirect '/programme/'+getProgID+'/summary'
427+
end
428+
#redirect '/search_p'
429+
end
430+
407431
# Project summary page
408-
get '/projects/*/summary' do
432+
get '/programme/*/summary' do
409433
n = ERB::Util.url_encode (params['splat'][0]).to_s
410434
#n = sanitize_input(n,"p")
411435
check_if_project_exists(n)
@@ -459,7 +483,7 @@ def getCacheData(fileName)
459483
end
460484

461485
# Project documents page
462-
get '/projects/*/documents/?' do
486+
get '/programme/*/documents/?' do
463487
n = ERB::Util.url_encode (params['splat'][0]).to_s
464488
check_if_project_exists(n)
465489
# get the project data from the API
@@ -476,7 +500,7 @@ def getCacheData(fileName)
476500
end
477501

478502
#Project transactions page
479-
get '/projects/*/transactions/?' do
503+
get '/programme/*/transactions/?' do
480504
n = ERB::Util.url_encode (params['splat'][0]).to_s
481505
check_if_project_exists(n)
482506
# get the project data from the API
@@ -492,7 +516,7 @@ def getCacheData(fileName)
492516
end
493517

494518
#Project transactions page
495-
get '/projects/*/components/?' do
519+
get '/programme/*/projects/?' do
496520
n = ERB::Util.url_encode (params['splat'][0]).to_s
497521
check_if_project_exists(n)
498522
# get the project data from the API
@@ -650,7 +674,7 @@ def getCacheData(fileName)
650674
######################################################################
651675
######################################################################
652676
#Project partners page
653-
get '/projects/*/partners/?' do
677+
get '/programme/*/partners/?' do
654678
n = ERB::Util.url_encode (params['splat'][0]).to_s
655679
check_if_project_exists(n)
656680
# get the project data from the API

views/partials/_projects-header.html.erb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@
6666
6767
<nav class="moj-sub-navigation" aria-label="Sub navigation">
6868
<ul class="moj-sub-navigation__list">
69-
<li class="moj-sub-navigation__item"><a href="/projects/<%=ERB::Util.url_encode(project['iati_identifier']).to_s%>/summary" id='summary' class="moj-sub-navigation__link" <%= active=="summary" ? "aria-current='page'" : ""%>>Summary</a></li>
70-
<li class="moj-sub-navigation__item"><a href="/projects/<%=ERB::Util.url_encode(project['iati_identifier']).to_s%>/documents" id='documents' class="moj-sub-navigation__link" <%= active=="documents" ? "aria-current='page'" : ""%>>Documents (<%= project.has_key?('document_link_url') ? project['document_link_url'].count : 0 %>)</a></li>
71-
<li class="moj-sub-navigation__item"><a href="/projects/<%=ERB::Util.url_encode(project['iati_identifier']).to_s%>/components" id="components" class="moj-sub-navigation__link" <%= active=="components" ? "aria-current='page'" : ""%>>Projects</a></li>
72-
<li style="display: none" class="moj-sub-navigation__item transactions-tab"><a href="/projects/<%=ERB::Util.url_encode(project['iati_identifier']).to_s%>/transactions" id="transactions" class="moj-sub-navigation__link" <%= active=="transactions" ? "aria-current='page'" : ""%>>Transactions</a></li>
73-
<li style="display: none" class="moj-sub-navigation__item partner-tab"><a href="/projects/<%=ERB::Util.url_encode(project['iati_identifier']).to_s%>/partners" id="partners" class="moj-sub-navigation__link" <%= active=="partners" ? "aria-current='page'" : ""%>>Partners</a></li>
69+
<li class="moj-sub-navigation__item"><a href="/programme/<%=ERB::Util.url_encode(project['iati_identifier']).to_s%>/summary" id='summary' class="moj-sub-navigation__link" <%= active=="summary" ? "aria-current='page'" : ""%>>Summary</a></li>
70+
<li class="moj-sub-navigation__item"><a href="/programme/<%=ERB::Util.url_encode(project['iati_identifier']).to_s%>/documents" id='documents' class="moj-sub-navigation__link" <%= active=="documents" ? "aria-current='page'" : ""%>>Documents (<%= project.has_key?('document_link_url') ? project['document_link_url'].count : 0 %>)</a></li>
71+
<li class="moj-sub-navigation__item"><a href="/programme/<%=ERB::Util.url_encode(project['iati_identifier']).to_s%>/projects" id="components" class="moj-sub-navigation__link" <%= active=="components" ? "aria-current='page'" : ""%>>Projects</a></li>
72+
<li style="display: none" class="moj-sub-navigation__item transactions-tab"><a href="/programme/<%=ERB::Util.url_encode(project['iati_identifier']).to_s%>/transactions" id="transactions" class="moj-sub-navigation__link" <%= active=="transactions" ? "aria-current='page'" : ""%>>Transactions</a></li>
73+
<li style="display: none" class="moj-sub-navigation__item partner-tab"><a href="/programme/<%=ERB::Util.url_encode(project['iati_identifier']).to_s%>/partners" id="partners" class="moj-sub-navigation__link" <%= active=="partners" ? "aria-current='page'" : ""%>>Partners</a></li>
7474
</ul>
7575
</nav>
7676
</div>

0 commit comments

Comments
 (0)