aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/admin_request_controller.rb
diff options
context:
space:
mode:
authorHenare Degan <henare.degan@gmail.com>2013-03-14 14:33:17 +1100
committerHenare Degan <henare.degan@gmail.com>2013-03-14 14:33:17 +1100
commit48c6f8077429dd86da27a52be20c97cc583f31a9 (patch)
tree78d74660677a3a63659260c982dabfade692749d /app/controllers/admin_request_controller.rb
parent2f6af09899e2822121d060db55fdd78b15f099db (diff)
parentd8a5de249bfeb41317d64e7efbaab71da1ede00d (diff)
Merge remote-tracking branch 'mysociety/develop' into rails-3-develop
Conflicts: Gemfile Gemfile.lock app/controllers/admin_request_controller.rb app/controllers/admin_track_controller.rb app/controllers/request_controller.rb app/controllers/services_controller.rb app/helpers/link_to_helper.rb app/mailers/request_mailer.rb app/models/application_mailer.rb app/models/info_request.rb app/views/admin_censor_rule/edit.html.erb app/views/admin_censor_rule/new.html.erb app/views/admin_public_body/_form.html.erb app/views/admin_public_body/_locale_selector.html.erb app/views/admin_public_body/_one_list.html.erb app/views/admin_public_body/edit.html.erb app/views/admin_public_body/list.html.erb app/views/admin_public_body/new.html.erb app/views/admin_request/_incoming_message_actions.html.erb app/views/admin_request/edit.html.erb app/views/admin_request/edit_comment.html.erb app/views/admin_request/edit_outgoing.html.erb app/views/admin_request/list.html.erb app/views/admin_request/list_old_unclassified.html.erb app/views/admin_request/show.html.erb app/views/admin_track/_some_tracks.html.erb app/views/admin_track/list.html.erb app/views/admin_user/edit.html.erb app/views/admin_user/list.html.erb app/views/admin_user/show.html.erb app/views/general/_footer.html.erb app/views/general/exception_caught.html.erb app/views/help/contact.html.erb app/views/layouts/default.html.erb app/views/public_body/_alphabet.html.erb app/views/request/_request_listing_single.html.erb app/views/request/_sidebar.html.erb app/views/request/new.html.erb app/views/request/show.html.erb app/views/request_mailer/external_response.rhtml app/views/request_mailer/fake_response.rhtml config/environment.rb config/environments/production.rb config/routes.rb spec/controllers/admin_censor_rule_controller_spec.rb spec/controllers/request_controller_spec.rb spec/controllers/track_controller_spec.rb spec/helpers/link_to_helper_spec.rb spec/mailers/request_mailer_spec.rb spec/models/info_request_spec.rb spec/spec_helper.rb spec/views/public_body/show.html.erb_spec.rb spec/views/request/show.html.erb_spec.rb vendor/plugins/rails_xss/lib/rails_xss/erubis.rb
Diffstat (limited to 'app/controllers/admin_request_controller.rb')
-rw-r--r--app/controllers/admin_request_controller.rb42
1 files changed, 21 insertions, 21 deletions
diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb
index fc2cf8e97..3ad2713d2 100644
--- a/app/controllers/admin_request_controller.rb
+++ b/app/controllers/admin_request_controller.rb
@@ -56,7 +56,7 @@ class AdminRequestController < AdminController
@outgoing_message = OutgoingMessage.find(params[:outgoing_message_id])
@outgoing_message.resend_message
flash[:notice] = "Outgoing message resent"
- redirect_to request_admin_url(@outgoing_message.info_request)
+ redirect_to admin_request_show_url(@outgoing_message.info_request)
end
def edit
@@ -102,7 +102,7 @@ class AdminRequestController < AdminController
# expire cached files
expire_for_request(@info_request)
flash[:notice] = 'Request successfully updated.'
- redirect_to request_admin_url(@info_request)
+ redirect_to admin_request_show_url(@info_request)
else
render :action => 'edit'
end
@@ -118,7 +118,7 @@ class AdminRequestController < AdminController
# expire cached files
expire_for_request(@info_request)
flash[:notice] = "Request #{url_title} has been completely destroyed. Email of user who made request: " + user.email
- redirect_to admin_url('request/list')
+ redirect_to admin_request_list_url
end
def edit_outgoing
@@ -135,7 +135,7 @@ class AdminRequestController < AdminController
{ :editor => admin_current_user(), :deleted_outgoing_message_id => outgoing_message_id })
flash[:notice] = 'Outgoing message successfully destroyed.'
- redirect_to request_admin_url(@info_request)
+ redirect_to admin_request_show_url(@info_request)
end
def update_outgoing
@@ -148,7 +148,7 @@ class AdminRequestController < AdminController
{ :outgoing_message_id => @outgoing_message.id, :editor => admin_current_user(),
:old_body => old_body, :body => @outgoing_message.body })
flash[:notice] = 'Outgoing message successfully updated.'
- redirect_to request_admin_url(@outgoing_message.info_request)
+ redirect_to admin_request_show_url(@outgoing_message.info_request)
else
render :action => 'edit_outgoing'
end
@@ -172,7 +172,7 @@ class AdminRequestController < AdminController
:old_visible => old_visible, :visible => @comment.visible,
})
flash[:notice] = 'Comment successfully updated.'
- redirect_to request_admin_url(@comment.info_request)
+ redirect_to admin_request_show_url(@comment.info_request)
else
render :action => 'edit_comment'
end
@@ -190,7 +190,7 @@ class AdminRequestController < AdminController
# expire cached files
expire_for_request(@info_request)
flash[:notice] = 'Incoming message successfully destroyed.'
- redirect_to request_admin_url(@info_request)
+ redirect_to admin_request_show_url(@info_request)
end
def redeliver_incoming
@@ -207,7 +207,7 @@ class AdminRequestController < AdminController
end
if destination_request.nil?
flash[:error] = "Failed to find destination request '" + m + "'"
- return redirect_to request_admin_url(previous_request)
+ return redirect_to admin_request_show_url(previous_request)
end
raw_email_data = incoming_message.raw_email.data
@@ -227,7 +227,7 @@ class AdminRequestController < AdminController
expire_for_request(previous_request)
incoming_message.fully_destroy
end
- redirect_to request_admin_url(destination_request)
+ redirect_to admin_request_show_url(destination_request)
end
# change user or public body of a request magically
@@ -250,7 +250,7 @@ class AdminRequestController < AdminController
info_request.reindex_request_events
flash[:notice] = "Message has been moved to new user"
end
- redirect_to request_admin_url(info_request)
+ redirect_to admin_request_show_url(info_request)
elsif params[:commit] == 'Move request to authority' && !params[:public_body_url_name].blank?
old_public_body = info_request.public_body
destination_public_body = PublicBody.find_by_url_name(params[:public_body_url_name])
@@ -269,10 +269,10 @@ class AdminRequestController < AdminController
flash[:notice] = "Request has been moved to new body"
end
- redirect_to request_admin_url(info_request)
+ redirect_to admin_request_show_url(info_request)
else
flash[:error] = "Please enter the user or authority to move the request to"
- redirect_to request_admin_url(info_request)
+ redirect_to admin_request_show_url(info_request)
end
end
@@ -296,20 +296,20 @@ class AdminRequestController < AdminController
if !info_request.public_body.is_foi_officer?(user)
flash[:notice] = user.email + " is not an email at the domain @" + info_request.public_body.foi_officer_domain_required + ", so won't be able to upload."
- redirect_to request_admin_url(info_request)
+ redirect_to admin_request_show_url(info_request)
return
end
# Bejeeps, look, sometimes a URL is something that belongs in a controller, jesus.
- # XXX hammer this square peg into the round MVC hole - should be calling main_url(upload_response_url())
+ # XXX hammer this square peg into the round MVC hole
post_redirect = PostRedirect.new(
- :uri => main_url(upload_response_url(:url_title => info_request.url_title, :only_path => true)),
+ :uri => upload_response_url(:url_title => info_request.url_title),
:user_id => user.id)
post_redirect.save!
- url = main_url(confirm_url(:email_token => post_redirect.email_token, :only_path => true))
+ url = confirm_url(:email_token => post_redirect.email_token)
- flash[:notice] = 'Send "' + name + '" &lt;<a href="mailto:' + email + '">' + email + '</a>&gt; this URL: <a href="' + url + '">' + url + "</a> - it will log them in and let them upload a response to this request.".html_safe
- redirect_to request_admin_url(info_request)
+ flash[:notice] = ("Send \"#{name}\" &lt;<a href=\"mailto:#{email}\">#{email}</a>&gt; this URL: <a href=\"#{url}\">#{url}</a> - it will log them in and let them upload a response to this request.").html_safe
+ redirect_to admin_request_show_url(info_request)
end
def show_raw_email
@@ -359,7 +359,7 @@ class AdminRequestController < AdminController
info_request_event.save!
flash[:notice] = "Old response marked as having been a clarification"
- redirect_to request_admin_url(info_request_event.info_request)
+ redirect_to admin_request_show_url(info_request_event.info_request)
end
def hide_request
@@ -383,7 +383,7 @@ class AdminRequestController < AdminController
ContactMailer.from_admin_message(
info_request.user,
subject,
- params[:explanation]
+ params[:explanation].strip.html_safe
).deliver
flash[:notice] = _("Your message to {{recipient_user_name}} has been sent",:recipient_user_name=>CGI.escapeHTML(info_request.user.name))
else
@@ -391,7 +391,7 @@ class AdminRequestController < AdminController
end
# expire cached files
expire_for_request(info_request)
- redirect_to request_admin_url(info_request)
+ redirect_to admin_request_show_url(info_request)
end
end