From 55f7757f464b12bb945f9f7d94120ea4c5595b51 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Fri, 16 Sep 2011 10:57:25 +0100 Subject: Make clicks to filter requests on public body page jump to search results (i.e. beyond filter boxes) --- app/views/public_body/show.rhtml | 9 +++++---- app/views/request/_request_filter_form.rhtml | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'app') diff --git a/app/views/public_body/show.rhtml b/app/views/public_body/show.rhtml index 6c1bf626e..2436c58b9 100644 --- a/app/views/public_body/show.rhtml +++ b/app/views/public_body/show.rhtml @@ -76,12 +76,11 @@

<%= _('Nobody has made any Freedom of Information requests to {{public_body_name}} using this site yet.', :public_body_name => h(@public_body.name))%>

<% end %> <% else %> -

- +

<% if @public_body.eir_only? %> <%= pluralize(@public_body.info_requests.size, "Environmental Information Regulations request made using this site") %> <% else %> - <% if @public_body.info_requests.size > 1 %> + <% if @public_body.info_requests.size > 4 %> <%= n_('Search within the %d Freedom of Information requests to %s', 'Search within the %d Freedom of Information requests made to %s', @public_body.info_requests.size) % [@public_body.info_requests.size, @public_body.name] %> <% else %> <%= n_('%d Freedom of Information request to %s', '%d Freedom of Information requests to %s', @public_body.info_requests.size) % [@public_body.info_requests.size, @public_body.name] %> @@ -89,7 +88,9 @@ <% end %> <%= @page_desc %>

- <% if @public_body.info_requests.size > 1 %> + + + <% if @public_body.info_requests.size > 4 %> <%= render :partial => 'request/request_filter_form' %> <% end %> <% end %> diff --git a/app/views/request/_request_filter_form.rhtml b/app/views/request/_request_filter_form.rhtml index aa86e8596..fa760bf74 100644 --- a/app/views/request/_request_filter_form.rhtml +++ b/app/views/request/_request_filter_form.rhtml @@ -34,9 +34,9 @@ <% for status, label in statuses %> <% if params[:view] != status %> <% if params[:controller] == "public_body" %> - <%= link_to label, url_for(:controller => "public_body", :action => "show", :view => status, :url_name => @public_body.url_name) + "?" + request.query_string %> + <%= link_to label, url_for(:controller => "public_body", :action => "show", :view => status, :url_name => @public_body.url_name) + "?" + request.query_string + '#results' %> <% else %> - <%= link_to label, url_for(:controller => "request", :action => "list", :view => status) + "?" + request.query_string %> + <%= link_to label, url_for(:controller => "request", :action => "list", :view => status) + "?" + request.query_string + '#results' %> <% end %> <% else %> <%= label %> -- cgit v1.2.3