aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/public_body_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/public_body_controller.rb')
-rw-r--r--app/controllers/public_body_controller.rb34
1 files changed, 17 insertions, 17 deletions
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb
index 00d1cc1e0..95d936e54 100644
--- a/app/controllers/public_body_controller.rb
+++ b/app/controllers/public_body_controller.rb
@@ -14,23 +14,23 @@ class PublicBodyController < ApplicationController
def show
long_cache
if MySociety::Format.simplify_url_part(params[:url_name], 'body') != params[:url_name]
- redirect_to :url_name => MySociety::Format.simplify_url_part(params[:url_name], 'body'), :status => :moved_permanently
+ redirect_to :url_name => MySociety::Format.simplify_url_part(params[:url_name], 'body'), :status => :moved_permanently
return
end
@locale = self.locale_from_params()
- PublicBody.with_locale(@locale) do
+ PublicBody.with_locale(@locale) do
@public_body = PublicBody.find_by_url_name_with_historic(params[:url_name])
raise ActiveRecord::RecordNotFound.new("None found") if @public_body.nil?
if @public_body.url_name.nil?
redirect_to :back
return
- end
+ end
# If found by historic name, or alternate locale name, redirect to new name
if @public_body.url_name != params[:url_name]
- redirect_to show_public_body_url(:url_name => @public_body.url_name)
+ redirect_to show_public_body_url(:url_name => @public_body.url_name)
return
end
-
+
set_last_body(@public_body)
top_url = main_url("/")
@@ -50,8 +50,8 @@ class PublicBodyController < ApplicationController
begin
@xapian_requests = perform_search([InfoRequestEvent], query, sortby, 'request_collapse')
if (@page > 1)
- @page_desc = " (page " + @page.to_s + ")"
- else
+ @page_desc = " (page " + @page.to_s + ")"
+ else
@page_desc = ""
end
rescue
@@ -65,7 +65,7 @@ class PublicBodyController < ApplicationController
format.html { @has_json = true; render :template => "public_body/show"}
format.json { render :json => @public_body.json_for_api }
end
-
+
end
end
@@ -93,8 +93,8 @@ class PublicBodyController < ApplicationController
@tag = params[:tag]
@locale = self.locale_from_params()
default_locale = I18n.default_locale.to_s
- locale_condition = "(upper(public_body_translations.name) LIKE upper(?)
- OR upper(public_body_translations.notes) LIKE upper (?))
+ locale_condition = "(upper(public_body_translations.name) LIKE upper(?)
+ OR upper(public_body_translations.notes) LIKE upper (?))
AND public_body_translations.locale = ?
AND public_bodies.id <> #{PublicBody.internal_admin_body.id}"
if @tag.nil? or @tag == "all"
@@ -152,10 +152,10 @@ class PublicBodyController < ApplicationController
report = StringIO.new
CSV::Writer.generate(report, ',') do |title|
title << [
- 'Name',
+ 'Name',
'Short name',
# deliberately not including 'Request email'
- 'URL name',
+ 'URL name',
'Tags',
'Home page',
'Publication scheme',
@@ -164,12 +164,12 @@ class PublicBodyController < ApplicationController
'Version',
]
public_bodies.each do |public_body|
- title << [
- public_body.name,
- public_body.short_name,
+ title << [
+ public_body.name,
+ public_body.short_name,
# DO NOT include request_email (we don't want to make it
# easy to spam all authorities with requests)
- public_body.url_name,
+ public_body.url_name,
public_body.tag_string,
public_body.calculated_home_page,
public_body.publication_scheme,
@@ -181,7 +181,7 @@ class PublicBodyController < ApplicationController
end
report.rewind
send_data(report.read, :type=> 'text/csv; charset=utf-8; header=present',
- :filename => 'all-authorities.csv',
+ :filename => 'all-authorities.csv',
:disposition =>'attachment', :encoding => 'utf8')
end