aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/admin_public_body/edit.rhtml2
-rw-r--r--app/views/admin_public_body/new.rhtml2
-rw-r--r--app/views/general/_localised_datepicker.rhtml18
-rw-r--r--app/views/general/advanced_search.rhtml0
-rw-r--r--app/views/general/blog.rhtml2
-rw-r--r--app/views/general/search.rhtml205
-rw-r--r--app/views/layouts/default.rhtml5
-rw-r--r--app/views/public_body/list.rhtml11
-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.rhtml16
11 files changed, 238 insertions, 88 deletions
diff --git a/app/views/admin_public_body/edit.rhtml b/app/views/admin_public_body/edit.rhtml
index 1883eb083..b91f15a2e 100644
--- a/app/views/admin_public_body/edit.rhtml
+++ b/app/views/admin_public_body/edit.rhtml
@@ -1,6 +1,6 @@
<h1><%=@title%></h1>
-<script>
+<script type="text/javascript">
$(function() {
$("#div-locales").tabs();
});
diff --git a/app/views/admin_public_body/new.rhtml b/app/views/admin_public_body/new.rhtml
index 11186ee47..b859fdf6a 100644
--- a/app/views/admin_public_body/new.rhtml
+++ b/app/views/admin_public_body/new.rhtml
@@ -2,7 +2,7 @@
<h1><%=@title%></h1>
-<script>
+<script type="text/javascript">
$(function() {
$("#div-locales").tabs();
});
diff --git a/app/views/general/_localised_datepicker.rhtml b/app/views/general/_localised_datepicker.rhtml
new file mode 100644
index 000000000..5fdd63644
--- /dev/null
+++ b/app/views/general/_localised_datepicker.rhtml
@@ -0,0 +1,18 @@
+<script type="text/javascript">
+ $(function() {
+ $(".use-datepicker").datepicker(
+ {closeText: '<%= _("Done") %>',
+ prevText: '<%= _("Prev") %>',
+ nextText: '<%= _("Next") %>',
+ currentText: '<%= _("Today") %>',
+ monthNames: <%= I18n.translate('date.month_names')[1..-1].to_json %>,
+ monthNamesShort: <%= I18n.translate('date.abbr_month_names')[1..-1].to_json %>,
+ dayNames: <%= I18n.translate('date.day_names').to_json %>,
+ dayNamesShort: <%= I18n.translate('date.abbr_day_names').to_json %>,
+ dayNamesMin: <%= I18n.translate('date.abbr_day_names').collect{|x| x[0..0]}.to_json %>,
+ weekHeader: '<%= _("Wk") %>',
+ dateFormat: '<%= I18n.translate('date.formats.default').sub("%Y", "yy").sub("%m", "mm").sub("%d", "dd").gsub("-", "/") %>'}
+ );
+ });
+</script>
+
diff --git a/app/views/general/advanced_search.rhtml b/app/views/general/advanced_search.rhtml
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/app/views/general/advanced_search.rhtml
diff --git a/app/views/general/blog.rhtml b/app/views/general/blog.rhtml
index c9387c24f..f5bd66ebd 100644
--- a/app/views/general/blog.rhtml
+++ b/app/views/general/blog.rhtml
@@ -6,7 +6,7 @@
<% if !@twitter_user.empty? %>
<div id="twitter">
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
-<script>
+<script type="text/javascript">
new TWTR.Widget({
version: 2,
type: 'profile',
diff --git a/app/views/general/search.rhtml b/app/views/general/search.rhtml
index 1d934f65a..3e6a89582 100644
--- a/app/views/general/search.rhtml
+++ b/app/views/general/search.rhtml
@@ -2,73 +2,139 @@
<% 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 %>
-<% 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>
- <p><% _('Can\'t find it? <a href="%s">Browse all</a> or <a href="%s">ask us to add it</a>.') % [list_public_bodies_default, "#{help_requesting_path}#missing_body"] %></p>
- <p>
- </div>
-<% end %>
+<h1><%=@title%></h1>
-<% 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") %>
- <% if not @show_tips %>
- &nbsp;&nbsp;<%= link_to _('Advanced search tips'), search_redirect_path %>
+<%= render :partial => 'localised_datepicker' %>
+
+<% if @advanced %>
+ <p><%= _('To use the advanced search, combine phrases and labels as described in the search tips below.') %></p>
+ <% form_tag(advanced_search_url, :method => "get") do %>
+ <%= label_tag(:query, _("Search for:")) %>
+ <%= text_field_tag(:query, params[:query], { :size => 40 }) %>
+ <%= submit_tag("Search") %>
+ <% end %>
+ <p><%= link_to(_("Simple search"), search_redirect_url) %></p>
+
+<% else %>
+
+<% form_tag(request.url, :method => "get") do %>
+<div id="list-filter">
+ <div id="simple-search-box">
+ <%= label_tag(:query, _("Search for:")) %>
+ <%= text_field_tag(:query, params[:query], { :size => 40 }) %>
+ <%= submit_tag("Search") %>
+ </div>
+
+ <fieldset>
+ <legend>
+ <%= _("Filters:") %>
+ </legend>
+<div id="common-subfilters">
+ <div id="variety-filter">
+ <ul>
+ <% for variety, label in [
+ ["all", _("everything")],
+ ["requests", _("requests")],
+ ["users", _("users")],
+ ["bodies", _("authorities")]]%>
+ <li>
+ <% if @variety_postfix != variety %>
+ <% if variety != "users" %>
+ <%= link_to label, search_url([params[:query], @common_query], variety, @sort_postfix), :method => :get %>
+ <% else %>
+ <%= link_to label, search_url(params[:query], variety, @sort_postfix), :method => :get %>
+ <% end %>
+ <% else %>
+ <%= label %>
<% end %>
- </p>
+ </li>
+ <% end %>
+ </ul>
+ </div>
+
+<% if false %>
+<%-# Commented out for now as tags are of limited use when users can't see them. This will change in the future! -%>
+<% if @variety_postfix != "users" %>
+ <div>
+ <%= label_tag(:query, _("Tags (separated by a space):")) %><%= text_field_tag(:tags, params[:tags], { :size => 20 }) %>
+ <% for tag in InfoRequest.get_tags %>
+ <%= tag.name_and_value %>
+ <% end %>
+ </div>
+<% end %>
+<% end %>
+</div>
+
+<% if @variety_postfix == "requests" %>
+<div id="requests-subfilters">
+ <div>
+ <%= _("Only show:") %> <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>
+ <%= _("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>
+ 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>
<% end %>
+ <%= submit_tag("Filter") %>
+ </fieldset>
+</div>
+<% end %>
+
+<p><%= link_to(_("Advanced search"), advanced_search_url) %></p>
+<% end %>
<% if !@query.nil? %>
<p>
- <%=link_to_unless @sortby == 'relevant', _("Show most relevant results first"), search_url(@query, 'relevant') %>
+ <%=link_to_unless @sortby == 'relevant', _("Show most relevant results first"), search_url(@query, @variety_postfix, 'relevant', @advanced) %>
|
- <%=link_to_unless @sortby == 'newest', _("Newest results first"), search_url(@query, 'newest') %>
+ <%=link_to_unless @sortby == 'newest', _("Newest results first"), search_url(@query, @variety_postfix, 'newest', @advanced) %>
<% if @sortby == 'described' %>
| <%= _('Recently described results first') %>
<% end %>
</p>
<% end %>
-<% if @bodies && !@query.nil? && @xapian_bodies.results.size == 0 && @page == 1 %>
- <h1><%= _('No public authorities found') %></h1>
- <% if @spelling_correction %>
- <p id="did_you_mean"><%= _('Did you mean: {{correction}}',
- :correction => search_link(@spelling_correction, @postfix)) %></p>
- <% end %>
- <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>
+ <p id="did_you_mean"><%= _('Did you mean: {{correction}}', :correction => search_link(@spelling_correction, @variety_postfix, @sort_postfix, @advanced)) %></p>
<% end %>
- <% if (!@bodies || @xapian_requests.results.size == 0) && @track_thing && (@xapian_bodies.results.size > 0 || @xapian_users.results.size > 0 || @total_hits == 0)%>
+ <% if (!@bodies || @xapian_requests_hits == 0) && @track_thing && (@xapian_bodies_hits > 0 || @xapian_users_hits > 0 || @total_hits == 0)%>
<%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %>
<% end %>
- <% 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>
+ <% if @xapian_bodies_hits > 0 %>
+ <% if @xapian_bodies_hits == 1 && @page == 1 %>
+ <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 %>
@@ -80,8 +146,8 @@
<%= will_paginate WillPaginate::Collection.new(@page, @bodies_per_page, @xapian_bodies.matches_estimated) %>
<% end %>
- <% if @xapian_users.results.size > 0 %>
- <% if @xapian_users.results.size == 1 && @page == 1 %>
+ <% if @xapian_users_hits > 0 %>
+ <% if @xapian_users_hits == 1 && @page == 1 %>
<h1><%= _("One person matching &#x2018;{{user_search_query}}&#x2019;", :user_search_query => h(@query)) %></h1>
<% else %>
<h1><%= _("People {{start_count}} to {{end_count}} of {{total_count}} for &#x2018;{{user_search_query}}&#x2019;", :start_count => ((@page-1)*@users_per_page+1).to_s, :end_count => [@page*@users_per_page, @xapian_users.matches_estimated].min.to_s, :total_count => @xapian_users.matches_estimated.to_s, :user_search_query => h(@query)) %></h1>
@@ -94,11 +160,15 @@
<%= will_paginate WillPaginate::Collection.new(@page, @users_per_page, @xapian_users.matches_estimated) %>
<% end %>
- <% if @xapian_requests.results.size > 0 %>
- <% if @xapian_requests.results.size == 1 && @page == 1 %>
- <h1><%= _("One FOI request matching &#x2018;{{user_search_query}}&#x2019;", :user_search_query => h(@query)) %></h1>
+ <% if @xapian_requests_hits > 0 %>
+ <% if @xapian_requests_hits == 1 && @page == 1 %>
+ <h1><%= _("One FOI request matching your search", :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>
+<<<<<<< HEAD
+ <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>
+=======
+ <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>
+>>>>>>> e8ff6d861faefb76c11475a112002cd1b0095590
<% end %>
<% if @track_thing %>
@@ -117,7 +187,10 @@
<% end %>
<% end %>
-<% if @show_tips %>
+<% if @advanced %>
+
+<div id="advanced-search-tips">
+ <a name="show-tips"></a>
<h2><%= _("Advanced search tips")%></h2>
<ul>
<li><%= _("Enter words that you want to find separated by spaces, e.g. <strong>climbing lane</strong>") %></li>
@@ -139,28 +212,30 @@
<h2 id="statuses"><%= _('Table of statuses') %></h2>
<table class="status_table">
- <tr><td><strong><%=search_link('status:waiting_response')%></strong></td><td><%= _('Waiting for the public authority to reply') %></td></tr>
- <tr><td><strong><%=search_link('status:not_held')%></strong></td><td><%= _('The public authority does not have the information requested') %></td></tr>
- <tr><td><strong><%=search_link('status:rejected')%></strong></td><td><%= _('The request was refused by the public authority') %></td></tr>
- <tr><td><strong><%=search_link('status:partially_successful')%></strong></td><td><%= _('Some of the information requested has been received') %></td></tr>
- <tr><td><strong><%=search_link('status:successful')%></strong></td><td><%= _('All of the information requested has been received') %></td></tr>
- <tr><td><strong><%=search_link('status:waiting_clarification')%></strong></td><td><%= _('The public authority would like part of the request explained') %></td></tr>
- <tr><td><strong><%=search_link('status:gone_postal')%></strong></td><td><%= _('The public authority would like to / has responded by post') %></td></tr>
- <tr><td><strong><%=search_link('status:internal_review')%></strong></td><td><%= _('Waiting for the public authority to complete an internal review of their handling of the request') %></td></tr>
- <tr><td><strong><%=search_link('status:error_message')%></strong></td><td><%= _('Received an error message, such as delivery failure.') %></td></tr>
- <tr><td><strong><%=search_link('status:requires_admin')%></strong></td><td><%= _('A strange reponse, required attention by the {{site_name}} team', :site_name=>site_name) %></td></tr>
- <tr><td><strong><%=search_link('status:user_withdrawn')%></strong></td><td><%= _('The requester has abandoned this request for some reason') %></td></tr>
+ <tr><td><strong><%=search_link('status:waiting_response', nil, nil, true)%></strong></td><td><%= _('Waiting for the public authority to reply') %></td></tr>
+ <tr><td><strong><%=search_link('status:not_held', nil, nil, true)%></strong></td><td><%= _('The public authority does not have the information requested') %></td></tr>
+ <tr><td><strong><%=search_link('status:rejected', nil, nil, true)%></strong></td><td><%= _('The request was refused by the public authority') %></td></tr>
+ <tr><td><strong><%=search_link('status:partially_successful', nil, nil, true)%></strong></td><td><%= _('Some of the information requested has been received') %></td></tr>
+ <tr><td><strong><%=search_link('status:successful', nil, nil, true)%></strong></td><td><%= _('All of the information requested has been received') %></td></tr>
+ <tr><td><strong><%=search_link('status:waiting_clarification', nil, nil, true)%></strong></td><td><%= _('The public authority would like part of the request explained') %></td></tr>
+ <tr><td><strong><%=search_link('status:gone_postal', nil, nil, true)%></strong></td><td><%= _('The public authority would like to / has responded by post') %></td></tr>
+ <tr><td><strong><%=search_link('status:internal_review', nil, nil, true)%></strong></td><td><%= _('Waiting for the public authority to complete an internal review of their handling of the request') %></td></tr>
+ <tr><td><strong><%=search_link('status:error_message', nil, nil, true)%></strong></td><td><%= _('Received an error message, such as delivery failure.') %></td></tr>
+ <tr><td><strong><%=search_link('status:requires_admin', nil, nil, true)%></strong></td><td><%= _('A strange reponse, required attention by the {{site_name}} team', :site_name=>site_name) %></td></tr>
+ <tr><td><strong><%=search_link('status:user_withdrawn', nil, nil, true)%></strong></td><td><%= _('The requester has abandoned this request for some reason') %></td></tr>
</table>
<h2 id="varieties"><%= _('Table of varieties') %></h2>
<table class="status_table">
- <tr><td><strong><%=search_link('variety:sent')%></strong></td><td><%= _('Original request sent') %></td></tr>
- <tr><td><strong><%=search_link('variety:followup_sent')%></strong></td><td><%= _('Follow up message sent by requester') %></td></tr>
- <tr><td><strong><%=search_link('variety:response')%></strong></td><td><%= _('Response from a public authority') %></td></tr>
- <tr><td><strong><%=search_link('variety:comment')%></strong></td><td><%= _('Annotation added to request') %></td></tr>
- <tr><td><strong><%=search_link('variety:authority')%></strong></td><td><%= _('A public authority') %></td></tr>
- <tr><td><strong><%=search_link('variety:user')%></strong></td><td><%= _('A {{site_name}} user', :site_name=>site_name) %></td></tr>
+ <tr><td><strong><%=search_link('variety:sent', nil, nil, true)%></strong></td><td><%= _('Original request sent') %></td></tr>
+ <tr><td><strong><%=search_link('variety:followup_sent', nil, nil, true)%></strong></td><td><%= _('Follow up message sent by requester') %></td></tr>
+ <tr><td><strong><%=search_link('variety:response', nil, nil, true)%></strong></td><td><%= _('Response from a public authority') %></td></tr>
+ <tr><td><strong><%=search_link('variety:comment', nil, nil, true)%></strong></td><td><%= _('Annotation added to request') %></td></tr>
+ <tr><td><strong><%=search_link('variety:authority', nil, nil, true)%></strong></td><td><%= _('A public authority') %></td></tr>
+ <tr><td><strong><%=search_link('variety:user', nil, nil, true)%></strong></td><td><%= _('A {{site_name}} user', :site_name=>site_name) %></td></tr>
</table>
+</div>
+
<% end %>
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..c8a89ed3a 100644
--- a/app/views/public_body/list.rhtml
+++ b/app/views/public_body/list.rhtml
@@ -38,14 +38,19 @@
<h1><%=@title%></h1>
+<% form_tag(request.url, :method => "get") do %>
+ <div>
+ <%= label_tag(:public_body_query, _("Search:")) %>
+ <%= text_field_tag(:public_body_query, params[:public_body_query]) %>
+ <%= submit_tag(_("Search")) %>
+ </div>
+<% 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..1151b9966 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..33b7bfb27
--- /dev/null
+++ b/app/views/request/_request_filter_form.rhtml
@@ -0,0 +1,55 @@
+<%= render :partial => 'general/localised_datepicker' %>
+
+<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>
+ <% form_tag(request.path, :method => "get") do %>
+ <div class="list-filter-item">
+ <%= label_tag(:query, _("Search for:")) %>
+ <%= text_field_tag(:query, params[:query]) %>
+ </div>
+<% if false # don't think we want this, but leaving as an example %>
+ <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>
+<% end %>
+ <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 04dc0d010..a434566ac 100644
--- a/app/views/request/list.rhtml
+++ b/app/views/request/list.rhtml
@@ -1,19 +1,9 @@
-<div id="list_sidebar">
-<h1><%= _('Show only...')%></h1>
-<ul>
-<% for view, description, target in [
- ['successful', _('Successful responses'), request_list_successful_url(:view => 'successful')],
- ['recent', _('Recently sent requests'), request_list_recent_url(:view => 'recent')]
-] %>
-<li>
- <%= link_to_unless (@view == view), description, target %>
-</li>
-<% end %>
-</ul>
-</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 %>