aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/admin_request_controller.rb2
-rw-r--r--app/controllers/api_controller.rb2
-rw-r--r--app/controllers/comment_controller.rb2
-rw-r--r--app/controllers/general_controller.rb2
-rw-r--r--app/controllers/request_controller.rb34
-rw-r--r--app/controllers/services_controller.rb2
-rw-r--r--app/controllers/track_controller.rb2
7 files changed, 23 insertions, 23 deletions
diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb
index e39d55c7c..c631c88f9 100644
--- a/app/controllers/admin_request_controller.rb
+++ b/app/controllers/admin_request_controller.rb
@@ -42,7 +42,7 @@ class AdminRequestController < AdminController
vars = OpenStruct.new(:name_to => @info_request.user_name,
:name_from => Configuration::contact_name,
:info_request => @info_request, :reason => params[:reason],
- :info_request_url => 'http://' + Configuration::domain + request_url(@info_request),
+ :info_request_url => 'http://' + Configuration::domain + request_path(@info_request),
:site_name => site_name)
template = File.read(File.join(File.dirname(__FILE__), "..", "views", "admin_request", "hidden_user_explanation.rhtml"))
@request_hidden_user_explanation = ERB.new(template).result(vars.instance_eval { binding })
diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb
index 0d6582773..aa1ea632f 100644
--- a/app/controllers/api_controller.rb
+++ b/app/controllers/api_controller.rb
@@ -220,7 +220,7 @@ class ApiController < ApplicationController
:event_id => event.id,
:created_at => event.created_at.iso8601,
:event_type => event.event_type,
- :request_url => main_url(request_url(request)),
+ :request_url => main_url(request_path(request)),
:request_email => request.incoming_email,
:title => request.title,
:body => event.outgoing_message.body,
diff --git a/app/controllers/comment_controller.rb b/app/controllers/comment_controller.rb
index ed249d6cc..9b8e0f799 100644
--- a/app/controllers/comment_controller.rb
+++ b/app/controllers/comment_controller.rb
@@ -86,7 +86,7 @@ class CommentController < ApplicationController
@info_request.save!
# we don't use comment_url here, as then you don't see the flash at top of page
- redirect_to request_url(@info_request)
+ redirect_to request_path(@info_request)
else
# do nothing - as "authenticated?" has done the redirect to signin page for us
end
diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb
index 875e39494..8aff5f7fc 100644
--- a/app/controllers/general_controller.rb
+++ b/app/controllers/general_controller.rb
@@ -221,7 +221,7 @@ class GeneralController < ApplicationController
# Jump to a random request
def random_request
info_request = InfoRequest.random
- redirect_to request_url(info_request)
+ redirect_to request_path(info_request)
end
def custom_css
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index dfa3a4834..0dd54b503 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -57,7 +57,7 @@ class RequestController < ApplicationController
# Look up by old style numeric identifiers
if params[:url_title].match(/^[0-9]+$/)
@info_request = InfoRequest.find(params[:url_title].to_i)
- redirect_to request_url(@info_request, :format => params[:format])
+ redirect_to request_path(@info_request, :format => params[:format])
return
end
@@ -380,14 +380,14 @@ class RequestController < ApplicationController
# If this isn't a form submit, go to the request page
if params[:submitted_describe_state].nil?
- redirect_to request_url(@info_request)
+ redirect_to request_path(@info_request)
return
end
# If this is an external request, go to the request page - we don't allow
# state change from the front end interface.
if @info_request.is_external?
- redirect_to request_url(@info_request)
+ redirect_to request_path(@info_request)
return
end
@@ -408,13 +408,13 @@ class RequestController < ApplicationController
if !params[:incoming_message]
flash[:error] = _("Please choose whether or not you got some of the information that you wanted.")
- redirect_to request_url(@info_request)
+ redirect_to request_path(@info_request)
return
end
if params[:last_info_request_event_id].to_i != @last_info_request_event_id
flash[:error] = _("The request has been updated since you originally loaded this page. Please check for any new incoming messages below, and try again.")
- redirect_to request_url(@info_request)
+ redirect_to request_path(@info_request)
return
end
@@ -439,11 +439,11 @@ class RequestController < ApplicationController
# Don't give advice on what to do next, as it isn't their request
RequestMailer.deliver_old_unclassified_updated(@info_request) if !@info_request.is_external?
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_url(@info_request)))
+ 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)))
redirect_to play_url
else
flash[:notice] = _('Thank you for updating this request!')
- redirect_to request_url(@info_request)
+ redirect_to request_path(@info_request)
end
return
end
@@ -453,10 +453,10 @@ class RequestController < ApplicationController
if calculated_status == 'waiting_response'
flash[:notice] = _("<p>Thank you! Hopefully your wait isn't too long.</p> <p>By law, you should get a response promptly, and normally before the end of <strong>
{{date_response_required_by}}</strong>.</p>",:date_response_required_by=>simple_date(@info_request.date_response_required_by))
- redirect_to request_url(@info_request)
+ redirect_to request_path(@info_request)
elsif calculated_status == 'waiting_response_overdue'
flash[:notice] = _("<p>Thank you! Hope you don't have to wait much longer.</p> <p>By law, you should have got a response promptly, and normally before the end of <strong>{{date_response_required_by}}</strong>.</p>",:date_response_required_by=>simple_date(@info_request.date_response_required_by))
- redirect_to request_url(@info_request)
+ redirect_to request_path(@info_request)
elsif calculated_status == 'waiting_response_very_overdue'
flash[:notice] = _("<p>Thank you! Your request is long overdue, by more than {{very_late_number_of_days}} working days. Most requests should be answered within {{late_number_of_days}} working days. You might like to complain about this, see below.</p>", :very_late_number_of_days => Configuration::reply_very_late_after_days, :late_number_of_days => Configuration::reply_late_after_days)
redirect_to unhappy_url(@info_request)
@@ -474,13 +474,13 @@ class RequestController < ApplicationController
:find_authority_url => "/new",
:complain_url => CGI.escapeHTML(unhappy_url(@info_request)),
:other_means_url => CGI.escapeHTML(unhappy_url(@info_request)) + "#other_means")
- redirect_to request_url(@info_request)
+ redirect_to request_path(@info_request)
elsif calculated_status == 'rejected'
flash[:notice] = _("Oh no! Sorry to hear that your request was refused. Here is what to do now.")
redirect_to unhappy_url(@info_request)
elsif calculated_status == 'successful'
flash[:notice] = _("<p>We're glad you got all the information that you wanted. If you write about or make use of the information, please come back and add an annotation below saying what you did.</p><p>If you found {{site_name}} useful, <a href=\"{{donation_url}}\">make a donation</a> to the charity which runs it.</p>", :site_name=>site_name, :donation_url => "http://www.mysociety.org/donate/")
- redirect_to request_url(@info_request)
+ redirect_to request_path(@info_request)
elsif calculated_status == 'partially_successful'
flash[:notice] = _("<p>We're glad you got some of the information that you wanted. If you found {{site_name}} useful, <a href=\"{{donation_url}}\">make a donation</a> to the charity which runs it.</p><p>If you want to try and get the rest of the information, here's what to do now.</p>", :site_name=>site_name, :donation_url=>"http://www.mysociety.org/donate/")
redirect_to unhappy_url(@info_request)
@@ -491,7 +491,7 @@ class RequestController < ApplicationController
redirect_to respond_to_last_url(@info_request) + "?gone_postal=1"
elsif calculated_status == 'internal_review'
flash[:notice] = _("<p>Thank you! Hopefully your wait isn't too long.</p><p>You should get a response within {{late_number_of_days}} days, or be told if it will take longer (<a href=\"{{review_url}}\">details</a>).</p>",:late_number_of_days => Configuration.reply_late_after_days, :review_url => unhappy_url(@info_request) + "#internal_review")
- redirect_to request_url(@info_request)
+ redirect_to request_path(@info_request)
elsif calculated_status == 'error_message'
flash[:notice] = _("<p>Thank you! We'll look into what happened and try and fix it up.</p><p>If the error was a delivery failure, and you can find an up to date FOI email address for the authority, please tell us using the form below.</p>")
redirect_to help_general_url(:action => 'contact')
@@ -520,7 +520,7 @@ class RequestController < ApplicationController
redirect_to outgoing_message_url(@info_request_event.outgoing_message), :status => :moved_permanently
else
# XXX maybe there are better URLs for some events than this
- redirect_to request_url(@info_request_event.info_request), :status => :moved_permanently
+ redirect_to request_path(@info_request_event.info_request), :status => :moved_permanently
end
end
@@ -655,7 +655,7 @@ class RequestController < ApplicationController
else
flash[:notice] = _("Your follow up message has been sent on its way.")
end
- redirect_to request_url(@info_request)
+ redirect_to request_path(@info_request)
end
else
# render default show_response template
@@ -696,7 +696,7 @@ class RequestController < ApplicationController
else
flash[:notice] = _("This request has already been reported for administrator attention")
end
- redirect_to request_url(info_request)
+ redirect_to request_path(info_request)
end
# special caching code so mime types are handled right
@@ -853,7 +853,7 @@ class RequestController < ApplicationController
mail = RequestMailer.create_fake_response(@info_request, @user, body, file_name, file_content)
@info_request.receive(mail, mail.encoded, true)
flash[:notice] = _("Thank you for responding to this FOI request! Your response has been published below, and a link to your response has been emailed to ") + CGI.escapeHTML(@info_request.user.name) + "."
- redirect_to request_url(@info_request)
+ redirect_to request_path(@info_request)
return
end
end
@@ -895,7 +895,7 @@ class RequestController < ApplicationController
convert_command = Configuration::html_to_pdf_command
done = false
if !convert_command.blank? && File.exists?(convert_command)
- url = "http://#{Configuration::domain}#{request_url(@info_request)}?print_stylesheet=1"
+ url = "http://#{Configuration::domain}#{request_path(@info_request)}?print_stylesheet=1"
tempfile = Tempfile.new('foihtml2pdf')
output = AlaveteliExternalCommand.run(convert_command, url, tempfile.path)
if !output.nil?
diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb
index 1db5348c7..b21000bc4 100644
--- a/app/controllers/services_controller.rb
+++ b/app/controllers/services_controller.rb
@@ -38,7 +38,7 @@ class ServicesController < ApplicationController
:locals => {:name_to => info_request.user_name,
:name_from => Configuration::contact_name,
:info_request => info_request, :reason => params[:reason],
- :info_request_url => 'http://' + Configuration::domain + request_url(info_request),
+ :info_request_url => 'http://' + Configuration::domain + request_path(info_request),
:site_name => site_name}
end
diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb
index 15da7f327..e2be3c7d0 100644
--- a/app/controllers/track_controller.rb
+++ b/app/controllers/track_controller.rb
@@ -19,7 +19,7 @@ class TrackController < ApplicationController
return atom_feed_internal if params[:feed] == 'feed'
if self.track_set
- redirect_to request_url(@info_request)
+ redirect_to request_path(@info_request)
end
end