aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/general/frontpage.rhtml2
-rw-r--r--app/views/request/list.rhtml21
2 files changed, 18 insertions, 5 deletions
diff --git a/app/views/general/frontpage.rhtml b/app/views/general/frontpage.rhtml
index 81822da64..563a2609a 100644
--- a/app/views/general/frontpage.rhtml
+++ b/app/views/general/frontpage.rhtml
@@ -59,7 +59,7 @@
<div id="find_information">
<h1>Explore information that others requested</h1>
<%= render :partial => 'request/request_listing', :locals => { :info_requests => @info_requests } %>
- <p><%=link_to "View more successful requests", search_url(:query => 'variety:response (status:successful OR status:partially_successful)', :sortby => 'newest') %></p>
+ <p><%=link_to "View more successful requests", request_list_url(:view => 'successful') %></p>
<% form_tag({:action => "search_redirect"}, {:id => "search_form"}) do %>
<p>
<%= text_field_tag 'query', params[:query], { :size => 20 } %>
diff --git a/app/views/request/list.rhtml b/app/views/request/list.rhtml
index 469c79283..b4a101b2d 100644
--- a/app/views/request/list.rhtml
+++ b/app/views/request/list.rhtml
@@ -1,7 +1,20 @@
-<% @title = "Recent Freedom of Information requests" %>
-
<h1><%=@title%></h1>
-<%= render :partial => 'request_listing', :locals => { :info_requests => @info_requests } %>
+<% if @search_results.empty? %>
+ <p>No requests made yet.</p>
+<% else %>
+ <% for search_result in @search_results %>
+ <% if search_result.class.to_s == 'PublicBody' %>
+ <%= render :partial => 'body/body_listing_single', :locals => { :public_body => search_result } %>
+ <% elsif search_result.class.to_s == 'User' %>
+ <%= render :partial => 'user/user_listing_single', :locals => { :display_user => search_result } %>
+ <% elsif search_result.class.to_s == 'InfoRequestEvent' %>
+ <%= render :partial => 'request/request_listing_via_event', :locals => { :event => search_result, :info_request => search_result.info_request } %>
+ <% else %>
+ <p><strong>Unknown search result type <%=search_result.class.to_s%></strong></p>
+ <% end %>
+ <% end %>
+<% end %>
+
+<%= will_paginate WillPaginate::Collection.new(@page, @per_page, @search_hits) %>
-<%= will_paginate(@info_requests) %>