aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/public_body_controller.rb3
-rw-r--r--app/controllers/request_controller.rb2
-rw-r--r--app/controllers/services_controller.rb2
-rw-r--r--app/views/public_body/show.html.erb11
4 files changed, 17 insertions, 1 deletions
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb
index e64644a1b..2e540d198 100644
--- a/app/controllers/public_body_controller.rb
+++ b/app/controllers/public_body_controller.rb
@@ -55,6 +55,8 @@ class PublicBodyController < ApplicationController
@xapian_requests = nil
end
+ flash.keep(:search_params)
+
@track_thing = TrackThing.create_track_for_public_body(@public_body)
@feed_autodetect = [ { :url => do_track_url(@track_thing, 'feed'), :title => @track_thing.params[:title_in_rss], :has_json => true } ]
@@ -349,6 +351,7 @@ class PublicBodyController < ApplicationController
# Since acts_as_xapian doesn't support the Partial match flag, we work around it
# by making the last work a wildcard, which is quite the same
query = params[:query]
+ flash[:search_params] = params.slice(:query, :bodies, :page)
@xapian_requests = perform_search_typeahead(query, PublicBody)
render :partial => "public_body/search_ahead"
end
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index 39e7616ed..f1076f0bc 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -37,6 +37,7 @@ class RequestController < ApplicationController
end
if !params[:query].nil?
query = params[:query]
+ flash[:search_params] = params.slice(:query, :bodies, :page)
@xapian_requests = perform_search_typeahead(query, PublicBody)
end
medium_cache
@@ -123,7 +124,6 @@ class RequestController < ApplicationController
@track_thing = TrackThing.create_track_for_request(@info_request)
@feed_autodetect = [ { :url => do_track_url(@track_thing, 'feed'), :title => @track_thing.params[:title_in_rss], :has_json => true } ]
-
respond_to do |format|
format.html { @has_json = true; render :template => 'request/show'}
format.json { render :json => @info_request.json_for_api(true) }
diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb
index dc4f783a6..9b3a3396f 100644
--- a/app/controllers/services_controller.rb
+++ b/app/controllers/services_controller.rb
@@ -5,6 +5,8 @@ require 'open-uri'
class ServicesController < ApplicationController
def other_country_message
+ flash.keep
+
text = ""
iso_country_code = AlaveteliConfiguration::iso_country_code.downcase
if country_from_ip.downcase != iso_country_code
diff --git a/app/views/public_body/show.html.erb b/app/views/public_body/show.html.erb
index 5ac637a78..a9fd8443a 100644
--- a/app/views/public_body/show.html.erb
+++ b/app/views/public_body/show.html.erb
@@ -1,5 +1,16 @@
<% @title = h(@public_body.name) + _(" - view and make Freedom of Information requests") %>
<div id="main_content">
+
+ <% if flash[:search_params] %>
+ <div class="back-to-results">
+ <div class="message">
+ <%= link_to select_authority_path(flash[:search_params]) do %>
+ <%= _('« Back to search results') %>
+ <% end %>
+ </div>
+ </div>
+ <% end %>
+
<div id="header_right">
<h2><%= _('Follow this authority')%></h2>