aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/reports_controller.rb23
-rw-r--r--app/controllers/request_controller.rb22
-rw-r--r--app/views/reports/new_report_request.html.erb (renamed from app/views/request/new_report_request.html.erb)0
3 files changed, 23 insertions, 22 deletions
diff --git a/app/controllers/reports_controller.rb b/app/controllers/reports_controller.rb
new file mode 100644
index 000000000..cf1ad19e7
--- /dev/null
+++ b/app/controllers/reports_controller.rb
@@ -0,0 +1,23 @@
+class ReportsController < ApplicationController
+ def report_request
+ info_request = InfoRequest.find_by_url_title!(params[:url_title])
+ if !authenticated_user
+ flash[:notice] = _("You need to be logged in to report a request for administrator attention")
+ elsif info_request.attention_requested
+ flash[:notice] = _("This request has already been reported for administrator attention")
+ else
+ info_request.report!(params[:reason], params[:message], @user)
+ flash[:notice] = _("This request has been reported for administrator attention")
+ end
+ redirect_to request_url(info_request)
+ end
+
+ def new_report_request
+ @info_request = InfoRequest.find_by_url_title!(params[:url_title])
+ if authenticated?(
+ :web => _("To report this request"),
+ :email => _("Then you can report the request '{{title}}'", :title => @info_request.title),
+ :email_subject => _("Report an offensive or unsuitable request"))
+ end
+ end
+end
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index 12ba1a3a9..7bc37de5e 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -680,28 +680,6 @@ class RequestController < ApplicationController
end
end
- def report_request
- info_request = InfoRequest.find_by_url_title!(params[:url_title])
- if !authenticated_user
- flash[:notice] = _("You need to be logged in to report a request for administrator attention")
- elsif info_request.attention_requested
- flash[:notice] = _("This request has already been reported for administrator attention")
- else
- info_request.report!(params[:reason], params[:message], @user)
- flash[:notice] = _("This request has been reported for administrator attention")
- end
- redirect_to request_url(info_request)
- end
-
- def new_report_request
- @info_request = InfoRequest.find_by_url_title!(params[:url_title])
- if authenticated?(
- :web => _("To report this request"),
- :email => _("Then you can report the request '{{title}}'", :title => @info_request.title),
- :email_subject => _("Report an offensive or unsuitable request"))
- end
- end
-
# special caching code so mime types are handled right
around_filter :cache_attachments, :only => [ :get_attachment, :get_attachment_as_html ]
def cache_attachments
diff --git a/app/views/request/new_report_request.html.erb b/app/views/reports/new_report_request.html.erb
index 11b682282..11b682282 100644
--- a/app/views/request/new_report_request.html.erb
+++ b/app/views/reports/new_report_request.html.erb