aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/request_controller.rb
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2012-05-24 12:06:22 +0100
committerSeb Bacon <seb.bacon@gmail.com>2012-05-24 12:06:31 +0100
commitacde8a57e087d3058b8539e04c12e790866f8451 (patch)
treed972b799c89eb5be11cfee3c93cf5bd36956c741 /app/controllers/request_controller.rb
parentbd1dede2591fd9c4ebc54e5ef41232193f0a0f5b (diff)
parent774c199fa52b98b6780928a602dfdee1b2fce711 (diff)
Merge branch 'feature/report-request-as-unsuitable' into develop. Fixes #445
Diffstat (limited to 'app/controllers/request_controller.rb')
-rw-r--r--app/controllers/request_controller.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index af142c530..94fbcde29 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -654,6 +654,19 @@ class RequestController < ApplicationController
end
end
+ def report_request
+ info_request = InfoRequest.find_by_url_title(params[:url_title])
+ if !info_request.attention_requested
+ info_request.set_described_state('attention_requested')
+ info_request.attention_requested = true # tells us if attention has ever been requested
+ info_request.save!
+ flash[:notice] = _("This request has been reported for administrator attention")
+ else
+ flash[:notice] = _("This request has already been reported for administrator attention")
+ end
+ redirect_to request_url(info_request)
+ end
+
# special caching code so mime types are handled right
around_filter :cache_attachments, :only => [ :get_attachment, :get_attachment_as_html ]
def cache_attachments