diff options
author | Matthew Landauer <matthew@openaustralia.org> | 2012-10-19 07:48:12 +1100 |
---|---|---|
committer | Matthew Landauer <matthew@openaustralia.org> | 2012-10-19 07:48:12 +1100 |
commit | f920a81351e6c54d06d58c8df8360650cd1ba6e9 (patch) | |
tree | 60cfce99bbea11296704e67202c4a616d8fa5dea | |
parent | 51f4bc36b65a6d4aaba6233bd5caba39f3215ee5 (diff) |
Fix bug where visitors from overseas visit a site which is not officially live yet
-rw-r--r-- | app/controllers/services_controller.rb | 5 | ||||
-rw-r--r-- | lib/world_foi_websites.rb | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index 5156f3416..38bf51772 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -13,8 +13,9 @@ class ServicesController < ApplicationController old_fgt_locale = FastGettext.locale begin FastGettext.locale = FastGettext.best_locale_in(request.env['HTTP_ACCEPT_LANGUAGE']) - if found_country && found_country[:country_name] - text = _("Hello! You can make Freedom of Information requests within {{country_name}} at {{link_to_website}}", :country_name => found_country[:country_name], :link_to_website => "<a href=\"#{found_country[:url]}\">#{found_country[:name]}</a>") + if found_country && found_country[:country_name] && found_country[:url] && found_country[:name] + text = _("Hello! You can make Freedom of Information requests within {{country_name}} at {{link_to_website}}", + :country_name => found_country[:country_name], :link_to_website => "<a href=\"#{found_country[:url]}\">#{found_country[:name]}</a>") else current_country = WorldFOIWebsites.by_code(iso_country_code)[:country_name] text = _("Hello! We have an <a href=\"/help/alaveteli?country_name=#{CGI.escape(current_country)}\">important message</a> for visitors outside {{country_name}}", :country_name => current_country) diff --git a/lib/world_foi_websites.rb b/lib/world_foi_websites.rb index f175afd3d..8cfd0dfae 100644 --- a/lib/world_foi_websites.rb +++ b/lib/world_foi_websites.rb @@ -45,7 +45,11 @@ class WorldFOIWebsites {:name => "Acceso Intelligente", :country_name => "Chile", :country_iso_code => "CL", - :url => "http://accesointeligente.org"}] + :url => "http://accesointeligente.org"}, + {:country_name => "Australia", + :country_iso_code => "AU", + # The Australian site is not yet live. So, not including name & url yet. + }] return world_foi_websites end |