aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorDavid Cabo <david@calibea.com>2011-08-17 11:05:21 +0200
committerDavid Cabo <david@calibea.com>2011-08-17 11:05:21 +0200
commit817ce18d16d037aadc5ea44d93854c6e17f06747 (patch)
tree1820f4a62c1060063e0b9751473eca9610142598 /app/controllers
parent0ca78b7c2abfe28ef7acd7137fda5d82a973c2e1 (diff)
parente1a2e1ad36c6b0c7bfac501eb2a0d0ae5efd05a1 (diff)
Merge branch 'fixes' into asktheeu
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/admin_public_body_controller.rb26
-rw-r--r--app/controllers/request_controller.rb2
2 files changed, 10 insertions, 18 deletions
diff --git a/app/controllers/admin_public_body_controller.rb b/app/controllers/admin_public_body_controller.rb
index 021122734..60cb324a1 100644
--- a/app/controllers/admin_public_body_controller.rb
+++ b/app/controllers/admin_public_body_controller.rb
@@ -82,16 +82,12 @@ class AdminPublicBodyController < AdminController
end
def new
- @locale = self.locale_from_params()
- PublicBody.with_locale(@locale) do
- @public_body = PublicBody.new
- render
- end
+ @public_body = PublicBody.new
+ render
end
-
+
def create
- @locale = self.locale_from_params()
- PublicBody.with_locale(@locale) do
+ PublicBody.with_locale(I18n.default_locale) do
params[:public_body][:last_edit_editor] = admin_http_auth_user()
@public_body = PublicBody.new(params[:public_body])
if @public_body.save
@@ -104,17 +100,13 @@ class AdminPublicBodyController < AdminController
end
def edit
- @locale = self.locale_from_params()
- PublicBody.with_locale(@locale) do
- @public_body = PublicBody.find(params[:id])
- @public_body.last_edit_comment = ""
- render
- end
+ @public_body = PublicBody.find(params[:id])
+ @public_body.last_edit_comment = ""
+ render
end
def update
- @locale = self.locale_from_params()
- PublicBody.with_locale(@locale) do
+ PublicBody.with_locale(I18n.default_locale) do
params[:public_body][:last_edit_editor] = admin_http_auth_user()
@public_body = PublicBody.find(params[:id])
if @public_body.update_attributes(params[:public_body])
@@ -157,7 +149,7 @@ class AdminPublicBodyController < AdminController
# Try with dry run first
csv_contents = params[:csv_file].read
- en = PublicBody.import_csv(csv_contents, params[:tag], true, admin_http_auth_user(), I18n.available_locales)
+ en = PublicBody.import_csv(csv_contents, params[:tag], true, admin_http_auth_user(), available_locales)
errors = en[0]
notes = en[1]
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index fac57c7e0..dadbb0cbd 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -397,7 +397,7 @@ class RequestController < ApplicationController
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)
elsif @info_request.calculate_status == 'waiting_response_very_overdue'
- flash[:notice] = _("<p>Thank you! Your request is long overdue, by more than 40 working days. Most requests should be answered within 20 working days. You might like to complain about this, see below.</p>")
+ 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 => MySociety::Config.get('REPLY_VERY_LATE_AFTER_DAYS', 40), :late_number_of_days => MySociety::Config.get('REPLY_LATE_AFTER_DAYS', 20))
redirect_to unhappy_url(@info_request)
elsif @info_request.calculate_status == 'not_held'
flash[:notice] = _("<p>Thank you! Here are some ideas on what to do next:</p>