diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2011-09-16 10:57:25 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2011-09-16 12:09:36 +0100 |
commit | 55f7757f464b12bb945f9f7d94120ea4c5595b51 (patch) | |
tree | 9037f5504b7b7f5443dc588838e4d0dd882afa3a | |
parent | f43d57d5ba491b32bafcfdbdd314dbce6d317dbb (diff) |
Make clicks to filter requests on public body page jump to search results (i.e. beyond filter boxes)
-rw-r--r-- | app/views/public_body/show.rhtml | 9 | ||||
-rw-r--r-- | app/views/request/_request_filter_form.rhtml | 4 |
2 files changed, 7 insertions, 6 deletions
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 @@ <p><%= _('Nobody has made any Freedom of Information requests to {{public_body_name}} using this site yet.', :public_body_name => h(@public_body.name))%></p> <% end %> <% else %> - <h2 class="foi_results"> - + <h2 class="foi_results"> <% 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 %> </h2> - <% if @public_body.info_requests.size > 1 %> + <a name="results"></a> + + <% 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 %> |