aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/request_controller.rb4
-rw-r--r--app/models/track_thing.rb4
-rw-r--r--app/views/general/search.rhtml52
3 files changed, 32 insertions, 28 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index 58ea944cb..7ac979453 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -4,7 +4,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: request_controller.rb,v 1.84 2008-05-15 17:40:43 francis Exp $
+# $Id: request_controller.rb,v 1.85 2008-05-15 22:18:19 francis Exp $
class RequestController < ApplicationController
@@ -60,7 +60,7 @@ class RequestController < ApplicationController
else
raise "unknown request list view " + @view.to_s
end
- @xapian_object = perform_search([InfoRequestEvent], sortby, 'request_collapse')
+ @xapian_object = perform_search([InfoRequestEvent], query, sortby, 'request_collapse')
end
# Page new form posts to
diff --git a/app/models/track_thing.rb b/app/models/track_thing.rb
index 53e5817b0..86349d761 100644
--- a/app/models/track_thing.rb
+++ b/app/models/track_thing.rb
@@ -21,7 +21,7 @@
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: track_thing.rb,v 1.17 2008-05-12 10:57:44 francis Exp $
+# $Id: track_thing.rb,v 1.18 2008-05-15 22:18:19 francis Exp $
class TrackThing < ActiveRecord::Base
belongs_to :tracking_user, :class_name => 'User'
@@ -127,7 +127,7 @@ class TrackThing < ActiveRecord::Base
@params = {
# Website
:set_title => "How would you like to be told when any request succeeds?",
- :list_description => "any <a href=\"/list\">successful requests</a>",
+ :list_description => "any <a href=\"/list/successful\">successful requests</a>",
:verb_on_page => "Be told when any request succeeds",
:verb_on_page_already => "being told when any request succeeds",
# Email
diff --git a/app/views/general/search.rhtml b/app/views/general/search.rhtml
index a31596463..839fe0155 100644
--- a/app/views/general/search.rhtml
+++ b/app/views/general/search.rhtml
@@ -20,46 +20,50 @@
</p>
<% end %>
-<%=link_to_unless @sortby.nil?, "Show most relevant results first", search_url(@query, nil) %>
-|
-<%=link_to_unless @sortby == 'newest', "Newest results first", search_url(@query, 'newest') %>
+<% if not @query.nil? %>
+ <%=link_to_unless @sortby.nil?, "Show most relevant results first", search_url(@query, nil) %>
+ |
+ <%=link_to_unless @sortby == 'newest', "Newest results first", search_url(@query, 'newest') %>
+<% end %>
<% if @total_hits == 0 %>
<h1><%=@title %></h1>
<% end %>
-<% if @spelling_correction %>
- <p id="did_you_mean">Did you mean: <%= link_to @spelling_correction, search_url(@spelling_correction, @sortby) %></p>
-<% end %>
+<% if not @query.nil? %>
+ <% if @spelling_correction %>
+ <p id="did_you_mean">Did you mean: <%= link_to @spelling_correction, search_url(@spelling_correction, @sortby) %></p>
+ <% end %>
+
+ <% if @xapian_bodies.results.size > 0 %>
+ <h1><%= "Public authorities " + ((@page-1)*@per_page+1).to_s + "-" + [@page*@per_page, @xapian_bodies.matches_estimated].min.to_s + " of " + @xapian_bodies.matches_estimated.to_s + " for '" + h(@query) + "'" %></h1>
-<% if @xapian_bodies.results.size > 0 %>
- <h1><%= "Public authorities " + ((@page-1)*@per_page+1).to_s + "-" + [@page*@per_page, @xapian_bodies.matches_estimated].min.to_s + " of " + @xapian_bodies.matches_estimated.to_s + " for '" + h(@query) + "'" %></h1>
+ <% for result in @xapian_bodies.results %>
+ <%= render :partial => 'body/body_listing_single', :locals => { :public_body => result[:model] } %>
+ <% end %>
- <% for result in @xapian_bodies.results %>
- <%= render :partial => 'body/body_listing_single', :locals => { :public_body => result[:model] } %>
+ <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @xapian_bodies.matches_estimated) %>
<% end %>
- <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @xapian_bodies.matches_estimated) %>
-<% end %>
+ <% if @xapian_users.results.size > 0 %>
+ <h1><%= "People " + ((@page-1)*@per_page+1).to_s + "-" + [@page*@per_page, @xapian_users.matches_estimated].min.to_s + " of " + @xapian_users.matches_estimated.to_s + " for '" + h(@query) + "'" %></h1>
-<% if @xapian_users.results.size > 0 %>
- <h1><%= "People " + ((@page-1)*@per_page+1).to_s + "-" + [@page*@per_page, @xapian_users.matches_estimated].min.to_s + " of " + @xapian_users.matches_estimated.to_s + " for '" + h(@query) + "'" %></h1>
+ <% for result in @xapian_users.results %>
+ <%= render :partial => 'user/user_listing_single', :locals => { :display_user => result[:model] } %>
+ <% end %>
- <% for result in @xapian_users.results %>
- <%= render :partial => 'user/user_listing_single', :locals => { :display_user => result[:model] } %>
+ <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @xapian_users.matches_estimated) %>
<% end %>
- <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @xapian_users.matches_estimated) %>
-<% end %>
+ <% if @xapian_requests.results.size > 0 %>
+ <h1><%= "FOI requests " + ((@page-1)*@per_page+1).to_s + "-" + [@page*@per_page, @xapian_requests.matches_estimated].min.to_s + " of " + @xapian_requests.matches_estimated.to_s + " for '" + h(@query) + "'" %></h1>
-<% if @xapian_requests.results.size > 0 %>
- <h1><%= "FOI requests " + ((@page-1)*@per_page+1).to_s + "-" + [@page*@per_page, @xapian_requests.matches_estimated].min.to_s + " of " + @xapian_requests.matches_estimated.to_s + " for '" + h(@query) + "'" %></h1>
+ <% for result in @xapian_requests.results %>
+ <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
+ <% end %>
- <% for result in @xapian_requests.results %>
- <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
+ <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @xapian_requests.matches_estimated) %>
<% end %>
-
- <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @xapian_requests.matches_estimated) %>
<% end %>
<% if @show_tips %>