aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/application_controller.rb72
-rw-r--r--app/controllers/general_controller.rb8
-rw-r--r--app/controllers/public_body_controller.rb29
-rw-r--r--app/controllers/request_controller.rb7
-rwxr-xr-xapp/helpers/link_to_helper.rb2
-rw-r--r--app/models/track_thing.rb14
-rw-r--r--app/views/general/search.rhtml71
-rw-r--r--app/views/layouts/default.rhtml5
-rw-r--r--app/views/public_body/list.rhtml10
-rw-r--r--app/views/public_body/show.rhtml10
-rw-r--r--app/views/request/_request_filter_form.rhtml55
-rw-r--r--app/views/request/list.rhtml37
12 files changed, 212 insertions, 108 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index e16f9f5bb..31a6ef3db 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -349,10 +349,18 @@ class ApplicationController < ActionController::Base
session[:last_body_id] = public_body.id
end
- def alter_query_from_params(query)
+ def param_exists(item)
+ return params[item] && !params[item].empty?
+ end
+
+ def alter_query_from_params
# various forms are used to customise queries and hide
# xapian's complexity. This parses the form fields and turns
# them into a xapian query string
+ if params[:latest_status].nil?
+ params[:latest_status] = params[:view] || "all"
+ end
+ query = params[:query]
query = "" if query.nil?
sortby = "newest"
if params[:request_variety] && !(query =~ /variety:/)
@@ -369,35 +377,53 @@ class ApplicationController < ActionController::Base
end
query += " (#{varieties.join(' OR ')})"
end
- case params[:request_status]
- when "recent", "all"
- if !(query =~ /variety:/)
- query += " (variety:sent)"
+ if params[:latest_status] && !(query =~ /latest_status:/)
+ statuses = []
+ if params[:latest_status].class == String
+ params[:latest_status] = [params[:latest_status]]
end
- when "successful"
- query += ' (latest_status:successful OR latest_status:partially_successful)'
- sortby = "described"
- when "unsuccessful"
- query += ' (latest_status:rejected OR latest_status:not_held)'
- sortby = "described"
- when "awaiting"
- if query.empty?
- query += 'variety:sent '
+ if params[:latest_status].include?("recent") || params[:latest_status].include?("all")
+ if !(query =~ /variety:/)
+ query += " (variety:sent)"
+ end
end
- query += ' NOT (latest_status:successful OR latest_status:partially_successful OR latest_status:rejected OR latest_status:not_held OR latest_status:gone_postal)'
- sortby = "described"
- when "internal_review"
- query += ' (latest_status:internal_review)'
- sortby = "described"
- end
+ if params[:latest_status].include? "successful"
+ statuses << ['latest_status:successful', 'latest_status:partially_successful']
+ sortby = "described"
+ end
+ if params[:latest_status].include? "unsuccessful"
+ statuses << ['latest_status:rejected', 'latest_status:not_held']
+ sortby = "described"
+ end
+ if params[:latest_status].include? "awaiting"
+ statuses << ['latest_status:waiting_response', 'latest_status:waiting_clarification', 'waiting_classification:true']
+ sortby = "described"
+ end
+ if params[:latest_status].include? "internal_review"
+ statuses << ['status:internal_review']
+ sortby = "described"
+ end
+ if params[:latest_status].include? "other"
+ statuses << ['latest_status:gone_postal', 'latest_status:error_message', 'latest_status:requires_admin', 'latest_status:user_withdrawn']
+ sortby = "described"
+ end
+ if params[:latest_status].include? "gone_postal"
+ statuses << ['latest_status:gone_postal']
+ sortby = "described"
+ end
+ query += " (#{statuses.join(' OR ')})"
- if !params[:request_date_after].nil? && params[:request_date_before].nil?
+ end
+ if query.empty?
+ query = "variety:sent"
+ end
+ if param_exists(:request_date_after) && !param_exists(:request_date_before)
params[:request_date_before] = Date.now.strftime("%d/%m/%Y")
query += " #{params[:request_date_after]}..#{params[:request_date_before]}"
- elsif params[:request_date_after].nil? && !params[:request_date_before].nil?
+ elsif !param_exists(:request_date_after) && param_exists(:request_date_before)
params[:request_date_after] = "01/01/2008"
end
- if params[:request_date_after]
+ if param_exists(:request_date_after)
query = "#{params[:request_date_after]}..#{params[:request_date_before]} " + query
end
return query, sortby
diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb
index 4fa603aab..e9325c3c5 100644
--- a/app/controllers/general_controller.rb
+++ b/app/controllers/general_controller.rb
@@ -82,9 +82,12 @@ class GeneralController < ApplicationController
# Just does a redirect from ?query= search to /query
def search_redirect
- @query = params[:query]
+ @query = alter_query_from_params
@sortby = params[:sortby]
@bodies = params[:bodies]
+ [:latest_status, :request_variety, :request_date_after, :request_date_before, :query].each do |x|
+ session[x] = params[x]
+ end
if @query.nil? || @query.empty?
@query = nil
@page = 1
@@ -103,6 +106,9 @@ class GeneralController < ApplicationController
def search
# XXX Why is this so complicated with arrays and stuff? Look at the route
# in config/routes.rb for comments.
+ [:latest_status, :request_variety, :request_date_after, :request_date_before, :query].each do |x|
+ params[x] = session[x]
+ end
combined = params[:combined]
@sortby = nil
@bodies = false # searching from front page, largely for a public authority
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb
index 05acf4868..cb27e78f0 100644
--- a/app/controllers/public_body_controller.rb
+++ b/app/controllers/public_body_controller.rb
@@ -16,7 +16,6 @@ class PublicBodyController < ApplicationController
redirect_to :url_name => MySociety::Format.simplify_url_part(params[:url_name], 'body'), :status => :moved_permanently
return
end
-
@locale = self.locale_from_params()
PublicBody.with_locale(@locale) do
@public_body = PublicBody.find_by_url_name_with_historic(params[:url_name])
@@ -39,11 +38,15 @@ class PublicBodyController < ApplicationController
if !referrer.nil? && referrer.match(%r{^#{top_url}search/.*/bodies$})
@searched_to_send_request = true
end
-
+ query, sortby = alter_query_from_params
+ if !query.empty?
+ query = "(#{query})"
+ end
+ query += "requested_from:#{@public_body.url_name}"
# Use search query for this so can collapse and paginate easily
# XXX really should just use SQL query here rather than Xapian.
begin
- @xapian_requests = perform_search([InfoRequestEvent], 'requested_from:' + @public_body.url_name, 'newest', 'request_collapse')
+ @xapian_requests = perform_search([InfoRequestEvent], query, sortby, 'request_collapse')
if (@page > 1)
@page_desc = " (page " + @page.to_s + ")"
else
@@ -83,29 +86,35 @@ class PublicBodyController < ApplicationController
def list
long_cache
# XXX move some of these tag SQL queries into has_tag_string.rb
+ if params[:commit] != _('Show all')
+ @query = "%#{params[:public_body_query].nil? ? "" : params[:public_body_query]}%"
+ else
+ redirect_to list_public_bodies_url(:tag => "all")
+ return
+ end
@tag = params[:tag]
@locale = self.locale_from_params()
- locale_condition = 'public_body_translations.locale = ?'
- if @tag.nil?
+ locale_condition = "upper(public_body_translations.name) LIKE upper(?) AND public_body_translations.locale = ?"
+ if @tag.nil? or @tag == "all"
@tag = "all"
- conditions = [locale_condition, @locale]
+ conditions = [locale_condition, @query, @locale]
elsif @tag == 'other'
category_list = PublicBodyCategories::CATEGORIES.map{|c| "'"+c+"'"}.join(",")
conditions = [locale_condition + ' AND (select count(*) from has_tag_string_tags where has_tag_string_tags.model_id = public_bodies.id
and has_tag_string_tags.model = \'PublicBody\'
- and has_tag_string_tags.name in (' + category_list + ')) = 0', @locale]
+ and has_tag_string_tags.name in (' + category_list + ')) = 0', @query, @locale]
elsif @tag.size == 1
@tag.upcase!
- conditions = [locale_condition + ' AND public_body_translations.first_letter = ?', @locale, @tag]
+ conditions = [locale_condition + ' AND public_body_translations.first_letter = ?', @query, @locale, @tag]
elsif @tag.include?(":")
name, value = HasTagString::HasTagStringTag.split_tag_into_name_value(@tag)
conditions = [locale_condition + ' AND (select count(*) from has_tag_string_tags where has_tag_string_tags.model_id = public_bodies.id
and has_tag_string_tags.model = \'PublicBody\'
- and has_tag_string_tags.name = ? and has_tag_string_tags.value = ?) > 0', @locale, name, value]
+ and has_tag_string_tags.name = ? and has_tag_string_tags.value = ?) > 0', @query, @locale, name, value]
else
conditions = [locale_condition + ' AND (select count(*) from has_tag_string_tags where has_tag_string_tags.model_id = public_bodies.id
and has_tag_string_tags.model = \'PublicBody\'
- and has_tag_string_tags.name = ?) > 0', @locale, @tag]
+ and has_tag_string_tags.name = ?) > 0', @query, @locale, @tag]
end
if @tag.size == 1
@description = _("beginning with") + " '" + @tag + "'"
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index 731348fbf..bb91cc854 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -129,12 +129,9 @@ class RequestController < ApplicationController
def list
medium_cache
@view = params[:view]
- if !@view.nil?
- params[:request_status] = @view
- end
params[:request_status] = "recent" if params[:query].nil? && params[:request_status].nil?
- query, sortby = alter_query_from_params(params[:query])
- @title = "Some title"
+ query, sortby = alter_query_from_params
+ @title = "View and search requests"
@page = get_search_page_from_params if !@page # used in cache case, as perform_search sets @page as side effect
behavior_cache :tag => [@view, @page] do
diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb
index 34354a79b..1299e53eb 100755
--- a/app/helpers/link_to_helper.rb
+++ b/app/helpers/link_to_helper.rb
@@ -79,7 +79,7 @@ module LinkToHelper
link_to(h(public_body.name), main_url(public_body_url(public_body))) + " (" + link_to("admin", public_body_admin_url(public_body)) + ")"
end
def list_public_bodies_default
- list_public_bodies_url(:tag => 'a')
+ list_public_bodies_url(:tag => 'all')
end
# Users
diff --git a/app/models/track_thing.rb b/app/models/track_thing.rb
index 16a0dab87..f993b4fe8 100644
--- a/app/models/track_thing.rb
+++ b/app/models/track_thing.rb
@@ -203,15 +203,15 @@ class TrackThing < ActiveRecord::Base
@params = {
# Website
:list_description => "'<a href=\"/search/" + CGI.escapeHTML(self.track_query) + "/newest\">" + CGI.escapeHTML(self.track_query) + "</a>' in new requests/responses", # XXX yeuch, sometimes I just want to call view helpers from the model, sorry! can't work out how
- :verb_on_page => _("Track things matching '{{query}}' by email", :query=>CGI.escapeHTML(self.track_query)),
- :verb_on_page_already => _("You are already tracking things matching '{{query}}' by email", :query=>CGI.escapeHTML(self.track_query)),
+ :verb_on_page => _("Track things matching this search by email"),
+ :verb_on_page_already => _("You are already tracking things matching this search by email"),
# Email
- :title_in_email => _("Requests or responses matching '{{query}}'", :query=>self.track_query),
- :title_in_rss => _("Requests or responses matching '{{query}}'", :query=>self.track_query),
+ :title_in_email => _("Requests or responses matching your saved search"),
+ :title_in_rss => _("Requests or responses matching your saved search"),
# Authentication
- :web => _("To follow requests and responses matching '{{query}}'", :query=>CGI.escapeHTML(self.track_query)),
- :email => _("Then you will be emailed whenever a new request or response matches '{{query}}'.", :query=>CGI.escapeHTML(self.track_query)),
- :email_subject => _("Confirm you want to be emailed about new requests or responses matching '{{query}}'", :query=>self.track_query),
+ :web => _("To follow requests and responses matching your search"),
+ :email => _("Then you will be emailed whenever a new request or response matches your search."),
+ :email_subject => _("Confirm you want to be emailed about new requests or responses matching your search"),
# RSS sorting - XXX hmmm, we don't really know which to use
# here for sorting. Might be a query term (e.g. 'cctv'), in
# which case newest is good, or might be something like
diff --git a/app/views/general/search.rhtml b/app/views/general/search.rhtml
index 1d934f65a..c66c41774 100644
--- a/app/views/general/search.rhtml
+++ b/app/views/general/search.rhtml
@@ -2,15 +2,15 @@
<% if @query.nil? %>
<% @title = _("Search Freedom of Information requests, public authorities and users") %>
- <h1><%=@title%></h1>
<% elsif @total_hits == 0 %>
- <%= _("Nothing found for &#x2018;{{search_terms}}&#x2019;", :search_terms => h(@query)) %>
+ <% @title = _('There were no requests matching your query.') %>
<% else %>
<% @title = _("Results page {{page_number}}", :page_number => @page.to_s) %>
<% end%>
-
<% @include_request_link_in_authority_listing = true %>
+<h1><%=@title%></h1>
+
<% if @bodies && (@page == 1 || @xapian_bodies.results.size > 0) %>
<div id="stepwise_instructions">
<p><strong><%=_("Next, select the public authority you'd like to make the request from.") %></strong></p>
@@ -19,19 +19,56 @@
</div>
<% end %>
-<% form_tag({:action => "search_redirect"}, {:id => "search_form"}) do %>
- <p>
- <%= text_field_tag 'query', @query, { :size => 40 } %>
- <%= hidden_field_tag 'sortby', @inputted_sortby %>
- <% if @bodies %>
- <%= hidden_field_tag 'bodies', 1 %>
- <% end %>
- <%= submit_tag _("Search") %>
+<script>
+ $(function() {
+ $(".use-datepicker").datepicker();
+ });
+</script>
+
+<div id="list-filter">
+
+ <div class="list-search-item">
+ <% form_tag(search_redirect_url, :method => "get") do %>
+ <%= label_tag(:query, _("Search for:")) %>
+ <%= text_field_tag(:query, params[:query], { :size => 40 }) %>
+ <%= submit_tag("Search") %>
+ </div>
+ <div class="list-filter-item">
+ <%= _("Restrict search to:") %> <br />
+ <% [["successful", _("successful requests")],
+ ["unsuccessful", _("unsuccessful requests")],
+ ["awaiting", _("unresolved requests")],
+ ["internal_review", _("internal reviews")]].each_with_index do |item, index|
+
+ status, title = item %>
+ <%= check_box_tag "latest_status[]", status, params[:latest_status].nil? ? false : params[:latest_status].include?(status), :id => "latest_status_#{index}" %>
+ <%= label_tag("latest_status_#{index}", title) %> <br/>
+ <% end %>
+ </div>
+ <div class="list-filter-item">
+ <%= _("Search for words in:") %> <br/>
+ <% [["sent", _("messages from users")],
+ ["response", _("messages from authorities")],
+ ["comment", _("comments")]].each_with_index do |item, index|
+ variety, title = item %>
+
+ <%= check_box_tag "request_variety[]", variety, params[:request_variety].nil? ? true : params[:request_variety].include?(variety), :id => "request_variety_#{index}" %>
+ <%= label_tag("request_variety_#{index}", title) %> <br/>
+ <% end %>
+ </div>
+ <div class="list-filter-item">
+ Search between dates:
+ <%= text_field_tag(:request_date_after, params[:request_date_after], {:class => "use-datepicker", :size => 10}) %> -
+ <%= text_field_tag(:request_date_before, params[:request_date_before], {:class => "use-datepicker", :size => 10}) %>
+ </div>
+<% end %>
+
<% if not @show_tips %>
&nbsp;&nbsp;<%= link_to _('Advanced search tips'), search_redirect_path %>
<% end %>
- </p>
-<% end %>
+
+
+</div>
<% if !@query.nil? %>
<p>
@@ -53,10 +90,6 @@
<p><%= _('<a href="%s">Browse all</a> or <a href="%s">ask us to add one</a>.') % [list_public_bodies_default, help_requesting_path + '#missing_body'] %></p>
<% end %>
-<% if @total_hits == 0 %>
- <h1><%=@title %></h1>
-<% end %>
-
<% if not @query.nil? %>
<% if @spelling_correction %>
<p id="did_you_mean"><%= _('Did you mean: {{correction}}', :correction => search_link(@spelling_correction, @postfix)) %></p>
@@ -68,7 +101,7 @@
<% if @xapian_bodies.results.size > 0 %>
<% if @xapian_bodies.results.size == 1 && @page == 1 %>
- <h1><%= _('One public authority matching &#x2018;{{user_search_query}}&#x2019;', :user_search_query => h(@query)) %></h1>
+ <h1><%= _('One public authority matching your search', :user_search_query => h(@query)) %></h1>
<% else %>
<h1><%= _('Public authorities {{start_count}} to {{end_count}} of {{total_count}} for {{user_search_query}}', :start_count => ((@page-1)*@bodies_per_page+1).to_s, :end_count => [@page*@bodies_per_page, @xapian_bodies.matches_estimated].min.to_s, :total_count => @xapian_bodies.matches_estimated.to_s, :user_search_query => h(@query)) %></h1>
<% end %>
@@ -98,7 +131,7 @@
<% if @xapian_requests.results.size == 1 && @page == 1 %>
<h1><%= _("One FOI request matching &#x2018;{{user_search_query}}&#x2019;", :user_search_query => h(@query)) %></h1>
<% else %>
- <h1><%= _("FOI requests {{start_count}} to {{end_count}} of {{total_count}} for &#x2018;{{user_search_query}}&#x2019;", :start_count => ((@page-1)*@requests_per_page+1).to_s, :end_count => [@page*@requests_per_page, @xapian_requests.matches_estimated].min.to_s, :total_count => @xapian_requests.matches_estimated.to_s, :user_search_query => h(@query)) %></h1>
+ <h1><%= _("FOI requests {{start_count}} to {{end_count}} of {{total_count}}", :start_count => ((@page-1)*@requests_per_page+1).to_s, :end_count => [@page*@requests_per_page, @xapian_requests.matches_estimated].min.to_s, :total_count => @xapian_requests.matches_estimated.to_s, :user_search_query => h(@query)) %></h1>
<% end %>
<% if @track_thing %>
diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml
index 94ec5a956..e1e7a1e19 100644
--- a/app/views/layouts/default.rhtml
+++ b/app/views/layouts/default.rhtml
@@ -15,9 +15,10 @@
<%= site_name %> - <%= _('Make and browse Freedom of Information (FOI) requests') %>
<% end %>
</title>
-
+
<link rel="shortcut icon" href="/favicon.ico">
-
+ <%= javascript_include_tag 'jquery.js', 'jquery-ui.min' %>
+ <%= stylesheet_link_tag 'admin-theme/jquery-ui-1.8.15.custom.css', :rel => 'stylesheet'%>
<%= stylesheet_link_tag 'main', :title => "Main", :rel => "stylesheet" %>
<!--[if LT IE 7]>
<style type="text/css">@import url("/stylesheets/ie6.css");</style>
diff --git a/app/views/public_body/list.rhtml b/app/views/public_body/list.rhtml
index 5d88b1501..9c36d076b 100644
--- a/app/views/public_body/list.rhtml
+++ b/app/views/public_body/list.rhtml
@@ -38,14 +38,18 @@
<h1><%=@title%></h1>
+<% form_tag(request.url, :method => "get") do %>
+ <%= label_tag(:public_body_query, _("Search:")) %>
+ <%= text_field_tag(:public_body_query, params[:public_body_query]) %>
+ <%= submit_tag(_("Search")) %>
+ <%= submit_tag(_("Show all")) %>
+<% end %>
+
<p class="subtitle">
<%= @public_bodies.size %> <%= _('in total') %>
(<%= _('<a href="%s">can\'t find the one you want?</a>') % [help_requesting_path + '#missing_body'] %>)
</p>
-<% if @tag.size == 1 %>
- <p><%= render :partial => 'alphabet' %></p>
-<% end %>
<%= render :partial => 'body_listing', :locals => { :public_bodies => @public_bodies } %>
<% if @tag.size == 1 && @public_bodies.size > 0 %>
<p><%= render :partial => 'alphabet' %></p>
diff --git a/app/views/public_body/show.rhtml b/app/views/public_body/show.rhtml
index 36bba8851..92f07ef1c 100644
--- a/app/views/public_body/show.rhtml
+++ b/app/views/public_body/show.rhtml
@@ -64,7 +64,7 @@
</div>
<% if !@xapian_requests.nil? %>
- <% if @xapian_requests.results.empty? %>
+ <% if @public_body.info_requests.size == 0 %>
<% if @public_body.eir_only? %>
<h2><%= _('Environmental Information Regulations requests made using this site') %></h2>
<p>Nobody has made any Environmental Information Regulations requests to <%=h(@public_body.name)%> using this site yet.</p>
@@ -82,13 +82,19 @@
<%= @page_desc %>
</h2>
+ <%= render :partial => 'request/request_filter_form' %>
+
<% for result in @xapian_requests.results %>
<%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
<% end %>
<%= will_paginate WillPaginate::Collection.new(@page, @per_page, @public_body.info_requests.size) %>
- <p> <%= _('Only requests made using {{site_name}} are shown.', :site_name => site_name) %></p>
+ <% if @xapian_requests.results.empty? %>
+ <p><% _('There were no requests matching your query.')</p>
+ <% else %>
+ <p> <%= _('Only requests made using {{site_name}} are shown.', :site_name => site_name) %></p>
+ <% end %>
<% end %>
<% else %>
diff --git a/app/views/request/_request_filter_form.rhtml b/app/views/request/_request_filter_form.rhtml
new file mode 100644
index 000000000..e88ec2723
--- /dev/null
+++ b/app/views/request/_request_filter_form.rhtml
@@ -0,0 +1,55 @@
+<script>
+ $(function() {
+ $(".use-datepicker").datepicker();
+ });
+</script>
+
+<div id="list-filter">
+ <div class="list-filter-item">
+ Showing:
+ <ul class="request-selector">
+ <% for status, label in [["all", _("all requests")],
+ ["successful", _("successful requests")],
+ ["unsuccessful", _("unsuccessful requests")],
+ ["awaiting", _("unresolved requests")]] %>
+ <li>
+ <% 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}" %>
+ <% else %>
+ <%= link_to label, url_for(:controller => "request", :action => "list", :view => status) + "?#{request.query_string}" %>
+ <% end %>
+ <% else %>
+ <%= label %>
+ <% end %>
+ </li>
+ <% end %>
+ </ul>
+ </div>
+ <div class="list-filter-item">
+ <% form_tag({}, :method => "get") do %>
+ <%= label_tag(:query, _("Search for:")) %>
+ <%= text_field_tag(:query, params[:query]) %>
+ </div>
+ <div class="list-filter-item">
+ <%= _("Search for words in:") %> <br/>
+ <% [["sent", _("messages from users")],
+ ["response", _("messages from authorities")],
+ ["comment", _("comments")]].each_with_index do |item, index|
+ variety, title = item %>
+
+ <%= check_box_tag "request_variety[]", variety, params[:request_variety].nil? ? true : params[:request_variety].include?(variety), :id => "request_variety_#{index}" %>
+ <%= label_tag("request_variety_#{index}", title) %> <br/>
+ <% end %>
+ </div>
+ <div class="list-filter-item">
+ Search between dates:
+ <%= text_field_tag(:request_date_after, params[:request_date_after], {:class => "use-datepicker", :size => 10}) %> -
+ <%= text_field_tag(:request_date_before, params[:request_date_before], {:class => "use-datepicker", :size => 10}) %>
+ </div>
+
+ <div class="list-filter-item">
+ <%= submit_tag("Search") %>
+ </div>
+<% end %>
+</div>
diff --git a/app/views/request/list.rhtml b/app/views/request/list.rhtml
index 50e98f6e1..a434566ac 100644
--- a/app/views/request/list.rhtml
+++ b/app/views/request/list.rhtml
@@ -1,42 +1,9 @@
-<div id="list-filter">
-<% form_tag({}, :method => "get") do %>
- <%= label_tag(:query, "Search for:") %>
- <%= text_field_tag(:query, params[:query]) %> <br/>
- <% [["sent", "messages from users"],
- ["response", "messages from authorities"],
- ["comment", "comments"]].each_with_index do |item, index|
- variety, title = item %>
-
- <%= check_box_tag "request_variety[]", variety, params[:request_variety].nil? ? true : params[:request_variety].include?(variety), :id => "request_variety_#{index}" %>
- <%= label_tag("request_variety_#{index}", title) %> <br />
- <% end %>
- <ul class="request-selector">
- <% for status in ["all", "successful", "unsuccessful", "awaiting"] %>
- <li>
- <% if params[:view] != status %>
- <%= link_to "#{status} requests", url_for(:controller => "request", :action => "list", :view => status) + "?#{request.query_string}" %>
- <% else %>
- <%= status %> requests
- <% end %>
- </li>
- <% end %>
- </ul>
-
- <div class="filter-item last">
- between dates:
- <input type="text" name="request_date_after" /> from<br>
- <input type="text" name="request_date_before" /> to<br>
- </div>
-
-
-
- <%= submit_tag("Search") %>
-<% end %>
-</div>
<h1><%=@title%></h1>
+<%= render :partial => 'request/request_filter_form' %>
+
<% if @track_thing %>
<%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %>
<% end %>