diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/models/info_request.rb | 20 | ||||
-rw-r--r-- | app/views/general/frontpage.rhtml | 2 |
2 files changed, 14 insertions, 8 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 8c626d2e6..d1b96bcc3 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -22,7 +22,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: info_request.rb,v 1.74 2008-03-31 17:20:59 francis Exp $ +# $Id: info_request.rb,v 1.75 2008-03-31 17:49:27 francis Exp $ require 'digest/sha1' @@ -78,16 +78,22 @@ class InfoRequest < ActiveRecord::Base info_request = InfoRequest.find(id, :lock =>true) do_index = (info_request.prominence != 'backpage') - # fill in any missing event states for all responses - so responses which - # have not been described get the status of later ones. + # Fill in any missing event states for first response before a + # description was made. events = info_request.info_request_events.find(:all, :order => "created_at") - curr_state = info_request.described_state + curr_state = nil for event in events.reverse - if event.event_type == 'response' - if not event.described_state.nil? + if event.described_state.nil? + if not curr_state.nil? and event.event_type == 'response' + event.described_state = curr_state + curr_state = nil + end + else + if event.event_type == 'response' + curr_state = nil + else curr_state = event.described_state end - event.described_state = curr_state end end diff --git a/app/views/general/frontpage.rhtml b/app/views/general/frontpage.rhtml index 3cf32432b..81822da64 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 => 'status:successful OR status:partially_successful', :sortby => 'newest') %></p> + <p><%=link_to "View more successful requests", search_url(:query => 'variety:response (status:successful OR status:partially_successful)', :sortby => 'newest') %></p> <% form_tag({:action => "search_redirect"}, {:id => "search_form"}) do %> <p> <%= text_field_tag 'query', params[:query], { :size => 20 } %> |