diff --git a/app/controllers/chapters_controller.rb b/app/controllers/chapters_controller.rb index b89b4a66..041f1fd4 100644 --- a/app/controllers/chapters_controller.rb +++ b/app/controllers/chapters_controller.rb @@ -8,7 +8,7 @@ class ChaptersController < ApplicationController # GET /chapters or /chapters.json def index - @countries = Country.order(:name) + @countries = Country.joins(:chapters).distinct.order(:name) @country_param = determine_country_param @chapters = filter_chapters_by_country load_country_data if @country_param diff --git a/app/helpers/chapters_helper.rb b/app/helpers/chapters_helper.rb index ba97d0e4..ffff924a 100644 --- a/app/helpers/chapters_helper.rb +++ b/app/helpers/chapters_helper.rb @@ -109,27 +109,48 @@ def country_icon(country_name) 'Botswana' => 'countries/country_botswana.png', 'Burkina Faso' => 'countries/country_burkina_faso.png', 'Burundi' => 'countries/country_burundi.png', + 'Cape Verde' => 'countries/country_cape_verde.png', 'Cameroon' => 'countries/country_cameroon.png', 'Central African Republic' => 'countries/country_central_african_republic.png', 'Chad' => 'countries/country_chad.png', - 'Democratic Republic of Congo' => 'countries/country_democratic_republic_of_congo.png', + 'Comoros' => 'countries/country_comoros.png', + 'Congo' => 'countries/congo.png', + 'DR Congo' => 'countries/country_democratic_republic_of_congo.png', + 'Djibouti' => 'countries/country_djibouti.png', 'Egypt' => 'countries/country_egypt.png', + 'Equatorial Guinea' => 'countries/country_equatorial_guinea.png', + 'Eritrea' => 'countries/country_eritrea.png', + 'Eswatini' => 'countries/country_eswatini.png', 'Ethiopia' => 'countries/country_ethiopia.png', 'Gabon' => 'countries/country_gabon.png', + 'Gambia' => 'countries/country_gambia.png', 'Ghana' => 'countries/country_ghana.png', + 'Guinea' => 'countries/country_guinea.png', + 'Guinea-Bissau' => 'countries/country_guinea_bissau.png', 'Ivory Coast' => 'countries/country_ivory_coast.png', 'Kenya' => 'countries/country_kenya.png', + 'Lesotho' => 'countries/country_lesotho.png', + 'Liberia' => 'countries/country_liberia.png', + 'Libya' => 'countries/country_libya.png', 'Madagascar' => 'countries/country_madagascar.png', + 'Mali' => 'countries/country_mali.png', 'Malawi' => 'countries/country_malawi.png', + 'Mauritania' => 'countries/country_mauritania.png', 'Mauritius' => 'countries/country_mauritius.png', 'Morocco' => 'countries/country_morocco.png', + 'Mozambique' => 'countries/country_mozambique.png', 'Namibia' => 'countries/country_namibia.png', + 'Niger' => 'countries/country_niger.png', 'Nigeria' => 'countries/country_nigeria.png', 'Rwanda' => 'countries/country_rwanda.png', + 'Sao Tome & Principe' => 'countries/country_sao_tome_and_principe.png', 'Senegal' => 'countries/country_senegal.png', + 'Seychelles' => 'countries/country_seychelles.png', 'Sierra Leone' => 'countries/country_sierra_leone.png', 'Somalia' => 'countries/country_somalia.png', 'South Africa' => 'countries/country_south_africa.png', + 'South Sudan' => 'countries/country_south_sudan.png', + 'Sudan' => 'countries/country_sudan.png', 'Tanzania' => 'countries/country_tanzania.png', 'Togo' => 'countries/country_togo.png', 'Tunisia' => 'countries/country_tunisia.png', diff --git a/app/views/chapters/index.html.erb b/app/views/chapters/index.html.erb index 4543857a..64ea38e5 100644 --- a/app/views/chapters/index.html.erb +++ b/app/views/chapters/index.html.erb @@ -82,7 +82,7 @@ -