diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/admin_controller.rb | 5 | ||||
-rw-r--r-- | app/controllers/request_controller.rb | 2 | ||||
-rwxr-xr-x | app/helpers/link_to_helper.rb | 3 | ||||
-rw-r--r-- | app/views/request/_followup.rhtml | 4 |
4 files changed, 8 insertions, 6 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 8598091d9..655670b5a 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -48,10 +48,13 @@ class AdminController < ApplicationController def authenticate username = MySociety::Config.get('ADMIN_USERNAME', '') password = MySociety::Config.get('ADMIN_PASSWORD', '') - if !(username && password).empty? + if !username.empty? && !password.empty? authenticate_or_request_with_http_basic do |user_name, password| user_name == username && password == password + session[:using_admin] = 1 end + else + session[:using_admin] = 1 end end end diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index b6111b087..c8c7bd34b 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -313,7 +313,7 @@ class RequestController < ApplicationController replied by then.</p> <p>If you write about this request (for example in a forum or a blog) please link to this page, and add an annotation below telling people about your writing.</p>",:law_used_full=>@info_request.law_used_full) - redirect_to request_url(@info_request) + redirect_to show_new_request_path(:url_title => @info_request.url_title) end # Submitted to the describing state of messages form diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb index 6d8ae345e..444129052 100755 --- a/app/helpers/link_to_helper.rb +++ b/app/helpers/link_to_helper.rb @@ -162,7 +162,8 @@ module LinkToHelper # Admin pages def admin_url(relative_path) - admin_url_prefix = MySociety::Config.get("ADMIN_BASE_URL", admin_general_index_path+"/") + admin_url_prefix = MySociety::Config.get("ADMIN_BASE_URL", "") + admin_url_prefix = admin_general_index_path+"/" if admin_url_prefix.empty? return admin_url_prefix + relative_path end diff --git a/app/views/request/_followup.rhtml b/app/views/request/_followup.rhtml index 8c279d234..78de7decd 100644 --- a/app/views/request/_followup.rhtml +++ b/app/views/request/_followup.rhtml @@ -25,9 +25,7 @@ <% end %> <p> - <%= _('Please <strong>only</strong> write messages directly relating to your - request {{request_link}}. If you would like to ask for information - that was not in your original request, then <a href="%s">file a new request</a>.',:request_link=>request_link(@info_request)) % [new_request_to_body_url(:url_name => @info_request.public_body.url_name)] %> + <%= _('Please <strong>only</strong> write messages directly relating to your request {{request_link}}. If you would like to ask for information that was not in your original request, then <a href="{{new_request_link}}">file a new request</a>.', :request_link=>request_link(@info_request), :new_request_link => new_request_to_body_url(:url_name => @info_request.public_body.url_name)) %> </p> <% status = @info_request.calculate_status %> |