aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/admin_public_body_controller.rb83
-rw-r--r--app/controllers/application_controller.rb154
-rw-r--r--app/controllers/general_controller.rb143
-rw-r--r--app/controllers/public_body_controller.rb51
-rw-r--r--app/controllers/request_controller.rb135
-rw-r--r--app/controllers/services_controller.rb32
-rw-r--r--app/controllers/user_controller.rb47
-rw-r--r--app/helpers/application_helper.rb19
-rw-r--r--app/helpers/config_helper.rb4
-rwxr-xr-xapp/helpers/link_to_helper.rb27
-rw-r--r--app/models/incoming_message.rb52
-rw-r--r--app/models/info_request.rb21
-rw-r--r--app/models/info_request_event.rb81
-rw-r--r--app/models/public_body.rb157
-rw-r--r--app/models/request_mailer.rb34
-rw-r--r--app/models/track_mailer.rb4
-rw-r--r--app/models/track_thing.rb107
-rw-r--r--app/models/user.rb9
-rw-r--r--app/models/user_mailer.rb2
-rw-r--r--app/views/admin_public_body/_form.rhtml82
-rw-r--r--app/views/admin_public_body/_tag_help.rhtml18
-rw-r--r--app/views/admin_public_body/edit.rhtml41
-rw-r--r--app/views/admin_public_body/import_csv.rhtml23
-rw-r--r--app/views/admin_public_body/new.rhtml26
-rw-r--r--app/views/admin_public_body/show.rhtml11
-rw-r--r--app/views/comment/_single_comment.rhtml2
-rw-r--r--app/views/comment/new.rhtml3
-rw-r--r--app/views/general/_credits.rhtml2
-rw-r--r--app/views/general/_footer.rhtml6
-rw-r--r--app/views/general/_frontpage_intro_sentence.rhtml7
-rw-r--r--app/views/general/_frontpage_search_examples.es.rhtml1
-rw-r--r--app/views/general/_frontpage_search_examples.rhtml1
-rw-r--r--app/views/general/_localised_datepicker.rhtml18
-rw-r--r--app/views/general/_orglink.rhtml2
-rw-r--r--app/views/general/_topnav.rhtml10
-rw-r--r--app/views/general/advanced_search.rhtml0
-rw-r--r--app/views/general/blog.rhtml101
-rw-r--r--app/views/general/exception_caught.rhtml35
-rw-r--r--app/views/general/frontpage.rhtml75
-rw-r--r--app/views/general/search.rhtml308
-rw-r--r--app/views/help/_sidebar.rhtml9
-rw-r--r--app/views/help/about.rhtml96
-rw-r--r--app/views/help/alaveteli.rhtml30
-rw-r--r--app/views/help/api.rhtml155
-rw-r--r--app/views/help/contact.rhtml8
-rw-r--r--app/views/help/credits.rhtml161
-rw-r--r--app/views/help/officers.rhtml476
-rw-r--r--app/views/help/privacy.rhtml100
-rw-r--r--app/views/help/requesting.rhtml548
-rw-r--r--app/views/help/unhappy.rhtml2
-rw-r--r--app/views/layouts/admin.rhtml6
-rw-r--r--app/views/layouts/default.rhtml135
-rw-r--r--app/views/layouts/no_chrome.rhtml41
-rw-r--r--app/views/public_body/_body_listing.rhtml2
-rw-r--r--app/views/public_body/_search_ahead.rhtml18
-rw-r--r--app/views/public_body/list.rhtml39
-rw-r--r--app/views/public_body/show.rhtml165
-rw-r--r--app/views/request/_after_actions.rhtml10
-rw-r--r--app/views/request/_correspondence.rhtml20
-rw-r--r--app/views/request/_followup.rhtml37
-rw-r--r--app/views/request/_next_actions.rhtml1
-rw-r--r--app/views/request/_request_filter_form.rhtml52
-rw-r--r--app/views/request/_request_listing_via_event.rhtml29
-rw-r--r--app/views/request/_search_ahead.rhtml12
-rw-r--r--app/views/request/_sidebar.rhtml32
-rw-r--r--app/views/request/list.rhtml63
-rw-r--r--app/views/request/new.rhtml228
-rw-r--r--app/views/request/preview.rhtml10
-rw-r--r--app/views/request/select_authority.rhtml68
-rw-r--r--app/views/request/show.rhtml2
-rw-r--r--app/views/request/simple_correspondence.rhtml45
-rw-r--r--app/views/track/_tracking_links.rhtml17
-rw-r--r--app/views/track_mailer/event_digest.rhtml12
-rw-r--r--app/views/user/_signin.rhtml7
-rw-r--r--app/views/user/_signup.rhtml13
-rw-r--r--app/views/user/set_draft_profile_photo.rhtml4
-rw-r--r--app/views/user/show.rhtml69
-rw-r--r--app/views/user/sign.rhtml21
-rw-r--r--app/views/user/signin_successful.rhtml9
-rw-r--r--app/views/user/wrong_user.rhtml6
80 files changed, 2882 insertions, 1810 deletions
diff --git a/app/controllers/admin_public_body_controller.rb b/app/controllers/admin_public_body_controller.rb
index 021122734..d80e2937f 100644
--- a/app/controllers/admin_public_body_controller.rb
+++ b/app/controllers/admin_public_body_controller.rb
@@ -6,6 +6,8 @@
#
# $Id: admin_public_body_controller.rb,v 1.23 2009-08-26 00:58:29 francis Exp $
+require "public_body_categories"
+
class AdminPublicBodyController < AdminController
def index
list
@@ -82,16 +84,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 +102,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])
@@ -146,41 +140,36 @@ class AdminPublicBodyController < AdminController
def import_csv
if params[:csv_file]
- if !params[:tag].empty?
- if params['commit'] == 'Dry run'
- dry_run_only = true
- elsif params['commit'] == 'Upload'
- dry_run_only = false
+ if params['commit'] == 'Dry run'
+ dry_run_only = true
+ elsif params['commit'] == 'Upload'
+ dry_run_only = false
+ else
+ raise "internal error, unknown button label"
+ end
+
+ # 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)
+ errors = en[0]
+ notes = en[1]
+
+ if errors.size == 0
+ if dry_run_only
+ notes.push("Dry run was successful, real run would do as above.")
else
- raise "internal error, unknown button label"
- end
-
- # 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)
- errors = en[0]
- notes = en[1]
-
- if errors.size == 0
- if dry_run_only
- notes.push("Dry run was successful, real run would do as above.")
- else
- # And if OK, with real run
- en = PublicBody.import_csv(csv_contents, params[:tag], false, admin_http_auth_user(), available_locales)
- errors = en[0]
- notes = en[1]
- if errors.size != 0
- raise "dry run mismatched real run"
- end
- notes.push("Import was successful.")
+ # And if OK, with real run
+ en = PublicBody.import_csv(csv_contents, params[:tag], false, admin_http_auth_user(), I18n.available_locales)
+ errors = en[0]
+ notes = en[1]
+ if errors.size != 0
+ raise "dry run mismatched real run"
end
+ notes.push("Import was successful.")
end
- @errors = errors.join("\n")
- @notes = notes.join("\n")
- else
- @errors = "Please enter a tag, use a singular e.g. sea_fishery_committee"
- @notes = ""
end
+ @errors = errors.join("\n")
+ @notes = notes.join("\n")
else
@errors = ""
@notes = ""
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 0df3e22da..f34f6e388 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -8,13 +8,20 @@
#
# $Id: application.rb,v 1.59 2009-09-17 13:01:56 francis Exp $
+require 'open-uri'
class ApplicationController < ActionController::Base
# Standard headers, footers and navigation for whole site
layout "default"
include FastGettext::Translation # make functions like _, n_, N_ etc available)
+
+ # Note: a filter stops the chain if it redirects or renders something
+ before_filter :authentication_check
before_filter :set_gettext_locale
+ before_filter :check_in_post_redirect
+ before_filter :session_remember_me
before_filter :set_vary_header
+
# scrub sensitive parameters from the logs
filter_parameter_logging :password
@@ -47,7 +54,14 @@ class ApplicationController < ActionController::Base
else
requested_locale = params[:locale] || session[:locale] || cookies[:locale] || I18n.default_locale
end
+ requested_locale = FastGettext.best_locale_in(requested_locale)
session[:locale] = FastGettext.set_locale(requested_locale)
+ if !@user.nil?
+ if @user.locale != requested_locale
+ @user.locale = session[:locale]
+ @user.save!
+ end
+ end
end
# scrub sensitive parameters from the logs
@@ -84,7 +98,6 @@ class ApplicationController < ActionController::Base
# Set cookie expiry according to "remember me" checkbox, as per "An easier
# and more flexible hack" on this page:
# http://wiki.rubyonrails.org/rails/pages/HowtoChangeSessionOptions
- before_filter :session_remember_me
def session_remember_me
# Reset the "sliding window" session expiry time.
if request.env['rack.session.options']
@@ -101,11 +114,17 @@ class ApplicationController < ActionController::Base
# Make sure expiry time for session is set (before_filters are
# otherwise missed by this override)
session_remember_me
-
+ case exception
+ when ActiveRecord::RecordNotFound, ActionController::UnknownAction, ActionController::RoutingError
+ @status = 404
+ else
+ @status = 500
+ end
# Display user appropriate error message
@exception_backtrace = exception.backtrace.join("\n")
@exception_class = exception.class.to_s
- render :template => "general/exception_caught.rhtml", :status => 404
+ @exception_message = exception.message
+ render :template => "general/exception_caught.rhtml", :status => @status
end
# For development sites.
@@ -192,7 +211,9 @@ class ApplicationController < ActionController::Base
post_redirect = PostRedirect.new(:uri => request.request_uri, :post_params => params,
:reason_params => reason_params)
post_redirect.save!
- redirect_to signin_url(:token => post_redirect.token)
+ # 'modal' controls whether the sign-in form will be displayed in the typical full-blown
+ # page or on its own, useful for pop-ups
+ redirect_to signin_url(:token => post_redirect.token, :modal => params[:modal])
return false
end
return true
@@ -256,7 +277,6 @@ class ApplicationController < ActionController::Base
end
# If we are in a faked redirect to POST request, then set post params.
- before_filter :check_in_post_redirect
def check_in_post_redirect
if params[:post_redirect] and session[:post_redirect_token]
post_redirect = PostRedirect.find_by_token(session[:post_redirect_token])
@@ -265,7 +285,6 @@ class ApplicationController < ActionController::Base
end
# Default layout shows user in corner, so needs access to it
- before_filter :authentication_check
def authentication_check
if session[:user_id]
@user = authenticated_user
@@ -339,14 +358,127 @@ class ApplicationController < ActionController::Base
return (params[:page] || "1").to_i
end
- # Store last visited pages, for contact form
+ # Store last visited pages, for contact form; but only for logged in users, as otherwise this breaks caching
def set_last_request(info_request)
- session[:last_request_id] = info_request.id
- session[:last_body_id] = nil
+ if !session[:user_id].nil?
+ session[:last_request_id] = info_request.id
+ session[:last_body_id] = nil
+ end
end
def set_last_body(public_body)
- session[:last_request_id] = nil
- session[:last_body_id] = public_body.id
+ if !session[:user_id].nil?
+ session[:last_request_id] = nil
+ session[:last_body_id] = public_body.id
+ end
+ end
+
+ def param_exists(item)
+ return params[item] && !params[item].empty?
+ end
+
+ def get_request_variety_from_params
+ query = ""
+ sortby = "newest"
+ varieties = []
+ if params[:request_variety] && !(query =~ /variety:/)
+ if params[:request_variety].include? "sent"
+ varieties -= ['variety:sent', 'variety:followup_sent', 'variety:response', 'variety:comment']
+ varieties << ['variety:sent', 'variety:followup_sent']
+ end
+ if params[:request_variety].include? "response"
+ varieties << ['variety:response']
+ end
+ if params[:request_variety].include? "comment"
+ varieties << ['variety:comment']
+ end
+ end
+ if !varieties.empty?
+ query = " (#{varieties.join(' OR ')})"
+ end
+ return query
+ end
+
+ def get_status_from_params
+ query = ""
+ if params[:latest_status]
+ statuses = []
+ if params[:latest_status].class == String
+ params[:latest_status] = [params[:latest_status]]
+ end
+ if params[:latest_status].include?("recent") || params[:latest_status].include?("all")
+ query += " variety:sent"
+ end
+ if params[:latest_status].include? "successful"
+ statuses << ['latest_status:successful', 'latest_status:partially_successful']
+ end
+ if params[:latest_status].include? "unsuccessful"
+ statuses << ['latest_status:rejected', 'latest_status:not_held']
+ end
+ if params[:latest_status].include? "awaiting"
+ statuses << ['latest_status:waiting_response', 'latest_status:waiting_clarification', 'waiting_classification:true']
+ end
+ if params[:latest_status].include? "internal_review"
+ statuses << ['status:internal_review']
+ end
+ if params[:latest_status].include? "other"
+ statuses << ['latest_status:gone_postal', 'latest_status:error_message', 'latest_status:requires_admin', 'latest_status:user_withdrawn']
+ end
+ if params[:latest_status].include? "gone_postal"
+ statuses << ['latest_status:gone_postal']
+ end
+ if !statuses.empty?
+ query = " (#{statuses.join(' OR ')})"
+ end
+ end
+ return query
+ end
+
+ def get_date_range_from_params
+ query = ""
+ if param_exists(:request_date_after) && !param_exists(:request_date_before)
+ params[:request_date_before] = Time.now.strftime("%d/%m/%Y")
+ query += " #{params[:request_date_after]}..#{params[:request_date_before]}"
+ elsif !param_exists(:request_date_after) && param_exists(:request_date_before)
+ params[:request_date_after] = "01/01/2001"
+ end
+ if param_exists(:request_date_after)
+ query = " #{params[:request_date_after]}..#{params[:request_date_before]}"
+ end
+ return query
+ end
+
+ def get_tags_from_params
+ query = ""
+ tags = []
+ if param_exists(:tags)
+ params[:tags].split().each do |tag|
+ tags << "tag:#{tag}"
+ end
+ end
+ if !tags.empty?
+ query = " (#{tags.join(' OR ')})"
+ end
+ return query
+ end
+
+ def make_query_from_params
+ query = params[:query] || "" if query.nil?
+ query += get_date_range_from_params
+ query += get_request_variety_from_params
+ query += get_status_from_params
+ query += get_tags_from_params
+ return query
+ end
+
+ def country_from_ip
+ gaze = MySociety::Config.get('GAZE_URL', '')
+ default = MySociety::Config.get('ISO_COUNTRY_CODE', '')
+ country = ""
+ if !gaze.empty?
+ country = open("#{gaze}/gaze-rest?f=get_country_from_ip;ip=#{request.remote_ip}").read.strip
+ end
+ country = default if country.empty?
+ return country
end
# URL generating functions are needed by all controllers (for redirects),
diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb
index 4fa603aab..55abea3b7 100644
--- a/app/controllers/general_controller.rb
+++ b/app/controllers/general_controller.rb
@@ -45,20 +45,23 @@ class GeneralController < ApplicationController
:joins => :translations)
end
end
- @search_examples = MySociety::Config.get('FRONTPAGE_SEARCH_EXAMPLES', '').split(/\s*;\s*/)
- if @search_examples.empty?
- @search_examples = @popular_bodies.map { |body| body.name }
- end
# Get some successful requests #
begin
query = 'variety:response (status:successful OR status:partially_successful)'
# query = 'variety:response' # XXX debug
sortby = "described"
- xapian_object = perform_search([InfoRequestEvent], query, sortby, 'request_title_collapse', 8)
- @successful_request_events = xapian_object.results.map { |r| r[:model] }
- @successful_request_events = @successful_request_events.sort_by { |e| e.described_at }.reverse
+ max_count = 5
+ xapian_object = perform_search([InfoRequestEvent], query, sortby, 'request_title_collapse', max_count)
+ @request_events = xapian_object.results.map { |r| r[:model] }
+ @request_events = @request_events.sort_by { |e| e.described_at }.reverse
+ if @request_events.count < max_count
+ query = 'variety:sent'
+ xapian_object = perform_search([InfoRequestEvent], query, sortby, 'request_title_collapse', max_count-@request_events.count)
+ more_events = xapian_object.results.map { |r| r[:model] }
+ @request_events += more_events.sort_by { |e| e.described_at }.reverse
+ end
rescue
- @successful_request_events = []
+ @request_events = []
end
end
end
@@ -82,20 +85,34 @@ class GeneralController < ApplicationController
# Just does a redirect from ?query= search to /query
def search_redirect
- @query = params[:query]
+ if params[:advanced].nil?
+ @query, _ = make_query_from_params
+ else
+ @query, _ = params[:query]
+ end
@sortby = params[:sortby]
- @bodies = params[:bodies]
+ path = request.path.split("/")
+ if path.size > 0 && (['newest', 'described', 'relevant'].include?(path[-1]))
+ @sort_postfix = path.pop
+ end
+ if path.size > 0 && (['bodies', 'requests', 'users', 'all'].include?(path[-1]))
+ @variety_postfix = path.pop
+ end
+ @variety_postfix = "bodies" if @variety_postfix.nil? && !params[:bodies].nil?
+ @variety_postfix = "requests" if @variety_postfix.nil?
+ if @variety_postfix != "users"
+ @common_query = get_tags_from_params
+ end
+ [:latest_status, :request_variety, :request_date_after, :request_date_before, :query, :tags].each do |x|
+ session[x] = params[x]
+ end
if @query.nil? || @query.empty?
@query = nil
@page = 1
+ @advanced = !params[:advanced].nil?
render :action => "search"
else
- if (@bodies == '1') && (@sortby.nil? || @sortby.empty?)
- @postfix = 'bodies'
- else
- @postfix = @sortby
- end
- redirect_to search_url(@query, @postfix)
+ redirect_to search_url(@query, @variety_postfix, @sort_postfix, params[:advanced])
end
end
@@ -103,23 +120,59 @@ class GeneralController < ApplicationController
def search
# XXX Why is this so complicated with arrays and stuff? Look at the route
# in config/routes.rb for comments.
+ if !params[:commit].nil?
+ search_redirect
+ return
+ end
+ [:latest_status, :request_variety, :request_date_after, :request_date_before, :query, :tags].each do |x|
+ params[x] = session[x] if params[x].nil?
+ end
combined = params[:combined]
@sortby = nil
- @bodies = false # searching from front page, largely for a public authority
+ @bodies = @requests = @users = true
+ if combined.size > 0 && (['advanced'].include?(combined[-1]))
+ combined.pop
+ @advanced = true
+ else
+ @advanced = false
+ end
# XXX currently /described isn't linked to anywhere, just used in RSS and for /list/successful
# This is because it's confusingly different from /newest - but still useful for power users.
- if combined.size > 1 && (['newest', 'described', 'bodies', 'relevant'].include?(combined[-1]))
- @postfix = combined[-1]
- combined = combined[0..-2]
- if @postfix == 'bodies'
+ if combined.size > 0 && (['newest', 'described', 'relevant'].include?(combined[-1]))
+ @sort_postfix = combined.pop
+ @sortby = @sort_postfix
+ end
+ if !params[:view].nil?
+ combined += [params[:view]]
+ end
+ if combined.size > 0 && (['bodies', 'requests', 'users', 'all'].include?(combined[-1]))
+ @variety_postfix = combined.pop
+ case @variety_postfix
+ when 'bodies'
@bodies = true
+ @requests = false
+ @users = false
+ when 'requests'
+ @bodies = false
+ @requests = true
+ @users = false
+ when 'users'
+ @bodies = false
+ @requests = false
+ @users = true
else
- @sortby = @postfix
+ @variety_postfix = "all"
end
end
@query = combined.join("/")
-
+ if params[:query].nil?
+ params[:query] = @query
+ end
+ if @variety_postfix != "all" && @requests
+ @query, _ = make_query_from_params
+ end
@inputted_sortby = @sortby
+ @common_query = get_tags_from_params
if @sortby.nil?
# Parse query, so can work out if it has prefix terms only - if so then it is a
# structured query which should show newest first, rather than a free text search
@@ -145,21 +198,41 @@ class GeneralController < ApplicationController
if params[:requests_per_page]
requests_per_page = params[:requests_per_page].to_i
end
- @xapian_requests = perform_search([InfoRequestEvent], @query, @sortby, 'request_collapse', requests_per_page)
- @requests_per_page = @per_page
- @xapian_bodies = perform_search([PublicBody], @query, @sortby, nil, 5)
- @bodies_per_page = @per_page
- @xapian_users = perform_search([User], @query, @sortby, nil, 5)
- @users_per_page = @per_page
-
- @this_page_hits = @xapian_requests.results.size + @xapian_bodies.results.size + @xapian_users.results.size
- @total_hits = @xapian_requests.matches_estimated + @xapian_bodies.matches_estimated + @xapian_users.matches_estimated
+ @this_page_hits = @total_hits = @xapian_requests_hits = @xapian_bodies_hits = @xapian_users_hits = 0
+ if @requests
+ @xapian_requests = perform_search([InfoRequestEvent], @query, @sortby, 'request_collapse', requests_per_page)
+ @requests_per_page = @per_page
+ @this_page_hits += @xapian_requests.results.size
+ @xapian_requests_hits = @xapian_requests.results.size
+ @xapian_requests_total_hits = @xapian_requests.matches_estimated
+ @total_hits += @xapian_requests.matches_estimated
+ end
+ if @bodies
+ @xapian_bodies = perform_search([PublicBody], @query, @sortby, nil, 5)
+ @bodies_per_page = @per_page
+ @this_page_hits += @xapian_bodies.results.size
+ @xapian_bodies_hits = @xapian_bodies.results.size
+ @xapian_bodies_total_hits = @xapian_bodies.matches_estimated
+ @total_hits += @xapian_bodies.matches_estimated
+ end
+ if @users
+ @xapian_users = perform_search([User], @query, @sortby, nil, 5)
+ @users_per_page = @per_page
+ @this_page_hits += @xapian_users.results.size
+ @xapian_users_hits = @xapian_users.results.size
+ @xapian_users_total_hits = @xapian_users.matches_estimated
+ @total_hits += @xapian_users.matches_estimated
+ end
# Spelling and highight words are same for all three queries
- @spelling_correction = @xapian_requests.spelling_correction
- @highlight_words = @xapian_requests.words_to_highlight
+ if !@xapian_requests.nil?
+ @highlight_words = @xapian_requests.words_to_highlight
+ if !(@xapian_requests.spelling_correction =~ /[a-z]+:/)
+ @spelling_correction = @xapian_requests.spelling_correction
+ end
+ end
- @track_thing = TrackThing.create_track_for_search_query(@query)
+ @track_thing = TrackThing.create_track_for_search_query(@query, @variety_postfix)
@feed_autodetect = [ { :url => do_track_url(@track_thing, 'feed'), :title => @track_thing.params[:title_in_rss], :has_json => true } ]
end
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb
index 05acf4868..e4f8753af 100644
--- a/app/controllers/public_body_controller.rb
+++ b/app/controllers/public_body_controller.rb
@@ -16,11 +16,10 @@ class PublicBodyController < ApplicationController
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
@public_body = PublicBody.find_by_url_name_with_historic(params[:url_name])
- raise "None found" if @public_body.nil? # XXX proper 404
+ raise ActiveRecord::RecordNotFound.new("None found") if @public_body.nil? # XXX proper 404
if @public_body.url_name.nil?
redirect_to :back
return
@@ -39,11 +38,16 @@ class PublicBodyController < ApplicationController
if !referrer.nil? && referrer.match(%r{^#{top_url}search/.*/bodies$})
@searched_to_send_request = true
end
+ @view = params[:view]
+ params[:latest_status] = @view
+ query = make_query_from_params
+ query += " requested_from:#{@public_body.url_name}"
# Use search query for this so can collapse and paginate easily
# XXX really should just use SQL query here rather than Xapian.
+ sortby = "described"
begin
- @xapian_requests = perform_search([InfoRequestEvent], 'requested_from:' + @public_body.url_name, 'newest', 'request_collapse')
+ @xapian_requests = perform_search([InfoRequestEvent], query, sortby, 'request_collapse')
if (@page > 1)
@page_desc = " (page " + @page.to_s + ")"
else
@@ -83,39 +87,46 @@ class PublicBodyController < ApplicationController
def list
long_cache
# XXX move some of these tag SQL queries into has_tag_string.rb
+ @query = "%#{params[:public_body_query].nil? ? "" : params[:public_body_query]}%"
@tag = params[:tag]
@locale = self.locale_from_params()
- locale_condition = 'public_body_translations.locale = ?'
- if @tag.nil?
+
+ 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"
@tag = "all"
- conditions = [locale_condition, @locale]
+ conditions = [locale_condition, @query, @query, @locale]
elsif @tag == 'other'
- category_list = PublicBodyCategories::CATEGORIES.map{|c| "'"+c+"'"}.join(",")
+ category_list = PublicBodyCategories::get().tags().map{|c| "'"+c+"'"}.join(",")
conditions = [locale_condition + ' AND (select count(*) from has_tag_string_tags where has_tag_string_tags.model_id = public_bodies.id
and has_tag_string_tags.model = \'PublicBody\'
- and has_tag_string_tags.name in (' + category_list + ')) = 0', @locale]
+ and has_tag_string_tags.name in (' + category_list + ')) = 0', @query, @query, @locale]
elsif @tag.size == 1
@tag.upcase!
- conditions = [locale_condition + ' AND public_body_translations.first_letter = ?', @locale, @tag]
+ conditions = [locale_condition + ' AND public_body_translations.first_letter = ?', @query, @query, @locale, @tag]
elsif @tag.include?(":")
name, value = HasTagString::HasTagStringTag.split_tag_into_name_value(@tag)
conditions = [locale_condition + ' AND (select count(*) from has_tag_string_tags where has_tag_string_tags.model_id = public_bodies.id
and has_tag_string_tags.model = \'PublicBody\'
- and has_tag_string_tags.name = ? and has_tag_string_tags.value = ?) > 0', @locale, name, value]
+ and has_tag_string_tags.name = ? and has_tag_string_tags.value = ?) > 0', @query, @query, @locale, name, value]
else
conditions = [locale_condition + ' AND (select count(*) from has_tag_string_tags where has_tag_string_tags.model_id = public_bodies.id
and has_tag_string_tags.model = \'PublicBody\'
- and has_tag_string_tags.name = ?) > 0', @locale, @tag]
+ and has_tag_string_tags.name = ?) > 0', @query, @query, @locale, @tag]
end
- if @tag.size == 1
+ if @tag == "all"
+ @description = ""
+ elsif @tag.size == 1
@description = _("beginning with") + " '" + @tag + "'"
else
- @description = PublicBodyCategories::CATEGORIES_BY_TAG[@tag]
+ @description = PublicBodyCategories::get().by_tag()[@tag]
if @description.nil?
@description = @tag
end
end
- PublicBody.with_locale(@locale) do
+ PublicBody.with_locale(@locale) do
@public_bodies = PublicBody.paginate(
:order => "public_body_translations.name", :page => params[:page], :per_page => 1000, # fit all councils on one page
:conditions => conditions,
@@ -168,5 +179,17 @@ class PublicBodyController < ApplicationController
:filename => 'all-authorities.csv',
:disposition =>'attachment', :encoding => 'utf8')
end
+
+ # Type ahead search
+ def search_typeahead
+ # Since acts_as_xapian doesn't support the Partial match flag, we work around it
+ # by making the last work a wildcard, which is quite the same
+ query = params[:q] + '*'
+
+ query = query.split(' ').join(' OR ') # XXX: HACK for OR instead of default AND!
+ @xapian_requests = perform_search([PublicBody], query, 'relevant', 'request_collapse', 5)
+
+ render :partial => "public_body/search_ahead"
+ end
end
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index c1a13273a..06d8f15f4 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -7,6 +7,8 @@
# $Id: request_controller.rb,v 1.192 2009-10-19 19:26:40 francis Exp $
require 'alaveteli_file_types'
+require 'zip/zip'
+require 'open-uri'
class RequestController < ApplicationController
before_filter :check_read_only, :only => [ :new, :show_response, :describe_state, :upload_response ]
@@ -22,6 +24,26 @@ class RequestController < ApplicationController
rescue MissingSourceFile, NameError
end
+ def select_authority
+ # Check whether we force the user to sign in right at the start, or we allow her
+ # to start filling the request anonymously
+ if force_registration_on_new_request && !authenticated?(
+ :web => _("To send your FOI request"),
+ :email => _("Then you'll be allowed to send FOI requests."),
+ :email_subject => _("Confirm your email address")
+ )
+ # do nothing - as "authenticated?" has done the redirect to signin page for us
+ return
+ end
+
+ if !params[:query].nil?
+ query = params[:query] + '*'
+ query = query.split(' ').join(' OR ') # XXX: HACK for OR instead of default AND!
+ @xapian_requests = perform_search([PublicBody], query, 'relevant', 'request_collapse', 5)
+ end
+ medium_cache
+ end
+
def show
medium_cache
@locale = self.locale_from_params()
@@ -37,7 +59,7 @@ class RequestController < ApplicationController
# Look up by new style text names
@info_request = InfoRequest.find_by_url_title(params[:url_title])
if @info_request.nil?
- raise "Request not found"
+ raise ActiveRecord::RecordNotFound.new("Request not found")
end
set_last_request(@info_request)
@@ -52,7 +74,6 @@ class RequestController < ApplicationController
@status = @info_request.calculate_status
@collapse_quotes = params[:unfold] ? false : true
@update_status = params[:update_status] ? true : false
- @is_owning_user = @info_request.is_owning_user?(authenticated_user)
@old_unclassified = @info_request.is_old_unclassified? && !authenticated_user.nil?
if @update_status
@@ -66,7 +87,7 @@ class RequestController < ApplicationController
@last_info_request_event_id = @info_request.last_event_id_needing_description
@new_responses_count = @info_request.events_needing_description.select {|i| i.event_type == 'response'}.size
-1
+
# Sidebar stuff
# ... requests that have similar imporant terms
behavior_cache :tag => ['similar', @info_request.id] do
@@ -86,7 +107,7 @@ class RequestController < ApplicationController
# For send followup link at bottom
@last_response = @info_request.get_last_response
-
+ @is_owning_user = @info_request.is_owning_user?(authenticated_user)
respond_to do |format|
format.html { @has_json = true; render :template => 'request/show'}
format.json { render :json => @info_request.json_for_api(true) }
@@ -129,26 +150,10 @@ class RequestController < ApplicationController
def list
medium_cache
@view = params[:view]
-
- if @view.nil?
- redirect_to request_list_url(:view => 'successful')
- return
- end
-
- if @view == 'recent'
- @title = _("Recently sent Freedom of Information requests")
- query = "variety:sent";
- sortby = "newest"
- @track_thing = TrackThing.create_track_for_all_new_requests
- elsif @view == 'successful'
- @title = _("Recently successful responses")
- query = 'variety:response (status:successful OR status:partially_successful)'
- sortby = "described"
- @track_thing = TrackThing.create_track_for_all_successful_requests
- else
- raise "unknown request list view " + @view.to_s
- end
-
+ params[:latest_status] = @view
+ query = make_query_from_params
+ @title = _("View and search requests")
+ sortby = "newest"
@page = get_search_page_from_params if !@page # used in cache case, as perform_search sets @page as side effect
behavior_cache :tag => [@view, @page] do
xapian_object = perform_search([InfoRequestEvent], query, sortby, 'request_collapse')
@@ -157,7 +162,7 @@ class RequestController < ApplicationController
end
@title = @title + " (page " + @page.to_s + ")" if (@page > 1)
-
+ @track_thing = TrackThing.create_track_for_search_query(query)
@feed_autodetect = [ { :url => do_track_url(@track_thing, 'feed'), :title => @track_thing.params[:title_in_rss], :has_json => true } ]
# Don't let robots go more than 20 pages in
@@ -203,7 +208,7 @@ class RequestController < ApplicationController
params[:info_request][:public_body_id] = params[:url_name]
else
public_body = PublicBody.find_by_url_name_with_historic(params[:url_name])
- raise "None found" if public_body.nil? # XXX proper 404
+ raise ActiveRecord::RecordNotFound.new("None found") if public_body.nil? # XXX proper 404
params[:info_request][:public_body_id] = public_body.id
end
elsif params[:public_body_id]
@@ -686,10 +691,10 @@ class RequestController < ApplicationController
raise "internal error, pre-auth filter should have caught this" if !@info_request.user_can_view?(authenticated_user)
@attachment = IncomingMessage.get_attachment_by_url_part_number(@incoming_message.get_attachments_for_display, @part_number)
- raise "attachment not found part number " + @part_number.to_s + " incoming_message " + @incoming_message.id.to_s if @attachment.nil?
+ raise ActiveRecord::RecordNotFound.new("attachment not found part number " + @part_number.to_s + " incoming_message " + @incoming_message.id.to_s) if @attachment.nil?
# check filename in URL matches that in database (use a censor rule if you want to change a filename)
- raise "please use same filename as original file has, display: '" + @attachment.display_filename + "' old_display: '" + @attachment.old_display_filename + "' original: '" + @original_filename + "'" if @attachment.display_filename != @original_filename && @attachment.old_display_filename != @original_filename
+ raise ActiveRecord::RecordNotFound.new("please use same filename as original file has, display: '" + @attachment.display_filename + "' old_display: '" + @attachment.old_display_filename + "' original: '" + @original_filename + "'") if @attachment.display_filename != @original_filename && @attachment.old_display_filename != @original_filename
@attachment_url = get_attachment_url(:id => @incoming_message.info_request_id,
:incoming_message_id => @incoming_message.id, :part => @part_number,
@@ -743,5 +748,79 @@ class RequestController < ApplicationController
return
end
end
+
+ # Type ahead search
+ def search_typeahead
+ # Since acts_as_xapian doesn't support the Partial match flag, we work around it
+ # by making the last work a wildcard, which is quite the same
+ query = params[:q] + '*'
+
+ query = query.split(' ').join(' OR ') # XXX: HACK for OR instead of default AND!
+ @xapian_requests = perform_search([InfoRequestEvent], query, 'relevant', 'request_collapse', 5)
+
+ render :partial => "request/search_ahead.rhtml"
+ end
+
+ def download_entire_request
+ @locale = self.locale_from_params()
+ PublicBody.with_locale(@locale) do
+ info_request = InfoRequest.find_by_url_title(params[:url_title])
+ if info_request.nil?
+ raise ActiveRecord::RecordNotFound.new("Request not found")
+ end
+ if authenticated?(
+ :web => _("To download the zip file"),
+ :email => _("Then you can download a zip file of {{info_request_title}}.",:info_request_title=>info_request.title),
+ :email_subject => _("Log in to download a zip file of {{info_request_title}}",:info_request_title=>info_request.title)
+ )
+ updated = Digest::SHA1.hexdigest(info_request.get_last_event.created_at.to_s + info_request.updated_at.to_s)
+ @url_path = "/download/#{updated[0..1]}/#{updated}/#{params[:url_title]}.zip"
+ file_path = File.join(File.dirname(__FILE__), '../../cache/zips', @url_path)
+ if !File.exists?(file_path)
+ FileUtils.mkdir_p(File.dirname(file_path))
+ Zip::ZipFile.open(file_path, Zip::ZipFile::CREATE) { |zipfile|
+ convert_command = MySociety::Config.get("HTML_TO_PDF_COMMAND")
+ done = false
+ if File.exists?(convert_command)
+ domain = MySociety::Config.get("DOMAIN")
+ url = "http://#{domain}#{request_url(info_request)}?print_stylesheet=1"
+ tempfile = Tempfile.new('foihtml2pdf')
+ output = AlaveteliExternalCommand.run(convert_command, url, tempfile.path)
+ if !output.nil?
+ zipfile.get_output_stream("correspondence.pdf") { |f|
+ f.puts(File.open(tempfile.path).read)
+ }
+ done = true
+ else
+ logger.error("Could not convert info request #{info_request.id} to PDF with command '#{convert_command} #{url} #{tempfile.path}'")
+ end
+ tempfile.close
+ else
+ logger.warn("No HTML -> PDF converter found at #{convert_command}")
+ end
+ if !done
+ @info_request = info_request
+ @info_request_events = info_request.info_request_events
+ template = File.read(File.join(File.dirname(__FILE__), "..", "views", "request", "simple_correspondence.rhtml"))
+ output = ERB.new(template).result(binding)
+ zipfile.get_output_stream("correspondence.txt") { |f|
+ f.puts(output)
+ }
+ end
+ for message in info_request.incoming_messages
+ attachments = message.get_attachments_for_display
+ for attachment in attachments
+ zipfile.get_output_stream(attachment.display_filename) { |f|
+ f.puts(attachment.body)
+ }
+ end
+ end
+ }
+ File.chmod(0644, file_path)
+ end
+ redirect_to @url_path
+ end
+ end
+ end
end
diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb
new file mode 100644
index 000000000..6fb20336e
--- /dev/null
+++ b/app/controllers/services_controller.rb
@@ -0,0 +1,32 @@
+# controllers/application.rb:
+# Parent class of all controllers in FOI site. Filters added to this controller
+# apply to all controllers in the application. Likewise, all the methods added
+# will be available for all controllers.
+#
+# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
+# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
+#
+# $Id: application.rb,v 1.59 2009-09-17 13:01:56 francis Exp $
+
+require 'open-uri'
+
+class ServicesController < ApplicationController
+ def other_country_message
+ text = ""
+ iso_country_code = MySociety::Config.get('ISO_COUNTRY_CODE').downcase
+ if country_from_ip.downcase != iso_country_code
+ found_country = WorldFOIWebsites.by_code(country_from_ip)
+ found_country_name = !found_country.nil? && found_country[:country_name]
+ if found_country_name
+ text = _("Hello! You can make Freedom of Information requests within {{country_name}} at {{link_to_website}}", :country_name => found_country_name, :link_to_website => "<a href=\"#{found_country[:url]}\">#{found_country[:name]}</a>")
+ else
+ current_country = WorldFOIWebsites.by_code(iso_country_code)[:country_name]
+ text = _("Hello! We have an <a href=\"/help/alaveteli?country_name=#{CGI.escape(current_country)}\">important message</a> for visitors outside {{country_name}}", :country_name => current_country)
+ end
+ end
+ if !text.empty?
+ text += ' <span class="close-button">X</span>'
+ end
+ render :text => text, :content_type => "text/plain" # XXX workaround the HTML validation in test suite
+ end
+end
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb
index d3c42c7f1..96dbfba74 100644
--- a/app/controllers/user_controller.rb
+++ b/app/controllers/user_controller.rb
@@ -8,6 +8,8 @@
class UserController < ApplicationController
+ layout :select_layout
+
protect_from_forgery :only => [ :contact,
:set_profile_photo,
:signchangeemail,
@@ -24,7 +26,7 @@ class UserController < ApplicationController
@display_user = User.find(:first, :conditions => [ "url_name = ? and email_confirmed = ?", params[:url_name], true ])
if not @display_user
- raise "user not found, url_name=" + params[:url_name]
+ raise ActiveRecord::RecordNotFound.new("user not found, url_name=" + params[:url_name])
end
@same_name_users = User.find(:all, :conditions => [ "name ilike ? and email_confirmed = ? and id <> ?", @display_user.name, true, @display_user.id ], :order => "created_at")
@@ -33,9 +35,16 @@ class UserController < ApplicationController
# Use search query for this so can collapse and paginate easily
# XXX really should just use SQL query here rather than Xapian.
begin
- @xapian_requests = perform_search([InfoRequestEvent], 'requested_by:' + @display_user.url_name, 'newest', 'request_collapse')
- @xapian_comments = perform_search([InfoRequestEvent], 'commented_by:' + @display_user.url_name, 'newest', nil)
-
+ requests_query = 'requested_by:' + @display_user.url_name
+ comments_query = 'commented_by:' + @display_user.url_name
+ if !params[:user_query].nil?
+ requests_query += " " + params[:user_query]
+ comments_query += " " + params[:user_query]
+ @match_phrase = _("{{search_results}} matching '{{query}}'", :search_results => "", :query => params[:user_query])
+ end
+ @xapian_requests = perform_search([InfoRequestEvent], requests_query, 'newest', 'request_collapse')
+ @xapian_comments = perform_search([InfoRequestEvent], comments_query, 'newest', nil)
+
if (@page > 1)
@page_desc = " (page " + @page.to_s + ")"
else
@@ -71,7 +80,7 @@ class UserController < ApplicationController
# Login form
def signin
work_out_post_redirect
-
+ @request_from_foreign_country = country_from_ip != MySociety::Config.get('ISO_COUNTRY_CODE', 'GB')
# make sure we have cookies
if session.instance_variable_get(:@dbman)
if not session.instance_variable_get(:@dbman).instance_variable_get(:@original)
@@ -106,7 +115,12 @@ class UserController < ApplicationController
session[:user_id] = @user_signin.id
session[:user_circumstance] = nil
session[:remember_me] = params[:remember_me] ? true : false
- do_post_redirect @post_redirect
+
+ if is_modal_dialog
+ render :action => 'signin_successful'
+ else
+ do_post_redirect @post_redirect
+ end
else
send_confirmation_mail @user_signin
end
@@ -118,10 +132,15 @@ class UserController < ApplicationController
# Create new account form
def signup
work_out_post_redirect
-
+ @request_from_foreign_country = country_from_ip != MySociety::Config.get('ISO_COUNTRY_CODE', 'GB')
# Make the user and try to save it
@user_signup = User.new(params[:user_signup])
- if !@user_signup.valid?
+ error = false
+ if @request_from_foreign_country && !verify_recaptcha
+ flash.now[:error] = _("There was an error with the words you entered, please try again.")
+ error = true
+ end
+ if error || !@user_signup.valid?
# Show the form
render :action => 'sign'
else
@@ -133,7 +152,6 @@ class UserController < ApplicationController
# New unconfirmed user
@user_signup.email_confirmed = false
@user_signup.save!
-
send_confirmation_mail @user_signup
return
end
@@ -454,7 +472,7 @@ class UserController < ApplicationController
def get_profile_photo
@display_user = User.find(:first, :conditions => [ "url_name = ? and email_confirmed = ?", params[:url_name], true ])
if !@display_user
- raise "user not found, url_name=" + params[:url_name]
+ raise ActiveRecord::RecordNotFound.new("user not found, url_name=" + params[:url_name])
end
if !@display_user.profile_photo
raise "user has no profile photo, url_name=" + params[:url_name]
@@ -500,6 +518,15 @@ class UserController < ApplicationController
private
+ def is_modal_dialog
+ (params[:modal].to_i != 0)
+ end
+
+ # when logging in through a modal iframe, don't display chrome around the content
+ def select_layout
+ is_modal_dialog ? 'no_chrome' : 'default'
+ end
+
# Decide where we are going to redirect back to after signin/signup, and record that
def work_out_post_redirect
# Redirect to front page later if nothing else specified
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index ec56566a9..a0f16dfaf 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -94,5 +94,24 @@ module ApplicationHelper
block.call
end
end
+ # (unfortunately) ugly way of getting id of generated form element
+ # ids
+ # see http://chrisblunt.com/2009/10/12/rails-getting-the-id-of-form-fields-inside-a-fields_for-block/
+ def sanitized_object_name(object_name)
+ object_name.gsub(/\]\[|[^-a-zA-Z0-9:.]/,"_").sub(/_$/,"")
+ end
+
+ def sanitized_method_name(method_name)
+ method_name.sub(/\?$/, "")
+ end
+
+ def form_tag_id(object_name, method_name, locale=nil)
+ if locale.nil?
+ return "#{sanitized_object_name(object_name.to_s)}_#{sanitized_method_name(method_name.to_s)}"
+ else
+ return "#{sanitized_object_name(object_name.to_s)}_#{sanitized_method_name(method_name.to_s)}__#{locale.to_s}"
+ end
+ end
+
end
diff --git a/app/helpers/config_helper.rb b/app/helpers/config_helper.rb
index 80f2deed2..b0381a2f5 100644
--- a/app/helpers/config_helper.rb
+++ b/app/helpers/config_helper.rb
@@ -2,4 +2,8 @@ module ConfigHelper
def site_name
MySociety::Config.get('SITE_NAME', 'Alaveteli')
end
+
+ def force_registration_on_new_request
+ MySociety::Config.get('FORCE_REGISTRATION_ON_NEW_REQUEST', false)
+ end
end \ No newline at end of file
diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb
index 444129052..54b8d69d0 100755
--- a/app/helpers/link_to_helper.rb
+++ b/app/helpers/link_to_helper.rb
@@ -61,7 +61,7 @@ module LinkToHelper
# Public bodies
def public_body_url(public_body)
- return show_public_body_url(:url_name => public_body.url_name, :only_path => true)
+ public_body.url_name.nil? ? '' : show_public_body_url(:url_name => public_body.url_name, :only_path => true)
end
def public_body_link_short(public_body)
link_to h(public_body.short_or_long_name), public_body_url(public_body)
@@ -79,7 +79,7 @@ module LinkToHelper
link_to(h(public_body.name), main_url(public_body_url(public_body))) + " (" + link_to("admin", public_body_admin_url(public_body)) + ")"
end
def list_public_bodies_default
- list_public_bodies_url(:tag => 'a')
+ list_public_bodies_url(:tag => 'all')
end
# Users
@@ -135,11 +135,10 @@ module LinkToHelper
end
end
- # General pages. postfix is either the sort order, or 'bodies' to show you
- # came from the front page and are looking for public bodies
- def search_url(query, postfix = nil)
+ # General pages.
+ def search_url(query, variety_postfix = nil, sort_postfix = nil, advanced = nil)
+ query = query - ["", nil] if query.kind_of?(Array)
url = search_general_url(:combined => query)
-
# Here we can't escape the slashes, as RFC 2396 doesn't allow slashes
# within a path component. Rails is assuming when generating URLs that
# either there aren't slashes, or we are in a query part where you can
@@ -151,13 +150,19 @@ module LinkToHelper
# http://rails.lighthouseapp.com/projects/8994/tickets/144-patch-bug-in-rails-route-globbing
url = url.gsub("%2F", "/")
- if !postfix.nil? && !postfix.empty?
- url = url + "/" + postfix
+ if !variety_postfix.nil? && !variety_postfix.empty?
+ url = url + "/" + variety_postfix
+ end
+ if !sort_postfix.nil? && !sort_postfix.empty?
+ url = url + "/" + sort_postfix
+ end
+ if !advanced.nil? && (advanced)
+ url = url + "/advanced"
end
return url
end
- def search_link(query, postfix = nil)
- link_to h(query), search_url(query, postfix)
+ def search_link(query, variety_postfix = nil, sort_postfix = nil, advanced = nil)
+ link_to h(query), search_url(query, variety_postfix, sort_postfix, advanced)
end
# Admin pages
@@ -187,7 +192,7 @@ module LinkToHelper
# Basic date format
def simple_date(date)
- return date.strftime("%e %B %Y").strip
+ return I18n.l(date, :format => "%e %B %Y")
end
def simple_time(date)
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 17dd333e6..2b795ddf5 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -29,7 +29,6 @@
# general not specific to IncomingMessage.
require 'alaveteli_file_types'
-require 'external_command'
require 'htmlentities'
require 'rexml/document'
require 'zip/zip'
@@ -1121,38 +1120,38 @@ class IncomingMessage < ActiveRecord::Base
tempfile.print body
tempfile.flush
if content_type == 'application/vnd.ms-word'
- external_command("/usr/bin/wvText", tempfile.path, tempfile.path + ".txt")
+ AlaveteliExternalCommand.run("/usr/bin/wvText", tempfile.path, tempfile.path + ".txt")
# Try catdoc if we get into trouble (e.g. for InfoRequestEvent 2701)
if not File.exists?(tempfile.path + ".txt")
- external_command("/usr/bin/catdoc", tempfile.path, :append_to => text)
+ AlaveteliExternalCommand.run("/usr/bin/catdoc", tempfile.path, :append_to => text)
else
text += File.read(tempfile.path + ".txt") + "\n\n"
File.unlink(tempfile.path + ".txt")
end
elsif content_type == 'application/rtf'
# catdoc on RTF prodcues less comments and extra bumf than --text option to unrtf
- external_command("/usr/bin/catdoc", tempfile.path, :append_to => text)
+ AlaveteliExternalCommand.run("/usr/bin/catdoc", tempfile.path, :append_to => text)
elsif content_type == 'text/html'
# lynx wordwraps links in its output, which then don't get formatted properly
# by Alaveteli. We use elinks instead, which doesn't do that.
- external_command("/usr/bin/elinks", "-eval", "'set document.codepage.assume = \"utf-8\"'", "-dump-charset", "utf-8", "-force-html", "-dump",
+ AlaveteliExternalCommand.run("/usr/bin/elinks", "-eval", "'set document.codepage.assume = \"utf-8\"'", "-dump-charset", "utf-8", "-force-html", "-dump",
tempfile.path, :append_to => text)
elsif content_type == 'application/vnd.ms-excel'
# Bit crazy using /usr/bin/strings - but xls2csv, xlhtml and
# py_xls2txt only extract text from cells, not from floating
# notes. catdoc may be fooled by weird character sets, but will
# probably do for UK FOI requests.
- external_command("/usr/bin/strings", tempfile.path, :append_to => text)
+ AlaveteliExternalCommand.run("/usr/bin/strings", tempfile.path, :append_to => text)
elsif content_type == 'application/vnd.ms-powerpoint'
# ppthtml seems to catch more text, but only outputs HTML when
# we want text, so just use catppt for now
- external_command("/usr/bin/catppt", tempfile.path, :append_to => text)
+ AlaveteliExternalCommand.run("/usr/bin/catppt", tempfile.path, :append_to => text)
elsif content_type == 'application/pdf'
- external_command("/usr/bin/pdftotext", tempfile.path, "-", :append_to => text)
+ AlaveteliExternalCommand.run("/usr/bin/pdftotext", tempfile.path, "-", :append_to => text)
elsif content_type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
# This is Microsoft's XML office document format.
# Just pull out the main XML file, and strip it of text.
- xml = external_command("/usr/bin/unzip", "-qq", "-c", tempfile.path, "word/document.xml")
+ xml = AlaveteliExternalCommand.run("/usr/bin/unzip", "-qq", "-c", tempfile.path, "word/document.xml")
if !xml.nil?
doc = REXML::Document.new(xml)
text += doc.each_element( './/text()' ){}.join(" ")
@@ -1308,7 +1307,12 @@ class IncomingMessage < ActiveRecord::Base
if !prefix.nil? && prefix.downcase.match(/^(postmaster|mailer-daemon|auto_reply|do.?not.?reply|no.reply)$/)
return false
end
-
+ if !self.mail['return-path'].nil? && self.mail['return-path'].addr == "<>"
+ return false
+ end
+ if !self.mail['auto-submitted'].nil? && !self.mail['auto-submitted'].keys.empty?
+ return false
+ end
return true
end
@@ -1336,34 +1340,6 @@ class IncomingMessage < ActiveRecord::Base
end
private :normalise_content_type
- def self.external_command(program_name, *args)
- # Run an external program, and return its output.
- # Standard error is suppressed unless the program
- # fails (i.e. returns a non-zero exit status).
- opts = {}
- if !args.empty? && args[-1].is_a?(Hash)
- opts = args.pop
- end
-
- xc = ExternalCommand.new(program_name, *args)
- if opts.has_key? :append_to
- xc.out = opts[:append_to]
- end
- xc.run()
- if xc.status != 0
- # Error
- $stderr.puts("Error from #{program_name} #{args.join(' ')}:")
- $stderr.print(xc.err)
- return nil
- else
- if opts.has_key? :append_to
- opts[:append_to] << "\n\n"
- else
- return xc.out
- end
- end
- end
- private_class_method :external_command
end
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index c667e1499..92322f74f 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -117,13 +117,13 @@ class InfoRequest < ActiveRecord::Base
# only check on create, so existing models with mixed case are allowed
def validate_on_create
if !self.title.nil? && !MySociety::Validate.uses_mixed_capitals(self.title, 10)
- errors.add(:title, N_('Please write the summary using a mixture of capital and lower case letters. This makes it easier for others to read.'))
+ errors.add(:title, _('Please write the summary using a mixture of capital and lower case letters. This makes it easier for others to read.'))
end
if !self.title.nil? && title.size > 200
- errors.add(:title, N_('Please keep the summary short, like in the subject of an email. You can use a phrase, rather than a full sentence.'))
+ errors.add(:title, _('Please keep the summary short, like in the subject of an email. You can use a phrase, rather than a full sentence.'))
end
if !self.title.nil? && self.title =~ /^(FOI|Freedom of Information)\s*requests?$/i
- errors.add(:title, N_('Please describe more what the request is about in the subject. There is no need to say it is an FOI request, we add that on anyway.'))
+ errors.add(:title, _('Please describe more what the request is about in the subject. There is no need to say it is an FOI request, we add that on anyway.'))
end
end
@@ -451,7 +451,7 @@ public
self.log_event("response", params)
self.save!
end
-
+ self.info_request_events.each { |event| event.xapian_mark_needs_index } # for the "waiting_classification" index
RequestMailer.deliver_new_response(self, incoming_message)
end
@@ -564,6 +564,7 @@ public
def calculate_event_states
curr_state = nil
for event in self.info_request_events.reverse
+ event.xapian_mark_needs_index # we need to reindex all events in order to update their latest_* terms
if curr_state.nil?
if !event.described_state.nil?
curr_state = event.described_state
@@ -779,8 +780,7 @@ public
# Display version of status
- def display_status
- status = self.calculate_status
+ def InfoRequest.get_status_description(status)
if status == 'waiting_classification'
_("Awaiting classification.")
elsif status == 'waiting_response'
@@ -818,6 +818,10 @@ public
end
end
+ def display_status
+ InfoRequest.get_status_description(self.calculate_status)
+ end
+
# Completely delete this request and all objects depending on it
def fully_destroy
self.track_things.each do |track_thing|
@@ -918,10 +922,13 @@ public
end
# List of incoming messages to followup, by unique email
- def who_can_followup_to
+ def who_can_followup_to(skip_message = nil)
ret = []
done = {}
for incoming_message in self.incoming_messages.reverse
+ if incoming_message == skip_message
+ next
+ end
incoming_message.safe_mail_from
email = OutgoingMailer.email_for_followup(self, incoming_message)
diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb
index d79647c98..4ea89bf81 100644
--- a/app/models/info_request_event.rb
+++ b/app/models/info_request_event.rb
@@ -57,22 +57,7 @@ class InfoRequestEvent < ActiveRecord::Base
]
# user described state (also update in info_request)
- validates_inclusion_of :described_state, :in => [
- nil,
- 'waiting_response',
- 'waiting_clarification',
- 'gone_postal',
- 'deadline_extended',
- 'wrong_response',
- 'not_held',
- 'rejected',
- 'successful',
- 'partially_successful',
- 'internal_review',
- 'error_message',
- 'requires_admin',
- 'user_withdrawn'
- ]
+ validate :must_be_valid_state
# whether event is publicly visible
validates_inclusion_of :prominence, :in => [
@@ -81,6 +66,12 @@ class InfoRequestEvent < ActiveRecord::Base
'requester_only'
]
+ def must_be_valid_state
+ if !described_state.nil? and !InfoRequest.enumerate_states.include?(described_state)
+ errors.add(described_state, "is not a valid state")
+ end
+ end
+
def user_can_view?(user)
if !self.info_request.user_can_view?(user)
raise "internal error, called user_can_view? on event when there is not permission to view entire request"
@@ -103,7 +94,7 @@ class InfoRequestEvent < ActiveRecord::Base
[ :created_at_numeric, 1, "created_at", :number ], # for sorting
[ :described_at_numeric, 2, "described_at", :number ], # XXX using :number for lack of :datetime support in Xapian values
[ :request, 3, "request_collapse", :string ],
- [ :request_title_collapse, 4, "request_title_collapse", :string ]
+ [ :request_title_collapse, 4, "request_title_collapse", :string ],
],
:terms => [ [ :calculated_state, 'S', "status" ],
[ :requested_by, 'B', "requested_by" ],
@@ -111,6 +102,9 @@ class InfoRequestEvent < ActiveRecord::Base
[ :commented_by, 'C', "commented_by" ],
[ :request, 'R', "request" ],
[ :variety, 'V', "variety" ],
+ [ :latest_variety, 'K', "latest_variety" ],
+ [ :latest_status, 'L', "latest_status" ],
+ [ :waiting_classification, 'W', "waiting_classification" ],
[ :filetype, 'T', "filetype" ],
[ :tags, 'U', "tag" ]
],
@@ -138,6 +132,27 @@ class InfoRequestEvent < ActiveRecord::Base
def request
self.info_request.url_title
end
+
+ def latest_variety
+ for event in self.info_request.info_request_events.reverse
+ if !event.variety.nil? and !event.variety.empty?
+ return event.variety
+ end
+ end
+ end
+
+ def latest_status
+ for event in self.info_request.info_request_events.reverse
+ if !event.calculated_state.nil? and !event.calculated_state.empty?
+ return event.calculated_state
+ end
+ end
+ end
+
+ def waiting_classification
+ self.info_request.awaiting_description == true ? "yes" : "no"
+ end
+
def request_title_collapse
url_title = self.info_request.url_title
# remove numeric section from the end, use this to group lots
@@ -288,37 +303,7 @@ class InfoRequestEvent < ActiveRecord::Base
def display_status
if is_incoming_message?
status = self.calculated_state
- if !status.nil?
- if status == 'waiting_response'
- return _("Acknowledgement")
- elsif status == 'waiting_clarification'
- return _("Clarification required")
- elsif status == 'gone_postal'
- return _("Handled by post")
- elsif status == 'deadline_extended'
- return _("Deadline Extended")
- elsif status == 'wrong_response'
- return _("Wrong Response")
- elsif status == 'not_held'
- return _("Information not held")
- elsif status == 'rejected'
- return _("Refused")
- elsif status == 'partially_successful'
- return _("Some information sent")
- elsif status == 'successful'
- return _("All information sent")
- elsif status == 'internal_review'
- return _("Internal review acknowledgement")
- elsif status == 'user_withdrawn'
- return _("Withdrawn by requester")
- elsif status == 'error_message'
- return _("Delivery error")
- elsif status == 'requires_admin'
- return _("Unusual response")
- end
- raise "unknown status " + status
- end
- return "Response"
+ return status.nil? ? _("Response") : InfoRequest.get_status_description(status)
end
if is_outgoing_message?
diff --git a/app/models/public_body.rb b/app/models/public_body.rb
index b75da4331..430aa8f34 100644
--- a/app/models/public_body.rb
+++ b/app/models/public_body.rb
@@ -38,7 +38,7 @@ class PublicBody < ActiveRecord::Base
validates_uniqueness_of :short_name, :message => N_("Short name is already taken"), :if => Proc.new { |pb| pb.short_name != "" }
validates_uniqueness_of :name, :message => N_("Name is already taken")
-
+
has_many :info_requests, :order => 'created_at desc'
has_many :track_things, :order => 'created_at desc'
@@ -46,6 +46,40 @@ class PublicBody < ActiveRecord::Base
translates :name, :short_name, :request_email, :url_name, :notes, :first_letter, :publication_scheme
+ # Convenience methods for creating/editing translations via forms
+ def translation(locale)
+ self.translations.find_by_locale(locale)
+ end
+
+ # XXX - Don't like repeating this!
+ def calculate_cached_fields(t)
+ t.first_letter = t.name.scan(/^./mu)[0].upcase unless t.name.nil? or t.name.empty?
+ short_long_name = t.name
+ short_long_name = t.short_name if t.short_name and !t.short_name.empty?
+ t.url_name = MySociety::Format.simplify_url_part(short_long_name, 'body')
+ end
+
+ def translated_versions
+ translations
+ end
+
+ def translated_versions=(translation_attrs)
+ if translation_attrs.respond_to? :each_value # Hash => updating
+ translation_attrs.each_value do |attrs|
+ t = translation(attrs[:locale]) || PublicBody::Translation.new
+ t.attributes = attrs
+ calculate_cached_fields(t)
+ t.save!
+ end
+ else # Array => creating
+ translation_attrs.each do |attrs|
+ new_translation = PublicBody::Translation.new(attrs)
+ calculate_cached_fields(new_translation)
+ translations << new_translation
+ end
+ end
+ end
+
# Make sure publication_scheme gets the correct default value.
# (This would work automatically, were publication_scheme not a translated attribute)
def after_initialize
@@ -78,16 +112,6 @@ class PublicBody < ActiveRecord::Base
end
end
- # XXX this should be saner; probably implement categories as data
- begin
- load "public_body_categories_#{I18n.locale.to_s}.rb"
- rescue MissingSourceFile
- begin
- load "public_body_categories_#{I18n.default_locale.to_s}.rb"
- rescue MissingSourceFile
- load "public_body_categories.rb"
- end
- end
# Set the first letter, which is used for faster queries
before_save(:set_first_letter)
def set_first_letter
@@ -172,7 +196,7 @@ class PublicBody < ActiveRecord::Base
return self.created_at.strftime("%Y%m%d%H%M%S")
end
def variety
- "authority"
+ return "authority"
end
# if the URL name has changed, then all requested_from: queries
@@ -191,7 +215,6 @@ class PublicBody < ActiveRecord::Base
# When name or short name is changed, also change the url name
def short_name=(short_name)
-
globalize.write(self.class.locale || I18n.locale, :short_name, short_name)
self[:short_name] = short_name
self.update_url_name
@@ -204,15 +227,15 @@ class PublicBody < ActiveRecord::Base
end
def update_url_name
- url_name = MySociety::Format.simplify_url_part(self.short_or_long_name, 'body')
- self.url_name = url_name
+ self.url_name = MySociety::Format.simplify_url_part(self.short_or_long_name, 'body')
end
+
# Return the short name if present, or else long name
def short_or_long_name
- if self.short_name.nil? # can happen during construction
+ if self.short_name.nil? || self.short_name.empty? # 'nil' can happen during construction
self.name
else
- self.short_name.empty? ? self.name : self.short_name
+ self.short_name
end
end
@@ -222,8 +245,8 @@ class PublicBody < ActiveRecord::Base
types = []
first = true
for tag in self.tags
- if PublicBodyCategories::CATEGORIES_BY_TAG.include?(tag.name)
- desc = PublicBodyCategories::CATEGORY_SINGULAR_BY_TAG[tag.name]
+ if PublicBodyCategories::get().by_tag().include?(tag.name)
+ desc = PublicBodyCategories::get().singular_by_tag()[tag.name]
if first
# terrible that Ruby/Rails doesn't have an equivalent of ucfirst
# (capitalize shockingly converts later characters to lowercase)
@@ -311,9 +334,10 @@ class PublicBody < ActiveRecord::Base
# Import from CSV. Just tests things and returns messages if dry_run is true.
# Returns an array of [array of errors, array of notes]. If there are errors,
# always rolls back (as with dry_run).
- def self.import_csv(csv, tag, dry_run, editor, additional_locales = [])
+ def self.import_csv(csv, tag, dry_run, editor, available_locales = [])
errors = []
notes = []
+ available_locales = [I18n.default_locale] if available_locales.empty?
begin
ActiveRecord::Base.transaction do
@@ -323,14 +347,18 @@ class PublicBody < ActiveRecord::Base
bodies_by_name = {}
set_of_existing = Set.new()
PublicBody.with_locale(I18n.default_locale) do
- for existing_body in PublicBody.find_by_tag(tag)
+ bodies = (tag.nil? || tag.empty?) ? PublicBody.find(:all) : PublicBody.find_by_tag(tag)
+ for existing_body in bodies
+ # Hide InternalAdminBody from import notes
+ next if existing_body.id == PublicBody.internal_admin_body.id
+
bodies_by_name[existing_body.name] = existing_body
set_of_existing.add(existing_body.name)
end
end
set_of_importing = Set.new()
- field_names = { 'name'=>1, 'email'=>2 } # Default values in case no field list is given
+ field_names = { 'name'=>1, 'request_email'=>2 } # Default values in case no field list is given
line = 0
CSV::Reader.parse(csv) do |row|
line = line + 1
@@ -341,57 +369,64 @@ class PublicBody < ActiveRecord::Base
row.each_with_index {|field, i| field_names[field] = i}
next
end
+
+ fields = {}
+ field_names.each{|name, i| fields[name] = row[i]}
name = row[field_names['name']]
- email = row[field_names['email']]
+ email = row[field_names['request_email']]
next if name.nil?
- if email.nil?
- email = '' # unknown/bad contact is empty string
- end
name.strip!
email.strip!
- if email != "" && !MySociety::Validate.is_valid_email(email)
- errors.push "error: line " + line.to_s + ": invalid email " + email + " for authority '" + name + "'"
+ if !email.nil? && !email.empty? && !MySociety::Validate.is_valid_email(email)
+ errors.push "error: line #{line.to_s}: invalid email '#{email}' for authority '#{name}'"
next
end
+
+ field_list = ['name', 'short_name', 'request_email', 'notes', 'publication_scheme', 'home_page', 'tag_string']
+
+ if public_body = bodies_by_name[name] # Existing public body
+ available_locales.each do |locale|
+ PublicBody.with_locale(locale) do
+ changed = {}
+ field_list.each do |field_name|
+ localized_field_name = (locale === I18n.default_locale) ? field_name : "#{field_name}.#{locale}"
+ localized_value = field_names[localized_field_name] && row[field_names[localized_field_name]]
+ if !localized_value.nil? and public_body.send(field_name) != localized_value
+ changed[field_name] = "#{public_body.send(field_name)}: #{localized_value}"
+ public_body.send("#{field_name}=", localized_value)
+ end
+ end
- if bodies_by_name[name]
- # Already have the public body, just update email
- public_body = bodies_by_name[name]
- if public_body.request_email != email
- notes.push "line " + line.to_s + ": updating email for '" + name + "' from " + public_body.request_email + " to " + email
- public_body.request_email = email
- public_body.last_edit_editor = editor
- public_body.last_edit_comment = 'Updated from spreadsheet'
- public_body.save!
- end
-
- additional_locales.each do |locale|
- localized_name = field_names["name.#{locale}"] && row[field_names["name.#{locale}"]]
- PublicBody.with_locale(locale) do
- if !localized_name.nil? and public_body.name != localized_name
- notes.push "line " + line.to_s + ": updating name for '#{name}' from '#{public_body.name}' to '#{localized_name}' (locale: #{locale})."
- public_body.name = localized_name
+ unless changed.empty?
+ notes.push "line #{line.to_s}: updating authority '#{name}' (locale: #{locale}):\n\t#{changed.to_json}"
+ public_body.last_edit_editor = editor
+ public_body.last_edit_comment = 'Updated from spreadsheet'
public_body.save!
end
end
end
- else
- # New public body
- notes.push "line " + line.to_s + ": new authority '" + name + "' with email " + email
- public_body = PublicBody.new(:name => name, :request_email => email, :short_name => "", :home_page => "", :publication_scheme => "", :notes => "", :last_edit_editor => editor, :last_edit_comment => 'Created from spreadsheet')
- public_body.tag_string = tag
- public_body.save!
-
- additional_locales.each do |locale|
- localized_name = field_names["name.#{locale}"] && row[field_names["name.#{locale}"]]
- if !localized_name.nil?
- PublicBody.with_locale(locale) do
- notes.push "line " + line.to_s + ": (aka '#{localized_name}' in locale #{locale})"
- public_body.name = localized_name
- public_body.publication_scheme = ""
+ else # New public body
+ public_body = PublicBody.new(:name=>name, :short_name=>"", :request_email=>"")
+ available_locales.each do |locale|
+ PublicBody.with_locale(locale) do
+ changed = {}
+ field_list.each do |field_name|
+ localized_field_name = (locale === I18n.default_locale) ? field_name : "#{field_name}.#{locale}"
+ localized_value = field_names[localized_field_name] && row[field_names[localized_field_name]]
+ if !localized_value.nil? and public_body.send(field_name) != localized_value
+ changed[field_name] = localized_value
+ public_body.send("#{field_name}=", localized_value)
+ end
+ end
+
+ unless changed.empty?
+ notes.push "line #{line.to_s}: creating new authority '#{name}' (locale: #{locale}):\n\t#{changed.to_json}"
+ public_body.publication_scheme = public_body.publication_scheme || ""
+ public_body.last_edit_editor = editor
+ public_body.last_edit_comment = 'Created from spreadsheet'
public_body.save!
end
end
@@ -404,7 +439,7 @@ class PublicBody < ActiveRecord::Base
# Give an error listing ones that are to be deleted
deleted_ones = set_of_existing - set_of_importing
if deleted_ones.size > 0
- notes.push "notes: Some " + tag + " bodies are in database, but not in CSV file:\n " + Array(deleted_ones).join("\n ") + "\nYou may want to delete them manually.\n"
+ notes.push "Notes: Some " + tag + " bodies are in database, but not in CSV file:\n " + Array(deleted_ones).join("\n ") + "\nYou may want to delete them manually.\n"
end
# Rollback if a dry run, or we had errors
@@ -473,7 +508,7 @@ class PublicBody < ActiveRecord::Base
end
def notes_without_html
# assume notes are reasonably behaved HTML, so just use simple regexp on this
- self.notes.gsub(/<\/?[^>]*>/, "")
+ self.notes.nil? ? '' : self.notes.gsub(/<\/?[^>]*>/, "")
end
def json_for_api
diff --git a/app/models/request_mailer.rb b/app/models/request_mailer.rb
index fc317d20d..f46ce33c5 100644
--- a/app/models/request_mailer.rb
+++ b/app/models/request_mailer.rb
@@ -61,7 +61,8 @@ class RequestMailer < ApplicationMailer
@from = contact_from_name_and_email
headers 'Return-Path' => blackhole_email, 'Reply-To' => @from, # not much we can do if the user's email is broken
- 'Auto-Submitted' => 'auto-generated' # http://tools.ietf.org/html/rfc3834
+ 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834
+ 'X-Auto-Response-Suppress' => 'OOF'
@recipients = info_request.user.name_and_email
@subject = "New response to your FOI request - " + info_request.title
@body = { :incoming_message => incoming_message, :info_request => info_request, :url => url }
@@ -79,7 +80,8 @@ class RequestMailer < ApplicationMailer
@from = contact_from_name_and_email
headers 'Return-Path' => blackhole_email, 'Reply-To' => @from, # not much we can do if the user's email is broken
- 'Auto-Submitted' => 'auto-generated' # http://tools.ietf.org/html/rfc3834
+ 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834
+ 'X-Auto-Response-Suppress' => 'OOF'
@recipients = user.name_and_email
@subject = "Delayed response to your FOI request - " + info_request.title
@body = { :info_request => info_request, :url => url }
@@ -97,7 +99,8 @@ class RequestMailer < ApplicationMailer
@from = contact_from_name_and_email
headers 'Return-Path' => blackhole_email, 'Reply-To' => @from, # not much we can do if the user's email is broken
- 'Auto-Submitted' => 'auto-generated' # http://tools.ietf.org/html/rfc3834
+ 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834
+ 'X-Auto-Response-Suppress' => 'OOF'
@recipients = user.name_and_email
@subject = "You're long overdue a response to your FOI request - " + info_request.title
@body = { :info_request => info_request, :url => url }
@@ -116,7 +119,8 @@ class RequestMailer < ApplicationMailer
@from = contact_from_name_and_email
headers 'Return-Path' => blackhole_email, 'Reply-To' => @from, # not much we can do if the user's email is broken
- 'Auto-Submitted' => 'auto-generated' # http://tools.ietf.org/html/rfc3834
+ 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834
+ 'X-Auto-Response-Suppress' => 'OOF'
@recipients = info_request.user.name_and_email
@subject = "Was the response you got to your FOI request any good?"
@body = { :incoming_message => incoming_message, :info_request => info_request, :url => url }
@@ -126,7 +130,8 @@ class RequestMailer < ApplicationMailer
def old_unclassified_updated(info_request)
@from = contact_from_name_and_email
headers 'Return-Path' => blackhole_email, 'Reply-To' => @from, # not much we can do if the user's email is broken
- 'Auto-Submitted' => 'auto-generated' # http://tools.ietf.org/html/rfc3834
+ 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834
+ 'X-Auto-Response-Suppress' => 'OOF'
@recipients = info_request.user.name_and_email
@subject = "Someone has updated the status of your request"
url = main_url(request_url(info_request))
@@ -146,7 +151,8 @@ class RequestMailer < ApplicationMailer
@from = contact_from_name_and_email
headers 'Return-Path' => blackhole_email, 'Reply-To' => @from, # not much we can do if the user's email is broken
- 'Auto-Submitted' => 'auto-generated' # http://tools.ietf.org/html/rfc3834
+ 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834
+ 'X-Auto-Response-Suppress' => 'OOF'
@recipients = info_request.user.name_and_email
@subject = "Clarify your FOI request - " + info_request.title
@body = { :incoming_message => incoming_message, :info_request => info_request, :url => url }
@@ -156,7 +162,8 @@ class RequestMailer < ApplicationMailer
def comment_on_alert(info_request, comment)
@from = contact_from_name_and_email
headers 'Return-Path' => blackhole_email, 'Reply-To' => @from, # not much we can do if the user's email is broken
- 'Auto-Submitted' => 'auto-generated' # http://tools.ietf.org/html/rfc3834
+ 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834
+ 'X-Auto-Response-Suppress' => 'OOF'
@recipients = info_request.user.name_and_email
@subject = "Somebody added a note to your FOI request - " + info_request.title
@body = { :comment => comment, :info_request => info_request, :url => main_url(comment_url(comment)) }
@@ -164,7 +171,8 @@ class RequestMailer < ApplicationMailer
def comment_on_alert_plural(info_request, count, earliest_unalerted_comment)
@from = contact_from_name_and_email
headers 'Return-Path' => blackhole_email, 'Reply-To' => @from, # not much we can do if the user's email is broken
- 'Auto-Submitted' => 'auto-generated' # http://tools.ietf.org/html/rfc3834
+ 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834
+ 'X-Auto-Response-Suppress' => 'OOF'
@recipients = info_request.user.name_and_email
@subject = "Some notes have been added to your FOI request - " + info_request.title
@body = { :count => count, :info_request => info_request, :url => main_url(comment_url(earliest_unalerted_comment)) }
@@ -266,12 +274,12 @@ class RequestMailer < ApplicationMailer
end
end
- # Send email alerts for new responses which haven't been classified. Goes
- # out 3 days after last update of event, then after 7, then after 24.
+ # Send email alerts for new responses which haven't been classified. By default,
+ # it goes out 3 days after last update of event, then after 10, then after 24.
def self.alert_new_response_reminders
- self.alert_new_response_reminders_internal(3, 'new_response_reminder_1')
- self.alert_new_response_reminders_internal(10, 'new_response_reminder_2')
- self.alert_new_response_reminders_internal(24, 'new_response_reminder_3')
+ MySociety::Config.get("NEW_RESPONSE_REMINDER_AFTER_DAYS", [3, 10, 24]).each_with_index do |days, i|
+ self.alert_new_response_reminders_internal(days, "new_response_reminder_#{i+1}")
+ end
end
def self.alert_new_response_reminders_internal(days_since, type_code)
info_requests = InfoRequest.find_old_unclassified(:order => 'info_requests.id',
diff --git a/app/models/track_mailer.rb b/app/models/track_mailer.rb
index 5e1c31974..85b1fedd8 100644
--- a/app/models/track_mailer.rb
+++ b/app/models/track_mailer.rb
@@ -93,7 +93,11 @@ class TrackMailer < ApplicationMailer
# If we have anything to send, then send everything for the user in one mail
if email_about_things.size > 0
# Send the email
+
+ previous_locale = I18n.locale
+ I18n.locale = user.get_locale
TrackMailer.deliver_event_digest(user, email_about_things)
+ I18n.locale = previous_locale
end
# Record that we've now sent those alerts to that user
diff --git a/app/models/track_thing.rb b/app/models/track_thing.rb
index 16a0dab87..b74f7dad5 100644
--- a/app/models/track_thing.rb
+++ b/app/models/track_thing.rb
@@ -22,6 +22,7 @@
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
# $Id: track_thing.rb,v 1.53 2009-09-17 21:10:05 francis Exp $
+require 'set'
class TrackThing < ActiveRecord::Base
belongs_to :tracking_user, :class_name => 'User'
@@ -67,6 +68,63 @@ class TrackThing < ActiveRecord::Base
TrackThing.track_type_description(self.track_type)
end
+ def track_query_description
+ # XXX this is very brittle... we should probably ask users
+ # simply to name their tracks when they make them?
+ self.track_query = self.track_query.gsub(/([()]|OR)/, "")
+ filters = self.track_query.scan /\b\S+:\S+\b/
+ text = self.track_query
+ varieties = Set.new
+ date = ""
+ statuses = Set.new
+ for filter in filters
+ text = text.sub(filter, "")
+ if filter =~ /variety:user/
+ varieties << _("users")
+ end
+ if filter =~ /variety:comment/
+ varieties << _("comments")
+ end
+ if filter =~ /variety:authority/
+ varieties << _("authorities")
+ end
+ if filter =~ /(variety:(sent|followup_sent|response)|latest_status)/
+ varieties << _("requests")
+ end
+ if filter =~ /[0-9\/]+\.\.[0-9\/]+/
+ date = _("between two dates")
+ end
+ if filter =~ /(rejected|not_held)/
+ statuses << _("unsuccessful")
+ end
+ if filter =~ /(:successful|:partially_successful)/
+ statuses << _("successful")
+ end
+ if filter =~ /waiting/
+ statuses << _("awaiting a response")
+ end
+ end
+ if filters.empty?
+ text = self.track_query
+ end
+ descriptions = []
+ if varieties.include? _("requests")
+ descriptions << _("requests which are {{list_of_statuses}}", :list_of_statuses => Array(statuses).join(_(' or ')))
+ varieties -= [_("requests")]
+ end
+ if descriptions.empty? and varieties.empty?
+ varieties << _("anything")
+ end
+ descriptions += Array(varieties)
+ text = text.strip
+ descriptions = descriptions.join(_(" or "))
+ if !text.empty?
+ descriptions += _("{{list_of_things}} matching text '{{search_query}}'", :list_of_things => "", :search_query => text)
+ end
+ return descriptions
+ end
+
+
def TrackThing.create_track_for_request(info_request)
track_thing = TrackThing.new
track_thing.track_type = 'request_updates'
@@ -105,10 +163,25 @@ class TrackThing < ActiveRecord::Base
return track_thing
end
- def TrackThing.create_track_for_search_query(query)
+ def TrackThing.create_track_for_search_query(query, variety_postfix = nil)
track_thing = TrackThing.new
track_thing.track_type = 'search_query'
+ if !(query =~ /variety:/)
+ case variety_postfix
+ when "requests"
+ query += " variety:sent"
+ when "users"
+ query += " variety:user"
+ when "authorities"
+ query += " variety:authority"
+ end
+ end
track_thing.track_query = query
+ # XXX should extract requested_by:, request:, requested_from:
+ # and stick their values into the respective relations.
+ # Should also update "params" to make the list_description
+ # nicer and more generic. It will need to do some clever
+ # parsing of the query to do this nicely
return track_thing
end
@@ -119,16 +192,16 @@ class TrackThing < ActiveRecord::Base
if self.track_type == 'request_updates'
@params = {
# Website
- :list_description => "'<a href=\"/request/" + CGI.escapeHTML(self.info_request.url_title) + "\">" + CGI.escapeHTML(self.info_request.title) + "</a>', a request", # XXX yeuch, sometimes I just want to call view helpers from the model, sorry! can't work out how
+ :list_description => _("'{{link_to_request}}', a request", :link_to_request => "<a href=\"/request/" + CGI.escapeHTML(self.info_request.url_title) + "\">" + CGI.escapeHTML(self.info_request.title) + "</a>"), # XXX yeuch, sometimes I just want to call view helpers from the model, sorry! can't work out how
:verb_on_page => _("Track this request by email"),
:verb_on_page_already => _("You are already tracking this request by email"),
# Email
- :title_in_email => "New updates for the request '" + self.info_request.title + "'",
- :title_in_rss => "New updates for the request '" + self.info_request.title + "'",
+ :title_in_email => _("New updates for the request '{{request_title}}'", :request_title => self.info_request.title),
+ :title_in_rss => _("New updates for the request '{{request_title}}'", :request_title => self.info_request.title),
# Authentication
- :web => "To follow updates to the request '" + CGI.escapeHTML(self.info_request.title) + "'",
- :email => "Then you will be emailed whenever the request '" + CGI.escapeHTML(self.info_request.title) + "' is updated.",
- :email_subject => "Confirm you want to follow updates to the request '" + self.info_request.title + "'",
+ :web => _("To follow updates to the request '{{request_title}}'", :request_title => CGI.escapeHTML(self.info_request.title)),
+ :email => _("Then you will be emailed whenever the request '{{request_title}}' is updated.", :request_title => CGI.escapeHTML(self.info_request.title)),
+ :email_subject => _("Confirm you want to follow updates to the request '{{request_title}}'", :request_title => self.info_request.title),
# RSS sorting
:feed_sortby => 'newest'
}
@@ -170,7 +243,7 @@ class TrackThing < ActiveRecord::Base
elsif self.track_type == 'public_body_updates'
@params = {
# Website
- :list_description => "'<a href=\"/body/" + CGI.escapeHTML(self.public_body.url_name) + "\">" + CGI.escapeHTML(self.public_body.name) + "</a>', a public authority", # XXX yeuch, sometimes I just want to call view helpers from the model, sorry! can't work out how
+ :list_description => _("'{{link_to_authority}}', a public authority", :link_to_authority => "<a href=\"/body/" + CGI.escapeHTML(self.public_body.url_name) + "\">" + CGI.escapeHTML(self.public_body.name) + "</a>"), # XXX yeuch, sometimes I just want to call view helpers from the model, sorry! can't work out how
:verb_on_page => _("Track requests to {{public_body_name}} by email",:public_body_name=>CGI.escapeHTML(self.public_body.name)),
:verb_on_page_already => _("You are already tracking requests to {{public_body_name}} by email", :public_body_name=>CGI.escapeHTML(self.public_body.name)),
# Email
@@ -186,7 +259,7 @@ class TrackThing < ActiveRecord::Base
elsif self.track_type == 'user_updates'
@params = {
# Website
- :list_description => "'<a href=\"/user/" + CGI.escapeHTML(self.tracked_user.url_name) + "\">" + CGI.escapeHTML(self.tracked_user.name) + "</a>', a person", # XXX yeuch, sometimes I just want to call view helpers from the model, sorry! can't work out how
+ :list_description => _("'{{link_to_user}}', a person", :link_to_user => "<a href=\"/user/" + CGI.escapeHTML(self.tracked_user.url_name) + "\">" + CGI.escapeHTML(self.tracked_user.name) + "</a>"), # XXX yeuch, sometimes I just want to call view helpers from the model, sorry! can't work out how
:verb_on_page => _("Track this person by email"),
:verb_on_page_already => _("You are already tracking this person by email"),
# Email
@@ -202,16 +275,16 @@ class TrackThing < ActiveRecord::Base
elsif self.track_type == 'search_query'
@params = {
# Website
- :list_description => "'<a href=\"/search/" + CGI.escapeHTML(self.track_query) + "/newest\">" + CGI.escapeHTML(self.track_query) + "</a>' in new requests/responses", # XXX yeuch, sometimes I just want to call view helpers from the model, sorry! can't work out how
- :verb_on_page => _("Track things matching '{{query}}' by email", :query=>CGI.escapeHTML(self.track_query)),
- :verb_on_page_already => _("You are already tracking things matching '{{query}}' by email", :query=>CGI.escapeHTML(self.track_query)),
+ :list_description => "<a href=\"/search/" + CGI.escapeHTML(self.track_query) + "/newest/advanced\">" + self.track_query_description + "</a>", # XXX yeuch, sometimes I just want to call view helpers from the model, sorry! can't work out how
+ :verb_on_page => _("Track things matching this search by email"),
+ :verb_on_page_already => _("You are already tracking things matching this search by email"),
# Email
- :title_in_email => _("Requests or responses matching '{{query}}'", :query=>self.track_query),
- :title_in_rss => _("Requests or responses matching '{{query}}'", :query=>self.track_query),
+ :title_in_email => _("Requests or responses matching your saved search"),
+ :title_in_rss => _("Requests or responses matching your saved search"),
# Authentication
- :web => _("To follow requests and responses matching '{{query}}'", :query=>CGI.escapeHTML(self.track_query)),
- :email => _("Then you will be emailed whenever a new request or response matches '{{query}}'.", :query=>CGI.escapeHTML(self.track_query)),
- :email_subject => _("Confirm you want to be emailed about new requests or responses matching '{{query}}'", :query=>self.track_query),
+ :web => _("To follow requests and responses matching your search"),
+ :email => _("Then you will be emailed whenever a new request or response matches your search."),
+ :email_subject => _("Confirm you want to be emailed about new requests or responses matching your search"),
# RSS sorting - XXX hmmm, we don't really know which to use
# here for sorting. Might be a query term (e.g. 'cctv'), in
# which case newest is good, or might be something like
diff --git a/app/models/user.rb b/app/models/user.rb
index 5dbd4b98e..e98d777b1 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -98,6 +98,15 @@ class User < ActiveRecord::Base
end
end
end
+
+ def get_locale
+ if !self.locale.nil?
+ locale = self.locale
+ else
+ locale = I18n.locale
+ end
+ return locale.to_s
+ end
def visible_comments
self.comments.find(:all, :conditions => 'visible')
diff --git a/app/models/user_mailer.rb b/app/models/user_mailer.rb
index 0972e167d..7adf5b63c 100644
--- a/app/models/user_mailer.rb
+++ b/app/models/user_mailer.rb
@@ -46,7 +46,5 @@ class UserMailer < ApplicationMailer
@body[:old_email] = old_email
@body[:new_email] = new_email
end
-
-
end
diff --git a/app/views/admin_public_body/_form.rhtml b/app/views/admin_public_body/_form.rhtml
index b1516be2e..1cdc9b3fe 100644
--- a/app/views/admin_public_body/_form.rhtml
+++ b/app/views/admin_public_body/_form.rhtml
@@ -2,48 +2,60 @@
<!--[form:public_body]-->
-<div id="tag_help">
- <h2>List of tags</h2>
- <% first_row = true %>
- <% for row in PublicBodyCategories::CATEGORIES_WITH_HEADINGS %>
- <% if row.instance_of?(Array) %>
- <% if row[0] != 'other' %>
- <strong><%= row[0] %></strong>=<%= row[1] %>
- <br/>
- <% end %>
- <% elsif row != 'Miscellaneous' %>
- <% if not first_row %>
- <% else %>
- <% first_row = false %>
- <% end %>
- <h3><%=h row%></h3>
- <% end %>
+<div id="div-locales">
+ <ul>
+ <% for locale in I18n.available_locales do %>
+ <li><a href="#div-locale-<%=locale.to_s%>"><%=locale_name(locale.to_s)%></a></li>
<% end %>
+ </ul>
+
+<%
+ for locale in I18n.available_locales do
+ if locale==I18n.default_locale # The default locale is submitted as part of the bigger object...
+ prefix = 'public_body'
+ object = @public_body
+ else # ...but additional locales go "on the side"
+ prefix = "public_body[translated_versions][]"
+ object = @public_body.new_record? ?
+ PublicBody::Translation.new :
+ @public_body.translation(locale.to_s) || PublicBody::Translation.new
+ end
+
+ fields_for prefix, object do |t|
+%>
+ <div id="div-locale-<%=locale.to_s%>">
+ <%= t.hidden_field :locale, :value => locale.to_s %>
+
+ <p><label for="<%= form_tag_id(t.object_name, :name, locale) %>">Name</label><br/>
+ <%= t.text_field :name, :size => 60, :id => form_tag_id(t.object_name, :name, locale) %></p>
+
+ <p><label for="<%= form_tag_id(t.object_name, :short_name, locale) %>">Short name <small>(only put in abbreviations which are really used, otherwise leave blank. Short or long name is used in the URL - don't worry about breaking URLs through renaming, as the history is used to redirect)</small></label><br/>
+ <%= t.text_field :short_name, :size => 60, :id => form_tag_id(t.object_name, :short_name, locale) %></p>
+
+ <p><label for="<%= form_tag_id(t.object_name, :request_email, locale) %>">Request email <small>(set to <strong>blank</strong> (empty string) if can't find an address; these emails are <strong>public</strong> as anyone can view with a CAPTCHA)</small></label><br/>
+ <%= t.text_field :request_email, :size => 40, :id => form_tag_id(t.object_name, :request_email, locale) %></p>
+
+ <p><label for="<%= form_tag_id(t.object_name, :publication_scheme, locale) %>">Publication scheme URL</label><br/>
+ <%= t.text_field :publication_scheme, :size => 60, :id => form_tag_id(t.object_name, :publication_scheme, locale) %></p>
+
+ <p><label for="<%= form_tag_id(t.object_name, :notes, locale) %>">Public notes</label> <small>(HTML, for users to consider when making FOI requests to the authority)</small><br/>
+ <%= t.text_area :notes, :rows => 3, :cols => 60, :id => form_tag_id(t.object_name, :notes, locale) %></p>
+ </div>
+<%
+ end
+ end
+%>
</div>
-<p><label for="public_body_name">Name</label><br/>
-<%= text_field 'public_body', 'name', :size => 60 %></p>
-
-<p><label for="public_body_short_name">Short name <small>(only put in abbreviations which are really used, otherwise leave blank. Short or long name is used in the URL - don't worry about breaking URLs through renaming, as the history is used to redirect)</small></label><br/>
-<%= text_field 'public_body', 'short_name', :size => 60 %></p>
-
-<p><label for="public_body_request_email">Request email <small>(set to <strong>blank</strong> (empty string) if can't find an address; these emails are <strong>public</strong> as anyone can view with a CAPTCHA)</small></label><br/>
-<%= text_field 'public_body', 'request_email', :size => 40 %></p>
+<h3>Common Fields</h3>
<p><label for="public_body_tag_string">Tags <small>(space separated; see list of tags on the right; also <strong>not_apply</strong> if FOI and EIR no longer apply to authority, <strong>eir_only</strong> if EIR but not FOI applies to authority, <strong>defunct</strong> if the authority no longer exists; charity:NUMBER if a registered charity)</small></label><br/>
-<%= text_field 'public_body', 'tag_string', :size => 60 %></p>
+<%= f.text_field :tag_string, :size => 60 %></p>
<p><label for="public_body_home_page">Home page <small>(of whole authority, not just their FOI page; set to <strong>blank</strong> (empty string) to guess it from the email)</small></label><br/>
-<%= text_field 'public_body', 'home_page', :size => 60 %></p>
-
-<p><label for="public_body_publication_scheme">Publication scheme URL</label><br/>
-<%= text_field 'public_body', 'publication_scheme', :size => 60 %></p>
-
-<p><label for="public_body_notes">Public notes</label> <small>(HTML, for users to consider when making FOI requests to the authority)</small><br/>
-<%= text_area 'public_body', 'notes', :rows => 3, :cols => 60 %></p>
+<%= f.text_field :home_page, :size => 60 %></p>
<p><label for="public_body_last_edit_comment"><strong>Comment</strong> for this edit</label> <small>(put URL or other source of new info)</small><br/>
-<%= text_area 'public_body', 'last_edit_comment', :rows => 3, :cols => 60 %></p>
-<!--[eoform:public_body]-->
-
+<%= f.text_area :last_edit_comment, :rows => 3, :cols => 60 %></p>
+<!--[eoform:public_body]-->
diff --git a/app/views/admin_public_body/_tag_help.rhtml b/app/views/admin_public_body/_tag_help.rhtml
new file mode 100644
index 000000000..0d0f84dda
--- /dev/null
+++ b/app/views/admin_public_body/_tag_help.rhtml
@@ -0,0 +1,18 @@
+<div id="tag_help">
+ <h2>List of tags</h2>
+ <% first_row = true %>
+ <% for row in PublicBodyCategories::get().with_headings() %>
+ <% if row.instance_of?(Array) %>
+ <% if row[0] != 'other' %>
+ <strong><%= row[0] %></strong>=<%= row[1] %>
+ <br/>
+ <% end %>
+ <% elsif row != 'Miscellaneous' %>
+ <% if not first_row %>
+ <% else %>
+ <% first_row = false %>
+ <% end %>
+ <h3><%=h row%></h3>
+ <% end %>
+ <% end %>
+</div> \ No newline at end of file
diff --git a/app/views/admin_public_body/edit.rhtml b/app/views/admin_public_body/edit.rhtml
index 005ec93ce..b91f15a2e 100644
--- a/app/views/admin_public_body/edit.rhtml
+++ b/app/views/admin_public_body/edit.rhtml
@@ -1,23 +1,30 @@
-
-
<h1><%=@title%></h1>
-<% form_tag '../update/' + @public_body.id.to_s do %>
- <%= render :partial => 'form' %>
- <p><%= submit_tag 'Save', :accesskey => 's' %></p>
-<% end %>
+<script type="text/javascript">
+ $(function() {
+ $("#div-locales").tabs();
+ });
+</script>
-<p>
-<%= link_to 'Show', '../show/' + @public_body.id.to_s %> |
-<%= link_to 'List all', '../list' %>
-</p>
+<%= render :partial => 'tag_help' %>
-<% if @public_body.info_requests.size == 0 %>
- <% form_tag('../destroy/' + @public_body.id.to_s) do %>
- <p>
- <%= hidden_field_tag(:public_body_id, { :value => @public_body.id } ) %>
- <%= submit_tag "Destroy " + @public_body.name %> (this is permanent!)
- </p>
+<div id="public_body_form">
+ <% form_for @public_body, :url => {:action => 'update'} do |f| %>
+ <%= render :partial => 'form', :locals => {:f => f} %>
+ <p><%= f.submit 'Save', :accesskey => 's' %></p>
<% end %>
-<% end %>
+ <p>
+ <%= link_to 'Show', '../show/' + @public_body.id.to_s %> |
+ <%= link_to 'List all', '../list' %>
+ </p>
+
+ <% if @public_body.info_requests.size == 0 %>
+ <% form_tag('../destroy/' + @public_body.id.to_s) do %>
+ <p>
+ <%= hidden_field_tag(:public_body_id, { :value => @public_body.id } ) %>
+ <%= submit_tag "Destroy " + @public_body.name %> (this is permanent!)
+ </p>
+ <% end %>
+ <% end %>
+</div>
diff --git a/app/views/admin_public_body/import_csv.rhtml b/app/views/admin_public_body/import_csv.rhtml
index 50a4b951a..a7a13f477 100644
--- a/app/views/admin_public_body/import_csv.rhtml
+++ b/app/views/admin_public_body/import_csv.rhtml
@@ -12,27 +12,30 @@
<% form_tag 'import_csv', :multipart => true do %>
<p>
- <label for="tag">Tag to add entries to / alter entries for:</label>
- <%= text_field_tag 'tag', params[:tag] %>
- </p>
-
- <p>
<label for="csv_file">CSV file:</label>
<%= file_field_tag :csv_file, :size => 40 %>
</p>
+ <p>
+ <label for="tag">Optional: Tag to add entries to / alter entries for:</label>
+ <%= text_field_tag 'tag', params[:tag] %>
+ </p>
+
<p><strong>CSV file format:</strong> A first row with the list of fields,
starting with '#', is optional but highly recommended. The fields 'name'
- and 'email' are required; additionaly, translated values are supported by
+ and 'request_email' are required; additionaly, translated values are supported by
adding the locale name to the field name, e.g. 'name.es', 'name.de'... Example:
</p>
<blockquote>
- #id,name,email,name.es<br/>
- 1,An Authority,a@example.com,Un organismo<br/>
- 2,Another One,another@example.com,Otro organismo<br/>
+ #id,name,request_email,name.es,tag_string<br/>
+ 1,An Authority,a@example.com,Un organismo,a_tag another_tag<br/>
+ 2,Another One,another@example.com,Otro organismo,a_tag<br/>
</blockquote>
+ <p>Supported fields: name (i18n), short_name (i18n), request_email (i18n), notes (i18n),
+ publication_scheme (i18n), home_page, tag_string (tags separated by spaces).</p>
+
<p><strong>Note:</strong> Choose <strong>dry run</strong> to test, without
actually altering the database. Choose <strong>upload</strong> to actually
make the changes. In either case, you will be shown any errors, or details
@@ -46,7 +49,7 @@
<hr>
<p>Standard tags:
- <% for category, description in PublicBodyCategories::CATEGORIES_BY_TAG %>
+ <% for category, description in PublicBodyCategories::get().by_tag() %>
<% if category != "other" %>
<strong><%= category %></strong>=<%= description %>;
<% end %>
diff --git a/app/views/admin_public_body/new.rhtml b/app/views/admin_public_body/new.rhtml
index 95208b5b3..b859fdf6a 100644
--- a/app/views/admin_public_body/new.rhtml
+++ b/app/views/admin_public_body/new.rhtml
@@ -2,11 +2,21 @@
<h1><%=@title%></h1>
-<% form_tag 'create' do %>
- <%= render :partial => 'form' %>
- <p><%= submit_tag "Create" %></p>
-<% end %>
-
-<p>
-<%= link_to 'List all', 'list' %>
-</p>
+<script type="text/javascript">
+ $(function() {
+ $("#div-locales").tabs();
+ });
+</script>
+
+<%= render :partial => 'tag_help' %>
+
+<div id="public_body_form">
+ <% form_for :public_body, @public_body, :url => {:action => "create"} do |f| %>
+ <%= render :partial => 'form', :locals => {:f => f} %>
+ <p><%= f.submit "Create" %></p>
+ <% end %>
+
+ <p>
+ <%= link_to 'List all', 'list' %>
+ </p>
+</div>
diff --git a/app/views/admin_public_body/show.rhtml b/app/views/admin_public_body/show.rhtml
index c1292c63a..643ccf5e8 100644
--- a/app/views/admin_public_body/show.rhtml
+++ b/app/views/admin_public_body/show.rhtml
@@ -12,7 +12,7 @@
<% if column.name == 'home_page' and !column.name.empty? %>
<%= link_to(h(@public_body.send(column.name)), @public_body.send(column.name)) %>
<% elsif column.name == 'request_email' and !column.name.empty? %>
- <%= link_to(h(@public_body.send(column.name)), "mailto:" + @public_body.send(column.name)) %>
+ <%= link_to(h(@public_body.send(column.name)), "mailto:#{@public_body.send(column.name)}") %>
<% if !@public_body.is_requestable? %>
(not requestable due to: <%=h @public_body.not_requestable_reason %><% if @public_body.is_followupable? %>; but followupable<% end %>)
<% end %>
@@ -32,7 +32,14 @@
</p>
<p>
- <%= link_to 'Public page', main_url(public_body_url(@public_body)) %>
+ <%=
+ # url_name can be missing if the name hasn't been set for this locale
+ if !@public_body.url_name.nil?
+ link_to 'Public page', main_url(public_body_url(@public_body))
+ else
+ 'Public page not available'
+ end
+ %>
| <%= link_to 'Edit', '../edit/' + @public_body.id.to_s %>
</p>
diff --git a/app/views/comment/_single_comment.rhtml b/app/views/comment/_single_comment.rhtml
index e6a1728a8..013e5e107 100644
--- a/app/views/comment/_single_comment.rhtml
+++ b/app/views/comment/_single_comment.rhtml
@@ -17,7 +17,7 @@
</div>
<p class="event_actions">
<% if !comment.id.nil? %>
- <%= link_to "Link to this", comment_url(comment) %>
+ <%= link_to "Link to this", comment_url(comment), :class => "link_to_this" %>
<% if !@user.nil? && @user.admin_page_links? %>
| <%= link_to "Admin", admin_url("request/edit_comment/" + comment.id.to_s) %>
<% end %>
diff --git a/app/views/comment/new.rhtml b/app/views/comment/new.rhtml
index 1a4f2c0dc..cf9367b88 100644
--- a/app/views/comment/new.rhtml
+++ b/app/views/comment/new.rhtml
@@ -11,7 +11,8 @@
<%= foi_error_messages_for :comment %>
-<h1><%= _('Add an annotation to ')%>'<%=request_link(@info_request)%>'</h1>
+<h1><%= _('Add an annotation')%></h1>
+<h2>to &ldquo;<%=request_link(@info_request)%>&rdquo;</h2>
<p>
<%= _('Annotations are so anyone, including you, can help the requester with their request. For example:')%>
diff --git a/app/views/general/_credits.rhtml b/app/views/general/_credits.rhtml
index 8c519ce7e..b1a9ce05e 100644
--- a/app/views/general/_credits.rhtml
+++ b/app/views/general/_credits.rhtml
@@ -1 +1 @@
-| <%= _('Powered by <a href="http://www.alaveteli.org/">Alaveteli</a>.') %>
+| <%= _('Powered by <a href="http://www.alaveteli.org/">Alaveteli</a>') %>
diff --git a/app/views/general/_footer.rhtml b/app/views/general/_footer.rhtml
new file mode 100644
index 000000000..2f6c30f5f
--- /dev/null
+++ b/app/views/general/_footer.rhtml
@@ -0,0 +1,6 @@
+<div id="footer">
+ <%= link_to _("Contact {{site_name}}", :site_name => site_name), help_contact_url %>
+| <img src="/images/twitter-16.png" alt="twitter icon" class="twitter-icon"> <a href="http://www.twitter.com/<%= MySociety::Config.get('TWITTER_USERNAME') %>"><%= _("Follow us on twitter") %></a>
+<%= render :partial => 'general/credits' %>
+</div>
+<div class="after-footer">&nbsp;</div>
diff --git a/app/views/general/_frontpage_intro_sentence.rhtml b/app/views/general/_frontpage_intro_sentence.rhtml
index 2c3bcaf83..70b47ad06 100644
--- a/app/views/general/_frontpage_intro_sentence.rhtml
+++ b/app/views/general/_frontpage_intro_sentence.rhtml
@@ -1,3 +1,4 @@
-First, type in the <strong>name of the UK public authority</strong> you'd
-<br>like information from. <strong>By law, they have to respond</strong>
-(<a href="<%= help_about_url %>">why?</a>).
+<h2>
+ Your <strong>Right to Know</strong>
+</h2>
+<p>Every citizen has the right to access information held by public authorities. <strong>By law, they have to respond</strong>. <a href="<%= help_about_url %>">Find out more about freedom of information.</a></p>
diff --git a/app/views/general/_frontpage_search_examples.es.rhtml b/app/views/general/_frontpage_search_examples.es.rhtml
new file mode 100644
index 000000000..63c7c3c1e
--- /dev/null
+++ b/app/views/general/_frontpage_search_examples.es.rhtml
@@ -0,0 +1 @@
+por ejemplo <a href="/es/search/El%20Geraldine%20Quango">El Geraldine Quango</a>, <a href="/search/fancy%20dog">Fancy Dog</a>.
diff --git a/app/views/general/_frontpage_search_examples.rhtml b/app/views/general/_frontpage_search_examples.rhtml
new file mode 100644
index 000000000..359a132e2
--- /dev/null
+++ b/app/views/general/_frontpage_search_examples.rhtml
@@ -0,0 +1 @@
+for example <a href="/search/Geraldine%20Quango">Geraldine Quango</a> or <a href="/search/fancy%20dog">Fancy Dog</a>.
diff --git a/app/views/general/_localised_datepicker.rhtml b/app/views/general/_localised_datepicker.rhtml
new file mode 100644
index 000000000..5fdd63644
--- /dev/null
+++ b/app/views/general/_localised_datepicker.rhtml
@@ -0,0 +1,18 @@
+<script type="text/javascript">
+ $(function() {
+ $(".use-datepicker").datepicker(
+ {closeText: '<%= _("Done") %>',
+ prevText: '<%= _("Prev") %>',
+ nextText: '<%= _("Next") %>',
+ currentText: '<%= _("Today") %>',
+ monthNames: <%= I18n.translate('date.month_names')[1..-1].to_json %>,
+ monthNamesShort: <%= I18n.translate('date.abbr_month_names')[1..-1].to_json %>,
+ dayNames: <%= I18n.translate('date.day_names').to_json %>,
+ dayNamesShort: <%= I18n.translate('date.abbr_day_names').to_json %>,
+ dayNamesMin: <%= I18n.translate('date.abbr_day_names').collect{|x| x[0..0]}.to_json %>,
+ weekHeader: '<%= _("Wk") %>',
+ dateFormat: '<%= I18n.translate('date.formats.default').sub("%Y", "yy").sub("%m", "mm").sub("%d", "dd").gsub("-", "/") %>'}
+ );
+ });
+</script>
+
diff --git a/app/views/general/_orglink.rhtml b/app/views/general/_orglink.rhtml
index 20d0d6ce4..7d74dbaac 100644
--- a/app/views/general/_orglink.rhtml
+++ b/app/views/general/_orglink.rhtml
@@ -1,2 +1,2 @@
<%-# Put the link to your organisation here, or leave blank -%>
-<a href="http://www.alaveteli.org">an Alaveteli site</a>
+<%= link_to image_tag('logo.png'), frontpage_url, :id=>'logo' %>
diff --git a/app/views/general/_topnav.rhtml b/app/views/general/_topnav.rhtml
new file mode 100644
index 000000000..619ff3593
--- /dev/null
+++ b/app/views/general/_topnav.rhtml
@@ -0,0 +1,10 @@
+<div id="topnav">
+ <ul id="navigation">
+ <li class="<%= 'selected' if params[:controller] == 'general' and params[:action] != 'blog' %>"><%= link_to _("Home"), frontpage_url %></li>
+ <li class="<%= 'selected' if params[:controller] == 'request' and ['new', 'select_authority'].include?(params[:action]) %>"><%= link_to _("Make a request"), select_authority_url, :id => 'make-request-link' %></li>
+ <li class="<%= 'selected' if params[:controller] == 'request' and !['new', 'select_authority'].include?(params[:action]) %>"><%= link_to _("View requests"), request_list_successful_url %></li>
+ <li class="<%= 'selected' if params[:controller] == 'public_body' %>"><%= link_to _("View authorities"), list_public_bodies_default %></li>
+ <li class="<%= 'selected' if params[:controller] == 'general' and params[:action] == 'blog' %>"><%= link_to _("Read blog"), blog_url %></li>
+ <li class="<%= 'selected' if params[:controller] == 'help' %>"><%= link_to _("Help"), help_about_url %></li>
+ </ul>
+</div> \ No newline at end of file
diff --git a/app/views/general/advanced_search.rhtml b/app/views/general/advanced_search.rhtml
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/app/views/general/advanced_search.rhtml
diff --git a/app/views/general/blog.rhtml b/app/views/general/blog.rhtml
index c9387c24f..834676f82 100644
--- a/app/views/general/blog.rhtml
+++ b/app/views/general/blog.rhtml
@@ -1,56 +1,63 @@
-<% @title = "#{site_name} blog and tweets" %>
+<% @title = _("{{site_name}} blog and tweets", :site_name => site_name) %>
-<h1><%=@title %></h1>
- <img src="/images/twitter.png" alt="twitter icon" valign="middle"> <a href="http://www.twitter.com/<%= MySociety::Config.get('TWITTER_USERNAME') %>">Follow us on twitter</a>&nbsp;
- <img src="/images/rss.png" alt="RSS icon" valign="middle"> <a href="<%= MySociety::Config.get('BLOG_FEED') %>">Subscribe to blog</a>
<% if !@twitter_user.empty? %>
-<div id="twitter">
-<script src="http://widgets.twimg.com/j/2/widget.js"></script>
-<script>
-new TWTR.Widget({
- version: 2,
- type: 'profile',
- rpp: 15,
- interval: 6000,
- width: 'auto',
- height: 500,
- theme: {
- shell: {
- background: '#eaeaea',
- color: '#000000'
+<div id="right_column">
+ <div class="act_link">
+ <h2><%= _("Stay up to date") %></h2>
+ <img src="/images/twitter-16.png" alt="twitter icon" class="twitter-icon"> <a href="http://www.twitter.com/<%= MySociety::Config.get('TWITTER_USERNAME') %>"><%= _("Follow us on twitter") %></a><br/><br/>
+ <img src="/images/feed-16.png" alt="RSS icon" valign="middle"> <a href="<%= MySociety::Config.get('BLOG_FEED') %>"><%= _("Subscribe to blog") %></a>
+ </div>
+ <div id="twitter">
+ <script src="http://widgets.twimg.com/j/2/widget.js"></script>
+ <script type="text/javascript">
+ new TWTR.Widget({
+ version: 2,
+ type: 'profile',
+ rpp: 15,
+ interval: 6000,
+ width: 'auto',
+ height: 500,
+ theme: {
+ shell: {
+ background: '#eaeaea',
+ color: '#000000'
+ },
+ tweets: {
+ background: '#ffffff',
+ color: '#000000',
+ links: '#0b004a'
+ }
},
- tweets: {
- background: '#ffffff',
- color: '#000000',
- links: '#0b004a'
+ features: {
+ scrollbar: false,
+ loop: false,
+ live: false,
+ hashtags: true,
+ timestamp: true,
+ avatars: true,
+ behavior: 'all'
}
- },
- features: {
- scrollbar: false,
- loop: false,
- live: false,
- hashtags: true,
- timestamp: true,
- avatars: true,
- behavior: 'all'
- }
-}).render().setUser('<%=@twitter_user %>').start();
-</script>
-
+ }).render().setUser('<%=@twitter_user %>').start();
+ </script>
+ </div>
</div>
<% end %>
-<div id="blog">
- <% for item in @blog_items: %>
- <div class="blog_post">
- <h2><a href="<%=item['link']%>"><%=h item['title'] %></a></h2>
- <p class="subtitle">Posted on <%= simple_date(Time.parse(item['pubDate'][0])) %> by <%=h item['creator'] %></p>
- <div><%= item['encoded'] %></div>
- <p><em>
- <a href="<%=item['comments'][0]%>"><%=item['comments'][1]%> comments</a>
- </em>
- </p>
- </div>
- <% end %>
+<div id="left_column">
+ <h1><%=@title %></h1>
+
+ <div id="blog">
+ <% for item in @blog_items: %>
+ <div class="blog_post">
+ <h2 id="<%= Time.parse(item['pubDate'][0]).to_i %>"><a href="<%=item['link']%>"><%=h item['title'] %></a></h2>
+ <p class="subtitle"><%= _("Posted on {{date}} by {{author}}", :date=>simple_date(Time.parse(item['pubDate'][0])), :author=>item['creator']) %></p>
+ <div><%= item['encoded'] %></div>
+ <p><em>
+ <a href="<%=item['comments'][0]%>"><%= _("{{number_of_comments}} comments", :number_of_comments=>item['comments'][1]) %></a>
+ </em>
+ </p>
+ </div>
+ <% end %>
+ </div>
</div>
diff --git a/app/views/general/exception_caught.rhtml b/app/views/general/exception_caught.rhtml
index ca36b592b..b266b53a1 100644
--- a/app/views/general/exception_caught.rhtml
+++ b/app/views/general/exception_caught.rhtml
@@ -1,17 +1,24 @@
-<h1><%= _("Sorry, we couldn't find that page") %></h1>
+<div id="error-page">
+ <% if @status == 404 %>
+ <h1><%= _("Sorry, we couldn't find that page") %></h1>
-<p><%= _("The page either doesn't exist, or is broken. Things you can try now:")%></p>
+ <p><%= _("The page doesn't exist. Things you can try now:")%></p>
-<ul>
-<li><%= _("Check for mistakes if you typed or copied the address.")%></li>
-<li><%= _("Search the site to find what you were looking for.")%>
- <% form_tag({:controller => "general", :action => "search_redirect"}, {:id => "search_form"}) do %>
- <%= text_field_tag 'query', params[:query], { :size => 30 } %>
- <%= submit_tag _("Search") %>
- <% end %>
-</li>
-<li><%= _('<a href="%s">Contact us</a> to tell us about the problem</li>') % [help_contact_path] %>
-<li><%= _('Go to our <a href="%s">front page</a></li>') % ["/"] %>
-</ul>
+ <ul>
+ <li><%= _("Check for mistakes if you typed or copied the address.")%></li>
+ <li><%= _("Search the site to find what you were looking for.")%>
+ <% form_tag({:controller => "general", :action => "search_redirect"}, {:id => "search_form"}) do %>
+ <%= text_field_tag 'query', params[:query], { :size => 30 } %>
+ <%= submit_tag _("Search") %>
+ <% end %>
+ </li>
+ </ul>
+ <% else %>
+ <h1><%= _("Sorry, there was a problem processing this page") %></h1>
+ <p><%= _('You have found a bug. Please <a href="{{contact_url}}">contact us</a> to tell us about the problem', :contact_url => help_contact_path) %></p>
-<p id="error_technical_details"><%= _("<strong>Technical details:</strong>")%> <%=@exception_class ? @exception_class : _("Unknown")%></p>
+ <% end %>
+ <h2><%= _('Technical details') %></h2>
+ <p><strong><%=@exception_class ? @exception_class : _("Unknown")%></strong></p>
+ <p><strong><%=@exception_message %></strong></p>
+</div>
diff --git a/app/views/general/frontpage.rhtml b/app/views/general/frontpage.rhtml
index abed0294e..f71980302 100644
--- a/app/views/general/frontpage.rhtml
+++ b/app/views/general/frontpage.rhtml
@@ -1,33 +1,42 @@
<% view_cache :ttl => 5.minutes, :tag => I18n.locale do %>
-
-<div id="frontpage_search">
- <h1><%= _('Make or explore Freedom of Information requests') %></h1>
-
- <% form_tag({:action => "search_redirect"}, {:id => "search_form"}) do %>
- <p>
- <%= render :partial => 'frontpage_intro_sentence' %>
- <br>
-
- <br>
- <%= text_field_tag 'query', params[:query], { :size => 30 } %>
- <%= hidden_field_tag 'bodies', 1 %>
- <%= submit_tag _('Search') %>
- <br>
- <%= _('e.g.') %>
- <% @search_examples.each_with_index do |name, i| %>
- <%=link_to name, search_url(name, 'bodies')%><% if i < 2 %>, <% else %>. <% break %><% end %>
- <% end %>
-
- <br>
- <br>
- <%= _('OR, <strong>search</strong> for information others have requested using {{site_name}}', :site_name => site_name) %>
- </p>
- <% end %>
-</div>
+ <div id="frontpage_splash">
+ <div id="left_column">
+ <h1>
+ <%= _("Make a new<br/>
+ <strong>Freedom <span>of</span><br/>
+ Information<br/>
+ request</strong>") %>
+ </h1>
+ <a class="link_button_green_large" href="/select_authority"><%= _("Start now &raquo;") %></a>
+ </div>
+ <div id="right_column">
+ <div id="frontpage_search_box">
+ <h2>
+ <%= _("Search over<br/>
+ <strong>{{number_of_requests}} requests</strong> <span>and</span><br/>
+ <strong>{{number_of_authorities}} authorities</strong>",
+ :number_of_requests => InfoRequest.count, :number_of_authorities => PublicBody.count) %>
+ </h2>
+ <% form_tag({:action => "search_redirect"}, {:id => "search_form"}) do %>
+ <div>
+ <%= text_field_tag 'query', params[:query], { :size => 30 } %>
+ <%= submit_tag _('Search') %>
+ </div>
+ <% end %>
+ </div>
+ <div id="frontpage_right_to_know">
+ <%= render :partial => 'frontpage_intro_sentence' %>
+ </div>
+ </div>
+ <div style="clear:both"></div>
+ </div>
<div id="frontpage_examples">
<% if @popular_bodies.size > 0 %>
<div id="examples_0">
+ <h3><%= _("Who can I request information from?") %></h3>
+ <%= _("{{site_name}} covers requests to {{number_of_authorities}} authorities, including:",
+ :site_name => site_name, :number_of_authorities => PublicBody.count) %>
<ul>
<% for popular_body in @popular_bodies %>
<li><%=public_body_link(popular_body)%>
@@ -36,23 +45,27 @@
<% end%>
</ul>
<p><strong>
- <%= link_to _('More authorities...'), list_public_bodies_default %>
+ <%= link_to _('Browse all authorities...'), list_public_bodies_default %>
</strong></p>
</div>
<% end %>
- <% if @successful_request_events.size > 0 %>
<div id="examples_1">
+ <h3><%= _("What information has been released?") %></h3>
+ <%= _("{{site_name}} users have made {{number_of_requests}} requests, including:",
+ :site_name => site_name, :number_of_requests => InfoRequest.count) %>
<ul>
- <% for event in @successful_request_events %>
- <li><%=link_to h(excerpt(event.info_request.title, "", 30)), request_url(event.info_request)%>
- <%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(event.described_at)) %>
+ <% for event in @request_events %>
+ <li>
+ <%= public_body_link(event.info_request.public_body) %> <%= _('answered a request about') %>
+ <%=link_to h(event.info_request.title), request_url(event.info_request)%>
+ <%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(event.described_at)) %>
+ <p class="excerpt" onclick="document.location.href='<%=request_url(event.info_request)%>'"><%= excerpt(event.info_request.title, "", 200) %></p>
</li>
<% end %>
</ul>
<p><strong><%=link_to _('More successful requests...'), request_list_successful_url %></strong></p>
</div>
- <% end %>
</div>
diff --git a/app/views/general/search.rhtml b/app/views/general/search.rhtml
index 1d934f65a..6f0d25da4 100644
--- a/app/views/general/search.rhtml
+++ b/app/views/general/search.rhtml
@@ -1,123 +1,219 @@
<% @show_tips = @xapian_requests.nil? || (@total_hits == 0) %>
+<% @include_request_link_in_authority_listing = true %>
+
+<%= render :partial => 'localised_datepicker' %>
+
<% if @query.nil? %>
<% @title = _("Search Freedom of Information requests, public authorities and users") %>
- <h1><%=@title%></h1>
<% elsif @total_hits == 0 %>
- <%= _("Nothing found for &#x2018;{{search_terms}}&#x2019;", :search_terms => h(@query)) %>
+ <% @title = _('There were no requests matching your query.') %>
<% else %>
<% @title = _("Results page {{page_number}}", :page_number => @page.to_s) %>
<% end%>
-<% @include_request_link_in_authority_listing = true %>
+<div id="header_left">
+ <% if @query.nil? %>
+ <h1>Search</h1>
+ <% else %>
+ <h1>Search results</h1>
+ <% end%>
-<% if @bodies && (@page == 1 || @xapian_bodies.results.size > 0) %>
- <div id="stepwise_instructions">
- <p><strong><%=_("Next, select the public authority you'd like to make the request from.") %></strong></p>
- <p><% _('Can\'t find it? <a href="%s">Browse all</a> or <a href="%s">ask us to add it</a>.') % [list_public_bodies_default, "#{help_requesting_path}#missing_body"] %></p>
- <p>
- </div>
-<% end %>
+ <% if @advanced %>
+ <div id="advanced-search">
+ <p><%= _('To use the advanced search, combine phrases and labels as described in the search tips below.') %></p>
+ <% form_tag(advanced_search_url, :method => "get") do %>
+ <p>
+ <%= text_field_tag :query, @query, { :size => 60 } %>
+ <%= hidden_field_tag 'sortby', @inputted_sortby %>
+ <% if @bodies %>
+ <%= hidden_field_tag 'bodies', 1 %>
+ <% end %>
+ <%= submit_tag _("Search") %>
+ &nbsp;&nbsp;<%= link_to _('Simple search'), search_redirect_path %>
+ </p>
+ <% end %>
+ </div>
+ <% else %>
+ <% form_tag(request.url, {:method => "get", :id => "search_form"}) do %>
+ <p>
+ <%= text_field_tag 'query', params[:query], { :size => 40 } %>
+ <%= hidden_field_tag 'sortby', @inputted_sortby %>
+ <% if @bodies %>
+ <%= hidden_field_tag 'bodies', 1 %>
+ <% end %>
+ <%= submit_tag _("Search") %>
+ <%= link_to(_("Advanced search"), advanced_search_url) %>
-<% form_tag({:action => "search_redirect"}, {:id => "search_form"}) do %>
- <p>
- <%= text_field_tag 'query', @query, { :size => 40 } %>
- <%= hidden_field_tag 'sortby', @inputted_sortby %>
- <% if @bodies %>
- <%= hidden_field_tag 'bodies', 1 %>
- <% end %>
- <%= submit_tag _("Search") %>
- <% if not @show_tips %>
- &nbsp;&nbsp;<%= link_to _('Advanced search tips'), search_redirect_path %>
+
+ </p>
+<div id="common-subfilters">
+ <div id="variety-filter">
+ <h3 class="title"><%= _("Showing") %></h3>
+ <% labels = [
+ ["requests", _("requests")],
+ ["users", _("users")],
+ ["bodies", _("authorities")],
+ ["all", _("everything")]]%>
+ <% for variety, label in labels %>
+ <% if @variety_postfix != variety %>
+ <% if variety != "users" %>
+ <%= link_to label, search_url([params[:query], @common_query], variety, @sort_postfix) %>
+ <% else %>
+ <%= link_to label, search_url(params[:query], variety, @sort_postfix) %>
+ <% end %>
+ <% else %>
+ <%= label %>
<% end %>
- </p>
+ <%= "|" unless variety == labels.last[0]%>
+ <% end %>
+ </div>
+
+<% if false %>
+<%-# Commented out for now as tags are of limited use when users can't see them. This will change in the future! -%>
+<% if @variety_postfix != "users" %>
+ <div>
+ <%= label_tag(:query, _("Tags (separated by a space):")) %><%= text_field_tag(:tags, params[:tags], { :size => 20 }) %>
+ <% for tag in InfoRequest.get_tags %>
+ <%= tag.name_and_value %>
+ <% end %>
+ </div>
<% end %>
+<% end %>
+</div>
-<% if !@query.nil? %>
- <p>
- <%=link_to_unless @sortby == 'relevant', _("Show most relevant results first"), search_url(@query, 'relevant') %>
- |
- <%=link_to_unless @sortby == 'newest', _("Newest results first"), search_url(@query, 'newest') %>
- <% if @sortby == 'described' %>
- | <%= _('Recently described results first') %>
+<% if @variety_postfix == "requests" %>
+<div id="requests-subfilters">
+ <div>
+ <h3 class="title"><%= _("Restrict to") %></h3>
+ <% [["successful", _("successful requests")],
+ ["unsuccessful", _("unsuccessful requests")],
+ ["awaiting", _("unresolved requests")],
+ ["internal_review", _("internal reviews")]].each_with_index do |item, index|
+ status, title = item %>
+
+ <%= check_box_tag "latest_status[]", status, params[:latest_status].nil? ? false : params[:latest_status].include?(status), :id => "latest_status_#{index}" %>
+ <%= label_tag("latest_status_#{index}", title) %> <br/>
<% end %>
- </p>
+ </div>
+ <div>
+ <h3 class="title"><%= _("Search in") %></h3>
+ <% [["sent", _("messages from users")],
+ ["response", _("messages from authorities")],
+ ["comment", _("comments")]].each_with_index do |item, index|
+ variety, title = item %>
+
+ <%= check_box_tag "request_variety[]", variety, params[:request_variety].nil? ? true : params[:request_variety].include?(variety), :id => "request_variety_#{index}" %>
+ <%= label_tag("request_variety_#{index}", title) %> <br/>
+ <% end %>
+ </div>
+ <div id="date_range">
+ <label class="form_label title" for="query">Made between</label>
+ <%= text_field_tag(:request_date_after, params[:request_date_after], {:class => "use-datepicker", :size => 10}) %>
+ <label class="form_label" for="query">&nbsp;and</label>
+ <%= text_field_tag(:request_date_before, params[:request_date_before], {:class => "use-datepicker", :size => 10}) %>
+ </div>
+</div>
+<% end %>
+<div>
+ <%= submit_tag("Filter") if @variety_postfix == "requests"%>
+</div>
+ <% end %>
<% end %>
-<% if @bodies && !@query.nil? && @xapian_bodies.results.size == 0 && @page == 1 %>
- <h1><%= _('No public authorities found') %></h1>
- <% if @spelling_correction %>
- <p id="did_you_mean"><%= _('Did you mean: {{correction}}',
- :correction => search_link(@spelling_correction, @postfix)) %></p>
- <% end %>
- <p><%= _('<a href="%s">Browse all</a> or <a href="%s">ask us to add one</a>.') % [list_public_bodies_default, help_requesting_path + '#missing_body'] %></p>
+
+
+ <% if !@query.nil? %>
+ <p id="search_controls">
+ <%=link_to_unless @sortby == 'relevant', _("Show most relevant results first"), search_url(@query, @variety_postfix, 'relevant') %>
+ |
+ <%=link_to_unless @sortby == 'newest', _("Newest results first"), search_url(@query, @variety_postfix, 'newest') %>
+ <% if @sortby == 'described' %>
+ | <%= _('Recently described results first') %>
+ <% end %>
+ </p>
+ <% end %>
+</div>
+
+<% if @track_thing && (@xapian_bodies_hits > 0 || @xapian_users_hits > 0 || @total_hits == 0)%>
+ <div id="header_right">
+ <h2>Track this search</h2>
+ <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %>
+ </div>
<% end %>
+<div style="clear:both;"></div>
+
<% if @total_hits == 0 %>
- <h1><%=@title %></h1>
+ <h2><%=@title %></h2>
<% end %>
<% if not @query.nil? %>
- <% if @spelling_correction %>
- <p id="did_you_mean"><%= _('Did you mean: {{correction}}', :correction => search_link(@spelling_correction, @postfix)) %></p>
- <% end %>
-
- <% if (!@bodies || @xapian_requests.results.size == 0) && @track_thing && (@xapian_bodies.results.size > 0 || @xapian_users.results.size > 0 || @total_hits == 0)%>
- <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %>
- <% end %>
+ <div class="results_section">
+ <% if @xapian_bodies_hits > 0 %>
+ <% if @xapian_bodies_hits == 1 && @page == 1 %>
+ <h2 class="publicbody_results"><%= _('One public authority found') %></h2>
+ <% else %>
+ <h2 class="publicbody_results"><%= _('Public authorities {{start_count}} to {{end_count}} of {{total_count}}', :start_count => ((@page-1)*@bodies_per_page+1).to_s, :end_count => [@page*@bodies_per_page, @xapian_bodies.matches_estimated].min.to_s, :total_count => @xapian_bodies.matches_estimated.to_s) %></h2>
+ <% end %>
- <% if @xapian_bodies.results.size > 0 %>
- <% if @xapian_bodies.results.size == 1 && @page == 1 %>
- <h1><%= _('One public authority matching &#x2018;{{user_search_query}}&#x2019;', :user_search_query => h(@query)) %></h1>
- <% else %>
- <h1><%= _('Public authorities {{start_count}} to {{end_count}} of {{total_count}} for {{user_search_query}}', :start_count => ((@page-1)*@bodies_per_page+1).to_s, :end_count => [@page*@bodies_per_page, @xapian_bodies.matches_estimated].min.to_s, :total_count => @xapian_bodies.matches_estimated.to_s, :user_search_query => h(@query)) %></h1>
- <% end %>
+ <div class="results_block">
+ <% for result in @xapian_bodies.results %>
+ <%= render :partial => 'public_body/body_listing_single', :locals => { :public_body => result[:model] } %>
+ <% end %>
+ </div>
- <% for result in @xapian_bodies.results %>
- <%= render :partial => 'public_body/body_listing_single', :locals => { :public_body => result[:model] } %>
+ <%= will_paginate WillPaginate::Collection.new(@page, @bodies_per_page, @xapian_bodies.matches_estimated) %>
+ <% elsif @bodies && !@query.nil? && @xapian_bodies.results.size == 0 && @page == 1 %>
+ <h2 class="publicbody_results"><%= _('No public authorities found') %></h2>
+ <% if @spelling_correction %>
+ <p id="did_you_mean"><%= _('Did you mean: {{correction}}', :correction => search_link(@spelling_correction, @postfix)) %></p>
<% end %>
+ <p><%= _('<a href="%s">Browse all</a> or <a href="%s">ask us to add one</a>.') % [list_public_bodies_default, help_requesting_path + '#missing_body'] %></p>
+ <% end %>
+ </div>
- <%= will_paginate WillPaginate::Collection.new(@page, @bodies_per_page, @xapian_bodies.matches_estimated) %>
- <% end %>
-
- <% if @xapian_users.results.size > 0 %>
- <% if @xapian_users.results.size == 1 && @page == 1 %>
- <h1><%= _("One person matching &#x2018;{{user_search_query}}&#x2019;", :user_search_query => h(@query)) %></h1>
- <% else %>
- <h1><%= _("People {{start_count}} to {{end_count}} of {{total_count}} for &#x2018;{{user_search_query}}&#x2019;", :start_count => ((@page-1)*@users_per_page+1).to_s, :end_count => [@page*@users_per_page, @xapian_users.matches_estimated].min.to_s, :total_count => @xapian_users.matches_estimated.to_s, :user_search_query => h(@query)) %></h1>
- <% end %>
+ <div class="results_section">
+ <% if @xapian_users_hits > 0 %>
+ <% if @xapian_users_hits == 1 && @page == 1 %>
+ <h2 class="person_results"><%= _("One person found") %></h2>
+ <% else %>
+ <h2 class="person_results"><%= _("People {{start_count}} to {{end_count}} of {{total_count}}", :start_count => ((@page-1)*@users_per_page+1).to_s, :end_count => [@page*@users_per_page, @xapian_users.matches_estimated].min.to_s, :total_count => @xapian_users.matches_estimated.to_s) %></h2>
+ <% end %>
- <% for result in @xapian_users.results %>
- <%= render :partial => 'user/user_listing_single', :locals => { :display_user => result[:model] } %>
- <% end %>
+ <div class="results_block">
+ <% for result in @xapian_users.results %>
+ <%= render :partial => 'user/user_listing_single', :locals => { :display_user => result[:model] } %>
+ <% end %>
+ </div>
- <%= will_paginate WillPaginate::Collection.new(@page, @users_per_page, @xapian_users.matches_estimated) %>
- <% end %>
+ <%= will_paginate WillPaginate::Collection.new(@page, @users_per_page, @xapian_users.matches_estimated) %>
+ <% end %>
+ </div>
- <% if @xapian_requests.results.size > 0 %>
- <% if @xapian_requests.results.size == 1 && @page == 1 %>
- <h1><%= _("One FOI request matching &#x2018;{{user_search_query}}&#x2019;", :user_search_query => h(@query)) %></h1>
- <% else %>
- <h1><%= _("FOI requests {{start_count}} to {{end_count}} of {{total_count}} for &#x2018;{{user_search_query}}&#x2019;", :start_count => ((@page-1)*@requests_per_page+1).to_s, :end_count => [@page*@requests_per_page, @xapian_requests.matches_estimated].min.to_s, :total_count => @xapian_requests.matches_estimated.to_s, :user_search_query => h(@query)) %></h1>
- <% end %>
+ <div class="results_section">
+ <% if @xapian_requests_hits > 0 %>
+ <% if @xapian_requests_hits == 1 && @page == 1 %>
+ <h2 class="foi_results"><%= _("One FOI request found") %></h2>
+ <% else %>
+ <h2 class="foi_results"><%= _("FOI requests {{start_count}} to {{end_count}} of {{total_count}}", :start_count => ((@page-1)*@requests_per_page+1).to_s, :end_count => [@page*@requests_per_page, @xapian_requests.matches_estimated].min.to_s, :total_count => @xapian_requests.matches_estimated.to_s) %></h2>
+ <% end %>
- <% if @track_thing %>
- <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %>
- <% end %>
+ <div class="results_block">
+ <% for result in @xapian_requests.results %>
+ <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
+ <% end %>
+ </div>
- <% for result in @xapian_requests.results %>
- <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
- <% end %>
-
- <%= will_paginate WillPaginate::Collection.new(@page, @requests_per_page, @xapian_requests.matches_estimated) %>
- <% if @track_thing %>
- <p></p>
- <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %>
- <% end %>
- <% end %>
+ <%= will_paginate WillPaginate::Collection.new(@page, @requests_per_page, @xapian_requests.matches_estimated) %>
+ <% end %>
+ </div>
<% end %>
-<% if @show_tips %>
+<% if @advanced %>
+
+<div id="advanced-search-tips">
+ <a name="show-tips"></a>
<h2><%= _("Advanced search tips")%></h2>
<ul>
<li><%= _("Enter words that you want to find separated by spaces, e.g. <strong>climbing lane</strong>") %></li>
@@ -138,29 +234,33 @@
</ul>
<h2 id="statuses"><%= _('Table of statuses') %></h2>
+ <p><%= _("All the options below can use <strong>status</strong> or <strong>latest_status</strong> before the colon. For example, <strong>status:not_held</strong> will match requests which have <em>ever</em> been marked as not held; <strong>latest_status:not_held</strong> will match only requests that are <em>currently</em> marked as not held.") %></p>
+
<table class="status_table">
- <tr><td><strong><%=search_link('status:waiting_response')%></strong></td><td><%= _('Waiting for the public authority to reply') %></td></tr>
- <tr><td><strong><%=search_link('status:not_held')%></strong></td><td><%= _('The public authority does not have the information requested') %></td></tr>
- <tr><td><strong><%=search_link('status:rejected')%></strong></td><td><%= _('The request was refused by the public authority') %></td></tr>
- <tr><td><strong><%=search_link('status:partially_successful')%></strong></td><td><%= _('Some of the information requested has been received') %></td></tr>
- <tr><td><strong><%=search_link('status:successful')%></strong></td><td><%= _('All of the information requested has been received') %></td></tr>
- <tr><td><strong><%=search_link('status:waiting_clarification')%></strong></td><td><%= _('The public authority would like part of the request explained') %></td></tr>
- <tr><td><strong><%=search_link('status:gone_postal')%></strong></td><td><%= _('The public authority would like to / has responded by post') %></td></tr>
- <tr><td><strong><%=search_link('status:internal_review')%></strong></td><td><%= _('Waiting for the public authority to complete an internal review of their handling of the request') %></td></tr>
- <tr><td><strong><%=search_link('status:error_message')%></strong></td><td><%= _('Received an error message, such as delivery failure.') %></td></tr>
- <tr><td><strong><%=search_link('status:requires_admin')%></strong></td><td><%= _('A strange reponse, required attention by the {{site_name}} team', :site_name=>site_name) %></td></tr>
- <tr><td><strong><%=search_link('status:user_withdrawn')%></strong></td><td><%= _('The requester has abandoned this request for some reason') %></td></tr>
+ <tr><td><strong><%=search_link('status:waiting_response', nil, nil, true)%></strong></td><td><%= _('Waiting for the public authority to reply') %></td></tr>
+ <tr><td><strong><%=search_link('status:not_held', nil, nil, true)%></strong></td><td><%= _('The public authority does not have the information requested') %></td></tr>
+ <tr><td><strong><%=search_link('status:rejected', nil, nil, true)%></strong></td><td><%= _('The request was refused by the public authority') %></td></tr>
+ <tr><td><strong><%=search_link('status:partially_successful', nil, nil, true)%></strong></td><td><%= _('Some of the information requested has been received') %></td></tr>
+ <tr><td><strong><%=search_link('status:successful', nil, nil, true)%></strong></td><td><%= _('All of the information requested has been received') %></td></tr>
+ <tr><td><strong><%=search_link('status:waiting_clarification', nil, nil, true)%></strong></td><td><%= _('The public authority would like part of the request explained') %></td></tr>
+ <tr><td><strong><%=search_link('status:gone_postal', nil, nil, true)%></strong></td><td><%= _('The public authority would like to / has responded by post') %></td></tr>
+ <tr><td><strong><%=search_link('status:internal_review', nil, nil, true)%></strong></td><td><%= _('Waiting for the public authority to complete an internal review of their handling of the request') %></td></tr>
+ <tr><td><strong><%=search_link('status:error_message', nil, nil, true)%></strong></td><td><%= _('Received an error message, such as delivery failure.') %></td></tr>
+ <tr><td><strong><%=search_link('status:requires_admin', nil, nil, true)%></strong></td><td><%= _('A strange reponse, required attention by the {{site_name}} team', :site_name=>site_name) %></td></tr>
+ <tr><td><strong><%=search_link('status:user_withdrawn', nil, nil, true)%></strong></td><td><%= _('The requester has abandoned this request for some reason') %></td></tr>
</table>
<h2 id="varieties"><%= _('Table of varieties') %></h2>
-
+ <p><%= _("All the options below can use <strong>variety</strong> or <strong>latest_variety</strong> before the colon. For example, <strong>variety:sent</strong> will match requests which have <em>ever</em> been sent; <strong>latest_variety:sent</strong> will match only requests that are <em>currently</em> marked as sent.") %></p>
<table class="status_table">
- <tr><td><strong><%=search_link('variety:sent')%></strong></td><td><%= _('Original request sent') %></td></tr>
- <tr><td><strong><%=search_link('variety:followup_sent')%></strong></td><td><%= _('Follow up message sent by requester') %></td></tr>
- <tr><td><strong><%=search_link('variety:response')%></strong></td><td><%= _('Response from a public authority') %></td></tr>
- <tr><td><strong><%=search_link('variety:comment')%></strong></td><td><%= _('Annotation added to request') %></td></tr>
- <tr><td><strong><%=search_link('variety:authority')%></strong></td><td><%= _('A public authority') %></td></tr>
- <tr><td><strong><%=search_link('variety:user')%></strong></td><td><%= _('A {{site_name}} user', :site_name=>site_name) %></td></tr>
+ <tr><td><strong><%=search_link('variety:sent', nil, nil, true)%></strong></td><td><%= _('Original request sent') %></td></tr>
+ <tr><td><strong><%=search_link('variety:followup_sent', nil, nil, true)%></strong></td><td><%= _('Follow up message sent by requester') %></td></tr>
+ <tr><td><strong><%=search_link('variety:response', nil, nil, true)%></strong></td><td><%= _('Response from a public authority') %></td></tr>
+ <tr><td><strong><%=search_link('variety:comment', nil, nil, true)%></strong></td><td><%= _('Annotation added to request') %></td></tr>
+ <tr><td><strong><%=search_link('variety:authority', nil, nil, true)%></strong></td><td><%= _('A public authority') %></td></tr>
+ <tr><td><strong><%=search_link('variety:user', nil, nil, true)%></strong></td><td><%= _('A {{site_name}} user', :site_name=>site_name) %></td></tr>
</table>
+</div>
+
<% end %>
diff --git a/app/views/help/_sidebar.rhtml b/app/views/help/_sidebar.rhtml
index 99298e9c6..21038e8df 100644
--- a/app/views/help/_sidebar.rhtml
+++ b/app/views/help/_sidebar.rhtml
@@ -1,16 +1,17 @@
-<div id="about_sidebar">
- <h1>Help pages</h1>
- <ul>
+<div id="right_column_flip">
+ <h2>Help pages</h2>
+ <ul class="no_bullets">
<li><%= link_to_unless_current "Introduction", "/help/about" %></li>
<li><%= link_to_unless_current "Making requests", "/help/requesting" %></li>
<li><%= link_to_unless_current "Your privacy", "/help/privacy" %></li>
<li><%= link_to_unless_current "FOI officers", "/help/officers" %></li>
+ <li><%= link_to_unless_current "About the software", "/help/alaveteli" %></li>
<li><%= link_to_unless_current "Credits", "/help/credits" %></li>
<li><%= link_to_unless_current "Programmers API", "/help/api" %></li>
<li><%= link_to_unless_current "Advanced search", "/search" %></li>
</ul>
- <h1 id="contact">Contact us</h1>
+ <h2 id="contact">Contact us</h2>
<p>If your question isn't answered here, or you just wanted to let us know
something about the site, <a href="/help/contact">contact&nbsp;us</a>.
</p>
diff --git a/app/views/help/about.rhtml b/app/views/help/about.rhtml
index d22cc5b30..668a1df7f 100644
--- a/app/views/help/about.rhtml
+++ b/app/views/help/about.rhtml
@@ -2,50 +2,52 @@
<%= render :partial => 'sidebar' %>
-<h1 id="introduction">Introduction to <%= site_name %><a href="#introduction">#</a> </h1>
-<dl>
-
-<dt id="purpose">What is <%= site_name %> for? <a href="#purpose">#</a> </dt>
-<dd>To help you find out inside information about what the UK government
-is doing.
-</dd>
-
-<dt id="premise">How does the site work? <a href="#premise">#</a> </dt>
-<dd>You choose the public authority that you would like information from, then
-write a brief note describing what you want to know. We then send your request
-to the public authority. Any response they make is automatically published on the
-website for you and anyone else to find and read.
-</dd>
-
-<dt id="whybother_me">Why would I bother to do this? <a href="#whybother_me">#</a> </dt>
-<dd>You pay taxes, and then government does things with the money. All sorts of
-things that affect your life, from healthcare through to national defence. Some
-it does badly, some it does well. The more we find out about how government
-works, the better able we are to make suggestions to improve the things that
-are done badly, and to celebrate the things that are done well.
-</dd>
-
-<dt id="whybother_them">Why would the public authority bother to reply? <a href="#whybother_them">#</a> </dt>
-<dd>Under Freedom of Information (FOI) law, they have to respond. The response
-will either contain the information you want, or give a valid legal reason why
-it must be kept confidential.
-</dd>
-
-<dt id="who">Who makes <%= site_name %>? <a href="#who">#</a> </dt>
-<dd><%= site_name %> is created and run by <a href="http://www.mysociety.org">mySociety</a>,
-and was initially <a href="http://www.mysociety.org/2006/12/06/funding-for-freedom-of-information/">funded by the JRSST Charitable Trust</a>. mySociety is a project of the
-registered charity <a href="http://www.ukcod.org.uk/UK_Citizens_Online_Democracy">UK Citizens Online Democracy</a>.
-If you like what we're doing, then you can
-<a href="https://secure.mysociety.org/donate/">make a donation</a>.
-</dd>
-
-<dt id="updates">How can I keep up with news about <%= site_name %>?<a href="#updates">#</a> </dt>
-<dd>We have a <a href="/blog">blog</a> and a <a href="http://www.twitter.com/whatdotheyknow">twitter feed</a>.
-</dd>
-
-
-</dl>
-
-<p><strong>Next</strong>, read about <a href="/help/requesting">making requests</a> --&gt;
-
-<div id="hash_link_padding"></div>
+<div id="left_column_flip">
+ <h1 id="introduction">Introduction</h1>
+ <dl>
+
+ <dt id="purpose">What is WhatDoTheyKnow for? <a href="#purpose">#</a> </dt>
+ <dd>To help you find out inside information about what the UK government
+ is doing.
+ </dd>
+
+ <dt id="premise">How does the site work? <a href="#premise">#</a> </dt>
+ <dd>You choose the public authority that you would like information from, then
+ write a brief note describing what you want to know. We then send your request
+ to the public authority. Any response they make is automatically published on the
+ website for you and anyone else to find and read.
+ </dd>
+
+ <dt id="whybother_me">Why would I bother to do this? <a href="#whybother_me">#</a> </dt>
+ <dd>You pay taxes, and then government does things with the money. All sorts of
+ things that affect your life, from healthcare through to national defence. Some
+ it does badly, some it does well. The more we find out about how government
+ works, the better able we are to make suggestions to improve the things that
+ are done badly, and to celebrate the things that are done well.
+ </dd>
+
+ <dt id="whybother_them">Why would the public authority bother to reply? <a href="#whybother_them">#</a> </dt>
+ <dd>Under Freedom of Information (FOI) law, they have to respond. The response
+ will either contain the information you want, or give a valid legal reason why
+ it must be kept confidential.
+ </dd>
+
+ <dt id="who">Who makes WhatDoTheyKnow? <a href="#who">#</a> </dt>
+ <dd>WhatDoTheyKnow is created and run by <a href="http://www.mysociety.org">mySociety</a>,
+ and was initially <a href="http://www.mysociety.org/2006/12/06/funding-for-freedom-of-information/">funded by the JRSST Charitable Trust</a>. mySociety is a project of the
+ registered charity <a href="http://www.ukcod.org.uk/UK_Citizens_Online_Democracy">UK Citizens Online Democracy</a>.
+ If you like what we're doing, then you can
+ <a href="https://secure.mysociety.org/donate/">make a donation</a>.
+ </dd>
+
+ <dt id="updates">How can I keep up with news about WhatDoTheyKnow?<a href="#updates">#</a> </dt>
+ <dd>We have a <a href="/blog">blog</a> and a <a href="http://www.twitter.com/whatdotheyknow">twitter feed</a>.
+ </dd>
+
+
+ </dl>
+
+ <p><strong>Next</strong>, read about <a href="/help/requesting">making requests</a> --&gt;
+
+ <div id="hash_link_padding"></div>
+</div>
diff --git a/app/views/help/alaveteli.rhtml b/app/views/help/alaveteli.rhtml
new file mode 100644
index 000000000..41c75619c
--- /dev/null
+++ b/app/views/help/alaveteli.rhtml
@@ -0,0 +1,30 @@
+<% @title = "Making requests" %>
+
+<%= render :partial => 'sidebar' %>
+<div id="left_column_flip">
+ <% if params[:country_name] %>
+ <h1><%= _("Would you like to see a website like this in your country?") %></h1>
+ <% else %>
+ <h1>Powered by Alaveteli</h1>
+ <% end %>
+ <p>This website is powered by Alaveteli. Alaveteli is free software
+ for making Freedom of Information requests. It can easily be
+ translated into any language, and customised for variations of FOI
+ law.</p>
+
+ <p>The development of Alaveteli is sponsored and supported by a
+ number of foundataions and charities who are interested in
+ transparency across the world.</p>
+
+ <p>If you would like to set up an Alaveteli website in your own
+ country, we can help. You will need a few days to get the site
+ configured and ready to use, and will then have to spend at least an
+ hour a week moderating and managing the site (more for busy
+ websites).</p>
+
+ <p>Read more on the <a href="http://alaveteli.org">Alaveteli
+ website</a>, or <a href="mailto:hello@alaveteli.org">drop us an
+ email</a>.</p>
+
+ <div id="hash_link_padding"></div>
+</div>
diff --git a/app/views/help/api.rhtml b/app/views/help/api.rhtml
index 3cafbb665..76d2992fb 100644
--- a/app/views/help/api.rhtml
+++ b/app/views/help/api.rhtml
@@ -1,82 +1,81 @@
-<% @title = "Application Programming Interface - API" %>
+<% @title = "About our API" %>
<%= render :partial => 'sidebar' %>
-<h1><%=@title %></h1>
-
-<h2> Introduction </h2>
-
-<p>This page explains how programmers can make other websites and software
-interact with <%= site_name %> via an "API".
-</p>
-
-<p><%= site_name %> does not have a full API yet, but we are gradually adding
-lots of things that are similar in use to an API as they are requested.
-</p>
-
-<hr>
-
-<h2> 1. Linking to new requests </h2>
-
-<p>To encourage your users to make links to a particular public authority, use URLs of the form
-<%= link_to new_request_to_body_url(:url_name => "liverpool_city_council") , new_request_to_body_url(:url_name => "liverpool_city_council") %>.
-These are the parameters you can add to those URLs, either in the URL or from a form.
-
-<ul>
- <li> <strong>title</strong> - default summary of the new request.</li>
- <li> <strong>default_letter</strong> - default text of the body of the letter. The salutation (Dear...) and signoff (Yours...) are wrapped round this. </li>
- <li> <strong>body</strong> - as an alternative to default_letter, this sets the default entire text of the request, so you can customise the salutation and signoff. </li>
- <li> <strong>tags</strong> - space separated list of tags, so you can find and link up any requests made later, e.g. <em>openlylocal spending_id:12345</em>. The : indicates it is a machine tag. The values of machine tags may also include colons, useful for URIs.
-</ul>
-
-<hr>
-
-<h2> 2. RSS (actually, Atom) feeds </h2>
-
-<p>There are Atom feeds on most pages which list FOI requests, which you can
-use to get updates and links in XML format. Find the URL of the Atom feed in
-one of these ways:
-<ul>
- <li>Look for the <img src="/images/feed-16.png" alt=""> RSS feed links.</li>
- <li>Examine the <tt>&lt;link rel="alternate" type="application/atom+xml"&gt;</tt> tag in the head of the HTML. </li>
- <li>Add <tt>/feed</tt> to the start of another URL.
-</ul>
-
-<p>In particular, even complicated search queries have Atom feeds.
-You can do all sorts of things with them, such as query by authority, by file
-type, by date range, or by status. See the <a href="/search">advanced search
-tips</a> for details.
-
-<hr>
-
-<h2> 3. JSON structured data </h2>
-
-<p>Quite a few pages have JSON versions, which let you download information about
-objects in a structured form. Find them by:
-<ul>
- <li>Adding <tt>.json</tt> to the end of the URL. </li>
- <li>Look for the <tt>&lt;link rel="alternate" type="application/json"&gt;</tt> tag in the head of the HTML. </li>
-</ul>
-</p>
-
-<p>Requests, users and authorities all have JSON versions containing basic
-information about them. Every Atom feed has a JSON equivalent, containing
-information about the list of events in the feed.
-</p>
-
-<hr>
-<h2> 4. Spreadsheet of all authorities </h2>
-
-<p>
-A spreadsheet file listing every body in <%= site_name %> is available:
-<%= link_to "all-authorities.csv", all_public_bodies_csv_url() %>
-</p>
-
-<hr>
-
-<p>Please <a href="/help/contact">contact us</a> if you need an API feature that isn't there yet. It's
-very much a work in progress, and we do add things when people ask us to.</p>
-
-<div id="hash_link_padding"></div>
-
+<div id="left_column_flip">
+ <h1><%=@title %></h1>
+ <dl>
+ <dt>Introduction</dt>
+ <dd>
+ <p>This page explains how programmers can make other websites and software
+ interact with WhatDoTheyKnow via an "API".
+ </p>
+
+ <p>WhatDoTheyKnow does not have a full API yet, but we are gradually adding
+ lots of things that are similar in use to an API as they are requested.
+ </p>
+ </dd>
+
+ <dt>Linking to new requests</dt>
+ <dd>
+ <p>To encourage your users to make links to a particular public authority, use URLs of the form
+ <%= link_to new_request_to_body_url(:url_name => "liverpool_city_council") , new_request_to_body_url(:url_name => "liverpool_city_council") %>.
+ These are the parameters you can add to those URLs, either in the URL or from a form.
+
+ <ul>
+ <li> <strong>title</strong> - default summary of the new request.</li>
+ <li> <strong>default_letter</strong> - default text of the body of the letter. The salutation (Dear...) and signoff (Yours...) are wrapped round this. </li>
+ <li> <strong>body</strong> - as an alternative to default_letter, this sets the default entire text of the request, so you can customise the salutation and signoff. </li>
+ <li> <strong>tags</strong> - space separated list of tags, so you can find and link up any requests made later, e.g. <em>openlylocal spending_id:12345</em>. The : indicates it is a machine tag. The values of machine tags may also include colons, useful for URIs.
+ </ul>
+ </dd>
+
+ <dt>RSS (actually, Atom) feeds</h2>
+ <dd>
+ <p>There are Atom feeds on most pages which list FOI requests, which you can
+ use to get updates and links in XML format. Find the URL of the Atom feed in
+ one of these ways:
+ <ul>
+ <li>Look for the <img src="/images/feed-16.png" alt=""> RSS feed links.</li>
+ <li>Examine the <tt>&lt;link rel="alternate" type="application/atom+xml"&gt;</tt> tag in the head of the HTML. </li>
+ <li>Add <tt>/feed</tt> to the start of another URL.
+ </ul>
+
+ <p>In particular, even complicated search queries have Atom feeds.
+ You can do all sorts of things with them, such as query by authority, by file
+ type, by date range, or by status. See the <a href="/search">advanced search
+ tips</a> for details.
+ </dd>
+
+ <dt>JSON structured data</dt>
+ <dd>
+ <p>Quite a few pages have JSON versions, which let you download information about
+ objects in a structured form. Find them by:
+ <ul>
+ <li>Adding <tt>.json</tt> to the end of the URL. </li>
+ <li>Look for the <tt>&lt;link rel="alternate" type="application/json"&gt;</tt> tag in the head of the HTML. </li>
+ </ul>
+ </p>
+
+ <p>Requests, users and authorities all have JSON versions containing basic
+ information about them. Every Atom feed has a JSON equivalent, containing
+ information about the list of events in the feed.
+ </p>
+ </dd>
+
+ <dt>Spreadsheet of all authorities</dt>
+ <dd>
+ <p>
+ A spreadsheet file listing every body in WhatDoTheyKnow is available:
+ <%= link_to "all-authorities.csv", all_public_bodies_csv_url() %>
+ </p>
+
+ </dd>
+ </dl>
+
+ <p>Please <a href="/help/contact">contact us</a> if you need an API feature that isn't there yet. It's
+ very much a work in progress, and we do add things when people ask us to.</p>
+
+ <div id="hash_link_padding"></div>
+</div>
diff --git a/app/views/help/contact.rhtml b/app/views/help/contact.rhtml
index 6c65fb1c9..dd49f7951 100644
--- a/app/views/help/contact.rhtml
+++ b/app/views/help/contact.rhtml
@@ -2,10 +2,12 @@
<%= foi_error_messages_for :contact %>
+<h1><%= @title %></h1>
+
<div id="contact_preamble">
<% if !flash[:notice] %>
- <h1>Contact an authority to get official information</h1>
+ <h2>Contact an authority to get official information</h2>
<ul>
<li><a href="/new">Go here</a> to make a request, in public, for information
from UK public authorities.</li>
@@ -17,7 +19,7 @@
</li>
</ul>
- <h1>Take up an issue with Government</h1>
+ <h2>Take up an issue with Government</h2>
<ul>
<li><a href="http://www.writetothem.com">Write to your MP,
@@ -28,7 +30,7 @@
<% end %>
- <h1>Contact the <%= site_name %> team</h1>
+ <h2>Contact the WhatDoTheyKnow team</h2>
<% if !flash[:notice] %>
<ul>
<li>
diff --git a/app/views/help/credits.rhtml b/app/views/help/credits.rhtml
index 02cd55c90..02f1e40e8 100644
--- a/app/views/help/credits.rhtml
+++ b/app/views/help/credits.rhtml
@@ -1,90 +1,91 @@
-<% @title = "Credit where credit is due" %>
+<% @title = "Credit where credit's due" %>
<%= render :partial => 'sidebar' %>
-<h1 id="credits"><%= @title%> <a href="#credits">#</a> </h1>
+<div id="left_column_flip">
+ <h1 id="credits"><%= @title%></h1>
-<dl>
-
-<dt id="thanks">Which people made <%= site_name %>? <a href="#thanks">#</a> </dt>
-<dd>Oh, nearly everyone (and <a href="http://www.mysociety.org/helpus">maybe you too</a>)!
-<ul>
-<li>
- <a href="http://www.yrtk.org">Heather Brooke</a>
- (<a href="http://www.guardian.co.uk/politics/2008/mar/29/houseofcommons.michaelmartin?gusrc=rss&amp;feed=worldnews">vampy!</a>) has
- been pushing the idea of a UK FOI archive for years now.
-</li>
-<li>
- Both Phil Rodgers and <a href="http://www.flourish.org/blog/">Francis Irving</a>
- entered it in a mySociety competition for ideas for public interest websites to build.
-</li>
-<li>
- <a href="http://www.mysociety.org/2006/09/27/the-mysociety-call-for-proposals-the-winner-and-runners-up/">It won</a>,
- and then Chris Lightfoot (<a href="http://mk.ucant.org/archives/000129.html">RIP :(</a>)
- thought up the wheeze of intercepting email responses to requests and
- automatically publishing them.
-</li>
-<li>
- Tom Steinberg got the cash to pay for the site from
- <a href="http://www.jrrt.org.uk/">a dead chocolate mogul</a> (<em>thank you!</em>) ...
-</li>
-<li>
- ... so that Francis Irving, Angie Ahl, Tommy Martin, Louise Crow, Matthew Somerville
- and Tom Steinberg could do the complex mixture of design and coding to build
- what you see today.
-</li>
-<li>
- Thanks particularly to Julian Todd (<a href="http://www.freesteel.co.uk/wpblog/">great blog!</a>),
- Francis Davey, and Etienne Pollard for using the site early on and giving
- feedback (and/or legal advice!), and also to all our other users and
- testers.
-</li>
-<li>
- The amazing team of volunteers who run the site, answer your support
- emails, maintain the database of public authorities and
- <a href="http://www.mysociety.org/2009/10/13/behind-whatdotheyknow/">so much more</a>.
- Thanks to John Cross, Ben Harris, Adam McGreggor, Alex Skene,
- Richard Taylor.
-</li>
-<li>
- Volunteers who have provided patches to the code - thanks Peter Collingbourne
- and Tony Bowden.
-</li>
-<li>
- Everyone who has helped look up FOI email addresses.
-</li>
-<li>
- We couldn't do any of this without those
- <a href="http://www.ukcod.org.uk/UKCOD_Trustees">crazy people</a> who volunteer,
- amongst many other things, to do the accounts and fill in our VAT return.
-</li>
-<li>
- Finally, all the officers and servants who have answered the many requests
- made through the site. Their diligence, patience and professionalism is
- what has actually made the information that you see here. Thank them for
- helping make Government more transparent.
-</li>
-</ul>
-You're all stars.
-</dd>
-
-<dt id="helpus">Can I help out? <a href="#helpus">#</a> </dt>
-<dd>
- <p>Yes please! We're built out of our supporters and volunteers.</p>
+ <dl>
+ <dt id="thanks">Who made WhatDoTheyKnow? <a href="#thanks">#</a> </dt>
+ <dd>Oh, nearly everyone (and <a href="http://www.mysociety.org/helpus">maybe you too</a>)!
<ul>
- <li>You can <a href="https://secure.mysociety.org/donate/">make a donation</a>. We're a registered charity.</li>
- <li>Help people find successful requests, and monitor performance of authorities, by
- <a href="/categorise/play">playing the categorisation game</a>. </li>
- <li>Find out FOI email addresses of <a href="/help/requesting#missing_body">authorities that we're missing</a>.</li>
- <li>Write a blog post about either <%= site_name %> or an interesting request that you've
- found. Post about it on a forum that you frequent. Tell friends about it.</li> <li>If you're
- a programmer, get the source code for our parent project, <a href="http://alaveteli.org">Alaveteli</a>
- and tell us about patches we can pull. It's made in Ruby on Rails.
- <li>Read more about <a href="http://www.mysociety.org/helpus/">volunteering with mySociety</a>.
+ <li>
+ <a href="http://www.yrtk.org">Heather Brooke</a>
+ (<a href="http://www.guardian.co.uk/politics/2008/mar/29/houseofcommons.michaelmartin?gusrc=rss&amp;feed=worldnews">vampy!</a>) has
+ been pushing the idea of a UK FOI archive for years now.
+ </li>
+ <li>
+ Both Phil Rodgers and <a href="http://www.flourish.org/blog/">Francis Irving</a>
+ entered it in a mySociety competition for ideas for public interest websites to build.
+ </li>
+ <li>
+ <a href="http://www.mysociety.org/2006/09/27/the-mysociety-call-for-proposals-the-winner-and-runners-up/">It won</a>,
+ and then Chris Lightfoot (<a href="http://mk.ucant.org/archives/000129.html">RIP :(</a>)
+ thought up the wheeze of intercepting email responses to requests and
+ automatically publishing them.
+ </li>
+ <li>
+ Tom Steinberg got the cash to pay for the site from
+ <a href="http://www.jrrt.org.uk/">a dead chocolate mogul</a> (<em>thank you!</em>) ...
+ </li>
+ <li>
+ ... so that Francis Irving, Angie Ahl, Tommy Martin, Louise Crow, Matthew Somerville
+ and Tom Steinberg could do the complex mixture of design and coding to build
+ what you see today.
+ </li>
+ <li>
+ Thanks particularly to Julian Todd (<a href="http://www.freesteel.co.uk/wpblog/">great blog!</a>),
+ Francis Davey, and Etienne Pollard for using the site early on and giving
+ feedback (and/or legal advice!), and also to all our other users and
+ testers.
+ </li>
+ <li>
+ The amazing team of volunteers who run the site, answer your support
+ emails, maintain the database of public authorities and
+ <a href="http://www.mysociety.org/2009/10/13/behind-whatdotheyknow/">so much more</a>.
+ Thanks to John Cross, Ben Harris, Adam McGreggor, Alex Skene,
+ Richard Taylor.
+ </li>
+ <li>
+ Volunteers who have provided patches to the code - thanks Peter Collingbourne
+ and Tony Bowden.
+ </li>
+ <li>
+ Everyone who has helped look up FOI email addresses.
+ </li>
+ <li>
+ We couldn't do any of this without those
+ <a href="http://www.ukcod.org.uk/UKCOD_Trustees">crazy people</a> who volunteer,
+ amongst many other things, to do the accounts and fill in our VAT return.
+ </li>
+ <li>
+ Finally, all the officers and servants who have answered the many requests
+ made through the site. Their diligence, patience and professionalism is
+ what has actually made the information that you see here. Thank them for
+ helping make Government more transparent.
+ </li>
</ul>
-</dd>
+ You're all stars.
+ </dd>
+ <dt id="helpus">Can I help out? <a href="#helpus">#</a> </dt>
+ <dd>
+ <p>Yes please! We're built out of our supporters and volunteers.</p>
+ <ul>
+ <li>You can <a href="https://secure.mysociety.org/donate/">make a donation</a>. We're a registered charity.</li>
+ <li>Help people find successful requests, and monitor performance of authorities, by
+ <a href="/categorise/play">playing the categorisation game</a>. </li>
+ <li>Find out FOI email addresses of <a href="/help/requesting#missing_body">authorities that we're missing</a>.</li>
+ <li>Write a blog post about either WhatDoTheyKnow or an interesting request that you've
+ found. Post about it on a forum that you frequent. Tell friends about it.</li> <li>If you're
+ a programmer, get the source code for our parent project, <a href="http://alaveteli.org">Alaveteli</a>
+ and tell us about patches we can pull. It's made in Ruby on Rails.
+ <li>Read more about <a href="http://www.mysociety.org/helpus/">volunteering with mySociety</a>.
+ </ul>
+ </dd>
+ </dl>
-<div id="hash_link_padding"></div>
+ <div id="hash_link_padding"></div>
+</div>
diff --git a/app/views/help/officers.rhtml b/app/views/help/officers.rhtml
index d9656186a..3defec62f 100644
--- a/app/views/help/officers.rhtml
+++ b/app/views/help/officers.rhtml
@@ -2,246 +2,246 @@
<%= render :partial => 'sidebar' %>
-<h1 id="officers"><%= @title %> <a href="#officers">#</a> </h1>
-
-<dl>
-
-<dt id="top">I just got here from bottom of an FOI request, what is going on? <a href="#top">#</a> </dt>
-
-<dd><p><%= site_name %> is a service run by a charity. It helps ordinary members
-of the public make FOI requests, and easily track and share the responses.</p>
-
-<p>The FOI request you received was made by someone using <%= site_name %>. You can
-simply reply to the request as you would any other request from an individual.
-The only difference is that your response will be automatically published on
-the Internet.
-</p>
-<p>If you have privacy or other concerns, please read the answers below.
-You might also like to read the <a
-href="/help/about">introduction to <%= site_name %></a> to find out more about what
-the site does from the point of view of a user. You can also search the
-site to find the authority that you work for, and view the status of
-any requests made using the site.
-
-<p>Finally, we welcome comments and
-thoughts from FOI officers, please <a href="/help/contact">get in touch</a>.
-</p>
-</dd>
-
-<dt id="responses">Why are you publishing responses to FOI requests? <a href="#responses">#</a> </dt>
-
-<dd>We think there are lots of benefits. Most importantly it will encourage the
-public to be more interested and involved in the work of government. We
-also hope that it will reduce the number of duplicate requests on any
-subject that a public body will receive. Given that Freedom of Information
-responses contain public information, which anybody could easily request
-again from the public authority, we think there should be no reason not to
-publish it widely.
-</dd>
-
-<dt id="realpeople">Are the people making requests real people? <a href="#realpeople">#</a> </dt>
-
-<dd>Yes. For the purposes of keeping track of responses we use
-computer-generated email addresses for each request. However, before
-they can send a request, each user must register on the site with a
-unique email address that we then verify. You can search this site and
-find a page listing all requests that each person has made.
-</dd>
-
-<dt id="email_only">An email isn't a sufficient address for an FOI request! <a href="#email_only">#</a> </dt>
-
-<dd>Yes it is. This
-<a href="http://www.whatdotheyknow.com/request/1142/response/2894/attach/5/20080806100741260.pdf">letter from the ICO to Rother District Council</a> gives guidance on the matter, specifically
-in the context of requests made via <%= site_name %>.
-</dd>
-
-<dt id="vexatious">Aren't you making lots of vexatious requests? <a href="#vexatious">#</a> </dt>
-
-<dd><p><%= site_name %> is not making any requests. We are sending requests on
-behalf of our users, who are real people making the requests. </p>
-<p>Look at it like this - if lots of different people made requests from
-different Hotmail email addresses, then you would not think that Microsoft were
-making vexatious requests. It is exactly the same if lots of requests are made
-via <%= site_name %>. Moreover, since all requests are public it is much easier
-for you to see if one of our users is making vexatious requests. </p>
-<p>If that isn't enough for you, the
-<a href="http://www.whatdotheyknow.com/request/1142/response/2894/attach/5/20080806100741260.pdf">letter from the ICO to Rother District Council</a> gives some guidance on the matter.</p>
-</dd>
-
-<dt id="spam_problems">I can see a request on <%= site_name %>, but we never got it by email!<a href="#spam_problems">#</a> </dt>
-
-<dd><p>If a request appears on the site, then we have attempted to send it to
-the authority by email. Any delivery failure messages will automatically
-appear on the site. You can check the address we're using with the "View FOI
-email address" link which appears on the page for the authority. <a
-href="/help/contact">Contact us</a> if there is a better address we can
-use.</p>
-<p>Requests are sometimes not delivered because they are quietly removed by
-"spam filters" in the IT department of the authority. Authorities can make
-sure this doesn't happen by asking their IT departments to "whitelist"
-any email from <strong>@whatdotheyknow.com</strong>.
-If you <a href="/help/contact">ask us</a> we will resend any request,
-and/or give technical details of delivery so an IT department can chase
-up what happened to the message.
-</p>
-<p>Finally, you can respond to any request from your web browser, without
-needing any email, using the "respond to request" link at the bottom of
-each request page.
-</dd>
-
-<dt id="days">How do you calculate the deadline shown on request pages?<a href="#days">#</a> </dt>
-
-<dd>
-<p>The Freedom of Information Act says:</p>
-
-<blockquote><p>A public authority must comply with section 1(1) <strong>promptly</strong> and
-in any event not later than the twentieth working day following the date of
-receipt.</p></blockquote>
-
-<p>The nerdy detail of exactly how weekends are counted, and what happens if
-the request arrives out of office hours, is just that - detail. What matters
-here is that the law says authorities must respond <strong>promptly</strong>.</p>
-
-<p>If you've got a good reason why the request is going to take a while to
-process, requesters find it really helpful if you can send a quick email with a
-sentence or two saying what is happening. </p>
-
-<p>FOI officers often have to do a lot of <strong>hard work</strong> to answer
-requests, and this is hidden from the public. We think it would help everyone
-to have more of that complexity visible.</p>
-
-</dd>
-
-<dt id="days2">But really, how do you calculate the deadline?<a href="#days2">#</a> </dt>
-
-<dd>
-
-<p>Please read the answer to the previous question first. Legally, authorities
-must respond <strong>promptly</strong> to FOI requests. If they fail to do that,
-it is best if they show the hard work they are doing by explaining what is
-taking the extra time to do.
-</p>
-
-<p>That said, <%= site_name %> does show the maximum legal deadline
-for response on each request. Here's how we calculate it.</p>
-
-<ul>
-
-<li>If the day we deliver the request by email is a working day, we count that
-as "day zero", even if it was delivered late in the evening. Days end at
-midnight. We then count the next working day as "day one", and so on up to
-<strong>20 working days</strong>.</li>
-
-<li>If the day the request email was delivered was a non-working day, we count
-the next working day as "day one". Delivery is delivery, even if it happened on
-the weekend. Some authorities
-<a href="http://www.whatdotheyknow.com/request/policy_regarding_body_scans#incoming-1100">disagree with this</a>,
-our lawyer disagrees with them. </li>
-
-<li>Requesters are encouraged to mark when they have <strong>clarified</strong>
-their request so the clock resets, but sometimes they get this wrong. If you
-see a problem with a particular request, let us know and we'll fix it.</li>
-</ul>
-
-<p>The date thus calculated is shown on requests with the text "By law,
-Liverpool City Council should normally have responded by...". There is only
-one case which is not normal, see the next question about
-<a href="#public_interest_test">public interest test time extensions</a>.
-</p>
-
-<p>Schools are also a special case, which <%= site_name %> displays differently.
-</p>
-
-<ul>
-<li>Since June 2009, <strong>schools</strong> have "20 working days
-disregarding any working day which is not a school day, or 60 working days,
-whichever is first" (<a href="http://www.opsi.gov.uk/si/si2009/draft/ukdsi_9780111477632_en_1">FOI (Time for Compliance with Request) Regulations 2009</a>). <%= site_name %> indicates on requests to schools that the 20 day deadline is only
-during term time, and shows them as definitely overdue after 60 working days
-</li>
-</ul>
-
-<p>If you're getting really nerdy about all this, read the <a href="http://www.ico.gov.uk/upload/documents/library/freedom_of_information/detailed_specialist_guides/timeforcompliance.pdf">detailed ICO guidance</a>.
-Meanwhile, remember that the law says authorities must respond
-<strong>promptly</strong>. That's really what matters.</p>
-
-</dd>
-
-<dt id="public_interest_test">How do you reflect time extensions for public interest tests?<a href="#public_interest_test">#</a> </dt>
-
-<dd>
-
-<p>The Freedom of Information Act lets authorities claim an indefinite time
-extension when applying a <strong>public interest test</strong>. Information
-Commissioner guidance says that it should only be used in "exceptionally
-complex" cases
-(<a href="http://www.ico.gov.uk/upload/documents/library/freedom_of_information/detailed_specialist_guides/foi_good_practice_guidance_4.pdf">FOI Good Practice Guidance No. 4</a>).
-<%= site_name %> doesn't specifically handle this case, which is why we use the
-phrase "should normally have responded by" when the 20 working day time is
-exceeded.
-</p>
-
-<p>The same guidance says that, even in exceptionally complex cases, no
-Freedom of Information request should take more than <strong>40 working days</strong>
-to answer. <%= site_name %> displays requests which are overdue by that much
-with stronger wording to indicate they are definitely late.
-</p>
+<div id="left_column_flip">
+ <h1 id="officers"><%= @title %> <a href="#officers">#</a> </h1>
+
+ <dl>
+
+ <dt id="top">I just got here from bottom of an FOI request, what is going on? <a href="#top">#</a> </dt>
+
+ <dd><p>WhatDoTheyKnow is a service run by a charity. It helps ordinary members
+ of the public make FOI requests, and easily track and share the responses.</p>
+
+ <p>The FOI request you received was made by someone using WhatDoTheyKnow. You can
+ simply reply to the request as you would any other request from an individual.
+ The only difference is that your response will be automatically published on
+ the Internet.
+ </p>
+ <p>If you have privacy or other concerns, please read the answers below.
+ You might also like to read the <a
+ href="/help/about">introduction to WhatDoTheyKnow</a> to find out more about what
+ the site does from the point of view of a user. You can also search the
+ site to find the authority that you work for, and view the status of
+ any requests made using the site.
+
+ <p>Finally, we welcome comments and
+ thoughts from FOI officers, please <a href="/help/contact">get in touch</a>.
+ </p>
+ </dd>
+
+ <dt id="responses">Why are you publishing responses to FOI requests? <a href="#responses">#</a> </dt>
+
+ <dd>We think there are lots of benefits. Most importantly it will encourage the
+ public to be more interested and involved in the work of government. We
+ also hope that it will reduce the number of duplicate requests on any
+ subject that a public body will receive. Given that Freedom of Information
+ responses contain public information, which anybody could easily request
+ again from the public authority, we think there should be no reason not to
+ publish it widely.
+ </dd>
+
+ <dt id="realpeople">Are the people making requests real people? <a href="#realpeople">#</a> </dt>
+
+ <dd>Yes. For the purposes of keeping track of responses we use
+ computer-generated email addresses for each request. However, before
+ they can send a request, each user must register on the site with a
+ unique email address that we then verify. You can search this site and
+ find a page listing all requests that each person has made.
+ </dd>
+
+ <dt id="email_only">An email isn't a sufficient address for an FOI request! <a href="#email_only">#</a> </dt>
+
+ <dd>Yes it is. This
+ <a href="http://www.whatdotheyknow.com/request/1142/response/2894/attach/5/20080806100741260.pdf">letter from the ICO to Rother District Council</a> gives guidance on the matter, specifically
+ in the context of requests made via WhatDoTheyKnow.
+ </dd>
+
+ <dt id="vexatious">Aren't you making lots of vexatious requests? <a href="#vexatious">#</a> </dt>
+
+ <dd><p>WhatDoTheyKnow is not making any requests. We are sending requests on
+ behalf of our users, who are real people making the requests. </p>
+ <p>Look at it like this - if lots of different people made requests from
+ different Hotmail email addresses, then you would not think that Microsoft were
+ making vexatious requests. It is exactly the same if lots of requests are made
+ via WhatDoTheyKnow. Moreover, since all requests are public it is much easier
+ for you to see if one of our users is making vexatious requests. </p>
+ <p>If that isn't enough for you, the
+ <a href="http://www.whatdotheyknow.com/request/1142/response/2894/attach/5/20080806100741260.pdf">letter from the ICO to Rother District Council</a> gives some guidance on the matter.</p>
+ </dd>
+
+ <dt id="spam_problems">I can see a request on WhatDoTheyKnow, but we never got it by email!<a href="#spam_problems">#</a> </dt>
+
+ <dd><p>If a request appears on the site, then we have attempted to send it to
+ the authority by email. Any delivery failure messages will automatically
+ appear on the site. You can check the address we're using with the "View FOI
+ email address" link which appears on the page for the authority. <a
+ href="/help/contact">Contact us</a> if there is a better address we can
+ use.</p>
+ <p>Requests are sometimes not delivered because they are quietly removed by
+ "spam filters" in the IT department of the authority. Authorities can make
+ sure this doesn't happen by asking their IT departments to "whitelist"
+ any email from <strong>@whatdotheyknow.com</strong>.
+ If you <a href="/help/contact">ask us</a> we will resend any request,
+ and/or give technical details of delivery so an IT department can chase
+ up what happened to the message.
+ </p>
+ <p>Finally, you can respond to any request from your web browser, without
+ needing any email, using the "respond to request" link at the bottom of
+ each request page.
+ </dd>
+
+ <dt id="days">How do you calculate the deadline shown on request pages?<a href="#days">#</a> </dt>
+
+ <dd>
+ <p>The Freedom of Information Act says:</p>
+
+ <blockquote><p>A public authority must comply with section 1(1) <strong>promptly</strong> and
+ in any event not later than the twentieth working day following the date of
+ receipt.</p></blockquote>
+
+ <p>The nerdy detail of exactly how weekends are counted, and what happens if
+ the request arrives out of office hours, is just that - detail. What matters
+ here is that the law says authorities must respond <strong>promptly</strong>.</p>
+
+ <p>If you've got a good reason why the request is going to take a while to
+ process, requesters find it really helpful if you can send a quick email with a
+ sentence or two saying what is happening. </p>
+
+ <p>FOI officers often have to do a lot of <strong>hard work</strong> to answer
+ requests, and this is hidden from the public. We think it would help everyone
+ to have more of that complexity visible.</p>
+
+ </dd>
+
+ <dt id="days2">But really, how do you calculate the deadline?<a href="#days2">#</a> </dt>
+
+ <dd>
+
+ <p>Please read the answer to the previous question first. Legally, authorities
+ must respond <strong>promptly</strong> to FOI requests. If they fail to do that,
+ it is best if they show the hard work they are doing by explaining what is
+ taking the extra time to do.
+ </p>
+
+ <p>That said, WhatDoTheyKnow does show the maximum legal deadline
+ for response on each request. Here's how we calculate it.</p>
+
+ <ul>
+
+ <li>If the day we deliver the request by email is a working day, we count that
+ as "day zero", even if it was delivered late in the evening. Days end at
+ midnight. We then count the next working day as "day one", and so on up to
+ <strong>20 working days</strong>.</li>
+
+ <li>If the day the request email was delivered was a non-working day, we count
+ the next working day as "day one". Delivery is delivery, even if it happened on
+ the weekend. Some authorities <a href="http://www.whatdotheyknow.com/request/policy_regarding_body_scans#incoming-1100">disagree with this</a>, our lawyer disagrees with them. </li>
+
+ <li>Requesters are encouraged to mark when they have <strong>clarified</strong>
+ their request so the clock resets, but sometimes they get this wrong. If you
+ see a problem with a particular request, let us know and we'll fix it.</li>
+ </ul>
+
+ <p>The date thus calculated is shown on requests with the text "By law,
+ Liverpool City Council should normally have responded by...". There is only
+ one case which is not normal, see the next question about
+ <a href="#public_interest_test">public interest test time extensions</a>.
+ </p>
+
+ <p>Schools are also a special case, which WhatDoTheyKnow displays differently.
+ </p>
+
+ <ul>
+ <li>Since June 2009, <strong>schools</strong> have "20 working days
+ disregarding any working day which is not a school day, or 60 working days,
+ whichever is first" (<a href="http://www.opsi.gov.uk/si/si2009/draft/ukdsi_9780111477632_en_1">FOI (Time for Compliance with Request) Regulations 2009</a>). WhatDoTheyKnow indicates on requests to schools that the 20 day deadline is only
+ during term time, and shows them as definitely overdue after 60 working days
+ </li>
+ </ul>
+
+ <p>If you're getting really nerdy about all this, read the <a href="http://www.ico.gov.uk/upload/documents/library/freedom_of_information/detailed_specialist_guides/timeforcompliance.pdf">detailed ICO guidance</a>.
+ Meanwhile, remember that the law says authorities must respond
+ <strong>promptly</strong>. That's really what matters.</p>
+
+ </dd>
+
+ <dt id="public_interest_test">How do you reflect time extensions for public interest tests?<a href="#public_interest_test">#</a> </dt>
+
+ <dd>
+
+ <p>The Freedom of Information Act lets authorities claim an indefinite time
+ extension when applying a <strong>public interest test</strong>. Information
+ Commissioner guidance says that it should only be used in "exceptionally
+ complex" cases
+ (<a href="http://www.ico.gov.uk/upload/documents/library/freedom_of_information/detailed_specialist_guides/foi_good_practice_guidance_4.pdf">FOI Good Practice Guidance No. 4</a>).
+ WhatDoTheyKnow doesn't specifically handle this case, which is why we use the
+ phrase "should normally have responded by" when the 20 working day time is
+ exceeded.
+ </p>
+
+ <p>The same guidance says that, even in exceptionally complex cases, no
+ Freedom of Information request should take more than <strong>40 working days</strong>
+ to answer. WhatDoTheyKnow displays requests which are overdue by that much
+ with stronger wording to indicate they are definitely late.
+ </p>
-<p>The Freedom of Information (Scotland) Act does not allow such a public
-interest extension. <%= site_name %> would like to see the law changed to either
-remove the extension from the UK Act, or to reintroduce an absolute time limit
-of 40 working days even with the extension (the House of Lords <a
-href="http://www.publicwhip.org.uk/division.php?date=2000-10-17&amp;number=1&amp;house=lords">voted
-to remove</a> provision for such a time limit during the initial passage
-of the UK Act through Parliament).
-</p>
-</dd>
-
-<dt id="large_file">How can I send a large file, which won't go by email?<a href="#large_file">#</a> </dt>
+ <p>The Freedom of Information (Scotland) Act does not allow such a public
+ interest extension. WhatDoTheyKnow would like to see the law changed to either
+ remove the extension from the UK Act, or to reintroduce an absolute time limit
+ of 40 working days even with the extension (the House of Lords <a
+ href="http://www.publicwhip.org.uk/division.php?date=2000-10-17&amp;number=1&amp;house=lords">voted
+ to remove</a> provision for such a time limit during the initial passage
+ of the UK Act through Parliament).
+ </p>
+ </dd>
-<dd>Instead of email, you can respond to a request directly from your web
-browser, including uploading a file. To do this, choose "respond to request" at
-the bottom of the request's page. <a href="/help/contact">Contact us</a> if it
-is too big for even that (more than, say, 50Mb).
-</dd>
-
-<dt id="names">Why do you publish the names of civil servants and the text of emails? <a href="#names">#</a> </dt>
+ <dt id="large_file">How can I send a large file, which won't go by email?<a href="#large_file">#</a> </dt>
-<dd>We consider what officers or servants do in the course of their employment
-to be public information. We will only remove content in exceptional
-circumstances, see our <a href="/help/privacy#takedown">take down policy</a>.
-</dd>
-
-<dt id="mobiles">Do you publish email addresses or mobile phone numbers? <a href="#mobiles">#</a> </dt>
-
-<dd><p>To prevent spam, we automatically remove most emails and some mobile numbers from
-responses to requests. Please <a href="/help/contact">contact us</a> if we've
-missed one.
-For technical reasons we don't always remove them from attachments, such as certain PDFs.</p>
-<p>If you need to know what an address was that we've removed, please <a
- href="/help/contact">get in touch with us</a>. Occasionally, an email address
-forms an important part of a response and we will post it up in an obscured
-form in an annotation.
-</dd>
-
-<dt id="copyright"><a name="commercial"></a>What is your policy on copyright of documents?<a href="#copyright">#</a> </dt>
-
-<dd>Our Freedom of Information law is "applicant blind", so anyone in the
-world can request the same document and get a copy of it.
-
-If you think our making a document available on the internet infringes your
-copyright, you may <a href="/help/contact">contact us</a> and ask us
-to take it down. However, to save tax payers' money by preventing duplicate
-requests, and for good public relations, we'd advise you not to do that.
-</dd>
-
-</dl>
-
-
-</dl>
-
-<p><strong>If you haven't already</strong>, read <a href="/help/about">the introduction</a> --&gt;
-<br><strong>Otherwise</strong>, the <a href="/help/credits">credits</a> or the <a href="/help/api">programmers API</a> --&gt;
-
-<div id="hash_link_padding"></div>
+ <dd>Instead of email, you can respond to a request directly from your web
+ browser, including uploading a file. To do this, choose "respond to request" at
+ the bottom of the request's page. <a href="/help/contact">Contact us</a> if it
+ is too big for even that (more than, say, 50Mb).
+ </dd>
+
+ <dt id="names">Why do you publish the names of civil servants and the text of emails? <a href="#names">#</a> </dt>
+
+ <dd>We consider what officers or servants do in the course of their employment
+ to be public information. We will only remove content in exceptional
+ circumstances, see our <a href="/help/privacy#takedown">take down policy</a>.
+ </dd>
+
+ <dt id="mobiles">Do you publish email addresses or mobile phone numbers? <a href="#mobiles">#</a> </dt>
+
+ <dd><p>To prevent spam, we automatically remove most emails and some mobile numbers from
+ responses to requests. Please <a href="/help/contact">contact us</a> if we've
+ missed one.
+ For technical reasons we don't always remove them from attachments, such as certain PDFs.</p>
+ <p>If you need to know what an address was that we've removed, please <a
+ href="/help/contact">get in touch with us</a>. Occasionally, an email address
+ forms an important part of a response and we will post it up in an obscured
+ form in an annotation.
+ </dd>
+
+ <dt id="copyright"><a name="commercial"></a>What is your policy on copyright of documents?<a href="#copyright">#</a> </dt>
+
+ <dd>Our Freedom of Information law is "applicant blind", so anyone in the
+ world can request the same document and get a copy of it.
+
+ If you think our making a document available on the internet infringes your
+ copyright, you may <a href="/help/contact">contact us</a> and ask us
+ to take it down. However, to save tax payers' money by preventing duplicate
+ requests, and for good public relations, we'd advise you not to do that.
+ </dd>
+
+ </dl>
+
+
+ </dl>
+
+ <p><strong>If you haven't already</strong>, read <a href="/help/about">the introduction</a> --&gt;
+ <br><strong>Otherwise</strong>, the <a href="/help/credits">credits</a> or the <a href="/help/api">programmers API</a> --&gt;
+
+ <div id="hash_link_padding"></div>
+</div>
diff --git a/app/views/help/privacy.rhtml b/app/views/help/privacy.rhtml
index fc8c54885..bec0c8c23 100644
--- a/app/views/help/privacy.rhtml
+++ b/app/views/help/privacy.rhtml
@@ -2,54 +2,54 @@
<%= render :partial => 'sidebar' %>
-<h1 id="privacy"><%= @title %> <a href="#privacy">#</a> </h1>
-
-<dl>
-
-<dt id="email_address">Who gets to see my email address? <a href="#email_address">#</a> </dt>
-
-<dd><p>We will not disclose your email address to anyone unless we are obliged to by law,
-or you ask us to. This includes the public authority that you are sending a
-request to. They only get to see an email address
-@whatdotheyknow.com which is specific to that request. </p>
-<p>If you send a message to another user on the site, then it will reveal your
-email address to them. You will be told that this is going to happen.</p>
-</dd>
-
-<dt id="nasty_spam">Will you send nasty, brutish spam to my email address? <a href="#nasty_spam">#</a> </dt>
-<dd>Nope. After you sign up to <%= site_name %> we will only send you emails
-relating to a request you made, an email alert that you have signed up for,
-or for other reasons that you specifically authorise. We will never give or
-sell your email addresses to anyone else, unless we are obliged to by law, or
-you ask us to.
-</dd>
-
-<dt id="public_request">Why will my name and my request appear publicly on the site? <a href="#public_request">#</a> </dt>
-
-<dd>
-<p>We publish your request on the Internet so that anybody can read it and
-make use of the information that you have found. We do not normally delete
-requests (<a href="#delete_requests">more details</a>).
-</p>
-<p>
-Your name is tangled up with your request, so has to be published as well.
-It is only fair, as we're going to publish the name of the civil servant who
-writes the response to your request. Using your real name also helps people
-get in touch with you to assist you with your research or to campaign with you.
-</p>
-<p>By law, you must use your real name for the request to be a valid Freedom of
-Information request. See the next question for alternatives if you do not want
-to publish your full name.
-</p>
-</dd>
-
-<dt id="real_name">Can I make an FOI request using a pseudonym? <a href="#real_name">#</a> </dt>
-
-
-<dd>
-<p>Technically, you must use your real name for your request to be a valid Freedom of Information request in law. See this
-<a href="http://www.ico.gov.uk/upload/documents/library/freedom_of_information/detailed_specialist_guides/name_of_applicant_fop083_v1.pdf">guidance from the Information Commissioner</a> (January 2009).
-</p>
+<div id="left_column_flip">
+ <h1 id="privacy"><%= @title %></h1>
+ <dl>
+
+ <dt id="email_address">Who gets to see my email address? <a href="#email_address">#</a> </dt>
+
+ <dd><p>We will not disclose your email address to anyone unless we are obliged to by law,
+ or you ask us to. This includes the public authority that you are sending a
+ request to. They only get to see an email address
+ @whatdotheyknow.com which is specific to that request. </p>
+ <p>If you send a message to another user on the site, then it will reveal your
+ email address to them. You will be told that this is going to happen.</p>
+ </dd>
+
+ <dt id="nasty_spam">Will you send nasty, brutish spam to my email address? <a href="#nasty_spam">#</a> </dt>
+ <dd>Nope. After you sign up to WhatDoTheyKnow we will only send you emails
+ relating to a request you made, an email alert that you have signed up for,
+ or for other reasons that you specifically authorise. We will never give or
+ sell your email addresses to anyone else, unless we are obliged to by law, or
+ you ask us to.
+ </dd>
+
+ <dt id="public_request">Why will my name and my request appear publicly on the site? <a href="#public_request">#</a> </dt>
+
+ <dd>
+ <p>We publish your request on the Internet so that anybody can read it and
+ make use of the information that you have found. We do not normally delete
+ requests (<a href="#delete_requests">more details</a>).
+ </p>
+ <p>
+ Your name is tangled up with your request, so has to be published as well.
+ It is only fair, as we're going to publish the name of the civil servant who
+ writes the response to your request. Using your real name also helps people
+ get in touch with you to assist you with your research or to campaign with you.
+ </p>
+ <p>By law, you must use your real name for the request to be a valid Freedom of
+ Information request. See the next question for alternatives if you do not want
+ to publish your full name.
+ </p>
+ </dd>
+
+ <dt id="real_name">Can I make an FOI request using a pseudonym? <a href="#real_name">#</a> </dt>
+
+
+ <dd>
+ <p>Technically, you must use your real name for your request to be a valid Freedom of Information request in law. See this
+ <a href="http://www.ico.gov.uk/upload/documents/library/freedom_of_information/detailed_specialist_guides/name_of_applicant_fop083_v1.pdf">guidance from the Information Commissioner</a> (January 2009).
+ </p>
<p>However, the same guidance also says it is good practice for the public
authority to still consider a request made using an obvious pseudonym.
@@ -179,6 +179,6 @@ that authorities resend these with the personal information removed.</p>
<p><strong>Learn more</strong> from the help for <a href="/help/officers">FOI officers</a> --&gt;
-<div id="hash_link_padding"></div>
-
+ <div id="hash_link_padding"></div>
+</div>
diff --git a/app/views/help/requesting.rhtml b/app/views/help/requesting.rhtml
index eec887950..af8f2e45d 100644
--- a/app/views/help/requesting.rhtml
+++ b/app/views/help/requesting.rhtml
@@ -1,293 +1,293 @@
<% @title = "Making requests" %>
<%= render :partial => 'sidebar' %>
-
-<h1 id="making_requests"><%= @title %> <a href="#making_requests">#</a> </h1>
-<dl>
-
-<dt id="which_authority">I'm not sure which authority to make my request to, how can I find out? <a href="#which_authority">#</a> </dt>
-
-<dd>
-<p>It can be hard to untangle government's complicated structured, and work out
-who knows the information that you want. Here are a few tips:
-<ul>
-<li>Browse or search <%= site_name %> looking for similar requests to yours.</li>
-<li>When you've found an authority you think might have the information, use
-the "home page" link on the right hand side of their page to check what they do
-on their website.</li>
-<li>Contact the authority by phone or email to ask if they hold the kind of
-information you're after.</li>
-<li>Don't worry excessively about getting the right authority. If you get it
-wrong, they ought to advise you who to make the request to instead.
-</li>
-<li>If you've got a thorny case, please <a href="/help/contact">contact us</a> for help.</li>
-</ul>
-
-</dd>
-
-
-
-<dt id="missing_body">You're missing the public authority that I want to request from! <a href="#missing_body">#</a> </dt>
-
-<dd>
-<p>Please <a href="/help/contact">contact us</a> with the name of the public authority and,
-if you can find it, their contact email address for Freedom of Information requests.
-</p>
-<p>If you'd like to help add a whole category of public authority to the site, we'd love
-to hear from you too.
-</p>
-
-</dd>
-
-<dt id="authorities">Why do you include some authorities that aren't formally subject to FOI?<a href="#authorities">#</a> </dt>
-
-<dd>
-<p><%= site_name %> lets you make requests for information to a range of
-organisations:</p>
-
-<ul>
- <li> Those formally subject to the FOI Act</li>
- <li> Those formally subject to the Environmental Regulations (a less well
- defined group)</li>
- <li> Those which voluntarily comply with the FOI Act</li>
- <li> Those which aren't subject to the Act but we think should be, on grounds
- such as them having significant public responsibilities.
+<div id="left_column_flip">
+ <h1 id="making_requests"><%= @title %></h1>
+ <dl>
+
+ <dt id="which_authority">I'm not sure which authority to make my request to, how can I find out? <a href="#which_authority">#</a> </dt>
+
+ <dd>
+ <p>It can be hard to untangle government's complicated structured, and work out
+ who knows the information that you want. Here are a few tips:
+ <ul>
+ <li>Browse or search WhatDoTheyKnow looking for similar requests to yours.</li>
+ <li>When you've found an authority you think might have the information, use
+ the "home page" link on the right hand side of their page to check what they do
+ on their website.</li>
+ <li>Contact the authority by phone or email to ask if they hold the kind of
+ information you're after.</li>
+ <li>Don't worry excessively about getting the right authority. If you get it
+ wrong, they ought to advise you who to make the request to instead.
</li>
-</ul>
-
-<p>In the last case, we're using the site to lobby for expansion of the
-scope of the FOI Act. Even if an organisation is not legally obliged to respond
-to an FOI request, they can still do so voluntarily.
-</p>
-
-</dd>
-
-<dt id="focused">Why must I keep my request focused?<a href="#focused">#</a> </dt>
-
-<dd>
+ <li>If you've got a thorny case, please <a href="/help/contact">contact us</a> for help.</li>
+ </ul>
-<p>
-Please put in your request only what is needed so that someone can
-easily identify what information you are asking for. Please do
-<i>not</i> include any of the following:
-</p>
+ </dd>
-<ul>
-<li>arguments about your cause</li>
-<li>statements that could defame or insult others</li>
-</ul>
-<p>
-If you do, we may have to remove your request to avoid problems with
-libel law, which is a pain for both you and us. Short, succinct messages
-make it easier for authorities to be clear what information you are
-requesting, which means you will get a reply more quickly.
-</p>
-<p>
-If you want information to support an argument or campaign, Freedom of
-Information is a powerful tool. Although you may not use this site to
-run your campaign, we encourage you to use it to get the information you
-need. We also encourage to run your campaign elsewhere - one effective
-and very easy way is to <%= link_to 'start your own blog',
-"http://wordpress.com/"%>. You are welcome to link to your campaign
-from this site in an annotation to your request (you can make
-annotations after submitting the request).
-</p>
+ <dt id="missing_body">You're missing the public authority that I want to request from! <a href="#missing_body">#</a> </dt>
-</dd>
+ <dd>
+ <p>Please <a href="/help/contact">contact us</a> with the name of the public authority and,
+ if you can find it, their contact email address for Freedom of Information requests.
+ </p>
+ <p>If you'd like to help add a whole category of public authority to the site, we'd love
+ to hear from you too.
+ </p>
-<dt id="fees">Does it cost me anything to make a request?<a href="#fees">#</a> </dt>
+ </dd>
-<dd>
+ <dt id="authorities">Why do you include some authorities that aren't formally subject to FOI?<a href="#authorities">#</a> </dt>
-<p>Making an FOI request is nearly always free.</p>
+ <dd>
+ <p>WhatDoTheyKnow lets you make requests for information to a range of
+ organisations:</p>
-<p>Authorities often include unnecessary, scary, boilerplate in
-acknowledgement messages saying they "may" charge a fee. Ignore such notices.
-They hardly ever will actually charge a fee. If they do, they can only charge you if
-you have specifically agreed in advance to pay. <a
- href="http://www.ico.gov.uk/upload/documents/library/freedom_of_information/practical_application/chargingafee.pdf">More
- details</a> from the Information Commissioner.
-</p>
-
-<p>Sometimes an authority will refuse your request, saying that the cost
-of handling it exceeds £600 (for central government) or £450 (for all other
-public authorities). At this point you can refine your
-request. e.g. it would be much cheaper for an authority to tell you the amount
-spent on marshmallows in the past year than in the past ten years.
-</p>
-
-</dd>
-
-
-
-<dt id="quickly_response">How quickly will I get a response? <a href="#quickly_response">#</a> </dt>
-
-<dd>
-<p>By law, public authorities must respond <strong>promptly</strong> to
-requests.
-</p>
-
-<p>Even if they are not prompt, in nearly all cases they must respond within
-20 working days. If you had to clarify your request, or they are a school,
-or one or two other cases, then they may have more time
-(<a href="/help/officers#days">full details</a>).
-
-<p><%= site_name %> will email you if you don't get a timely response. You can
-then send the public authority a message to remind them, and tell them if they
-are breaking the law.</p>
-
-</dd>
-
-<dt id="deadline_extended">Deadline extended <a href="#deadline_extended">#</a> </dt>
-
-<dd>
-<p>By law, public authorities must needs <strong>more time</strong> for request ... (TO DO)
-</p>
-
-
-</dd>
-<dt id="no_response">What if I never get a response?<a href="#no_response">#</a> </dt>
-
-<dd>
-<p>There are several things you can do if you never get a response.</p>
-<ul>
- <li>Sometimes there has been a genuine problem and the authority never
- received the request. It is worth telephoning the authority and politely
- checking that they received the request. It was sent to them by email.
- </li>
- <li>If they have not received it, the problem is most likely due to
- "spam filters". Refer the authority to the measures in the answer
- '<a href="/help/officers#spam_problems">I can see a request on <%= site_name %>, but we never got it by email!</a>'
- in the FOI officers section of this help.
+ <ul>
+ <li> Those formally subject to the FOI Act</li>
+ <li> Those formally subject to the Environmental Regulations (a less well
+ defined group)</li>
+ <li> Those which voluntarily comply with the FOI Act</li>
+ <li> Those which aren't subject to the Act but we think should be, on grounds
+ such as them having significant public responsibilities.
</li>
- <li>If you're still having no luck, then you can ask for an internal review,
- and then complain to the Information Commissioner about the authority.
- Read our page '<a href="/help/unhappy">Unhappy about the response you got?</a>'.
-</ul>
-</dd>
-
-<dt id="not_satifised">What if I'm not satisfied with the response? <a href="#not_satifised">#</a> </dt>
-<dd>If you didn't get the information you asked for, or you didn't get it in time,
-then read our page '<a href="/help/unhappy">Unhappy about the response you got?</a>'.
-</dd>
-
-<dt id="reuse">It says I can't re-use the information I got!<a href="#reuse">#</a> </dt>
-<dd>
-<p>Authorities often add legal boilerplate about the
-"<a href="http://www.opsi.gov.uk/si/si2005/20051515">Re-Use of Public Sector
-Information Regulations 2005</a>", which at first glance implies you may not
-be able do anything with the information.
-</p>
-
-<p>You can, of course, write articles about the information or summarise it, or
-quote parts of it. We also think you should feel free to republish the
-information in full, just as we do, even though in theory you might not be
-allowed to do so. See <a href="/help/officers#copyright">our policy on copyright</a>.</p>
-
-</dd>
-
-<dt id="ico_help">Can you tell me more of the nitty gritty about the process of making requests? <a href="#ico_help">#</a> </dt>
-
-<dd>
-<p>Have a look at the
-<a href="http://www.ico.gov.uk/for_the_public/access_to_official_information.aspx">access to official information</a>
-pages on the Information Commissioner's website.</p>
-
-<p>If you're requesting information from a Scottish public authority,
-the process is very similar. There are differences around time
-limits for compliance.
-See the <a href="http://www.itspublicknowledge.info/nmsruntime/saveasdialog.asp?lID=1858&amp;sID=321">Scottish
-Information Commissioner's guidance</a> for details.</p>
-</dd>
-
-<dt id="data_protection">Can I request information about myself? <a href="#data_protection">#</a> </dt>
-
-<dd>
-<p>No. Requests made using <%= site_name %> are public, made under the Freedom of
-Information Act, and cannot help you find information about a private
-individual.</p>
-
-<p>If you would like to know what information a public
-authority holds about yourself, you should make a "Subject Access Request" in
-private using Data Protection law. The leaflet "<a
-href="http://www.ico.gov.uk/upload/documents/library/data_protection/introductory/subject_access_rights.pdf">How to access your information</a>" (on the Information Commissioner's
-website) explains how to do this.</p>
-
-<p>If you see that somebody has included personal information, perhaps
-unwittingly, in a request, please <a href="/help/contact">contact us</a>
-immediately so we can remove it.</p>
-</dd>
-
-
-<dt id="private_requests">I'd like to keep my request secret! (At least until I publish my story) <a href="#private_requests">#</a> </dt>
-
-<dd><p><%= site_name %> is currently only designed for public requests. All
-responses that we receive are automatically published on the website for anyone
-to read. </p>
-<p>You should contact the public authority directly if you would like to
-make a request in private. If you're interested in buying a system which helps
-you manage FOI requests in secret, then <a href="/help/contact">contact us</a>.
-</p>
-</dd>
-
-<dt id="eir">Why can I only request information about the environment from some authorities? <a href="#eir">#</a> </dt>
-
-<dd>
-<p>Some public authorities, such as <a href="http://www.whatdotheyknow.com/body/south_east_water">South East Water</a>,
-don't come under the Freedom of Information Act, but do come under another law called
-the Environmental Information Regulations (EIR).
-</p>
-
-<p>It's a very similar law, so you make a request
-to them using <%= site_name %> in just the same way as an FOI request. The only
-difference is that on the page where your write you request, it reminds you
-that you can only request "environmental information" and tells you what that
-means. It is quite broad.
-</p>
-
-<p>You can, of course, request environmental information from other
-authorities. Just make a Freedom of Information (FOI) request as normal. The
-authority has a duty to work out if the Environmental Information Regulations
-(EIR) is the more appropriate legislation to reply under.
-</p>
-</dd>
-
-<dt id="multiple">Can I make the same to request to lots of authorities, e.g. all councils? <a href="#multiple">#</a> </dt>
-
-<dd>We ask you to first send a test version of your request to a few
-authorities. Their responses will help you improve the wording of your request,
-so that you get the best information when you send the request to all of
-the authorities. There is currently no automated system for sending the request
-to the other authorities, you must copy and paste it by hand.
-
-</dd>
-
-<dt id="offsite">I made a request off the site, how do I upload it to the archive?<a href="#offsite">#</a> </dt>
-
-<dd><%= site_name %> is an archive of requests made through the site,
-and does not try to be an archive of all FOI requests. We'll never support uploading
-other requests. For one thing, we wouldn't be able to verify that other
-responses actually came from the authority. If this really matters to you,
-you can always make the same request again via <%= site_name %>.
-</dd>
-
-<dt id="moderation">How do you moderate request annotations? <a href="#moderation">#</a> </dt>
-
-<dd>
-<p>Annotations on <%= site_name %> are to help
-people get the information they want, or to give them pointers to places they
-can go to help them act on it. We reserve the right to remove anything else.
-</p>
-<p>Endless, political discussions are not allowed.
-Post a link to a suitable forum or campaign site elsewhere.</p>
-<dd>
+ </ul>
-</dl>
+ <p>In the last case, we're using the site to lobby for expansion of the
+ scope of the FOI Act. Even if an organisation is not legally obliged to respond
+ to an FOI request, they can still do so voluntarily.
+ </p>
-<p><strong>Next</strong>, read about <a href="/help/privacy">your privacy</a> --&gt;
+ </dd>
-<div id="hash_link_padding"></div>
+ <dt id="focused">Why must I keep my request focused?<a href="#focused">#</a> </dt>
+ <dd>
+
+ <p>
+ Please put in your request only what is needed so that someone can
+ easily identify what information you are asking for. Please do
+ <i>not</i> include any of the following:
+ </p>
+
+ <ul>
+ <li>arguments about your cause</li>
+ <li>statements that could defame or insult others</li>
+ </ul>
+
+ <p>
+ If you do, we may have to remove your request to avoid problems with
+ libel law, which is a pain for both you and us. Short, succinct messages
+ make it easier for authorities to be clear what information you are
+ requesting, which means you will get a reply more quickly.
+ </p>
+
+ <p>
+ If you want information to support an argument or campaign, Freedom of
+ Information is a powerful tool. Although you may not use this site to
+ run your campaign, we encourage you to use it to get the information you
+ need. We also encourage to run your campaign elsewhere - one effective
+ and very easy way is to <%= link_to 'start your own blog',
+ "http://wordpress.com/"%>. You are welcome to link to your campaign
+ from this site in an annotation to your request (you can make
+ annotations after submitting the request).
+ </p>
+
+ </dd>
+
+ <dt id="fees">Does it cost me anything to make a request?<a href="#fees">#</a> </dt>
+
+ <dd>
+
+ <p>Making an FOI request is nearly always free.</p>
+
+ <p>Authorities often include unnecessary, scary, boilerplate in
+ acknowledgement messages saying they "may" charge a fee. Ignore such notices.
+ They hardly ever will actually charge a fee. If they do, they can only charge you if
+ you have specifically agreed in advance to pay. <a
+ href="http://www.ico.gov.uk/upload/documents/library/freedom_of_information/practical_application/chargingafee.pdf">More
+ details</a> from the Information Commissioner.
+ </p>
+
+ <p>Sometimes an authority will refuse your request, saying that the cost
+ of handling it exceeds £600 (for central government) or £450 (for all other
+ public authorities). At this point you can refine your
+ request. e.g. it would be much cheaper for an authority to tell you the amount
+ spent on marshmallows in the past year than in the past ten years.
+ </p>
+
+ </dd>
+
+
+
+ <dt id="quickly_response">How quickly will I get a response? <a href="#quickly_response">#</a> </dt>
+
+ <dd>
+ <p>By law, public authorities must respond <strong>promptly</strong> to
+ requests.
+ </p>
+
+ <p>Even if they are not prompt, in nearly all cases they must respond within
+ 20 working days. If you had to clarify your request, or they are a school,
+ or one or two other cases, then they may have more time
+ (<a href="/help/officers#days">full details</a>).
+
+ <p>WhatDoTheyKnow will email you if you don't get a timely response. You can
+ then send the public authority a message to remind them, and tell them if they
+ are breaking the law.</p>
+
+ </dd>
+
+ <dt id="deadline_extended">Deadline extended <a href="#deadline_extended">#</a> </dt>
+
+ <dd>
+ <p>By law, public authorities must needs <strong>more time</strong> for request ... (TO DO)
+ </p>
+
+
+ </dd>
+ <dt id="no_response">What if I never get a response?<a href="#no_response">#</a> </dt>
+
+ <dd>
+ <p>There are several things you can do if you never get a response.</p>
+ <ul>
+ <li>Sometimes there has been a genuine problem and the authority never
+ received the request. It is worth telephoning the authority and politely
+ checking that they received the request. It was sent to them by email.
+ </li>
+ <li>If they have not received it, the problem is most likely due to
+ "spam filters". Refer the authority to the measures in the answer
+ '<a href="/help/officers#spam_problems">I can see a request on WhatDoTheyKnow, but we never got it by email!</a>'
+ in the FOI officers section of this help.
+ </li>
+ <li>If you're still having no luck, then you can ask for an internal review,
+ and then complain to the Information Commissioner about the authority.
+ Read our page '<a href="/help/unhappy">Unhappy about the response you got?</a>'.
+ </ul>
+ </dd>
+
+ <dt id="not_satifised">What if I'm not satisfied with the response? <a href="#not_satifised">#</a> </dt>
+ <dd>If you didn't get the information you asked for, or you didn't get it in time,
+ then read our page '<a href="/help/unhappy">Unhappy about the response you got?</a>'.
+ </dd>
+
+ <dt id="reuse">It says I can't re-use the information I got!<a href="#reuse">#</a> </dt>
+ <dd>
+ <p>Authorities often add legal boilerplate about the
+ "<a href="http://www.opsi.gov.uk/si/si2005/20051515">Re-Use of Public Sector
+ Information Regulations 2005</a>", which at first glance implies you may not
+ be able do anything with the information.
+ </p>
+
+ <p>You can, of course, write articles about the information or summarise it, or
+ quote parts of it. We also think you should feel free to republish the
+ information in full, just as we do, even though in theory you might not be
+ allowed to do so. See <a href="/help/officers#copyright">our policy on copyright</a>.</p>
+
+ </dd>
+
+ <dt id="ico_help">Can you tell me more of the nitty gritty about the process of making requests? <a href="#ico_help">#</a> </dt>
+
+ <dd>
+ <p>Have a look at the
+ <a href="http://www.ico.gov.uk/for_the_public/access_to_official_information.aspx">access to official information</a>
+ pages on the Information Commissioner's website.</p>
+
+ <p>If you're requesting information from a Scottish public authority,
+ the process is very similar. There are differences around time
+ limits for compliance.
+ See the <a href="http://www.itspublicknowledge.info/nmsruntime/saveasdialog.asp?lID=1858&amp;sID=321">Scottish
+ Information Commissioner's guidance</a> for details.</p>
+ </dd>
+
+ <dt id="data_protection">Can I request information about myself? <a href="#data_protection">#</a> </dt>
+
+ <dd>
+ <p>No. Requests made using WhatDoTheyKnow are public, made under the Freedom of
+ Information Act, and cannot help you find information about a private
+ individual.</p>
+
+ <p>If you would like to know what information a public
+ authority holds about yourself, you should make a "Subject Access Request" in
+ private using Data Protection law. The leaflet "<a
+ href="http://www.ico.gov.uk/upload/documents/library/data_protection/introductory/subject_access_rights.pdf">How to access your information</a>" (on the Information Commissioner's
+ website) explains how to do this.</p>
+
+ <p>If you see that somebody has included personal information, perhaps
+ unwittingly, in a request, please <a href="/help/contact">contact us</a>
+ immediately so we can remove it.</p>
+ </dd>
+
+
+ <dt id="private_requests">I'd like to keep my request secret! (At least until I publish my story) <a href="#private_requests">#</a> </dt>
+
+ <dd><p>WhatDoTheyKnow is currently only designed for public requests. All
+ responses that we receive are automatically published on the website for anyone
+ to read. </p>
+ <p>You should contact the public authority directly if you would like to
+ make a request in private. If you're interested in buying a system which helps
+ you manage FOI requests in secret, then <a href="/help/contact">contact us</a>.
+ </p>
+ </dd>
+
+ <dt id="eir">Why can I only request information about the environment from some authorities? <a href="#eir">#</a> </dt>
+
+ <dd>
+ <p>Some public authorities, such as <a href="http://www.whatdotheyknow.com/body/south_east_water">South East Water</a>,
+ don't come under the Freedom of Information Act, but do come under another law called
+ the Environmental Information Regulations (EIR).
+ </p>
+
+ <p>It's a very similar law, so you make a request
+ to them using WhatDoTheyKnow in just the same way as an FOI request. The only
+ difference is that on the page where your write you request, it reminds you
+ that you can only request "environmental information" and tells you what that
+ means. It is quite broad.
+ </p>
+
+ <p>You can, of course, request environmental information from other
+ authorities. Just make a Freedom of Information (FOI) request as normal. The
+ authority has a duty to work out if the Environmental Information Regulations
+ (EIR) is the more appropriate legislation to reply under.
+ </p>
+ </dd>
+
+ <dt id="multiple">Can I make the same to request to lots of authorities, e.g. all councils? <a href="#multiple">#</a> </dt>
+
+ <dd>We ask you to first send a test version of your request to a few
+ authorities. Their responses will help you improve the wording of your request,
+ so that you get the best information when you send the request to all of
+ the authorities. There is currently no automated system for sending the request
+ to the other authorities, you must copy and paste it by hand.
+
+ </dd>
+
+ <dt id="offsite">I made a request off the site, how do I upload it to the archive?<a href="#offsite">#</a> </dt>
+
+ <dd>WhatDoTheyKnow is an archive of requests made through the site,
+ and does not try to be an archive of all FOI requests. We'll never support uploading
+ other requests. For one thing, we wouldn't be able to verify that other
+ responses actually came from the authority. If this really matters to you,
+ you can always make the same request again via WhatDoTheyKnow.
+ </dd>
+
+ <dt id="moderation">How do you moderate request annotations? <a href="#moderation">#</a> </dt>
+
+ <dd>
+ <p>Annotations on WhatDoTheyKnow are to help
+ people get the information they want, or to give them pointers to places they
+ can go to help them act on it. We reserve the right to remove anything else.
+ </p>
+ <p>Endless, political discussions are not allowed.
+ Post a link to a suitable forum or campaign site elsewhere.</p>
+ <dd>
+
+ </dl>
+
+ <p><strong>Next</strong>, read about <a href="/help/privacy">your privacy</a> --&gt;
+
+ <div id="hash_link_padding"></div>
+</div>
diff --git a/app/views/help/unhappy.rhtml b/app/views/help/unhappy.rhtml
index 86ded2e59..4f3c67b9e 100644
--- a/app/views/help/unhappy.rhtml
+++ b/app/views/help/unhappy.rhtml
@@ -29,7 +29,7 @@ to your request '<%=request_link(@info_request) %>'?
<p>
<% if !@info_request.nil? %>
- Choose <%= link_to "request an internal review", show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup" %> and then write a message asking the authority to review your request.
+ <%= link_to "Request an internal review", show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup", :class => 'link_button_green' %> and then write a message asking the authority to review your request.
<% else %>
At the bottom of the relevant request page on <%= site_name %> choose
"request an internal review". Then write a message asking for an internal
diff --git a/app/views/layouts/admin.rhtml b/app/views/layouts/admin.rhtml
index f0e9a7019..42ca5dbbb 100644
--- a/app/views/layouts/admin.rhtml
+++ b/app/views/layouts/admin.rhtml
@@ -3,6 +3,10 @@
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" >
<title><%= site_name %> admin<%= @title ? ":" : "" %> <%=@title%></title>
+
+ <%= javascript_include_tag 'jquery.js', 'jquery-ui.min' %>
+
+ <%= stylesheet_link_tag 'admin-theme/jquery-ui-1.8.15.custom.css', :rel => 'stylesheet'%>
<%= stylesheet_link_tag 'admin', :title => "Main", :rel => "stylesheet" %>
</head>
<body>
@@ -30,6 +34,6 @@
<% end %>
<%= yield %>
-
+
</body>
</html>
diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml
index 94ec5a956..abac4139c 100644
--- a/app/views/layouts/default.rhtml
+++ b/app/views/layouts/default.rhtml
@@ -1,8 +1,8 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="<%= I18n.locale %>">
<head>
+ <script type="text/javascript" src="/javascripts/jquery.js"></script>
<% if @profile_photo_javascript %>
- <script type="text/javascript" src="/javascripts/jquery.js"></script>
<script type="text/javascript" src="/javascripts/jquery.Jcrop.js"></script>
<script type="text/javascript" src="/javascripts/profile_photo.js"></script>
<link rel="stylesheet" href="/stylesheets/jquery.Jcrop.css" type="text/css" >
@@ -17,16 +17,29 @@
</title>
<link rel="shortcut icon" href="/favicon.ico">
-
- <%= stylesheet_link_tag 'main', :title => "Main", :rel => "stylesheet" %>
+ <%= stylesheet_link_tag 'main', :title => "Main", :rel => "stylesheet", :media => "all" %>
+ <%= stylesheet_link_tag 'fonts', :rel => "stylesheet", :media => "all" %>
+ <%= stylesheet_link_tag 'theme', :rel => "stylesheet", :media => "all" %>
+ <%= stylesheet_link_tag 'print', :rel => "stylesheet", :media => "print" %>
+ <% if !params[:print_stylesheet].nil? %>
+ <%= stylesheet_link_tag 'print', :rel => "stylesheet", :media => "all" %>
+ <% end %>
+ <%= javascript_include_tag 'jquery.js', 'jquery-ui.min','jquery.cookie.js', 'general.js' %>
+ <%= stylesheet_link_tag 'admin-theme/jquery-ui-1.8.15.custom.css', :rel => 'stylesheet'%>
<!--[if LT IE 7]>
<style type="text/css">@import url("/stylesheets/ie6.css");</style>
<![endif]-->
<!--[if LT IE 7]>
<style type="text/css">@import url("/stylesheets/ie6-custom.css");</style>
<![endif]-->
+ <!--[if LT IE 8]>
+ <style type="text/css">@import url("/stylesheets/ie7.css");</style>
+ <![endif]-->
<%= stylesheet_link_tag 'custom', :title => "Main", :rel => "stylesheet" %>
-
+ <% if force_registration_on_new_request %>
+ <%= stylesheet_link_tag 'jquery.fancybox-1.3.4', :rel => "stylesheet" %>
+ <% end %>
+
<% if @feed_autodetect %>
<% for feed in @feed_autodetect %>
<link rel="alternate" type="application/atom+xml" title="<%=h feed[:title] %>" href="<%=h feed[:url]%>">
@@ -45,8 +58,30 @@
<%= render :partial => 'general/before_head_end' %>
</head>
- <body>
+ <body <%= "class='front'" if params[:action] == 'frontpage' %>>
+ <!-- XXX: move to a separate file -->
+ <% if force_registration_on_new_request && !@user %>
+ <%= javascript_include_tag 'jquery.fancybox-1.3.4.pack' %>
+ <script type="text/javascript">
+ $(document).ready(function() {
+ $("#make-request-link").fancybox({
+ 'modal': false,
+ 'width': 900,
+ 'height': 400,
+ 'type': 'iframe',
+ 'href': '/en/profile/sign_in?modal=1',
+ 'onClosed': function() {
+ // modal_signin_successful variable set by modal dialog box
+ if (typeof modal_signin_successful != 'undefined' ) {
+ window.location.href = '<%= select_authority_url %>';
+ }
+ }
+ });
+ });
+ </script>
+ <% end %>
+
<% # code for popup advert for a campaign etc.
=begin
<div id="everypage" class="jshide">
@@ -57,59 +92,43 @@
=end
%>
<div class="entirebody">
- <div id="banner"></div>
- <div id="header">
- <h1>
- <%= link_to site_name, frontpage_url %>
- </h1>
+ <div id="banner">
+ <div id="banner_inner">
+ <div class="lang"><%= render :partial => 'general/locale_switcher' %></div>
+
+ <% if not (controller.action_name == 'signin' or controller.action_name == 'signup') %>
+ <div id="logged_in_bar">
+ <% if @user %>
+ <%= _('Hello, {{username}}!', :username => h(@user.name))%>
- <div id="tagline">
- <%= _('Make and explore Freedom of Information requests') %>
- </div>
+ <% if @user %>
+ <%=link_to _("My profile"), user_url(@user) %>
+ <% end %>
- </div>
- <div id="orglogo">
- <%= render :partial => 'general/orglink' %>
- </div>
- <div class="lang"><%= render :partial => 'general/locale_switcher' %></div>
-
- <div id="navigation_search">
- <% form_tag({:controller => "general", :action => "search_redirect"}, {:id => "navigation_search_form"}) do %>
- <p>
- <%= text_field_tag 'query', params[:query], { :size => 40, :id => "navigation_search_query" } %>
- <%= submit_tag _("Search") %>
- </p>
- <% end %>
- </div>
- <div id="topnav">
- <ul id="navigation">
- <li><%= link_to _("Make request"), frontpage_url %></li>
- <li><%= link_to _("View requests"), request_list_successful_url %></li>
- <li><%= link_to _("View authorities"), list_public_bodies_default %></li>
- <% if @user %>
- <li><%=link_to _("My requests"), user_url(@user) %></li>
- <% end %>
- <li><%= link_to _("Read blog"), blog_url %></li>
- <li><%= link_to _("Help"), help_about_url %></li>
- </ul>
- <% if not (controller.action_name == 'signin' or controller.action_name == 'signup') %>
- <div id="logged_in_bar">
- <% if @user %>
- <%= _('Hello, {{username}}!', :username => h(@user.name))%>
- (<%= link_to _("Sign out"), signout_url(:r => request.request_uri) %>)
- <% else %>
- <%= _('Hello!') %>
- (<%= link_to _("Sign in or sign up"), signin_url(:r => request.request_uri) %>)
+ <%= link_to _("Sign out"), signout_url(:r => request.request_uri) %>
+ <% else %>
+ <%= link_to _("Sign in or sign up"), signin_url(:r => request.request_uri) %>
+ <% end %>
+ </div>
+ <% end %>
+
+ <div id="navigation_search">
+ <% form_tag({:controller => "general", :action => "search_redirect"}, {:id => "navigation_search_form"}) do %>
+ <p>
+ <%= text_field_tag 'query', params[:query], { :size => 40, :id => "navigation_search_query" } %>
+ <%= image_submit_tag('search-button.png') %>
+ </p>
<% end %>
- </div>
- <% end %>
+ </div>
+
+ <%= render :partial => 'general/orglink' %>
+
+ <%= render :partial => 'general/topnav' %>
+ </div>
</div>
-
<div id="wrapper">
-
<div id="content">
-
<% if flash[:notice] %>
<div id="notice"><%= flash[:notice] %></div>
<% end %>
@@ -120,16 +139,20 @@
<div id="<%= controller.controller_name + "_" + controller.action_name %>" class="controller_<%= controller.controller_name %>">
<%= yield :layout %>
</div>
+ <div style="clear:both"></div>
</div>
</div>
- <div id="footer">
- <%= link_to _("Contact {{site_name}}", :site_name => site_name), help_contact_url %>
- <%= render :partial => 'general/credits' %>
- </div>
- <div class="after-footer">&nbsp;</div>
+ <%= render :partial => 'general/footer' %>
<%= render :partial => 'general/before_body_end' %>
</div>
+<div id="other-country-notice"></div>
+<div id="link_box"><span class="close-button">X</span>
+<%= _("Paste this link into emails, tweets, and anywhere else:") %>
+<br />
+<input type="text">
+</div>
</body>
</html>
+
diff --git a/app/views/layouts/no_chrome.rhtml b/app/views/layouts/no_chrome.rhtml
new file mode 100644
index 000000000..74c79b701
--- /dev/null
+++ b/app/views/layouts/no_chrome.rhtml
@@ -0,0 +1,41 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="<%= I18n.locale %>">
+ <head>
+ <title>
+ <% if @title %>
+ <%=@title%> - <%= site_name %>
+ <% else %>
+ <%= site_name %> - <%= _('Make and browse Freedom of Information (FOI) requests') %>
+ <% end %>
+ </title>
+
+ <script type="text/javascript" src="/javascripts/jquery.js"></script>
+
+ <%= stylesheet_link_tag 'main', :title => "Main", :rel => "stylesheet" %>
+ <%= stylesheet_link_tag 'fonts', :rel => "stylesheet" %>
+ <%= stylesheet_link_tag 'theme', :rel => "stylesheet" %>
+ <!--[if LT IE 7]>
+ <style type="text/css">@import url("/stylesheets/ie6.css");</style>
+ <![endif]-->
+ <!--[if LT IE 7]>
+ <style type="text/css">@import url("/stylesheets/ie6-custom.css");</style>
+ <![endif]-->
+ <%= stylesheet_link_tag 'custom', :title => "Main", :rel => "stylesheet" %>
+ </head>
+ <body>
+ <div class="entirebody">
+ <div id="content">
+ <% if flash[:notice] %>
+ <div id="notice"><%= flash[:notice] %></div>
+ <% end %>
+ <% if flash[:error] %>
+ <div id="error"><%= flash[:error] %></div>
+ <% end %>
+
+ <div id="<%= controller.controller_name + "_" + controller.action_name %>" class="controller_<%= controller.controller_name %>">
+ <%= yield :layout %>
+ </div>
+ </div>
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/app/views/public_body/_body_listing.rhtml b/app/views/public_body/_body_listing.rhtml
index 48b6e8245..864ab8c9b 100644
--- a/app/views/public_body/_body_listing.rhtml
+++ b/app/views/public_body/_body_listing.rhtml
@@ -1,5 +1,7 @@
<% if public_bodies.empty? %>
+ <p>
<%= _("None found.")%>
+ </p>
<% else %>
<% for public_body in public_bodies %>
<%= render :partial => 'public_body/body_listing_single', :locals => { :public_body => public_body } %>
diff --git a/app/views/public_body/_search_ahead.rhtml b/app/views/public_body/_search_ahead.rhtml
new file mode 100644
index 000000000..19c7eb4e8
--- /dev/null
+++ b/app/views/public_body/_search_ahead.rhtml
@@ -0,0 +1,18 @@
+<p>
+ <% if @xapian_requests.results.size > 0 %>
+ <h3><%= _('Top search results:') %></h3>
+ <p>
+ <%= _('Select one to see more information about the authority.')%>
+ </p>
+ <% else %>
+ <h3><%= _('No results found.') %></h3>
+ <% end %>
+ <div id="authority_search_ahead_results">
+ <% for result in @xapian_requests.results %>
+ <%= render :partial => 'body_listing_single', :locals => { :public_body => result[:model] } %>
+ <% end %>
+ </div>
+</p>
+
+
+
diff --git a/app/views/public_body/list.rhtml b/app/views/public_body/list.rhtml
index 5d88b1501..81593fcc7 100644
--- a/app/views/public_body/list.rhtml
+++ b/app/views/public_body/list.rhtml
@@ -1,14 +1,13 @@
-<div id="body_sidebar">
+<div id="right_column_flip">
+ <h2><%=_('Show only...')%></h2>
- <h1><%=_('Show only...')%></h1>
-
- <h2><%=_('Alphabet') %></h2>
+ <h3><%=_('Beginning with') %></h3>
<ul><li>
<%= render :partial => 'alphabet' %>
</li></ul>
<% first_row = true %>
- <% for row in PublicBodyCategories::CATEGORIES_WITH_HEADINGS %>
+ <% for row in PublicBodyCategories::get().with_headings() %>
<% if row.instance_of?(Array) %>
<li>
<%= link_to_unless (@tag == row[0]), row[1], list_public_bodies_url(:tag => row[0]) %>
@@ -19,7 +18,7 @@
<% else %>
<% first_row = false %>
<% end %>
- <h2><%=h row%></h2>
+ <h3><%=h row%></h3>
<ul>
<% end %>
<% end %>
@@ -31,24 +30,22 @@
<p>
<%= link_to _('List of all authorities (CSV)'), all_public_bodies_csv_url() %>
</p>
-
</div>
<% @title = _("Public authorities - {{description}}", :description => @description) %>
-
-<h1><%=@title%></h1>
-
-<p class="subtitle">
- <%= @public_bodies.size %> <%= _('in total') %>
- (<%= _('<a href="%s">can\'t find the one you want?</a>') % [help_requesting_path + '#missing_body'] %>)
-</p>
-
-<% if @tag.size == 1 %>
- <p><%= render :partial => 'alphabet' %></p>
+<div id="left_column_flip">
+<h1><%= _('Public authorities') %></h1>
+
+<% form_tag(list_public_bodies_default_url, :method => "get", :id=>"search_form") do %>
+ <div>
+ <%= text_field_tag(:public_body_query, params[:public_body_query]) %>
+ <%= submit_tag(_("Search")) %>
+ </div>
<% end %>
+
+<h2 class="publicbody_results"><%= _('Found {{count}} public bodies {{description}}', :count=>@public_bodies.size, :description=>@description) %></h2>
<%= render :partial => 'body_listing', :locals => { :public_bodies => @public_bodies } %>
-<% if @tag.size == 1 && @public_bodies.size > 0 %>
- <p><%= render :partial => 'alphabet' %></p>
-<% end %>
-<%= will_paginate(@public_bodies) %>
+ <%= will_paginate(@public_bodies) %><br/>
+ <%= _('<a href="%s">Can\'t find the one you want?</a>') % [help_requesting_path + '#missing_body'] %>
+</div>
diff --git a/app/views/public_body/show.rhtml b/app/views/public_body/show.rhtml
index 36bba8851..2436c58b9 100644
--- a/app/views/public_body/show.rhtml
+++ b/app/views/public_body/show.rhtml
@@ -1,70 +1,73 @@
<% @title = h(@public_body.name) + " - view and make Freedom of Information requests" %>
-<div id="request_sidebar">
- <h2><%= _('Track this authority')%></h2>
- <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'sidebar' } %>
- <h2><%= _('More about this authority')%></h2>
- <% if !@public_body.calculated_home_page.nil? %>
- <%= link_to _('Home page of authority'), @public_body.calculated_home_page %><br>
- <% end %>
- <% if !@public_body.publication_scheme.empty? %>
- <%= link_to _('Publication scheme'), @public_body.publication_scheme %><br>
- <% end %>
- <% if @public_body.has_tag?("charity") %>
- <% for tag_value in @public_body.get_tag_values("charity") %>
- <% if tag_value.match(/^SC/) %>
- <%= link_to _('Charity registration'), "http://www.oscr.org.uk/CharityIndexDetails.aspx?id=" + tag_value %><br>
- <% else %>
- <%= link_to _('Charity registration'), "http://www.charity-commission.gov.uk/SHOWCHARITY/RegisterOfCharities/CharityFramework.aspx?RegisteredCharityNumber=" + tag_value %><br>
- <% end %>
- <% end %>
- <% end %>
- <%= link_to _('View FOI email address'), view_public_body_email_url(@public_body.url_name) %><br>
-</div>
+<div id="main_content">
+ <div id="header_right">
+ <h2><%= _('Follow this authority')%></h2>
+
+ <% follower_count = TrackThing.count(:all, :conditions => ["public_body_id = ?", @public_body.id]) %>
+ <p><%= n_("There is %d person following this authority", "There are %d people following this authority", follower_count) % follower_count %></p>
-<h1><%=h(@public_body.name)%></h1>
+ <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'sidebar' } %>
+ <h2><%= _('More about this authority')%></h2>
+ <% if !@public_body.calculated_home_page.nil? %>
+ <%= link_to _('Home page of authority'), @public_body.calculated_home_page %><br>
+ <% end %>
+ <% if !@public_body.publication_scheme.empty? %>
+ <%= link_to _('Publication scheme'), @public_body.publication_scheme %><br>
+ <% end %>
+ <% if @public_body.has_tag?("charity") %>
+ <% for tag_value in @public_body.get_tag_values("charity") %>
+ <% if tag_value.match(/^SC/) %>
+ <%= link_to _('Charity registration'), "http://www.oscr.org.uk/CharityIndexDetails.aspx?id=" + tag_value %><br>
+ <% else %>
+ <%= link_to _('Charity registration'), "http://www.charity-commission.gov.uk/SHOWCHARITY/RegisterOfCharities/CharityFramework.aspx?RegisteredCharityNumber=" + tag_value %><br>
+ <% end %>
+ <% end %>
+ <% end %>
+ <%= link_to _('View FOI email address'), view_public_body_email_url(@public_body.url_name) %><br>
+ </div>
-<p class="subtitle">
-<%=@public_body.type_of_authority(true)%>
-<% if not @public_body.short_name.empty? %>,
-<%= _('also called {{public_body_short_name}}', :public_body_short_name => h(@public_body.short_name))%><% end %>
-<% if !@user.nil? && @user.admin_page_links? %>
-(<%= link_to _("admin"), public_body_admin_url(@public_body) %>)
-<% end %>
-</p>
+ <div id="header_left">
+ <p class="public-body-name-prefix"><%= _("Freedom of information requests to") %></p>
+ <h1><%=h(@public_body.name)%></h1>
-<% if @public_body.has_notes? && (@public_body.is_requestable? || @public_body.not_requestable_reason == 'bad_contact') %>
- <p><%= @public_body.notes_as_html %></p>
-<% end %>
+ <p class="subtitle">
+ <%=@public_body.type_of_authority(true)%><% if not @public_body.short_name.empty? %>,
+ <%= _('also called {{public_body_short_name}}', :public_body_short_name => h(@public_body.short_name))%><% end %>
+ <% if !@user.nil? && @user.admin_page_links? %>
+ (<%= link_to _("admin"), public_body_admin_url(@public_body) %>)
+ <% end %>
+ </p>
-<% if @public_body.eir_only? %>
- <p><%= _('You can only request information about the environment from this authority.')%></p>
-<% end %>
+ <% if @public_body.has_notes? && (@public_body.is_requestable? || @public_body.not_requestable_reason == 'bad_contact') %>
+ <p><%= @public_body.notes_as_html %></p>
+ <% end %>
-<div id="stepwise_make_request">
- <strong>
- <% if @public_body.is_requestable? || @public_body.not_requestable_reason == 'bad_contact' %>
- <% if @public_body.eir_only? %>
- <%= link_to _("Make a new Environmental Information request"), new_request_to_body_url(:url_name => @public_body.url_name)%> to <%= h(@public_body.name) %>
+ <% if @public_body.eir_only? %>
+ <p><%= _('You can only request information about the environment from this authority.')%></p>
+ <% end %>
+ <div id="stepwise_make_request">
+ <% if @public_body.is_requestable? || @public_body.not_requestable_reason == 'bad_contact' %>
+ <% if @public_body.eir_only? %>
+ <%= _('Make a new <strong>Environmental Information</strong> request')%>
+ <% else %>
+ <%= _('Make a new <strong>Freedom of Information</strong> request to {{public_body}}', :public_body => h(@public_body.name))%>
+ <% end %>
+ &nbsp;<%= _('<a class="link_button_green" href="{{url}}">{{text}}</a>', :url=>new_request_to_body_url(:url_name => @public_body.url_name), :text=>_("Start"))%>
+ <% elsif @public_body.has_notes? %>
+ <%= @public_body.notes_as_html %>
+ <% elsif @public_body.not_requestable_reason == 'not_apply' %>
+ <%= _('Freedom of Information law does not apply to this authority, so you cannot make
+ a request to it.')%>
+ <% elsif @public_body.not_requestable_reason == 'defunct' %>
+ <%= _('This authority no longer exists, so you cannot make a request to it.')%>
<% else %>
- <%= _('<a href="{{url}}">Make a new Freedom of Information request</a> to {{public_body_name}}',
- :public_body_name => h(@public_body.name), :url=>new_request_to_body_url(:url_name => @public_body.url_name))%>
+ <%= _('For an unknown reason, it is not possible to make a request to this authority.')%>
<% end %>
- <% elsif @public_body.has_notes? %>
- <%= @public_body.notes_as_html %>
- <% elsif @public_body.not_requestable_reason == 'not_apply' %>
- <%= _('Freedom of Information law does not apply to this authority, so you cannot make
- a request to it.')%>
- <% elsif @public_body.not_requestable_reason == 'defunct' %>
- <%= _('This authority no longer exists, so you cannot make a request to it.')%>
- <% else %>
- <%= _('For an unknown reason, it is not possible to make a request to this authority.')%>
- <% end %>
- </strong>
-</div>
+ </div>
+ </div>
-<% if !@xapian_requests.nil? %>
- <% if @xapian_requests.results.empty? %>
+ <% if @public_body.info_requests.size == 0 %>
<% if @public_body.eir_only? %>
<h2><%= _('Environmental Information Regulations requests made using this site') %></h2>
<p>Nobody has made any Environmental Information Regulations requests to <%=h(@public_body.name)%> using this site yet.</p>
@@ -73,30 +76,46 @@
<p><%= _('Nobody has made any Freedom of Information requests to {{public_body_name}} using this site yet.', :public_body_name => h(@public_body.name))%></p>
<% end %>
<% else %>
- <h2>
+ <h2 class="foi_results">
<% if @public_body.eir_only? %>
<%= pluralize(@public_body.info_requests.size, "Environmental Information Regulations request made using this site") %>
<% else %>
- <%= n_('%d Freedom of Information request made using this site', '%d Freedom of Information requests made using this site', @public_body.info_requests.size) % @public_body.info_requests.size %>
+ <% if @public_body.info_requests.size > 4 %>
+ <%= n_('Search within the %d Freedom of Information requests to %s', 'Search within the %d Freedom of Information requests made to %s', @public_body.info_requests.size) % [@public_body.info_requests.size, @public_body.name] %>
+ <% else %>
+ <%= n_('%d Freedom of Information request to %s', '%d Freedom of Information requests to %s', @public_body.info_requests.size) % [@public_body.info_requests.size, @public_body.name] %>
+ <% end %>
<% end %>
<%= @page_desc %>
</h2>
+ <a name="results"></a>
+
+ <% if @public_body.info_requests.size > 4 %>
+ <%= render :partial => 'request/request_filter_form' %>
+ <% end %>
+ <% end %>
- <% for result in @xapian_requests.results %>
- <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
- <% end %>
+ <div style="clear:both">&nbsp;</div>
+ <% if !@xapian_requests.nil? %>
- <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @public_body.info_requests.size) %>
+ <% for result in @xapian_requests.results %>
+ <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
+ <% end %>
- <p> <%= _('Only requests made using {{site_name}} are shown.', :site_name => site_name) %></p>
+ <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @public_body.info_requests.size) %>
- <% end %>
-<% else %>
- <% if @public_body.eir_only? %>
- <h2><%= _('Environmental Information Regulations requests made') %></h2>
- <% else %>
- <h2> <%= _('Freedom of Information requests made')%></h2>
- <% end %>
- <p> <%= _('The search index is currently offline, so we can\'t show the Freedom of Information requests that have been made to this authority.')%></p>
-<% end %>
+ <% if @xapian_requests.results.empty? %>
+ <p><% _('There were no requests matching your query.') %></p>
+ <% else %>
+ <p> <%= _('Only requests made using {{site_name}} are shown.', :site_name => site_name) %></p>
+ <% end %>
+ <% else %>
+ <% if @public_body.eir_only? %>
+ <h2><%= _('Environmental Information Regulations requests made') %></h2>
+ <% else %>
+ <h2> <%= _('Freedom of Information requests made')%></h2>
+ <% end %>
+ <p> <%= _('The search index is currently offline, so we can\'t show the Freedom of Information requests that have been made to this authority.')%></p>
+ <% end %>
+</div>
diff --git a/app/views/request/_after_actions.rhtml b/app/views/request/_after_actions.rhtml
index 797ecaea5..205b738de 100644
--- a/app/views/request/_after_actions.rhtml
+++ b/app/views/request/_after_actions.rhtml
@@ -13,19 +13,21 @@
<%= link_to _('Update the status of this request'), '#describe_state_form_1' %>
</li>
<% end %>
+ <li>
+ <%= link_to _("Download a zip file of all correspondence"), download_entire_request_url(:url_title => @info_request.url_title) %>
+ </li>
</ul>
</div>
<div id="owner_actions">
<strong><%= _('{{info_request_user_name}} only:',:info_request_user_name=>h(@info_request.user.name)) %></strong>
<ul>
+
<li>
<% if @last_response.nil? %>
- <%= link_to "Send follow up to " + OutgoingMailer.name_for_followup(@info_request, @last_response), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "#followup" %>
+ <%= link_to _("Send a followup"), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "#followup" %>
<% else %>
- <% foi_cache(:controller => "request", :action => "show_response", :id => @info_request.id, :incoming_message_id => @last_response.id, :only_path => true, :template => "_after_actions", :section => "reply_to_link") do %>
- <%= link_to "Reply to " + OutgoingMailer.name_for_followup(@info_request, @last_response), show_response_url(:id => @info_request.id, :incoming_message_id => @last_response.id) + "#followup" %>
- <% end %>
+ <%= link_to _("Write a reply"), show_response_url(:id => @info_request.id, :incoming_message_id => @last_response.id) + "#followup" %>
<% end %>
</li>
<% if !@old_unclassified %>
diff --git a/app/views/request/_correspondence.rhtml b/app/views/request/_correspondence.rhtml
index 4e46347b8..9a198ad7d 100644
--- a/app/views/request/_correspondence.rhtml
+++ b/app/views/request/_correspondence.rhtml
@@ -1,3 +1,4 @@
+<div class="ff-print-fix"></div>
<%
if !info_request_event.nil? && info_request_event.event_type == 'response'
incoming_message = info_request_event.incoming_message
@@ -5,11 +6,10 @@ end
if not incoming_message.nil?
%>
- <div class="correspondence" id="incoming-<%=incoming_message.id.to_s%>">
- <% foi_cache(:controller => "request", :action => "show_response", :id => @info_request.id, :incoming_message_id => incoming_message.id, :only_path => true, :template => "_correspondence", :section => "incoming_message_bubble", :collapse => @collapse_quotes ? nil : 'no' ) do %>
+ <div class="incoming correspondence" id="incoming-<%=incoming_message.id.to_s%>">
<h2>
<% if !incoming_message.safe_mail_from.nil? && incoming_message.safe_mail_from.strip != @info_request.public_body.name.strip %>
- <%=h incoming_message.safe_mail_from %><br>
+ <%= _("From:") %> <%=h incoming_message.safe_mail_from %><br>
<% end %>
<% if incoming_message.safe_mail_from.nil? || (incoming_message.mail_from_domain == @info_request.public_body.request_email_domain) %>
<%=h @info_request.public_body.name %><br>
@@ -18,25 +18,22 @@ if not incoming_message.nil?
</h2>
<%= render :partial => 'bubble', :locals => { :incoming_message => incoming_message, :body => incoming_message.get_body_for_html_display(@collapse_quotes), :attachments => incoming_message.get_attachments_for_display } %>
- <% end %>
<p class="event_actions">
<% if !@user.nil? && @user.admin_page_links? %>
<%= link_to "Admin", admin_url("request/show_raw_email/" + incoming_message.raw_email_id.to_s) %> |
<% end %>
- <%= link_to _("Link to this"), incoming_message_url(incoming_message) %> |
- <%= link_to _("Reply to this message"), show_response_url(:id => incoming_message.info_request.id, :incoming_message_id => incoming_message.id) + "#followup" %>
-
+ <%= link_to _("Link to this"), incoming_message_url(incoming_message), :class => "link_to_this" %>
</p>
</div>
<%
elsif [ 'sent', 'followup_sent' ].include?(info_request_event.event_type)
outgoing_message = info_request_event.outgoing_message
%>
- <div class="correspondence" id="outgoing-<%=outgoing_message.id.to_s%>">
+ <div class="outgoing correspondence" id="outgoing-<%=outgoing_message.id.to_s%>">
<h2>
- <%=h @info_request.user.name %><br>
+ <%= _("From:") %> <%=h @info_request.user.name %><br>
<br><%= simple_date(info_request_event.created_at) %>
</h2>
@@ -54,12 +51,11 @@ elsif [ 'sent', 'followup_sent' ].include?(info_request_event.event_type)
<% end %>
-->
- <%= link_to _("Link to this"), outgoing_message_url(outgoing_message) %> |
- <%= link_to _("Send follow up"), show_response_no_followup_url(:id => outgoing_message.info_request.id, :incoming_message_id => nil) + "#followup" %>
+ <%= link_to _("Link to this"), outgoing_message_url(outgoing_message), :class => "link_to_this" %>
</p>
</div>
<% elsif [ 'resent', 'followup_resent' ].include?(info_request_event.event_type) %>
- <div class="correspondence" id="outgoing-<%=outgoing_message.id.to_s%>">
+ <div class="outgoing correspondence" id="outgoing-<%=outgoing_message.id.to_s%>">
<h2>
<%= simple_date(info_request_event.created_at) %>
</h2>
diff --git a/app/views/request/_followup.rhtml b/app/views/request/_followup.rhtml
index a15f2912d..be57ac9ef 100644
--- a/app/views/request/_followup.rhtml
+++ b/app/views/request/_followup.rhtml
@@ -1,17 +1,44 @@
<div id="followup">
-
+ <% if (incoming_message.nil? || !incoming_message.valid_to_reply_to?)
+ name_for_followup = _("the main FOI contact at {{public_body}}", :public_body => h(OutgoingMailer.name_for_followup(@info_request, nil)))
+ else
+ name_for_followup = h(OutgoingMailer.name_for_followup(@info_request, incoming_message))
+ end %>
<% if @internal_review %>
- <h1><%= _('Request an internal review from') %> <%=h OutgoingMailer.name_for_followup(@info_request, nil) %>
+ <h1><%= _('Request an internal review from {{person_or_body}}', :person_or_body => name_for_followup) %>
</h1>
<% elsif incoming_message.nil? || !incoming_message.valid_to_reply_to? %>
- <h2><%= _('Send a public follow up message to') %> <%=h OutgoingMailer.name_for_followup(@info_request, nil) %>
+ <h2><%= _('Send a public follow up message to {{person_or_body}}', :person_or_body => name_for_followup) %>
</h2>
<% else %>
- <h2><%= _('Send a public reply to') %>
- <%=h OutgoingMailer.name_for_followup(@info_request, incoming_message) %>
+ <h2><%= _('Send a public reply to {{person_or_body}}', :person_or_body => name_for_followup) %>
</h2>
<% end %>
+<% if @info_request.who_can_followup_to(incoming_message).count > 0 %>
+<div id="other_recipients">
+ <%= _("Don't want to address your message to {{person_or_body}}? You can also write to:", :person_or_body => name_for_followup) %>
+ <ul>
+<% @info_request.who_can_followup_to(incoming_message).each do |name, email, id| %>
+ <% if id.nil? && !incoming_message.nil? && incoming_message.valid_to_reply_to? %>
+ <li><%= link_to(_("the main FOI contact address for {{public_body}}", :public_body => name), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil)) %></li>
+ <% else %>
+ <% if !id.nil? %>
+ <% if @info_request.public_body.request_email == email %>
+ <% if !incoming_message.nil? %>
+ <li><%= link_to(_("the main FOI contact address for {{public_body}}", :public_body => name), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil)) %></li>
+ <% end %>
+ <% else %>
+ <li><%= link_to name, show_response_url(:id => @info_request.id, :incoming_message_id => id)%></li>
+ <% end %>
+ <% else %>
+ <li><%= link_to(_("the main FOI contact address for {{public_body}}", :public_body => name), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil)) %></li>
+ <% end %>
+ <% end %>
+<% end %>
+</ul>
+</div>
+<% end %>
<% if @info_request.allow_new_responses_from == 'nobody' %>
<p><%= _('Follow ups and new responses to this request have been stopped to prevent spam. Please <a href="{{url}}">contact us</a> if you are {{user_link}} and need to send a follow up.',:user_link=>user_link(@info_request.user), :url=>help_contact_path) %></p>
<% else %>
diff --git a/app/views/request/_next_actions.rhtml b/app/views/request/_next_actions.rhtml
new file mode 100644
index 000000000..f318df6e4
--- /dev/null
+++ b/app/views/request/_next_actions.rhtml
@@ -0,0 +1 @@
+<!-- Consider listing websites that users might find useful here (in your theme) -->
diff --git a/app/views/request/_request_filter_form.rhtml b/app/views/request/_request_filter_form.rhtml
new file mode 100644
index 000000000..fa760bf74
--- /dev/null
+++ b/app/views/request/_request_filter_form.rhtml
@@ -0,0 +1,52 @@
+<%= render :partial => 'general/localised_datepicker' %>
+
+<div id="list-filter">
+ <% form_tag(request.path, :method => "get", :id=>"filter_requests_form") do %>
+ <div class="list-filter-item">
+ <%= label_tag(:query, _("Keywords"), :class=>"form_label title") %>
+ <%= text_field_tag(:query, params[:query]) %>
+ </div>
+<% if false # don't think we want this, but leaving as an example %>
+ <div class="list-filter-item">
+ <%= _("Search for words in:") %> <br/>
+ <% [["sent", _("messages from users")],
+ ["response", _("messages from authorities")],
+ ["comment", _("comments")]].each_with_index do |item, index|
+ variety, title = item %>
+
+ <%= check_box_tag "request_variety[]", variety, params[:request_variety].nil? ? true : params[:request_variety].include?(variety), :id => "request_variety_#{index}" %>
+ <%= label_tag("request_variety_#{index}", title) %> <br/>
+ <% end %>
+ </div>
+<% end %>
+ <div class="list-filter-item">
+ <%= label_tag(:query, _("Made between"), :class=>"form_label title") %>
+ <%= text_field_tag(:request_date_after, params[:request_date_after], {:class => "use-datepicker", :size => 10}) %>&nbsp;&nbsp;
+ <%= label_tag(:query, _("and"), :class=>"form_label") %>
+ <%= text_field_tag(:request_date_before, params[:request_date_before], {:class => "use-datepicker", :size => 10}) %>
+ </div>
+ <div class="list-filter-item">
+ <h3 class="title"><%= _("Showing") %></h3>
+ <% statuses = [["all", _("all requests")],
+ ["successful", _("successful requests")],
+ ["unsuccessful", _("unsuccessful requests")],
+ ["awaiting", _("unresolved requests")]] %>
+ <% for status, label in statuses %>
+ <% if params[:view] != status %>
+ <% if params[:controller] == "public_body" %>
+ <%= link_to label, url_for(:controller => "public_body", :action => "show", :view => status, :url_name => @public_body.url_name) + "?" + request.query_string + '#results' %>
+ <% else %>
+ <%= link_to label, url_for(:controller => "request", :action => "list", :view => status) + "?" + request.query_string + '#results' %>
+ <% end %>
+ <% else %>
+ <%= label %>
+ <% end %>
+ <%= "|" unless statuses.last[0] == status %>
+ <% end %>
+ </div>
+
+ <div class="list-filter-item">
+ <%= submit_tag(_("Search")) %>
+ </div>
+<% end %>
+</div>
diff --git a/app/views/request/_request_listing_via_event.rhtml b/app/views/request/_request_listing_via_event.rhtml
index afacabea5..e7c378cec 100644
--- a/app/views/request/_request_listing_via_event.rhtml
+++ b/app/views/request/_request_listing_via_event.rhtml
@@ -3,7 +3,8 @@
end %>
<div class="request_listing">
- <span class="head">
+ <div class="request_left">
+ <span class="head">
<% if event.is_incoming_message? %>
<%= link_to highlight_words(info_request.title, @highlight_words), incoming_message_url(event.incoming_message) %>
<% elsif event.is_outgoing_message? and event.event_type == 'followup_sent' %>
@@ -13,18 +14,9 @@ end %>
<% else %>
<%= link_to highlight_words(info_request.title, @highlight_words), request_url(info_request) %>
<% end %>
- </span>
- <span class="desc">
- <%= highlight_and_excerpt(event.search_text_main(true), @highlight_words, 150) %>
- </span>
-
- <span class="bottomline icon_<%= info_request.calculate_status %>">
-
- <strong>
- <%= info_request.display_status %>
- </strong><br>
-
- <% if event.event_type == 'sent' %>
+ </span>
+ <div class="requester">
+ <% if event.event_type == 'sent' %>
<%= _('Request sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>user_link_absolute(info_request.user),:date=>simple_date(event.created_at )) %>
<% elsif event.event_type == 'followup_sent' %>
<%=event.display_status %>
@@ -37,6 +29,17 @@ end %>
<% else %>
<% raise _("unknown event type indexed ") + event.event_type %>
<% end %>
+ </div>
+ <span class="bottomline icon_<%= info_request.calculate_status %>">
+ <strong>
+ <%= info_request.display_status %>
+ </strong><br>
</span>
+ </div>
+ <div class="request_right">
+ <span class="desc">
+ <%= highlight_and_excerpt(event.search_text_main(true), @highlight_words, 150) %>
+ </span>
+ </div>
</div>
diff --git a/app/views/request/_search_ahead.rhtml b/app/views/request/_search_ahead.rhtml
new file mode 100644
index 000000000..9c49680c3
--- /dev/null
+++ b/app/views/request/_search_ahead.rhtml
@@ -0,0 +1,12 @@
+<div id="request_search_ahead_results">
+ <% if @xapian_requests.results.size > 0 %>
+ <h3><%= _("Possibly related requests:") %></h3>
+ <% end %>
+ <% for result in @xapian_requests.results %>
+ <%= render :partial => 'request/request_listing_short_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
+ <% end %>
+
+ <p>
+ <a id="body-site-search-link" target="_blank"><%= _("Or search in their website for this information.") %></a>
+ </p>
+</div>
diff --git a/app/views/request/_sidebar.rhtml b/app/views/request/_sidebar.rhtml
index 2b9652d9c..2a9b5a73f 100644
--- a/app/views/request/_sidebar.rhtml
+++ b/app/views/request/_sidebar.rhtml
@@ -1,38 +1,32 @@
-<div id="request_sidebar">
- <h2><%= _('Track this request') %></h2>
+<div id="right_column">
+ <h2><%= _('Follow this request') %></h2>
+
+ <% follower_count = TrackThing.count(:all, :conditions => ["info_request_id = ?", @info_request.id]) + 1 %>
+ <p><%= n_("There is %d person following this request", "There are %d people following this request", follower_count) % follower_count %></p>
<%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => @info_request.user == @user, :location => 'sidebar' } %>
<h2><%= _("Act on what you've learnt") %></h2>
+
<div class="act_link">
- <%= link_to '<img src="/images/helpmeinvestigate.png" alt="" class="rss">', "http://helpmeinvestigate.com/"%>
- <%= link_to 'Get help investigating', "http://helpmeinvestigate.com/"%>
- </div>
- <div class="act_link">
- <%= link_to '<img src="/images/writetothem.png" alt="" class="rss">', "http://www.writetothem.com"%>
- <%= link_to 'Write to your politician', "http://www.writetothem.com"%>
- </div>
- <div class="act_link">
- <%= link_to '<img src="/images/pledgebank.png" alt="" class="rss">', "http://www.pledgebank.com"%>
- <%= link_to 'Pledge with others', "http://www.pledgebank.com"%>
+ <% tweet_link = "http://twitter.com/share?url=#{h(request.url)}&via=#{h(MySociety::Config.get('TWITTER_USERNAME', ''))}&text='#{h(@info_request.title)}'&related=#{_('alaveteli_foi:The software that runs {{site_name}}', :site_name => h(site_name))}" %>
+ <%= link_to '<img src="/images/twitter-16.png" alt="twitter icon">', tweet_link %>
+ <%= link_to _("Tweet this request"), tweet_link %>
</div>
- <!-- <div class="act_link">
- <%= link_to '<img src="/images/petitions.png" alt="" class="rss">', "http://petitions.number10.gov.uk"%>
- <%= link_to 'Petition the PM', "http://petitions.number10.gov.uk"%>
- </div> -->
<div class="act_link">
<%= link_to '<img src="/images/wordpress.png" alt="" class="rss">', "http://wordpress.com/"%>
- <%= link_to 'Start your own blog', "http://wordpress.com/"%>
+ <%= link_to _("Start your own blog"), "http://wordpress.com/"%>
</div>
+ <%= render :partial => 'request/next_actions' %>
<% view_cache :ttl => 1.day, :tag => ['similar', @info_request.id, I18n.locale] do %>
<% if !@xapian_similar.nil? && @xapian_similar.results.size > 0 %>
- <h2><% _('Similar requests')%></h2>
+ <h2><%= _('Similar requests')%></h2>
<% for result in @xapian_similar.results %>
<%= render :partial => 'request/request_listing_short_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
<% end %>
<% if @xapian_similar_more %>
- <p><%= link_to "More similar requests", request_similar_url(@info_request) %></p>
+ <p><%= link_to _("More similar requests"), request_similar_url(@info_request) %></p>
<% end %>
<!-- Important terms: <%= @xapian_similar.important_terms.join(" ") %> -->
<% end %>
diff --git a/app/views/request/list.rhtml b/app/views/request/list.rhtml
index 04dc0d010..0137cb6dd 100644
--- a/app/views/request/list.rhtml
+++ b/app/views/request/list.rhtml
@@ -1,40 +1,35 @@
-<div id="list_sidebar">
-<h1><%= _('Show only...')%></h1>
-<ul>
-<% for view, description, target in [
- ['successful', _('Successful responses'), request_list_successful_url(:view => 'successful')],
- ['recent', _('Recently sent requests'), request_list_recent_url(:view => 'recent')]
-] %>
-<li>
- <%= link_to_unless (@view == view), description, target %>
-</li>
-<% end %>
-</ul>
+
+<div id="header_left">
+ <h1><%=@title%></h1>
+ <%= render :partial => 'request/request_filter_form' %>
</div>
-<h1><%=@title%></h1>
+<div id="header_right">
+ <h2><%= _("Follow these requests") %></h2>
+ <% if @track_thing %>
+ <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %>
+ <% end %>
+</div>
-<% if @track_thing %>
- <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %>
-<% end %>
+<div style="clear:both"></div>
-<% view_cache :ttl => 5.minutes, :tag => [@view, @page, I18n.locale] do %>
- <% if @list_results.empty? %>
- <p> <%= _('No requests of this sort yet.')%></p>
- <% else %>
- <% for result in @list_results%>
- <% if result.class.to_s == 'InfoRequestEvent' %>
- <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result, :info_request => result.info_request } %>
- <% else %>
- <p><strong><%= _('Unexpected search result type') %> <%=result.class.to_s%></strong></p>
+<div class="results_section">
+ <% view_cache :ttl => 5.minutes, :tag => [@view, @page, I18n.locale] do %>
+ <% if @list_results.empty? %>
+ <p> <%= _('No requests of this sort yet.')%></p>
+ <% else %>
+ <h2 class="foi_results"><%= _('{{count}} FOI requests found', :count => @list_results.size) %></h2>
+ <div class="results_block">
+ <% for result in @list_results%>
+ <% if result.class.to_s == 'InfoRequestEvent' %>
+ <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result, :info_request => result.info_request } %>
+ <% else %>
+ <p><strong><%= _('Unexpected search result type') %> <%=result.class.to_s%></strong></p>
+ <% end %>
<% end %>
- <% end %>
- <% end %>
+ </div>
+ <% end %>
- <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @matches_estimated) %>
-<% end %>
-
-<% if @track_thing %>
- <p></p>
- <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %>
-<% end %>
+ <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @matches_estimated) %>
+ <% end %>
+</div>
diff --git a/app/views/request/new.rhtml b/app/views/request/new.rhtml
index b8625a8e6..355641b63 100644
--- a/app/views/request/new.rhtml
+++ b/app/views/request/new.rhtml
@@ -1,116 +1,118 @@
+<script type="text/javascript" src="/javascripts/ba-throttle-debounce.js"></script>
+<script type="text/javascript">
+ $(document).ready(function(){
+ // Avoid triggering too often (on each keystroke) by using the debounce jQuery plugin:
+ // http://benalman.com/projects/jquery-throttle-debounce-plugin/
+ $("#typeahead_search").keypress($.debounce( 300, function() {
+ $("#typeahead_response").load("<%=search_ahead_url%>?q="+encodeURI(this.value), function() {
+ // When following links in typeahead results, open new tab/window
+ $("#typeahead_response a").attr("target","_blank");
+
+ // Update the public body site search link
+ $("#body-site-search-link").attr("href", "http://www.google.com/#q="+encodeURI($("#typeahead_search").val())+
+ "+site:<%= @info_request.public_body.calculated_home_page %>");
+ });
+ }));
+
+ });
+</script>
+
<% @title = _("Make an {{law_used_short}} request to '{{public_body_name}}'",:law_used_short=>h(@info_request.law_used_short),:public_body_name=>h(@info_request.public_body.name)) %>
-<% if @existing_request %>
- <div class="errorExplanation" id="errorExplanation"><ul>
- <li>
- <%= _('{{existing_request_user}} already
- created the same request on {{date}}. You can either view the <a href="{{existing_request}}">existing request</a>,
- or edit the details below to make a new but similar request.',:existing_request_user=>user_or_you_capital_link(@existing_request.user), :date=>simple_date(@existing_request.created_at), :existing_request=>request_url(@existing_request)) %>
- </li>
- </ul></div>
-<% end %>
+ <h1><%= _('2. Ask for Information') %></h1>
+
+ <% if @existing_request %>
+ <div class="errorExplanation" id="errorExplanation"><ul>
+ <li>
+ <%= _('{{existing_request_user}} already
+ created the same request on {{date}}. You can either view the <a href="{{existing_request}}">existing request</a>,
+ or edit the details below to make a new but similar request.',:existing_request_user=>user_or_you_capital_link(@existing_request.user), :date=>simple_date(@existing_request.created_at), :existing_request=>request_url(@existing_request)) %>
+ </li>
+ </ul></div>
+ <% end %>
+
+ <%= foi_error_messages_for :info_request, :outgoing_message %>
-<%= foi_error_messages_for :info_request, :outgoing_message %>
+ <% form_for(:info_request, @info_request, :html => { :id => 'write_form' } ) do |f| %>
-<div id="request_advice">
- <h1><%= _('Read this before writing your {{info_request_law_used_full}} request', :info_request_law_used_full=>h(@info_request.law_used_full)) %></h1>
- <ul>
- <li>
- <% form_tag("http://www.google.co.uk/search", {:id => "search_body_website_form", :method => "get"} ) do %>
- <p>
- <%= _('First,') %>
- <% if !@info_request.public_body.publication_scheme.empty? %>
- <%= _('<strong>browse</strong> the authority\'s <a href="%s">publication scheme</a> or <strong>search</strong> their web site ...') % [@info_request.public_body.publication_scheme] %>
+ <div id="request_header">
+ <div>
+ <label class="form_label" for="info_request_public_body_id"><%= _('To:') %></label>
+ <span id="to_public_body"><%=h(@info_request.public_body.name)%></span>
+ <div class="form_item_note">
+ <% if @info_request.public_body.info_requests.size > 0 %>
+ <%= _("Browse <a href='{{url}}'>other requests</a> to '{{public_body_name}}' for examples of how to word your request.", :public_body_name=>h(@info_request.public_body.name), :url=>public_body_url(@info_request.public_body)) %>
<% else %>
- <%= _('<strong>search</strong> the authority\'s web site ...') %>
+ <%= _("Browse <a href='{{url}}'>other requests</a> for examples of how to word your request.", :url=>request_list_url) %>
<% end %>
- <% if !@info_request.public_body.calculated_home_page.nil? %>
- <br>
- &nbsp; &nbsp; &nbsp; &nbsp; <%= text_field_tag 'q', params[:q], { :size => 20 } %>
- <%= hidden_field_tag 'as_sitesearch', @info_request.public_body.calculated_home_page %>
- <%= submit_tag _("Search") %>
- <% end %>
- <br>
- ... <%= _('to check that the info isn\'t already published.') %>
- </p>
- <% end %>
- </li>
+ </div>
+ </div>
- <li>
- <% if @info_request.public_body.info_requests.size > 0 %>
- <%= _("Browse <a href='{{url}}'>other requests</a> to '{{public_body_name}}' for examples of how to word your request.", :public_body_name=>h(@info_request.public_body.name), :url=>public_body_url(@info_request.public_body)) %>
- <% else %>
- <%= _('Browse <a href="%s">other requests</a> for examples of how to word your request.') % [request_list_url] %>
+ <div id="request_header_text">
+ <% if @info_request.public_body.has_notes? %>
+ <h3><%= _('Special note for this authority!') %></h3>
+ <p><%= @info_request.public_body.notes_as_html %></p>
<% end %>
- </li>
- <li><%= _('Write your request in <strong>simple, precise language</strong>.') %></li>
- <li><%= _('Ask for <strong>specific</strong> documents or information, this site is not suitable for general enquiries.') %></li>
- <li><%= _('Keep it <strong>focused</strong>, you\'ll be more likely to get what you want (<a href="%s">why?</a>).') % [help_requesting_path + '#focused'] %></li>
- <li><%= _('This site is <strong>public</strong>. Everything you type and any response will be published.') %></li>
- </ul>
- <% if @info_request.public_body.has_notes? %>
- <h1><%= _('Special note for this authority!') %></h1>
- <ul>
- <li><p><%= @info_request.public_body.notes_as_html %></p></li>
- </ul>
- <% end %>
+ <% if @info_request.public_body.eir_only? %>
+ <h3><%= _('Please ask for environmental information only') %></h3>
- <% if @info_request.public_body.eir_only? %>
- <h1><%= _('Please ask for environmental information only') %></h1>
-
- <p><%= _('The Freedom of Information Act <strong>does not apply</strong> to') %> <%=h(@info_request.public_body.name)%>.
- <%= _('However, you have the right to request environmental
- information under a different law') %> (<a href="/help/requesting#eir">explanation</a>).
- <%= _('This covers a very wide spectrum of information about the state of
- the <strong>natural and built environment</strong>, such as:') %>
+ <p><%= _('The Freedom of Information Act <strong>does not apply</strong> to') %> <%=h(@info_request.public_body.name)%>.
+ <%= _('However, you have the right to request environmental
+ information under a different law') %> (<a href="/help/requesting#eir">explanation</a>).
+ <%= _('This covers a very wide spectrum of information about the state of
+ the <strong>natural and built environment</strong>, such as:') %>
+ <ul>
+ <li><%= _('Air, water, soil, land, flora and fauna (including how these effect
+ human beings)') %></li>
+ <li><%= _('Information on emissions and discharges (e.g. noise, energy,
+ radiation, waste materials)') %></li>
+ <li><%= _('Human health and safety') %></li>
+ <li><%= _('Cultural sites and built structures (as they may be affected by the
+ environmental factors listed above)') %></li>
+ <li><%= _('Plans and administrative measures that affect these matters') %></li>
+ </ul>
+
+ <p><%= _('Please only request information that comes under those categories, <strong>do not waste your
+ time</strong> or the time of the public authority by requesting unrelated information.') %></p>
+ <% end %>
+ </div>
+
+ <p>
+ <label class="form_label" for="typeahead_search"><%= _('Summary:') %></label>
+ <%= f.text_field :title, :size => 50, :id =>"typeahead_search" %>
+ </p>
+ <div class="form_item_note">
+ (<%= _("a one line summary of the information you are requesting, \n\t\t\te.g.") %>
+ <% if @info_request.law_used == 'eir' %>
+ <%= _("'Pollution levels over time for the River Tyne'") %>
+ <% else %>
+ <%= _("'Crime statistics by ward level for Wales'") %>
+ <% end %>
+ )
+ </div>
+
+ <div id="typeahead_response">
+ </div>
+ </div>
+
+ <div id="request_advice">
<ul>
- <li><%= _('Air, water, soil, land, flora and fauna (including how these effect
- human beings)') %></li>
- <li><%= _('Information on emissions and discharges (e.g. noise, energy,
- radiation, waste materials)') %></li>
- <li><%= _('Human health and safety') %></li>
- <li><%= _('Cultural sites and built structures (as they may be affected by the
- environmental factors listed above)') %></li>
- <li><%= _('Plans and administrative measures that affect these matters') %></li>
+ <li><%= _('Write your request in <strong>simple, precise language</strong>.') %></li>
+ <li><%= _('Ask for <strong>specific</strong> documents or information, this site is not suitable for general enquiries.') %></li>
+ <li><%= _('Keep it <strong>focused</strong>, you\'ll be more likely to get what you want (<a href="%s">why?</a>).') % [help_requesting_path + '#focused'] %></li>
</ul>
+ </div>
- <p><%= _('Please only request information that comes under those categories, <strong>do not waste your
- time</strong> or the time of the public authority by requesting unrelated information.') %></p>
- <% end %>
-</div>
-
-<% form_for(:info_request, @info_request, :html => { :id => 'write_form' } ) do |f| %>
-
- <div id="request_form">
- <h1>
- <label class="form_label" for="info_request_public_body_id"><%= _('To:') %></label>
- <span id="to_public_body"><%=h(@info_request.public_body.name)%></span>
- </h1>
-
- <p>
- <label class="form_label" for="info_request_title"><%= _('Summary:') %></label>
- <%= f.text_field :title, :size => 50 %>
- </p>
- <div class="form_item_note">
- (<%= _('a one line summary of the information you are requesting,
- e.g.') %>
- <% if @info_request.law_used == 'eir' %>
- <%= _("'Pollution levels over time for the River Tyne'") %>
- <% else %>
- <%= _("'Crime statistics by ward level for Wales'") %>
- <% end %>
- )
- </div>
-
- <% fields_for :outgoing_message do |o| %>
- <p>
- <label class="form_label" for="outgoing_message_body"><%= _('Your request:') %></label>
- <%= o.text_area :body, :rows => 20, :cols => 60 %>
- </p>
- <% end %>
-
+ <div id="request_form">
+ <% fields_for :outgoing_message do |o| %>
+ <p>
+ <label class="form_label" for="outgoing_message_body"><%= _('Your request:') %></label>
+ <%= o.text_area :body, :rows => 20, :cols => 60 %>
+ </p>
+ <% end %>
+
<% if !@user %>
<p class="form_note">
<%= _('Everything that you enter on this page, including <strong>your name</strong>,
@@ -126,18 +128,18 @@
this website forever (<a href="%s">why?</a>).') % [help_privacy_path+"#public_request"] %>
</p>
<% end %>
-
- <p class="form_note">
- <%= _('<strong> Can I request information about myself?</strong>
- <a href="%s">No! (Click here for details)</a>') % [help_requesting_path+"#data_protection"] %>
- </p>
-
- <div class="form_button">
- <%= f.hidden_field(:public_body_id, { :value => @info_request.public_body_id } ) %>
- <%= hidden_field_tag(:submitted_new_request, 1 ) %>
- <%= hidden_field_tag(:preview, 1 ) %>
- <%= submit_tag _("Preview your public request") %>
- </div>
+
+ <p class="form_note">
+ <%= _("<strong> Can I request information about myself?</strong>\n" +
+ "\t\t\t<a href=\"%s\">No! (Click here for details)</a>") % [help_requesting_path+"#data_protection"] %>
+ </p>
+
+ <div class="form_button">
+ <%= f.hidden_field(:public_body_id, { :value => @info_request.public_body_id } ) %>
+ <%= hidden_field_tag(:submitted_new_request, 1 ) %>
+ <%= hidden_field_tag(:preview, 1 ) %>
+ <%= submit_tag _("Preview your public request") %>
+ </div>
<% if !@info_request.tag_string.empty? %>
<p class="form_note">
@@ -148,8 +150,8 @@
<strong>Tags:</strong> <%=h @info_request.tag_string %>
</p>
<% end %>
-
- </div>
+
+ </div>
<% end %>
diff --git a/app/views/request/preview.rhtml b/app/views/request/preview.rhtml
index 6f6ecb2f9..45b6a3dc1 100644
--- a/app/views/request/preview.rhtml
+++ b/app/views/request/preview.rhtml
@@ -2,7 +2,7 @@
<% form_for(:info_request, @info_request, :html => { :id => 'preview_form' } ) do |f| %>
- <h1><%= _('Now preview your request') %></h1>
+ <h1><%= _('3. Now check your request') %></h1>
<ul>
<li><%= _('Check you haven\'t included any <strong>personal information</strong>.') %></li>
<li><%= _('Your name, request and any responses will appear in <strong>search engines</strong>
@@ -37,14 +37,12 @@
<%= f.hidden_field(:tag_string) %>
<%= hidden_field_tag(:submitted_new_request, 1) %>
<%= hidden_field_tag(:preview, 0 ) %>
- <%= submit_tag _("Re-edit this request"), :name => 'reedit' %>
- <%= submit_tag _("Send public ") + h(@info_request.law_used_full) + " request", :name => 'submit' %>
+ <%= submit_tag _("Edit this request"), :name => 'reedit', :id => 'reedit_button' %>
+ <%= submit_tag _("Send request"), :name => 'submit', :id => 'submit_button' %>
</p>
<% if !@info_request.tag_string.empty? %>
<p><strong><%= _('Tags:') %></strong> <%=h @info_request.tag_string %></p>
<% end %>
-<% end %>
-
-
+<% end %> \ No newline at end of file
diff --git a/app/views/request/select_authority.rhtml b/app/views/request/select_authority.rhtml
new file mode 100644
index 000000000..55ebc40c4
--- /dev/null
+++ b/app/views/request/select_authority.rhtml
@@ -0,0 +1,68 @@
+<script type="text/javascript" src="/javascripts/ba-throttle-debounce.js"></script>
+<script type="text/javascript">
+ $(document).ready(function(){
+ $("#authority_preview").hide();
+
+ // Avoid triggering too often (on each keystroke) by using the debounce jQuery plugin:
+ // http://benalman.com/projects/jquery-throttle-debounce-plugin/
+ $("#query").keypress($.debounce( 300, function() {
+ // Do a type ahead search and display results
+ $("#typeahead_response").load("<%=search_ahead_bodies_url%>?q="+encodeURI(this.value), function() {
+ $("#authority_preview").hide(); // Hide the preview, since results have changed
+
+ });
+ }));
+ // We're using the existing body list: we intercept the clicks on the titles to
+ // display a preview on the right hand side of the screen
+ $("#typeahead_response a").live('click', function() {
+ $("#authority_preview").load(this.href+" #public_body_show", function() {
+ $("#authority_preview").show();
+ $("#authority_preview #header_right").hide();
+ });
+ return false;
+ });
+ });
+</script>
+
+<% @title = _("Select the authority to write to") %>
+
+ <h1 style="clear: left"><%= _('1. Select an authority') %></h1>
+
+ <div id="authority_selection">
+ <% form_tag({:controller => "request", :action => "select_authority"}, {:id => "search_form", :method => "get"}) do %>
+ <p>
+ <p>
+ <%= _('First, type in the <strong>name of the UK public authority</strong> you\'d
+ <br>like information from. <strong>By law, they have to respond</strong>
+ (<a href="%s">why?</a>).') % help_about_url %>
+ </p>
+ <%= text_field_tag 'query', params[:query], { :size => 30 } %>
+ <%= hidden_field_tag 'bodies', 1 %>
+ <%= submit_tag _('Search') %>
+ </p>
+ <% end %>
+ <div id="typeahead_response">
+ <% if !@xapian_requests.nil? %>
+ <% if @xapian_requests.results.size > 0 %>
+ <h3><%= _('Top search results:') %></h3>
+ <p>
+ <%= _('Select one to see more information about the authority.')%>
+ </p>
+ <% else %>
+ <h3><%= _('No results found.') %></h3>
+ <% end %>
+ <div id="authority_search_ahead_results">
+ <% for result in @xapian_requests.results %>
+ <%= render :partial => 'public_body/body_listing_single', :locals => { :public_body => result[:model] } %>
+ <% end %>
+ </div>
+ <% end %>
+
+
+
+ </div>
+ </div>
+
+ <div id="authority_preview">
+ </div>
+
diff --git a/app/views/request/show.rhtml b/app/views/request/show.rhtml
index 2897a3564..c5d040fb7 100644
--- a/app/views/request/show.rhtml
+++ b/app/views/request/show.rhtml
@@ -22,7 +22,7 @@
<%= render :partial => 'sidebar' %>
-<div id="request_main">
+<div id="left_column">
<h1><%=h(@info_request.title)%></h1>
<% if @info_request.user.profile_photo %>
diff --git a/app/views/request/simple_correspondence.rhtml b/app/views/request/simple_correspondence.rhtml
new file mode 100644
index 000000000..45b90b84b
--- /dev/null
+++ b/app/views/request/simple_correspondence.rhtml
@@ -0,0 +1,45 @@
+<%= _('This is a plain-text version of the Freedom of Information request "{{request_title}}". The latest, full version is available online at {{full_url}}', :request_title => @info_request.title, :full_url => "http://#{MySociety::Config.get('DOMAIN')}#{show_request_path(:url_title=>@info_request.url_title)}") %>.
+
+<% for info_request_event in @info_request_events %>
+<%
+ incoming_message = nil
+ if info_request_event.visible
+ if !info_request_event.nil? && info_request_event.event_type == 'response'
+ incoming_message = info_request_event.incoming_message
+ end
+
+
+ if not incoming_message.nil?
+ if !incoming_message.safe_mail_from.nil? && incoming_message.safe_mail_from.strip != @info_request.public_body.name.strip %>
+<%= _('From:') %> <%= incoming_message.safe_mail_from %><% end
+ if incoming_message.safe_mail_from.nil? || (incoming_message.mail_from_domain == @info_request.public_body.request_email_domain) %>, <%= @info_request.public_body.name %><% end %>
+<%= _('To:') %> <%= @info_request.user.name %>
+<%= _('Date:') %> <%= simple_date(incoming_message.sent_at) %>
+
+<%= incoming_message.get_body_for_quoting %>
+<% incoming_message.get_attachments_for_display.each do |a| %>
+ <%= _('Attachment:') %> <%= a.display_filename %> (<%= a.display_size %>)
+ <% end %>
+<%
+elsif [ 'sent', 'followup_sent' ].include?(info_request_event.event_type)
+ outgoing_message = info_request_event.outgoing_message
+ %>
+<%= _('From:') %> <%= @info_request.user.name %>
+<%= _('To:') %> <%= @info_request.public_body.name %>
+<%= _('Date:') %> <%= simple_date(info_request_event.created_at) %>
+<%
+ text = outgoing_message.body.strip
+ outgoing_message.remove_privacy_sensitive_things!(text) %>
+
+<%= text %>
+<% elsif [ 'resent', 'followup_resent' ].include?(info_request_event.event_type) %>
+<%= _('Date:') %> <%= simple_date(info_request_event.created_at) %>
+Sent <% if info_request_event.outgoing_message.message_type == 'initial_request' %> request <% elsif info_request_event.outgoing_message.message_type == 'followup' %> a follow up <% else %> <% raise "unknown message_type" %><% end %> to <%= public_body_link(@info_request.public_body) %> again<% if not info_request_event.same_email_as_previous_send? %>, using a new contact address<% end %>.
+
+<% elsif info_request_event.event_type == 'comment'
+ comment = info_request_event.comment
+%>
+<%= _("{{username}} left an annotation:", :username =>comment.user.name) %> (<%= simple_date(comment.created_at || Time.now) %>)
+<%= comment.body.strip %>
+<% end %>
+-------------------------------<% end %><% end %>
diff --git a/app/views/track/_tracking_links.rhtml b/app/views/track/_tracking_links.rhtml
index a08f97c08..f50a8bbbf 100644
--- a/app/views/track/_tracking_links.rhtml
+++ b/app/views/track/_tracking_links.rhtml
@@ -4,11 +4,10 @@
end
%>
-
<% if own_request %>
<p><%= _('This is your own request, so you will be automatically emailed when new responses arrive.')%></p>
<% elsif existing_track %>
- <% form_tag({:controller => 'track', :action => 'update', :track_id => existing_track.id}, :class => "feed_form_" + location) do %>
+ <% form_tag({:controller => 'track', :action => 'update', :track_id => existing_track.id}, :class => "feed_form feed_form_" + location) do %>
<p>
<%= track_thing.params[:verb_on_page_already] %>
<%= hidden_field_tag 'track_medium', "delete" %>
@@ -16,15 +15,17 @@
<%= submit_tag "unsubscribe" %>
</p>
<% end %>
-<% else %>
+<% elsif track_thing %>
<div class="feed_link feed_link_<%=location%>">
<%= link_to '<img src="/images/email-16.png" alt="">', do_track_url(track_thing) %>
- <%= link_to track_thing.params[:verb_on_page], do_track_url(track_thing) %>
+ <%= link_to _("Follow by email"), do_track_url(track_thing) %>
+ </div>
+
+ <div class="feed_link feed_link_<%=location%>">
+ <%= link_to '<img src="/images/feed-16.png" alt="">', do_track_url(track_thing, 'feed') %>
+ <%= link_to (location == 'sidebar' ? _('RSS feed of updates') : _('RSS feed')), do_track_url(track_thing, 'feed') %>
</div>
<% end %>
-<div class="feed_link feed_link_<%=location%>">
- <%= link_to '<img src="/images/feed-16.png" alt="">', do_track_url(track_thing, 'feed') %>
- <%= link_to (location == 'sidebar' ? 'RSS feed of updates' : 'RSS feed'), do_track_url(track_thing, 'feed') %>
-</div>
+
diff --git a/app/views/track_mailer/event_digest.rhtml b/app/views/track_mailer/event_digest.rhtml
index 46f230da1..089b778f8 100644
--- a/app/views/track_mailer/event_digest.rhtml
+++ b/app/views/track_mailer/event_digest.rhtml
@@ -18,17 +18,17 @@
# e.g. Julian Burgess sent a request to Royal Mail Group (15 May 2008)
if event.event_type == 'response'
url = main_url(incoming_message_url(event.incoming_message))
- main_text += event.info_request.public_body.name + " sent a response to " + event.info_request.user.name
+ main_text += _("{{public_body}} sent a response to {{user_name}}", :public_body => event.info_request.public_body.name, :user_name => event.info_request.user.name)
elsif event.event_type == 'followup_sent'
url = main_url(outgoing_message_url(event.outgoing_message))
- main_text += event.info_request.user.name + " sent a follow up message to " + event.info_request.public_body.name
+ main_text += _("{{user_name}} sent a follow up message to {{public_body}}", :user_name => event.info_request.user.name, :public_body => event.info_request.public_body.name)
elsif event.event_type == 'sent'
# this is unlikely to happen in real life, but happens in the test code
url = main_url(outgoing_message_url(event.outgoing_message))
- main_text += event.info_request.user.name + " sent a request to " + event.info_request.public_body.name
+ main_text += _("{{user_name}} sent a request to {{public_body}}", :user_name => event.info_request.user.name, :public_body => event.info_request.public_body.name)
elsif event.event_type == 'comment'
url = main_url(comment_url(event.comment))
- main_text += event.comment.user.name + " added an annotation"
+ main_text += _("{{user_name}} added an annotation", :user_name => event.comment.user.name)
else
raise "unknown type in event_digest " + event.event_type
end
@@ -57,10 +57,10 @@
main_text += "\n"
end
-%><%=main_text%>Alter your subscription
+%><%=main_text%><%= _("Alter your subscription")%>
=======================
-Please click on the link below to cancel or alter these emails.
+<% _("Please click on the link below to cancel or alter these emails.") %>
<%=@unsubscribe_url%>
-- <%= _('the {{site_name}} team', :site_name=>site_name) %>
diff --git a/app/views/user/_signin.rhtml b/app/views/user/_signin.rhtml
index 79628b3a9..4fe98ee41 100644
--- a/app/views/user/_signin.rhtml
+++ b/app/views/user/_signin.rhtml
@@ -3,9 +3,9 @@
<% form_tag({:action => "signin"}, {:id => "signin_form"}) do %>
<%= foi_error_messages_for :user_signin %>
- <% if not sign_in_as_existing_user %>
+ <!--<% if not sign_in_as_existing_user %>
<h2><%= _('If you\'ve used {{site_name}} before', :site_name=>site_name)%></h2>
- <% end %>
+ <% end %>-->
<p>
<label class="form_label" for="user_signin_email"><%= _('Your e-mail:')%></label>
@@ -27,7 +27,8 @@
do not use on a public computer) ')%></p>
<div class="form_button">
- <%= hidden_field_tag 'token', params[:token], { :id => 'signin_token' } %>
+ <%= hidden_field_tag 'token', params[:token], {:id => 'signin_token' } %>
+ <%= hidden_field_tag :modal, params[:modal], {:id => 'signin_modal' } %>
<%= submit_tag _('Sign in') %>
</div>
<% end %>
diff --git a/app/views/user/_signup.rhtml b/app/views/user/_signup.rhtml
index 6b0a1f8c7..9c0132f26 100644
--- a/app/views/user/_signup.rhtml
+++ b/app/views/user/_signup.rhtml
@@ -3,15 +3,15 @@
<% form_tag({:action => "signup"}, {:id => "signup_form"}) do %>
<%= foi_error_messages_for :user_signup %>
- <h2><%= _('If you\'re new to {{site_name}}', :site_name=>site_name)%></h2>
+ <!--<h2><%= _('If you\'re new to {{site_name}}', :site_name=>site_name)%></h2>-->
<p>
<label class="form_label" for="user_signup_email"><%= _('Your e-mail:')%></label>
<%= text_field 'user_signup', 'email', { :size => 20 } %>
</p>
<div class="form_item_note">
- <%= ('We will not reveal your email address to anybody unless you or
- the law tell us to (<a href="%s">_details</a>). ') %[help_privacy_path] %>
+ <%= _('We will not reveal your email address to anybody unless you or
+ the law tell us to (<a href="%s">details</a>). ') %[help_privacy_path] %>
</div>
<p>
@@ -36,8 +36,13 @@
<%= password_field 'user_signup', 'password_confirmation', { :size => 15 } %>
</p>
+ <% if @request_from_foreign_country %>
+ <%= recaptcha_tags %>
+ <% end %>
+
<div class="form_button">
- <%= hidden_field_tag 'token', params[:token], { :id => 'signup_token' } %>
+ <%= hidden_field_tag 'token', params[:token], {:id => 'signup_token' } %>
+ <%= hidden_field_tag :modal, params[:modal], {:id => 'signup_modal' } %>
<%= submit_tag _('Sign up') %>
</div>
diff --git a/app/views/user/set_draft_profile_photo.rhtml b/app/views/user/set_draft_profile_photo.rhtml
index 70d27074b..90be49600 100644
--- a/app/views/user/set_draft_profile_photo.rhtml
+++ b/app/views/user/set_draft_profile_photo.rhtml
@@ -2,7 +2,7 @@
<% raise "internal error" if not @user %>
-<h2>Choose your profile photo</h2>
+<h2><%= _("Choose your profile photo") %></h2>
<%= foi_error_messages_for :draft_profile_photo %>
@@ -52,7 +52,7 @@
<% end %>
<p>
- <%= link_to h("Cancel, return to your profile page"), user_url(@user) %>
+ <%= link_to _("Cancel, return to your profile page"), user_url(@user) %>
</p>
</div>
diff --git a/app/views/user/show.rhtml b/app/views/user/show.rhtml
index 8fd6c52ad..2ae6e5ed5 100644
--- a/app/views/user/show.rhtml
+++ b/app/views/user/show.rhtml
@@ -24,20 +24,20 @@
</div>
<% end %>
-
-<div id="request_sidebar">
- <h2><%= _('Track this person')%></h2>
- <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'sidebar' } %>
-
- <h2><%= _('On this page')%></h2>
- <a href="#foi_requests"><%= _('FOI requests')%></a>
- <br><a href="#annotations"><%= _('Annotations')%></a>
- <% if @is_you %>
- <br><a href="#email_subscriptions"><%= _('Email subscriptions')%></a>
- <% end %>
-</div>
-
-<div class="single_user">
+<div>
+ <div id="header_right">
+ <h2><%= _('Track this person')%></h2>
+ <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'sidebar' } %>
+
+ <h2><%= _('On this page')%></h2>
+ <a href="#foi_requests"><%= _('FOI requests')%></a>
+ <br><a href="#annotations"><%= _('Annotations')%></a>
+ <% if @is_you %>
+ <br><a href="#email_subscriptions"><%= _('Email subscriptions')%></a>
+ <% end %>
+ </div>
+
+ <div class="header_left">
<p id="user_photo_on_profile">
<% if @display_user.profile_photo %>
<% if @is_you %>
@@ -113,19 +113,37 @@
<%= _('<a href="%s">Sign in</a> to change password, subscriptions and more ({{user_name}} only)',:user_name=>h(@display_user.name)) % [signin_url(:r => request.request_uri)]%>
</p>
<% end %>
+ </div>
+</div>
+<div style="clear:both"></div>
+ <% form_tag(show_user_url, :method => "get", :id=>"search_form") do %>
+ <div>
+ <%= text_field_tag(:user_query, params[:user_query]) %>
+ <% if @is_you %>
+ <%= submit_tag(_("Search your contributions")) %>
+ <% else %>
+ <%= submit_tag(_("Search contributions by this person")) %>
+ <% end %>
+ </div>
+ <% end %>
+
<% if !@xapian_requests.nil? %>
<% if @xapian_requests.results.empty? %>
<% if @page == 1 %>
- <h2 id="foi_requests"><%= @is_you ? 'Freedom of Information requests made by you' : 'Freedom of Information requests made by this person' %> </h2>
+ <h2 class="foi_results" id="foi_requests"><%= @is_you ? 'Freedom of Information requests made by you' : 'Freedom of Information requests made by this person' %> <%= @match_phrase %>
+</h2>
<p><%= @is_you ? _('You have made no Freedom of Information requests using this site.') : _('This person has made no Freedom of Information requests using this site.') %>
+ <%= @page_desc %>
<% end %>
<% else %>
- <h2 id="foi_requests">
- <%= @is_you ? n_('Your %d Freedom of Information request', 'Your %d Freedom of Information requests', @display_user.info_requests.size) % @display_user.info_requests.size : n_('This person\'s %d Freedom of Information request', 'This person\'s %d Freedom of Information requests', @display_user.info_requests.size) % @display_user.info_requests.size %>
+ <h2 class="foi_results" id="foi_requests">
+ <%= @is_you ? n_('Your %d Freedom of Information request', 'Your %d Freedom of Information requests', @xapian_requests.results.size) % @xapian_requests.results.size : n_('This person\'s %d Freedom of Information request', 'This person\'s %d Freedom of Information requests', @xapian_requests.results.size) % @xapian_requests.results.size %>
<!-- matches_estimated <%=@xapian_requests.matches_estimated%> -->
- <%= @page_desc %>
+ <%= @match_phrase %>
+ <%= @page_desc %>
</h2>
+
<% for result in @xapian_requests.results %>
<%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
@@ -134,14 +152,16 @@
<%= will_paginate WillPaginate::Collection.new(@page, @per_page, @display_user.info_requests.size) %>
<% end %>
<% else %>
- <h2 id="foi_requests"><%= @is_you ? _('Freedom of Information requests made by you') : _('Freedom of Information requests made by this person') %> </h2>
+ <h2 class="foi_results" id="foi_requests"><%= @is_you ? _('Freedom of Information requests made by you') : _('Freedom of Information requests made by this person') %> </h2>
<p><%= _('The search index is currently offline, so we can\'t show the Freedom of Information requests this person has made.')%></p>
<% end %>
<% if !@xapian_comments.nil? %>
<% if @xapian_comments.results.empty? %>
<% if @page == 1 %>
- <h2><%= @is_you ? _('Your annotations') : _('This person\'s annotations') %></h2>
+ <h2><%= @is_you ? _('Your annotations') : _('This person\'s annotations') %>
+ <%= @match_phrase %>
+ </h2>
<p><%= _('None made.')%></p>
<% end %>
<% else %>
@@ -166,7 +186,7 @@
<% else %>
<h2 id="email_subscriptions"> Your <%=pluralize(@track_things.size, _('email subscription')) %> </h2>
<% if @track_things_grouped.size == 1 %>
- <% form_tag :controller => 'track', :action => 'delete_all_type' do %>
+ <% form_tag({:controller => 'track', :action => 'delete_all_type'}, :class => "feed_form") do %>
<h3>
<%=TrackThing.track_type_description(@track_things[0].track_type)%>
<%= hidden_field_tag 'track_type', @track_things[0].track_type %>
@@ -180,7 +200,7 @@
<% end %>
<% for track_type, track_things in @track_things_grouped %>
<% if @track_things_grouped.size > 1 %>
- <% form_tag :controller => 'track', :action => 'delete_all_type' do %>
+ <% form_tag({:controller => 'track', :action => 'delete_all_type'}, :class => "feed_form") do %>
<h3>
<%=TrackThing.track_type_description(track_type)%>
<%= hidden_field_tag 'track_type', track_type %>
@@ -196,7 +216,7 @@
<ul>
<% for track_thing in track_things %>
<li>
- <% form_tag :controller => 'track', :action => 'update', :track_id => track_thing.id do %>
+ <% form_tag({:controller => 'track', :action => 'update', :track_id => track_thing.id}, :class => "feed_form") do %>
<div>
<%= track_thing.params[:list_description] %>
<%= hidden_field_tag 'track_medium', "delete", { :id => 'track_medium_' + track_thing.id.to_s } %>
@@ -210,6 +230,3 @@
<% end %>
<% end %>
<% end %>
-
-</div>
-
diff --git a/app/views/user/sign.rhtml b/app/views/user/sign.rhtml
index b76edbc64..76732c09a 100644
--- a/app/views/user/sign.rhtml
+++ b/app/views/user/sign.rhtml
@@ -21,17 +21,26 @@
<div id="sign_together">
- <p id="sign_in_reason">
+ <!--<p id="sign_in_reason">
<% if @post_redirect.reason_params[:web].empty? %>
<%= _(' Please sign in or make a new account.') %>
<% else %>
<%= @post_redirect.reason_params[:web] %>, <%= _('please sign in or make a new account.') %>
<% end %>
- </p>
-
- <%= render :partial => 'signin', :locals => { :sign_in_as_existing_user => false } %>
- <%= render :partial => 'signup' %>
-
+ </p>-->
+
+ <div id="left_half">
+ <h1>Sign in</h1>
+ <%= render :partial => 'signin', :locals => { :sign_in_as_existing_user => false } %>
+ </div>
+ <div id="middle_strip">
+ - or -
+ </div>
+ <div id="right_half">
+ <h1>Sign up</h1>
+ <%= render :partial => 'signup' %>
+ </div>
+ <div style="clear:both"></div>
</div>
<% end %>
diff --git a/app/views/user/signin_successful.rhtml b/app/views/user/signin_successful.rhtml
new file mode 100644
index 000000000..8c4b2b2d4
--- /dev/null
+++ b/app/views/user/signin_successful.rhtml
@@ -0,0 +1,9 @@
+<%= _("You're in. <a href=\"#\" id=\"send-request\">Continue sending your request</a>") %>
+
+<script type="text/javascript">
+ parent.modal_signin_successful = true;
+
+ $("#send-request").click(function() {
+ parent.$.fancybox.close(); return false;
+ });
+</script>
diff --git a/app/views/user/wrong_user.rhtml b/app/views/user/wrong_user.rhtml
index 9878d08ae..30256a639 100644
--- a/app/views/user/wrong_user.rhtml
+++ b/app/views/user/wrong_user.rhtml
@@ -1,8 +1,4 @@
-
<p id="sign_in_reason">
-<%= @reason_params[:web] %>, please
-<%= link_to _('sign out'), signout_url(:r => request.request_uri) %>,
-<%= _('and sign in as ')%><%= h(@reason_params[:user_name]) %>.
+<%= _('Sorry, but only {{user_name}} is allowed to do that.', :user_name => h(@reason_params[:user_name])) %>
</p>
-