diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/services_controller.rb | 32 | ||||
-rw-r--r-- | app/views/help/_sidebar.rhtml | 1 | ||||
-rw-r--r-- | app/views/help/alaveteli.rhtml | 30 | ||||
-rw-r--r-- | app/views/layouts/default.rhtml | 6 |
4 files changed, 67 insertions, 2 deletions
diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb new file mode 100644 index 000000000..6fb20336e --- /dev/null +++ b/app/controllers/services_controller.rb @@ -0,0 +1,32 @@ +# controllers/application.rb: +# Parent class of all controllers in FOI site. Filters added to this controller +# apply to all controllers in the application. Likewise, all the methods added +# will be available for all controllers. +# +# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. +# Email: francis@mysociety.org; WWW: http://www.mysociety.org/ +# +# $Id: application.rb,v 1.59 2009-09-17 13:01:56 francis Exp $ + +require 'open-uri' + +class ServicesController < ApplicationController + def other_country_message + text = "" + iso_country_code = MySociety::Config.get('ISO_COUNTRY_CODE').downcase + if country_from_ip.downcase != iso_country_code + found_country = WorldFOIWebsites.by_code(country_from_ip) + found_country_name = !found_country.nil? && found_country[:country_name] + if found_country_name + text = _("Hello! You can make Freedom of Information requests within {{country_name}} at {{link_to_website}}", :country_name => found_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) + end + end + if !text.empty? + text += ' <span class="close-button">X</span>' + end + render :text => text, :content_type => "text/plain" # XXX workaround the HTML validation in test suite + end +end diff --git a/app/views/help/_sidebar.rhtml b/app/views/help/_sidebar.rhtml index b6d26271e..db69f283b 100644 --- a/app/views/help/_sidebar.rhtml +++ b/app/views/help/_sidebar.rhtml @@ -5,6 +5,7 @@ <li><%= link_to_unless_current "Making requests", "/help/requesting" %></li> <li><%= link_to_unless_current "Your privacy", "/help/privacy" %></li> <li><%= link_to_unless_current "FOI officers", "/help/officers" %></li> + <li><%= link_to_unless_current "About the software", "/help/alaveteli" %></li> <li><%= link_to_unless_current "Credits", "/help/credits" %></li> <li><%= link_to_unless_current "Programmers API", "/help/api" %></li> <li><%= link_to_unless_current "Advanced search", "/search" %></li> diff --git a/app/views/help/alaveteli.rhtml b/app/views/help/alaveteli.rhtml new file mode 100644 index 000000000..f7accdd11 --- /dev/null +++ b/app/views/help/alaveteli.rhtml @@ -0,0 +1,30 @@ +<% @title = "Making requests" %> + +<%= render :partial => 'sidebar' %> +<div id="left_column"> + <% if params[:country_name] %> + <h1><%= _("Would you like to see a website like this in your country?") %></h1> + <% else %> + <h1>Powered by Alaveteli</h1> + <% end %> + <p>This website is powered by Alaveteli. Alaveteli is free software + for making Freedom of Information requests. It can easily be + translated into any language, and customised for variations of FOI + law.</p> + + <p>The development of Alaveteli is sponsored and supported by a + number of foundataions and charities who are interested in + transparency across the world.</p> + + <p>If you would like to set up an Alaveteli website in your own + country, we can help. You will need a few days to get the site + configured and ready to use, and will then have to spend at least an + hour a week moderating and managing the site (more for busy + websites).</p> + + <p>Read more on the <a href="http://alaveteli.org">Alaveteli + website</a>, or <a href="mailto:hello@alaveteli.org">drop us an + email</a>.</p> + + <div id="hash_link_padding"></div> +</div> diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml index e21553d0e..c82d75ebe 100644 --- a/app/views/layouts/default.rhtml +++ b/app/views/layouts/default.rhtml @@ -20,7 +20,7 @@ <%= stylesheet_link_tag 'main', :title => "Main", :rel => "stylesheet" %> <%= stylesheet_link_tag 'fonts', :rel => "stylesheet" %> <%= stylesheet_link_tag 'theme', :rel => "stylesheet" %> - <%= javascript_include_tag 'jquery.js', 'jquery-ui.min' %> + <%= javascript_include_tag 'jquery.js', 'jquery-ui.min','jquery.cookie.js', 'general.js' %> <%= stylesheet_link_tag 'admin-theme/jquery-ui-1.8.15.custom.css', :rel => 'stylesheet'%> <!--[if LT IE 7]> <style type="text/css">@import url("/stylesheets/ie6.css");</style> @@ -107,7 +107,7 @@ </div> </div> <div id="wrapper"> - + <div id="content"> <% if flash[:notice] %> @@ -118,6 +118,8 @@ <% end %> <div id="<%= controller.controller_name + "_" + controller.action_name %>" class="controller_<%= controller.controller_name %>"> + + <div id="other-country-notice"></div> <%= yield :layout %> </div> </div> |