diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-08-20 09:51:18 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-08-20 09:51:18 +0100 |
commit | 3d12cbe6ee7ff49dad9a473efc0792b2a4f4cba6 (patch) | |
tree | 1c43d3a004293f442f61b0e64847a4ef16cacd2a /app/controllers/request_controller.rb | |
parent | c449240a1b1cddebb53e9748b15be43c0f65c463 (diff) | |
parent | 4b95ccffc468c256d6ba6248303dd2b78bf5896a (diff) |
Merge branch 'release/0.13' into wdtk
Conflicts:
locale/he_IL/app.po
locale/hr_HR/app.po
locale/nb_NO/app.po
locale/uk/app.po
Diffstat (limited to 'app/controllers/request_controller.rb')
-rw-r--r-- | app/controllers/request_controller.rb | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 42693f867..45d8b7de6 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -150,12 +150,6 @@ class RequestController < ApplicationController :offset => (@page - 1) * @per_page, :limit => @per_page, :collapse_by_prefix => 'request_collapse') @matches_estimated = @xapian_object.matches_estimated @show_no_more_than = (@matches_estimated > MAX_RESULTS) ? MAX_RESULTS : @matches_estimated - - if (@page > 1) - @page_desc = " (page " + @page.to_s + ")" - else - @page_desc = "" - end end def list @@ -417,12 +411,22 @@ class RequestController < ApplicationController end # Make the state change + event = info_request.log_event("status_update", + { :user_id => authenticated_user.id, + :old_described_state => info_request.described_state, + :described_state => described_state, + }) + info_request.set_described_state(described_state, authenticated_user, message) # If you're not the *actual* requester. e.g. you are playing the # classification game, or you're doing this just because you are an # admin user (not because you also own the request). if !info_request.is_actual_owning_user?(authenticated_user) + # Create a classification event for league tables + RequestClassification.create!(:user_id => authenticated_user.id, + :info_request_event_id => event.id) + # Don't give advice on what to do next, as it isn't their request if session[:request_game] flash[:notice] = _('Thank you for updating the status of the request \'<a href="{{url}}">{{info_request_title}}</a>\'. There are some more requests below for you to classify.',:info_request_title=>CGI.escapeHTML(info_request.title), :url=>CGI.escapeHTML(request_path(info_request))) @@ -589,7 +593,7 @@ class RequestController < ApplicationController @outgoing_message.set_signature_name(@user.name) if !@user.nil? if (not @incoming_message.nil?) and @info_request != @incoming_message.info_request - raise sprintf("Incoming message %d does not belong to request %d", @incoming_message.info_request_id, @info_request.id) + raise ActiveRecord::RecordNotFound.new("Incoming message #{@incoming_message.id} does not belong to request #{@info_request.id}") end # Test for hidden requests |