aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--Rakefile2
-rw-r--r--app/controllers/admin_controller.rb1
-rw-r--r--app/controllers/public_body_controller.rb12
-rw-r--r--app/controllers/request_controller.rb2
-rw-r--r--app/models/incoming_message.rb34
-rw-r--r--app/models/info_request.rb20
-rw-r--r--app/models/public_body.rb48
-rw-r--r--app/views/layouts/default.rhtml6
-rw-r--r--app/views/user/bad_token.rhtml2
-rw-r--r--config/boot.rb2
-rw-r--r--config/environment.rb19
-rw-r--r--config/general.yml118
-rw-r--r--config/initializers/fast_gettext.rb2
-rw-r--r--config/routes.rb2
-rw-r--r--config/test.yml118
-rw-r--r--db/.gitignore1
-rw-r--r--doc/CHANGES.md17
-rw-r--r--doc/INSTALL.md55
-rw-r--r--doc/THEMES.md33
-rw-r--r--doc/todo.txt559
-rw-r--r--lib/languages.rb1
-rw-r--r--lib/old_rubygems_patch.rb6
-rw-r--r--lib/ruby19.rb8
-rw-r--r--lib/sendmail_return_path.rb2
-rw-r--r--lib/tasks/rspec.rake3
-rw-r--r--lib/tnef.rb2
-rw-r--r--public/images/logo.pngbin1064 -> 1348 bytes
-rw-r--r--public/images/quote-marks.pngbin470 -> 464 bytes
-rw-r--r--public/stylesheets/main.css2612
-rw-r--r--public/stylesheets/print.css2
-rw-r--r--public/stylesheets/theme.css1141
-rwxr-xr-xscript/about2
-rwxr-xr-xscript/breakpointer2
-rwxr-xr-xscript/console2
-rwxr-xr-xscript/destroy2
-rwxr-xr-xscript/generate2
-rwxr-xr-xscript/handle-mail-replies12
-rwxr-xr-xscript/performance/benchmarker2
-rwxr-xr-xscript/performance/profiler2
-rwxr-xr-xscript/plugin2
-rwxr-xr-xscript/process/inspector2
-rwxr-xr-xscript/process/reaper2
-rwxr-xr-xscript/process/spawner2
-rwxr-xr-xscript/runner2
-rwxr-xr-xscript/server2
-rwxr-xr-xscript/wraptest2
-rw-r--r--spec/controllers/admin_public_body_controller_spec.rb8
-rw-r--r--spec/controllers/admin_request_controller_spec.rb4
-rw-r--r--spec/controllers/admin_track_controller_spec.rb2
-rw-r--r--spec/controllers/admin_user_controller_spec.rb2
-rw-r--r--spec/controllers/comment_controller_spec.rb2
-rw-r--r--spec/controllers/general_controller_spec.rb26
-rw-r--r--spec/controllers/public_body_controller_spec.rb23
-rw-r--r--spec/controllers/request_controller_spec.rb59
-rw-r--r--spec/controllers/request_game_controller_spec.rb2
-rw-r--r--spec/controllers/track_controller_spec.rb8
-rw-r--r--spec/controllers/user_controller_spec.rb7
-rw-r--r--spec/fixtures/files/email-folding-example-1.txt32
-rw-r--r--spec/fixtures/files/email-folding-example-1.txt.expected10
-rw-r--r--spec/fixtures/files/email-folding-example-10.txt52
-rw-r--r--spec/fixtures/files/email-folding-example-10.txt.expected25
-rw-r--r--spec/fixtures/files/email-folding-example-2.txt7
-rw-r--r--spec/fixtures/files/email-folding-example-2.txt.expected4
-rw-r--r--spec/fixtures/files/email-folding-example-3.txt18
-rw-r--r--spec/fixtures/files/email-folding-example-3.txt.expected5
-rw-r--r--spec/fixtures/files/email-folding-example-4.txt37
-rw-r--r--spec/fixtures/files/email-folding-example-4.txt.expected15
-rw-r--r--spec/fixtures/files/email-folding-example-5.txt35
-rw-r--r--spec/fixtures/files/email-folding-example-5.txt.expected24
-rw-r--r--spec/fixtures/files/email-folding-example-6.txt30
-rw-r--r--spec/fixtures/files/email-folding-example-6.txt.expected15
-rw-r--r--spec/fixtures/files/email-folding-example-7.txt30
-rw-r--r--spec/fixtures/files/email-folding-example-7.txt.expected16
-rw-r--r--spec/fixtures/files/email-folding-example-8.txt18
-rw-r--r--spec/fixtures/files/email-folding-example-8.txt.expected6
-rw-r--r--spec/fixtures/files/email-folding-example-9.txt29
-rw-r--r--spec/fixtures/files/email-folding-example-9.txt.expected9
-rw-r--r--spec/fixtures/files/iso8859_2_email.html18
-rw-r--r--spec/fixtures/files/iso8859_2_raw_email.email50
-rw-r--r--spec/integration/errors_spec.rb22
-rw-r--r--spec/integration/search_request_spec.rb22
-rw-r--r--spec/lib/tmail_extensions_spec.rb10
-rw-r--r--spec/lib/whatdotheyknow/strip_empty_sessions_spec.rb2
-rw-r--r--spec/models/has_tag_string_tag_spec.rb2
-rw-r--r--spec/models/incoming_message_spec.rb30
-rw-r--r--spec/models/info_request_spec.rb14
-rw-r--r--spec/models/outgoing_mailer_spec.rb4
-rw-r--r--spec/models/outgoing_message_spec.rb4
-rw-r--r--spec/models/public_body_spec.rb40
-rw-r--r--spec/models/request_mailer_spec.rb2
-rw-r--r--spec/models/track_thing_spec.rb2
-rw-r--r--spec/models/user_spec.rb14
-rw-r--r--spec/models/xapian_spec.rb17
-rw-r--r--spec/spec_helper.rb29
-rw-r--r--spec/views/public_body/show.rhtml_spec.rb2
-rw-r--r--spec/views/request/_after_actions.rhtml_spec.rb2
-rw-r--r--spec/views/request/_describe_state.rhtml_spec.rb2
-rw-r--r--spec/views/request/list.rhtml_spec.rb2
-rw-r--r--spec/views/request/show.rhtml_spec.rb2
-rw-r--r--spec/views/request_game/play.rhtml_spec.rb2
-rw-r--r--vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb81
-rw-r--r--vendor/plugins/has_tag_string/lib/has_tag_string.rb2
m---------vendor/rails-locales0
104 files changed, 2675 insertions, 3136 deletions
diff --git a/.gitignore b/.gitignore
index 92831606a..ab1f3004f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,4 +16,6 @@ TAGS
/vendor/plugins/*theme
/locale/model_attributes.rb
/files/
-public/download \ No newline at end of file
+public/download
+general.yml
+
diff --git a/Rakefile b/Rakefile
index 7d7ac5bc7..d4ebade51 100644
--- a/Rakefile
+++ b/Rakefile
@@ -5,7 +5,7 @@ require(File.join(File.dirname(__FILE__), 'config', 'boot'))
require 'rake'
require 'rake/testtask'
-require 'rake/rdoctask'
+require 'rdoc/task'
require 'tasks/rails'
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index 0bfbcd3d1..adb506b91 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -53,6 +53,7 @@ class AdminController < ApplicationController
authenticate_or_request_with_http_basic do |user_name, password|
if user_name == config_username && password == config_password
session[:using_admin] = 1
+ request.env['REMOTE_USER'] = user_name
else
request_http_basic_authentication
end
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb
index 251ab5efe..ff9fbadb3 100644
--- a/app/controllers/public_body_controller.rb
+++ b/app/controllers/public_body_controller.rb
@@ -91,31 +91,31 @@ class PublicBodyController < ApplicationController
@query = "%#{params[:public_body_query].nil? ? "" : params[:public_body_query]}%"
@tag = params[:tag]
@locale = self.locale_from_params()
-
+ default_locale = I18n.default_locale.to_s
locale_condition = "(upper(public_body_translations.name) LIKE upper(?)
OR upper(public_body_translations.notes) LIKE upper (?))
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, @query, @query, @locale]
+ conditions = [locale_condition, @query, @query, default_locale]
elsif @tag == 'other'
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', @query, @query, @locale]
+ and has_tag_string_tags.name in (' + category_list + ')) = 0', @query, @query, default_locale]
elsif @tag.size == 1
@tag.upcase!
- conditions = [locale_condition + ' AND public_body_translations.first_letter = ?', @query, @query, @locale, @tag]
+ conditions = [locale_condition + ' AND public_body_translations.first_letter = ?', @query, @query, default_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', @query, @query, @locale, name, value]
+ and has_tag_string_tags.name = ? and has_tag_string_tags.value = ?) > 0', @query, @query, default_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', @query, @query, @locale, @tag]
+ and has_tag_string_tags.name = ?) > 0', @query, @query, default_locale, @tag]
end
if @tag == "all"
@description = ""
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index 4b7884065..1801648ca 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -774,7 +774,7 @@ class RequestController < ApplicationController
: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)
+ updated = Digest::SHA1.hexdigest(info_request.get_last_event.created_at.to_i.to_s + info_request.updated_at.to_i.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)
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 2b795ddf5..0608d46d7 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -267,7 +267,7 @@ class FOIAttachment
tempfile.flush
if self.content_type == 'application/pdf'
- IO.popen("/usr/bin/pdftohtml -nodrm -zoom 1.0 -stdout -enc UTF-8 -noframes " + tempfile.path + "", "r") do |child|
+ IO.popen("#{`which pdftohtml`.chomp} -nodrm -zoom 1.0 -stdout -enc UTF-8 -noframes " + tempfile.path + "", "r") do |child|
html = child.read()
end
elsif self.content_type == 'application/rtf'
@@ -447,7 +447,7 @@ class IncomingMessage < ActiveRecord::Base
# Special cases for some content types
if content_type == 'application/pdf'
uncompressed_text = nil
- IO.popen("/usr/bin/pdftk - output - uncompress", "r+") do |child|
+ IO.popen("#{`which pdftk`.chomp} - output - uncompress", "r+") do |child|
child.write(text)
child.close_write()
uncompressed_text = child.read()
@@ -464,7 +464,7 @@ class IncomingMessage < ActiveRecord::Base
if MySociety::Config.get('USE_GHOSTSCRIPT_COMPRESSION') == true
command = "gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=- -"
else
- command = "/usr/bin/pdftk - output - compress"
+ command = "#{`which pdftk`.chomp} - output - compress"
end
IO.popen(command, "r+") do |child|
child.write(censored_uncompressed_text)
@@ -606,21 +606,13 @@ class IncomingMessage < ActiveRecord::Base
text.gsub!(/^(>.*\n)/, replacement)
text.gsub!(/^(On .+ (wrote|said):\n)/, replacement)
- # Multiple line sections
- # http://www.whatdotheyknow.com/request/identity_card_scheme_expenditure
- # http://www.whatdotheyknow.com/request/parliament_protest_actions
- # http://www.whatdotheyknow.com/request/64/response/102
- # http://www.whatdotheyknow.com/request/47/response/283
- # http://www.whatdotheyknow.com/request/30/response/166
- # http://www.whatdotheyknow.com/request/52/response/238
- # http://www.whatdotheyknow.com/request/224/response/328 # example with * * * * *
- # http://www.whatdotheyknow.com/request/297/response/506
- ['-', '_', '*', '#'].each do |score|
+ ['-', '_', '*', '#'].each do |scorechar|
+ score = /(?:[#{scorechar}]\s*){8,}/
text.sub!(/(Disclaimer\s+)? # appears just before
(
- \s*(?:[#{score}]\s*){8,}\s*\n.*? # top line
+ \s*#{score}\n(?:(?!#{score}\n).)*? # top line
(disclaimer:\n|confidential|received\sthis\semail\sin\serror|virus|intended\s+recipient|monitored\s+centrally|intended\s+(for\s+|only\s+for\s+use\s+by\s+)the\s+addressee|routinely\s+monitored|MessageLabs|unauthorised\s+use)
- .*?((?:[#{score}]\s*){8,}\s*\n|\z) # bottom line OR end of whole string (for ones with no terminator XXX risky)
+ .*?(?:#{score}|\z) # bottom line OR end of whole string (for ones with no terminator XXX risky)
)
/imx, replacement)
end
@@ -1120,21 +1112,21 @@ class IncomingMessage < ActiveRecord::Base
tempfile.print body
tempfile.flush
if content_type == 'application/vnd.ms-word'
- AlaveteliExternalCommand.run("/usr/bin/wvText", tempfile.path, tempfile.path + ".txt")
+ AlaveteliExternalCommand.run(`which wvText`.chomp, tempfile.path, tempfile.path + ".txt")
# Try catdoc if we get into trouble (e.g. for InfoRequestEvent 2701)
if not File.exists?(tempfile.path + ".txt")
- AlaveteliExternalCommand.run("/usr/bin/catdoc", tempfile.path, :append_to => text)
+ AlaveteliExternalCommand.run(`which catdoc`.chomp, 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
- AlaveteliExternalCommand.run("/usr/bin/catdoc", tempfile.path, :append_to => text)
+ AlaveteliExternalCommand.run(`which catdoc`.chomp, 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.
- AlaveteliExternalCommand.run("/usr/bin/elinks", "-eval", "'set document.codepage.assume = \"utf-8\"'", "-dump-charset", "utf-8", "-force-html", "-dump",
+ AlaveteliExternalCommand.run(`which elinks`.chomp, "-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
@@ -1145,9 +1137,9 @@ class IncomingMessage < ActiveRecord::Base
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
- AlaveteliExternalCommand.run("/usr/bin/catppt", tempfile.path, :append_to => text)
+ AlaveteliExternalCommand.run(`which catppt`.chomp, tempfile.path, :append_to => text)
elsif content_type == 'application/pdf'
- AlaveteliExternalCommand.run("/usr/bin/pdftotext", tempfile.path, "-", :append_to => text)
+ AlaveteliExternalCommand.run(`which pdftotext`.chomp, 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.
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index 92322f74f..f482ca700 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -240,9 +240,9 @@ public
# into some sort of separate jurisdiction dependent file
if self.public_body.url_name == 'general_register_office'
# without GQ in the subject, you just get an auto response
- self.law_used_full + ' request GQ - ' + self.title
+ _('{{law_used_full}} request GQ - {{title}}',:law_used_full=>self.law_used_full,:title=>self.title)
else
- self.law_used_full + ' request - ' + self.title
+ _('{{law_used_full}} request - {{title}}',:law_used_full=>self.law_used_full,:title=>self.title)
end
end
def email_subject_followup(incoming_message = nil)
@@ -260,36 +260,36 @@ public
# Two sorts of laws for requests, FOI or EIR
def law_used_full
if self.law_used == 'foi'
- return "Freedom of Information"
+ return _("Freedom of Information")
elsif self.law_used == 'eir'
- return "Environmental Information Regulations"
+ return _("Environmental Information Regulations")
else
raise "Unknown law used '" + self.law_used + "'"
end
end
def law_used_short
if self.law_used == 'foi'
- return "FOI"
+ return _("FOI")
elsif self.law_used == 'eir'
- return "EIR"
+ return _("EIR")
else
raise "Unknown law used '" + self.law_used + "'"
end
end
def law_used_act
if self.law_used == 'foi'
- return "Freedom of Information Act"
+ return _("Freedom of Information Act")
elsif self.law_used == 'eir'
- return "Environmental Information Regulations"
+ return _("Environmental Information Regulations")
else
raise "Unknown law used '" + self.law_used + "'"
end
end
def law_used_with_a
if self.law_used == 'foi'
- return "A Freedom of Information request"
+ return _("A Freedom of Information request")
elsif self.law_used == 'eir'
- return "An Environmental Information Regulations request"
+ return _("An Environmental Information Regulations request")
else
raise "Unknown law used '" + self.law_used + "'"
end
diff --git a/app/models/public_body.rb b/app/models/public_body.rb
index ab836657b..453e3a6cf 100644
--- a/app/models/public_body.rb
+++ b/app/models/public_body.rb
@@ -64,8 +64,14 @@ class PublicBody < ActiveRecord::Base
end
def translated_versions=(translation_attrs)
+ def skip?(attrs)
+ valueless = attrs.inject({}) { |h, (k, v)| h[k] = v if v != '' and k != 'locale'; h } # because we want to fall back to alternative translations where there are empty values
+ return valueless.length == 0
+ end
+
if translation_attrs.respond_to? :each_value # Hash => updating
translation_attrs.each_value do |attrs|
+ next if skip?(attrs)
t = translation(attrs[:locale]) || PublicBody::Translation.new
t.attributes = attrs
calculate_cached_fields(t)
@@ -73,6 +79,7 @@ class PublicBody < ActiveRecord::Base
end
else # Array => creating
translation_attrs.each do |attrs|
+ next if skip?(attrs)
new_translation = PublicBody::Translation.new(attrs)
calculate_cached_fields(new_translation)
translations << new_translation
@@ -309,22 +316,23 @@ class PublicBody < ActiveRecord::Base
# The "internal admin" is a special body for internal use.
def PublicBody.internal_admin_body
- pb = PublicBody.find_by_url_name("internal_admin_authority")
- if pb.nil?
- pb = PublicBody.new(
- :name => 'Internal admin authority',
- :short_name => "",
- :request_email => MySociety::Config.get("CONTACT_EMAIL", 'contact@localhost'),
- :home_page => "",
- :notes => "",
- :publication_scheme => "",
- :last_edit_editor => "internal_admin",
- :last_edit_comment => "Made by PublicBody.internal_admin_body"
- )
- pb.save!
+ PublicBody.with_locale(I18n.default_locale) do
+ pb = PublicBody.find_by_url_name("internal_admin_authority")
+ if pb.nil?
+ pb = PublicBody.new(
+ :name => 'Internal admin authority',
+ :short_name => "",
+ :request_email => MySociety::Config.get("CONTACT_EMAIL", 'contact@localhost'),
+ :home_page => "",
+ :notes => "",
+ :publication_scheme => "",
+ :last_edit_editor => "internal_admin",
+ :last_edit_comment => "Made by PublicBody.internal_admin_body"
+ )
+ pb.save!
+ end
+ return pb
end
-
- return pb
end
@@ -360,11 +368,11 @@ class PublicBody < ActiveRecord::Base
set_of_importing = Set.new()
field_names = { 'name'=>1, 'request_email'=>2 } # Default values in case no field list is given
line = 0
- CSV::Reader.parse(csv) do |row|
+ CSV.parse(csv) do |row|
line = line + 1
# Parse the first line as a field list if it starts with '#'
- if line==1 and row.to_s =~ /^#(.*)$/
+ if line==1 and row.first.to_s =~ /^#(.*)$/
row[0] = row[0][1..-1] # Remove the # sign on first field
row.each_with_index {|field, i| field_names[field] = i}
next
@@ -390,7 +398,7 @@ class PublicBody < ActiveRecord::Base
if public_body = bodies_by_name[name] # Existing public body
available_locales.each do |locale|
PublicBody.with_locale(locale) do
- changed = {}
+ changed = ActiveSupport::OrderedHash.new
field_list.each do |field_name|
localized_field_name = (locale.to_s == I18n.default_locale.to_s) ? field_name : "#{field_name}.#{locale}"
localized_value = field_names[localized_field_name] && row[field_names[localized_field_name]]
@@ -425,7 +433,7 @@ class PublicBody < ActiveRecord::Base
public_body = PublicBody.new(:name=>"", :short_name=>"", :request_email=>"")
available_locales.each do |locale|
PublicBody.with_locale(locale) do
- changed = {}
+ changed = ActiveSupport::OrderedHash.new
field_list.each do |field_name|
localized_field_name = (locale.to_s == I18n.default_locale.to_s) ? field_name : "#{field_name}.#{locale}"
localized_value = field_names[localized_field_name] && row[field_names[localized_field_name]]
@@ -457,7 +465,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).sort.join("\n ") + "\nYou may want to delete them manually.\n"
end
# Rollback if a dry run, or we had errors
diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml
index 2af13f342..675bb38de 100644
--- a/app/views/layouts/default.rhtml
+++ b/app/views/layouts/default.rhtml
@@ -12,7 +12,6 @@
<link rel="shortcut icon" href="/favicon.ico">
<%= 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" %>
@@ -35,11 +34,12 @@
<!--[if LT IE 8]>
<style type="text/css">@import url("/stylesheets/ie7.css");</style>
<![endif]-->
- <%= stylesheet_link_tag 'custom', :title => "Main", :rel => "stylesheet" %>
+ <!-- the following method for customising CSS is deprecated; see `doc/THEMES.md` for detail -->
+ <%= 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]%>">
diff --git a/app/views/user/bad_token.rhtml b/app/views/user/bad_token.rhtml
index 443835382..538bc5606 100644
--- a/app/views/user/bad_token.rhtml
+++ b/app/views/user/bad_token.rhtml
@@ -1,6 +1,6 @@
<h1>
<%= _('Please check the URL (i.e. the long code of letters and numbers) is copied
-correctly from your email.'%>
+correctly from your email.')%>
</h1>
<p>
diff --git a/config/boot.rb b/config/boot.rb
index 90fd9cd4d..0f5e661ed 100644
--- a/config/boot.rb
+++ b/config/boot.rb
@@ -31,7 +31,7 @@ module Rails
end
def vendor_rails?
- File.exist?("#{RAILS_ROOT}/vendor/rails")
+ File.exist?("#{RAILS_ROOT}/vendor/rails/Rakefile")
end
def preinitialize
diff --git a/config/environment.rb b/config/environment.rb
index 0af465049..d15ee9a0e 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -6,7 +6,7 @@
# ENV['RAILS_ENV'] ||= 'production'
# Specifies gem version of Rails to use when vendor/rails is not present
-RAILS_GEM_VERSION = '2.3.11' unless defined? RAILS_GEM_VERSION
+RAILS_GEM_VERSION = '2.3.14' unless defined? RAILS_GEM_VERSION
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
@@ -37,7 +37,11 @@ require File.join(File.dirname(__FILE__), '../lib/old_rubygems_patch')
Rails::Initializer.run do |config|
# Load intial mySociety config
- MySociety::Config.set_file(File.join(config.root_path, 'config', 'general'), true)
+ if ENV["RAILS_ENV"] == "test"
+ MySociety::Config.set_file(File.join(config.root_path, 'config', 'test'), true)
+ else
+ MySociety::Config.set_file(File.join(config.root_path, 'config', 'general'), true)
+ end
MySociety::Config.load_default
# Settings in config/environments/* take precedence over those specified here
@@ -119,14 +123,8 @@ if (MySociety::Config.get("DOMAIN", "") != "")
end
# fallback locale and available locales
-if ENV["RAILS_ENV"] == "test"
- # The tests assume that the "en" and "es" locales are available
- available_locales = ["en", "es"]
- default_locale = "en"
-else
- available_locales = MySociety::Config.get('AVAILABLE_LOCALES', 'en es').split(/ /)
- default_locale = MySociety::Config.get('DEFAULT_LOCALE', 'en')
-end
+available_locales = MySociety::Config.get('AVAILABLE_LOCALES', '').split(/ /)
+default_locale = MySociety::Config.get('DEFAULT_LOCALE', '')
FastGettext.default_available_locales = available_locales
I18n.locale = default_locale
@@ -134,6 +132,7 @@ I18n.available_locales = available_locales.map {|locale_name| locale_name.to_sym
I18n.default_locale = default_locale
# Load monkey patches and other things from lib/
+require 'ruby19.rb'
require 'tmail_extensions.rb'
require 'activesupport_cache_extensions.rb'
require 'timezone_fixes.rb'
diff --git a/config/general.yml b/config/general.yml
new file mode 100644
index 000000000..7c70f8e71
--- /dev/null
+++ b/config/general.yml
@@ -0,0 +1,118 @@
+# general.yml-example:
+# Example values for the "general" config file.
+#
+# Configuration parameters, in YAML syntax.
+#
+# Copy this file to one called "general.yml" in the same directory. Or
+# have multiple config files and use a symlink to change between them.
+
+# Site name appears in various places throughout the site
+SITE_NAME: 'Alaveteli'
+
+# Domain used in URLs generated by scripts (e.g. for going in some emails)
+DOMAIN: 'localhost:3000'
+
+# ISO country code of country currrently deployed in
+# (http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
+ISO_COUNTRY_CODE: DE
+
+# These feeds are displayed accordingly on the Alaveteli "blog" page:
+BLOG_FEED: 'http://www.mysociety.org/category/projects/whatdotheyknow/feed/'
+TWITTER_USERNAME: 'alaveteli_foi'
+
+# Locales we wish to support in this app, space-delimited
+AVAILABLE_LOCALES: 'en'
+DEFAULT_LOCALE: 'en'
+
+# if 'true', respect the user's choice of language in the browser
+USE_DEFAULT_BROWSER_LANGUAGE: true
+
+# How many days should have passed before an answer to a request is officially late?
+REPLY_LATE_AFTER_DAYS: 20
+REPLY_VERY_LATE_AFTER_DAYS: 40
+# We give some types of authority like schools a bit longer than everyone else
+SPECIAL_REPLY_VERY_LATE_AFTER_DAYS: 60
+
+# example searches for the home page, semicolon delimited.
+FRONTPAGE_SEARCH_EXAMPLES: 'Geraldine Quango; Department for Humpadinking'
+
+# example public bodies for the home page, semicolon delimited - short_names
+FRONTPAGE_PUBLICBODY_EXAMPLES: 'tgq'
+
+# URL of theme to install (when running rails-post-deploy script)
+THEME_URL: 'git://github.com/sebbacon/alavetelitheme.git'
+
+
+## Incoming email
+# Your email domain, e.g. 'foifa.com'
+INCOMING_EMAIL_DOMAIN: 'localhost'
+
+# An optional prefix to help you distinguish FOI requests, e.g. 'foi+'
+INCOMING_EMAIL_PREFIX: ''
+
+# used for hash in request email address
+INCOMING_EMAIL_SECRET: 'xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx'
+
+# used as envelope from at the incoming email domain for cases where we don't care about failure
+BLACKHOLE_PREFIX: 'do-not-reply-to-this-address'
+
+## Administration
+
+# Leave these two blank to skip admin authorisation
+ADMIN_USERNAME: 'asd'
+ADMIN_PASSWORD: 'qwe'
+
+# Email "from" details
+CONTACT_EMAIL: 'postmaster@localhost'
+CONTACT_NAME: 'Alaveteli Webmaster'
+
+# Where the raw incoming email data gets stored; make sure you back
+# this up!
+RAW_EMAILS_LOCATION: 'files/raw_emails'
+
+# The base URL for admin pages. You probably don't want to change this.
+ADMIN_BASE_URL: '/admin/'
+
+# Where /stylesheets sits under for admin pages. See asset_host in
+# config/environment.rb. Can be full domain or relative path (not an
+# absolute path beginning with /). Again, unlikely to want to change
+# this.
+ADMIN_PUBLIC_URL: ''
+
+# Secret key for signing cookie_store sessions
+COOKIE_STORE_SESSION_SECRET: 'your secret key here, make it long and random'
+
+# If present, puts the site in read only mode, and uses the text as reason
+# (whole paragraph). Please use a read-only database user as well, as it only
+# checks in a few obvious places.
+READ_ONLY: ''
+
+# Doesn't do anything right now.
+STAGING_SITE: 1
+
+# Recaptcha, for detecting humans. Get keys here: http://recaptcha.net/whyrecaptcha.html
+RECAPTCHA_PUBLIC_KEY: '6LcsnMcSAAAAAAL4FqMix7IOsEIwdMh42MuOFztv'
+RECAPTCHA_PRIVATE_KEY: '6LcsnMcSAAAAAFjbWcf2dI874as0fmYSAiC9Jgvx'
+
+# For debugging memory problems. If true, the app logs
+# the memory use increase of the Ruby process due to the
+# request (Linux only). Since Ruby never returns memory to the OS, if the
+# existing process previously served a larger request, this won't
+# show any consumption for the later request.
+DEBUG_RECORD_MEMORY: false
+
+# If you have Alaveteli set up behind an HTTP caching proxy
+# (accelerator) like Varnish or Squid, you can cause the application
+# to purge selected URLs by setting these two variables (see
+# `../doc/CACHING.md` for details)
+ACCELERATOR_HOST: 'localhost'
+ACCELERATOR_PORT: '6081'
+
+# mySociety's gazeteer service. Shouldn't change.
+GAZE_URL: http://gaze.mysociety.org
+
+# Path to a program that converts a page at a URL to HTML. It should
+# take two arguments: the URL, and a path to an output file. A static
+# binary of wkhtmltopdf is recommended:
+# http://code.google.com/p/wkhtmltopdf/downloads/list
+HTML_TO_PDF_COMMAND: /usr/local/bin/wkhtmltopdf-amd64 \ No newline at end of file
diff --git a/config/initializers/fast_gettext.rb b/config/initializers/fast_gettext.rb
index 026c4111c..63cf6b50d 100644
--- a/config/initializers/fast_gettext.rb
+++ b/config/initializers/fast_gettext.rb
@@ -1,2 +1,2 @@
-FastGettext.add_text_domain 'app', :path => 'locale', :type => :po
+FastGettext.add_text_domain 'app', :path => File.join(Rails.root, 'locale'), :type => :po
FastGettext.default_text_domain = 'app'
diff --git a/config/routes.rb b/config/routes.rb
index 48bf92e75..511b5fc1e 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -15,7 +15,7 @@ ActionController::Routing::Routes.draw do |map|
# Keep in mind you can assign values other than :controller and :action
# Allow easy extension from themes. Note these will have the highest priority.
- require 'config/custom-routes'
+ require File.join(Rails.root, 'config', 'custom-routes')
map.with_options :controller => 'general' do |general|
general.frontpage '/', :action => 'frontpage'
diff --git a/config/test.yml b/config/test.yml
new file mode 100644
index 000000000..c13b9c9db
--- /dev/null
+++ b/config/test.yml
@@ -0,0 +1,118 @@
+# test.yml
+# Test values for the "general" config file.
+#
+# Configuration parameters, in YAML syntax.
+#
+# These may be values expected by the test suite; changing them may
+# break tests.
+
+# Site name appears in various places throughout the site
+SITE_NAME: 'Alaveteli'
+
+# Domain used in URLs generated by scripts (e.g. for going in some emails)
+DOMAIN: 'localhost:3000'
+
+# ISO country code of country currrently deployed in
+# (http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
+ISO_COUNTRY_CODE: DE
+
+# These feeds are displayed accordingly on the Alaveteli "blog" page:
+BLOG_FEED: 'http://www.mysociety.org/category/projects/whatdotheyknow/feed/'
+TWITTER_USERNAME: 'alaveteli_foi'
+
+# Locales we wish to support in this app, space-delimited
+AVAILABLE_LOCALES: 'en es'
+DEFAULT_LOCALE: 'en'
+
+# if 'true', respect the user's choice of language in the browser
+USE_DEFAULT_BROWSER_LANGUAGE: true
+
+# How many days should have passed before an answer to a request is officially late?
+REPLY_LATE_AFTER_DAYS: 20
+REPLY_VERY_LATE_AFTER_DAYS: 40
+# We give some types of authority like schools a bit longer than everyone else
+SPECIAL_REPLY_VERY_LATE_AFTER_DAYS: 60
+
+# example searches for the home page, semicolon delimited.
+FRONTPAGE_SEARCH_EXAMPLES: 'Geraldine Quango; Department for Humpadinking'
+
+# example public bodies for the home page, semicolon delimited - short_names
+FRONTPAGE_PUBLICBODY_EXAMPLES: 'tgq'
+
+# URL of theme to install (when running rails-post-deploy script)
+THEME_URL: 'git://github.com/sebbacon/alavetelitheme.git'
+
+
+## Incoming email
+# Your email domain, e.g. 'foifa.com'
+INCOMING_EMAIL_DOMAIN: 'localhost'
+
+# An optional prefix to help you distinguish FOI requests, e.g. 'foi+'
+INCOMING_EMAIL_PREFIX: ''
+
+# used for hash in request email address
+INCOMING_EMAIL_SECRET: 'xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx'
+
+# used as envelope from at the incoming email domain for cases where we don't care about failure
+BLACKHOLE_PREFIX: 'do-not-reply-to-this-address'
+
+## Administration
+
+# Leave these two blank to skip admin authorisation
+ADMIN_USERNAME: 'asd'
+ADMIN_PASSWORD: 'qwe'
+
+# Email "from" details
+CONTACT_EMAIL: 'postmaster@localhost'
+CONTACT_NAME: 'Alaveteli Webmaster'
+
+# Where the raw incoming email data gets stored; make sure you back
+# this up!
+RAW_EMAILS_LOCATION: 'files/raw_emails'
+
+# The base URL for admin pages. You probably don't want to change this.
+ADMIN_BASE_URL: '/admin/'
+
+# Where /stylesheets sits under for admin pages. See asset_host in
+# config/environment.rb. Can be full domain or relative path (not an
+# absolute path beginning with /). Again, unlikely to want to change
+# this.
+ADMIN_PUBLIC_URL: ''
+
+# Secret key for signing cookie_store sessions
+COOKIE_STORE_SESSION_SECRET: 'your secret key here, make it long and random'
+
+# If present, puts the site in read only mode, and uses the text as reason
+# (whole paragraph). Please use a read-only database user as well, as it only
+# checks in a few obvious places.
+READ_ONLY: ''
+
+# Doesn't do anything right now.
+STAGING_SITE: 1
+
+# Recaptcha, for detecting humans. Get keys here: http://recaptcha.net/whyrecaptcha.html
+RECAPTCHA_PUBLIC_KEY: 'xxx'
+RECAPTCHA_PRIVATE_KEY: 'xxx'
+
+# For debugging memory problems. If true, the app logs
+# the memory use increase of the Ruby process due to the
+# request (Linux only). Since Ruby never returns memory to the OS, if the
+# existing process previously served a larger request, this won't
+# show any consumption for the later request.
+DEBUG_RECORD_MEMORY: false
+
+# If you have Alaveteli set up behind an HTTP caching proxy
+# (accelerator) like Varnish or Squid, you can cause the application
+# to purge selected URLs by setting these two variables (see
+# `../doc/CACHING.md` for details)
+ACCELERATOR_HOST: 'localhost'
+ACCELERATOR_PORT: '6081'
+
+# mySociety's gazeteer service. Shouldn't change.
+GAZE_URL: http://gaze.mysociety.org
+
+# Path to a program that converts a page at a URL to HTML. It should
+# take two arguments: the URL, and a path to an output file. A static
+# binary of wkhtmltopdf is recommended:
+# http://code.google.com/p/wkhtmltopdf/downloads/list
+HTML_TO_PDF_COMMAND: /usr/local/bin/wkhtmltopdf-amd64 \ No newline at end of file
diff --git a/db/.gitignore b/db/.gitignore
index 7b6eceda6..f3aee50a1 100644
--- a/db/.gitignore
+++ b/db/.gitignore
@@ -1 +1,2 @@
+schema.rb
development_structure.sql
diff --git a/doc/CHANGES.md b/doc/CHANGES.md
index d4b8ca379..ea09de187 100644
--- a/doc/CHANGES.md
+++ b/doc/CHANGES.md
@@ -1,3 +1,17 @@
+# Version 0.5
+
+## Highlighted features
+* It should now be possible to develop the software on OSX
+* Base design refactored: CSS simplified and reduced, base design colours removed, now provided in example Alaveteli theme override
+
+## Upgrade notes
+* **IMPORTANT! We now depend on Xapian 1.2**, which means you may need to install Xapian from backports. See [issue #159] for more info.
+* Themes created for 0.4 and below should be changed to match the new format (although the old way should continue to work):
+ * You should create a resources folder at `<yourtheme>/public/` and symlink to it from the main rails app. See the `install.rb` in `alaveteli-theme` example theme for details.
+ * Your styles should be moved from `general/custom_css.rhtml` to a standalone stylesheet in `<yourtheme>/public/stylesheets/`
+ * The partial at `general/_before_head_end.rhtml` should be changed in the theme to include this stylesheet
+
+
# Version 0.4
## Highlighted features
@@ -16,6 +30,9 @@
* TRACK_SENDER_EMAIL
* TRACK_SENDER_NAME
* HTML_TO_PDF_COMMAND
+ * NEW_RESPONSE_REMINDER_AFTER_DAYS
+ * FORCE_REGISTRATION_ON_NEW_REQUEST
+* The config variable `FRONTPAGE_SEARCH_EXAMPLES` is no longer used, so you should remove it to avoid confusion.
* Execute `script/rebuild-xapian-index` to create new xapian index
terms used in latest version of search (can take a long time)
* Install wkhtmltopdf to enable PDFs in downloadable zipfiles. A
diff --git a/doc/INSTALL.md b/doc/INSTALL.md
index 656b96467..a666ac2f0 100644
--- a/doc/INSTALL.md
+++ b/doc/INSTALL.md
@@ -1,8 +1,13 @@
-These instructions are based on getting the FOI site up and running on
-Ubuntu and/or Debian.
+These instructions assume Debian Squeeze or Ubuntu 11.04, or later
+(probably, though we won't necessarily have tested in later versions
+yet!)
+[Install instructions for OS X](https://github.com/sebbacon/alaveteli/wiki/OS-X-Quickstart)
+are under development.
-It was last run using the Lucid Lynx version of Ubuntu and on the
-Parallels debian instance (2.6.18-4-686).
+It is possible to install on Ubuntus as old as 10.04, but you must use
+[Xapian backports](https://launchpad.net/~xapian-backports/+archive/xapian-1.2)
+(see [issue #158](https://github.com/sebbacon/alaveteli/issues/159)
+for discussion).
Commands are intended to be run via the terminal or over ssh.
@@ -82,6 +87,18 @@ The following command will set up a user 'foi' with password 'foi':
ALTER DATABASE foi_development OWNER TO foi;
ALTER DATABASE foi_test OWNER TO foi;" | psql
+# Configure email
+
+You will need to set up an email server (MTA) to send and receive
+emails. Full configuration for an MTA is beyond the scope of this
+document. However, just to get the tests to pass, you will at a
+minimum need to allow sending emails via a `sendmail` command (a
+requirement met, for example, with `sudo apt-get install exim4`).
+
+To receive email in a production setup, you will also need to
+configure your MTA to forward incoming emails to Alaveteli. An
+example configuration is described in `INSTALL-exim4.md`.
+
# Set up configs
For overall application settings, copy `config/general.yml-example` to
@@ -266,3 +283,33 @@ is supplied in `../conf/varnish-alaveteli.vcl`.
Did you remember to remove the file `alaveteli/config/rails_env.rb`
as described above? It's created every time you run
`script/rails-post-deploy`
+
+* **Non-ASCII characters are being displayed as asterisks in my incoming messages**
+
+ We rely on `elinks` to convert HTML email to plain text.
+ Normally, the encoding should just work, but under some
+ circumstances it appears that `elinks` ignores the parameters
+ passed to it from Alaveteli.
+
+ To force `elinks` always to treat input as UTF8, add the following
+ to `/etc/elinks/elinks.conf`:
+
+ set document.codepage.assume = "utf-8"
+
+ You should also check that your locale is set up wrongly. See
+ [https://github.com/sebbacon/alaveteli/issues/128#issuecomment-1814845](this issue followup)
+ for further discussion.
+
+* **I'm getting lots of `SourceIndex.new(hash) is deprecated` errors when running the tests**
+
+ The latest versions of rubygems contain a large number of noisy
+ deprecation warnings that you can't turn off individually. Rails
+ 2.x isn't under active development so isn't going to get fixed (in
+ the sense of using a non-deprecated API). So the only vaguely
+ sensible way to avoid this noisy output is to downgrade rubygems.
+
+ For example, you might do this by uninstalling your
+ system-packaged rubygems, and then installing the latest rubygems
+ from source, and finally executing `sudo gem update --system
+ 1.6.2`.
+
diff --git a/doc/THEMES.md b/doc/THEMES.md
index a4793a6fd..c2381b61f 100644
--- a/doc/THEMES.md
+++ b/doc/THEMES.md
@@ -50,24 +50,21 @@ These means that a file at
`vendor/plugins/alavetelitheme/lib/help/about.rhml` will appear in
place of the core "about us" file.
-There's a special file at
-`vendor/plugins/alavetelitheme/lib/views/general/custom_css.rhtml`.
-Its contents are automatically included as the last CSS file in the
-header of the site. In theory, it should be possible to do quite a
-lot of layout customisation by only changing this file.
-
-Your CSS is likely to reference various images such as a logo,
-background images, etc. We don't have a nice way of supporting these
-at the moment. The current practice is to place them in
-`vendor/plugins/alavetelitheme/public/images/` and then symlink this
-directory to somewhere within the `public/` folder in the main
-Alaveteli Rails app, e.g.:
-
- ln -s $ALAVETELI_SITE/vendor/plugins/alavetelitheme/public/images/ public/images/my_images
-
-...and then refer to these in your custom_css.rhtml like so:
-
- background-image: url("../my_images/navimg/my-logo.png");
+Rails expects all its stylesheets to live at `<railshome>/public`,
+which presents a problem for plugins. Here's how we solve it: the
+stylesheet and associated resources for your theme live (by
+convention) in at `alavatelitheme/public/`. This is symlinked from
+the main Rails app -- see `alavetelitheme/install.rb` to see how this
+happens.
+
+The partial at
+`alavetelitheme/lib/views/general/_before_head_end.rhtml` includes the
+custom CSS in your theme's stylesheet folder (by convention, in
+`alavetelitheme/public/stylesheets/`), with:
+
+ <%= stylesheet_link_tag "/alavetelitheme/stylesheets/custom" %>
+
+...which will, of course, need changing for your theme.
# Customising the request states
diff --git a/doc/todo.txt b/doc/todo.txt
deleted file mode 100644
index e78429960..000000000
--- a/doc/todo.txt
+++ /dev/null
@@ -1,559 +0,0 @@
-
-
-Next (things that will reduce admin time mainly)
-====
-
-- "Can I help out" a bit invisible
-
-Destroy request - does it remove the tags?
-Richard says he wants the internationalisation to be so it could be one site
-with combined search. Why obey the notion of a country? I'm not sure, but
-it might be prudent to write it so it can run multiple jurisdictions in
-one deploy, if only for administrative reasoins.
- - path maybe: lib/juris/uk, lib/juris/eu etc.
- - consider Single Table Inheritance (harder to back out of though)
- - http://code.alexreisner.com/articles/single-table-inheritance-in-rails.html
- - use mixins with explicit include otherwise
-
-Add links to these tags where possible:
- ch:* - Bodies that appear on the Register of Companies. '*' is replaced by the company number, which is eight characters long and consists of optional upper-case letters followed by digits.
- coins:* Bodies appearing in COINS database followed by reference code e.g. coins:BRL048 (British Library)
- dpr:* - Bodies that appear on the Register of Data Controllers. '*' is replaced by the registration number.
- urn:* - Bodies that appear on EduBase. '*' is replaced by the institution's Unique Reference Number.
- VAT:* - Bodies with a VAT (UK Value Added Tax) registration number. '*' is replaced by the VAT registration number (no spaces) e.g. VAT:895108987
-http://foiwiki.com/foiwiki/index.php/WhatDoTheyKnow.com_Tags
-
-Merge with New Zealand code base properly
-
-Handle bounce messages from alerts automatically
-
-Make it so when you make followups the whole request is shown on the page.
-Remove all show_response URLs, and replace with a special version of the
-request URL with a new input box at the bottom and a hash link to it?
-<< when following links such as "I'm about to send clarification", a
-form appears into which the reply can be typed. However, the
-previous correspondence in that thread is not shown.
-I usually open a new tab to see what was written previously before
-writing in the form. It might be useful if the previous
-correspondence were instead shown on the page in which the form
-appears. >>
-
-Make profile photo on comments slightly larger
-
-Ask people for annotation immediately after they have submitted their request
-Ask for annotation about what they learnt from request?
-
-Private request premium feature
-http://www.activemerchant.org/
-
-Froze during reindex, is the doc files inside the .zip here:
- http://www.whatdotheyknow.com/request/last_collection_times#incoming-8405
- ActsAsXapian.rebuild_index InfoRequestEvent 16061
- foi 23175 0.0 0.0 5176 1472 pts/1 S+ 14:16 0:00 /bin/sh /usr/bin/wvText /tmp/foiextract20100619-20578-1gcbuqz-0 /tmp/foiextract20100619-20578-1gcbuqz-0.txt
- foi 23180 0.0 0.0 4664 1220 pts/1 S+ 14:16 0:00 /bin/sh /usr/bin/wvHtml -1 /tmp/foiextract20100619-20578-1gcbuqz-0 --targetdir=/tmp wv-XeJwGT
-Also freezes Abiword, but not catdoc
-
-
-Performance
-===========
-
-Reduce storing the number of bogus post redirects that aren't people
-
-Receiving email can be resource drain starting app instance each time - use daemon instead
-
-Cache /feed/list/successful
-Cache /body/list/a
-
-Cache parts of /body/xxxxx
-Cache parts of /user/xxxxx
-
-Finish migration to Rails 1.9 - for uncached requests, seems to be twice as fast.
-
-Regular expression library - change to faster one. Oniguruma isn't enough.
-This shows slowness:
- e = InfoRequestEvent.find(213700)
- text = e.incoming_message.get_main_body_text (XXX alter to call internal not cache)
- IncomingMessage.remove_quoted_sections(text, "")
-
-This is slow:
-http://www.whatdotheyknow.com/request/renumeration_committee
-
-Varnish config
-http://www.varnish-cache.org/wiki/VCLExampleCachingLoggedInUsers
-
-Some requests to lower memory use of still:
-PID: 676 CONSUME MEMORY: 16968 KB Now: 102604 KB http://www.whatdotheyknow.com/request/parking_ticket_data_81
-PID: 2036 CONSUME MEMORY: 129368 KB Now: 179652 KB http://www.whatdotheyknow.com/request/14186/response/33740
-- search engines shouldn't be going for those URLs. and do they really need to
- unpack so much? could use snippet cache.
-
-Things to make bots not crawl somehow:
- /request/13683/response?internal_review=1
- /request/febrile_neutropenia_154?unfold=1
-
-Renaming of a body, or changing its domain, should clear the cached bubbles of
-all requests to that body.
-
-Change it to store emails as files in the filesystem? For speed of backup if nothing else.
-Should have simpler system for us to upload files sent to us via CD etc.
-Currently we have to manually put them in the files directory on the vhost.
-Make it so web upload interface copes gracefully with arbitarily large messages
-(it causes speed trouble having them in the database right now)
-Maybe have flag saying "don't try to make snippet for this it is just too big".
-
-Compress the emails in the database, or on disk
-
-Keep cached columns in database in their own table, might give performance benefits
-
-
-
-
-Letting you hide individual events (incoming/outgoing messages, annotations)
-==================================
-
-*** this needs either removing or finishing, it is half done. Has the
-database entries but doesn't use them yet.
-
-Move comments to use new system first
-Show message to signed in user that others can't see this part
-Make sure hidden things don't show in search snippets
- in models/comment.rb: # So when made invisble it vanishes
-Remove comments visible
-
-
-Later
-=====
-
-JSON API:
- Pagination on the Atom feed JSON, so you can get later pages, and/or choose > 25 items
- Information about attachments in event JSON
- Allow Javascript callbacks (JSONP)
-
-Spelling correction not working if you search for "comission", as described here:
- http://comments.gmane.org/gmane.comp.search.xapian.general/8384
-When this patch from Xapian is in stable version, check that it all works.
- http://trac.xapian.org/changeset/14859
-
-Make outgoing requests and follow ups get CCed to our backup mailbox, so that
-can do data recovery more easily
-
-Admin button to resend request one off to particular address
-
-Stop search for users working on unconfirmed accounts
-
-Make zip file contents browseable, so each document in them "appears in Google".
-http://www.whatdotheyknow.com/request/transport_direct_cycle_journey_p#incoming-78421
-
-Ability to move requests to other bodies. Useful in these two places - anywhere else?
-http://www.whatdotheyknow.com/body/suffolk_primary_care_trust_pct_duplicate
-http://www.whatdotheyknow.com/body/colchester_hospital_university_nhs_foundation_trust_duplicate
-
-In admin interface, move a response from the holding pen to a request which is
-closed to new responses. The message disappears into the ether. Should either
-stop or allow such moves.
-
-PDF that gets corrupted by email censoring - have only seen this once, watch for it again
- http://www.whatdotheyknow.com/request/information_on_traffic_flows_in
-The image in a "stream" section get corrupted:
- _#p!/DB]eER4cPAPm&W7;-]L!e(*U=7"h^X7hYXqSI][9UZJV+>hr2:&c@S.lRr.ndm)2]b$-lU+#lg
- _#p!/DB]eER4cPAPm&W7;-]L!e(*U=7"h^X7hYXqSI][9UZJV+>hr2:&x@x.xxx.xxx)2]b$-lU+#lg
-Needs a fancy PDF library (which doesn't exist yet) that can tell when it is
-binary or text stream within the file. See thread in email "corrupted pdf" for
-more details. Maybe have option in admin to turn off censoring on a particular file.
-Maybe just do an MX check to see if it is really an email :)
-
-check-recent-requests-sent probably doesn't work, as exim log lines wouldn't
-be load in case where the envelope from gets broken?
-
-Point all MX records to one server, so can see incoming messages in exim logs also.
-Hmmm, but less robust. Run the exim log grabber across all mail servers?
-
-When on a small screen, the actual form when making a new request is below
-the fold, and it isn't obvious what you need to do. (Seen while watching
-a new user try to make a request)
-
-Put public body name in search text for each info request, so that people
-typing in a word and a body name in the search (have seen people new
-to the site doing that) do find things
-
-Completely remove the "feed" option in the database from tracks (it is only
-there for historical reasons, as feeds used to have to be explicitly in the
-database)
-
-Show the Subject: lines on request pages. Perhaps only show them where they are
-substantively different (modulo Re: and Fwd:) from the title and other subjects
-- so you can see any FOI code number the authority has put in the subject.
-
-For Scotland, don't need to say "normally" equivocally when it is taking more than 20 days
-(as there is no public interest test).
-Arguably, and to simplify things with Alaveteli, we should just be campaigning about this whole public interest test thing anyway, and not pussy foot about it. Not sure what form of wording to use that does that that is true though.
-
-Add explicit option for user to select "misdelivered to the wrong request"
-and let people move them to the right place.
-(Julian wants that too)
-
-Perhaps fold up request pages more by default - don't show known acknowledgements until
-you click and some (javascript) expands them.
-
-Some people want the fold/unfold of quoted sections to be javascripty as well.
-Esp. when filling in a form on the same page.
-
-Somehow make clear that a "rejection because referring to info already
-in public domain" should really be marked sucessful.
-
-Emails sent to stopped requests should follow RFC: http://tools.ietf.org/html/rfc3834
- Shouldn't bounce message back to Auto-Submitted
- Should check from address being replied to is valid
- Should set In-Reply-To and References fields
- Reconsider message content given that section in RFC
-
-When registering a new user, give a warning if they only enter one name. Link
-to the help about pseudonymous requests, that you need at least initial
-as well.
-
-Let requesters view the uncensored versions of their correspondence (e.g. with
-emails in it). Let other people do so with a CAPTCHA?
-Perhaps easy thing to do is just to do it for email addresses (and not the request email address)
-
-For followups, have radio button to say is it a new request or followup
-Do by uncommenting the "new information" option when writing a followup, so
-that it makes a new request
-
-When a user says that a response is an error message, it prompts them to say
-what the problem is to administrators. It could at that time show them the
-email of the authority that their request was sent to for them to check
-then and there, and tell the administrators.
-
-If you've already conducted an internal review, at all places
- - when on unhappy/url
- - when on not held link
- - on the page for the request
-don't offer it again, as they've already done it.
-Example of completed review:
-http://www.whatdotheyknow.com/request/request_for_full_disclosure_of_b#incoming-9267
-
-Don't allow sending internal review boiler plate text twice (although make sure they
-can write followups to internal review)
-e.g. http://www.whatdotheyknow.com/request/reply_to_letter_from_historic_ro
-
-Clock for internal review
- The Information Commissioner has issued a "Good Practice Guidance" document: http://www.ico.gov.uk/upload/documents/library/freedom_of_information/detailed_specialist_guides/foi_good_practice_guidance_5.pdf
- 20 days is late
- 40 days max.
-Fix up the text: "The internal review should take 2-3 weeks for simple cases,
-and up to 6 weeks even for complex reviews."
-Awaiting internal review overdue state?
-
-Sort requests on user page by status.
- "For sorting I was just thinking of a generic sort/filter by clicking
- on the header or some such -- I'd probably want to sort open requests
- in order of 'last action'... to quickly see what was most overdue."
-Group list on user page by authority
-
-I have several email alerts set up. Is there any chance they could include part
-(or, preferably, all) of the search criterion in the Subject: line? :o)
-(Perhaps do it in the case when only one search criterion makes the mail)
-
-Search for text "internal review" in followups and add warning if they aren't
-using the internal review mode.
-
-CSS / design things
- - The stepwise instruction boxes "Next, select the public authority ... "
- need to look better, and have icons associated with them etc.
- - CSS error on "all councils" page on some browsers
- https://bugzilla.mozilla.org/show_bug.cgi?id=424194
- - Spacing on error boxes round form elements. Matthew says:
- Well, the correct thing to do is have the class="fieldWithErrors" on the
- <p> containing the Summary: label and text input box, not have the
- pointless <span> at all, and then it all looks perfect and as you'd
- expect. But I had a look at the code and haven't got the slightest clue
- how you'd do that, sorry, given it appears new.rhtml is printing the <p>
- but some magic Ruby thing is printing the error span.
- - Improve CSS on IE7 for large images in docs
- http://www.whatdotheyknow.com/request/3289/response/7810/attach/html/3/20081023ReplyLetter.pdf.html
- - Get Atom feed of search results to include stylesheet for highlighting words in
- yellow somehow
-
-When doing search, people often just want it to show the whole page. Perhaps
-all listing should just link to top of page, rather than # links for outgoing
-incoming, or perhaps just some of them.
-
-Some more traditional help (in a new section in the help) such as:
- * Information about how to track requests and RSS feeds
- * Information about how to contacting other users
- * How to change your email address
-
-Show similar requests after you have filed yours - maybe on preview too.
-
-Test code for rendering lots of different attachments and filetypes
-Test code for internal review submitting
-
-Look at quote_address_if_necessary in actionmailer's quoting.rb - why did it
-not work for the email address with "@" in its name part?
-
-Something to check which tags are used but aren't in PublicBody category lists
-
-Other references to title field changes don't get search index updated when title is altered
- (e.g. when a public body is renamed)
-Maybe just reindex all once a week, but it is a bit slow now, so perhaps do it properly.
-$ ./script/rebuild-xapian-index
-
-Renaming public authorities will break alerts on them. For basic alerts the
-structured info is there so this should just be fixed. For searches, perhaps
-Xapian index should search url_name history as well?
-We have a policy of not renaming them in some cases, which helps a bit.
-
-Never updates cached attachment text unless cache is explicitly cleared (which
- might matter with software updates, or code changes). Should we clear the
- cache automatically every month in the middle of the night or something?
-$ ./script/clear-caches
-Alternative - embed some identifier in the code and the cache directory, and
-detect it changes and automatically clear the cache.
-
-
-Display and indexing of response emails/attachments
----------------------------------------------------
-
-Install more recent poppler-utils
- e.g. 0.12.0 can definitely convert this to HTML, extacting the images:
- http://www.whatdotheyknow.com/request/13903/response/36117/attach/html/4/FOI%20beaver%20site%20species%20audit%20SNH%20review%20of%20proposal%20redact.pdf.html
-Really need a "pdftk -nodrm" to remove compression from encrypted PDFs, so strips emails from e.g.:
- http://www.whatdotheyknow.com/request/14414/response/38590/attach/html/3/090807%20FOI.pdf.html
- ... this misses a whole page out (someone emailed us)
- http://www.whatdotheyknow.com/request/unredacted_expense_claims_for_jo#incoming-49674
-
-Worth doing View as HTML ourselves for .docx, .ppt, .tif (covered now by Google Docs)
-View as HTML for .txt requested
-
-Failed to detect attachments are emails and decode them:
- http://www.whatdotheyknow.com/request/malicious_communication_act#incoming-12964
-
-When indexing .docx do you need to index docProps/custom.xml and docProps/app.xml
-as well as word/document.xml ? (thread on xapian-discuss does so)
-
-Consider using odt2txt or unoconv
-http://www-verimag.imag.fr/~moy/opendocument/
-
-Mime type / extension wrong on these .docx's
-http://www.whatdotheyknow.com/request/bridleway_classifications
-http://www.whatdotheyknow.com/request/19976/response/51468/attach/3/TU%20MembershipTeachers%20SolidarityTU%20231009.docx.doc (thinks it is doc when it is docx)
-Search for "OIC" for some more examples
-
-VSD files vsdump - example in zip file
- http://www.whatdotheyknow.com/request/dog_control_orders#incoming-3510
- doing file RESPONSE/Internal documents/Briefing with Contact Islington/Contact Islington Flowchart Jul 08.vsd content type
-
-Search for other file extensions that we have now and look for ones we could
-and should be indexing
- (call IncomingMessage.find_all_unknown_mime_types to find them - needs
- updating to do it in clumps as all requests won't load in RAM now )
-
-Render HTML alternative rather than text (so tables look good) e.g.:
- http://www.whatdotheyknow.com/request/parking_policy
-
-These attachment.bin files should come out as winmail.dat and be parsed
-by existing TNEF code. For some reason though TMail doesn't get the right
-content-type out of them. Not sure why.
- http://www.whatdotheyknow.com/request/acting_up_in_a_higher_rank
-
-Make HTML attachments have view as HTML :)
-http://www.whatdotheyknow.com/request/enforced_medication#incoming-7395
-
-Knackered view as HTML:
- http://www.whatdotheyknow.com/request/1385/response/5483/attach/html/3/Response%20465.2008.pdf.html
-Some other pdftohtml bugs (fix them or file about them)
- http://www.whatdotheyknow.com/request/sale_of_public_land#incoming-8146
- http://www.whatdotheyknow.com/request/childrens_database_compliance_wi#incoming-8088
- http://www.whatdotheyknow.com/request/3326/response/7701/attach/html/2/Scan001.PDF.pdf.html
- http://www.whatdotheyknow.com/request/risk_log#incoming-8090 (bad tables)
- http://www.whatdotheyknow.com/request/4635/response/11248/attach/html/4/FOI%20request.pdf.html (bad table)
-Orientation wrong:
- http://www.whatdotheyknow.com/request/3153/response/7726/attach/html/2/258850.pdf.html
-Bug in wvHtml, segfaults when converting this:
- http://www.whatdotheyknow.com/request/subject_access_request_guide_sar#incoming-10242
-
-Images aren't coming out here
- http://www.whatdotheyknow.com/request/33682/response/83455/attach/html/3/100428%20Reply%201519%2010.doc.html
-
-Doesn't detect doc type of a few garbage results in this list right:
- http://www.whatdotheyknow.com/search/UWE
-
-Quoting fixing TODO:
- http://www.whatdotheyknow.com/request/35/response/191 # Funny disclaimer
- http://www.whatdotheyknow.com/request/40/response/163 # funny disclaimer
- http://www.whatdotheyknow.com/request/35/response/191 # funny disclaimer "- - Disclaimer - -"
-
- http://www.whatdotheyknow.com/request/m3_junction_2_eastbound_speed_re # cut here
-
- http://www.whatdotheyknow.com/request/123/response/184 # nasty nasty formatted quoting
- http://www.whatdotheyknow.com/request/155/response/552 # nasty nasty formatted quoting
- http://www.whatdotheyknow.com/request/how_do_the_pct_deal_with_retirin_87#incoming-1847
- http://www.whatdotheyknow.com/request/complaints_about_jobcentres#incoming-688 # word wrapping of <
-
- http://www.whatdotheyknow.com/request/224/response/589 # have knackered the apostrophes here
-
- http://www.whatdotheyknow.com/request/operation_oasis_protester_databa#incoming-20922
-
- http://www.whatdotheyknow.com/request/new_bristol_city_stadium_plansci#incoming-44114 # funny forward not detected
- http://www.whatdotheyknow.com/request/the_facts_about_side_effects_cau#incoming-6754 # "Communications via the GSi" should be stripped, so then subject would get shown
-
- Unclassified:
- http://www.whatdotheyknow.com/request/666/response/1020
- http://www.whatdotheyknow.com/request/364/response/1100
- http://www.whatdotheyknow.com/request/council_housing_accommodation # over zealous half cuts
- http://www.whatdotheyknow.com/request/621/response/1131 # virus footer
- http://www.whatdotheyknow.com/request/231/response/338
- http://www.whatdotheyknow.com/request/930/response/1609
- http://www.whatdotheyknow.com/request/1102/response/2067
- http://www.whatdotheyknow.com/request/list_of_public_space_cctv_instal#incoming-2164
- http://www.whatdotheyknow.com/request/errors_in_list_of_postbox_locati#incoming-2272
- http://localhost:3000/request/cctv_data_retention_and_use#incoming-2093
- http://www.whatdotheyknow.com/request/stasi_activity_at_climate_camp#incoming-3362
- http://www.whatdotheyknow.com/request/total_remuneration_and_benefits#incoming-2436
- http://www.whatdotheyknow.com/request/dual_british_and_israeli_nationa#incoming-3461
- http://www.whatdotheyknow.com/request/council_functions_55#incoming-4099
- http://www.whatdotheyknow.com/request/public_safety_consequential_to_c#incoming-1586
- http://www.whatdotheyknow.com/request/functions_council_43#incoming-4509
- http://www.whatdotheyknow.com/request/york_road_tube_re_opening_feasib#incoming-3509
- http://www.whatdotheyknow.com/request/controlled_drinking_zones_5#incoming-4210
- http://www.whatdotheyknow.com/request/road_and_junction_specifications#incoming-3598
- http://www.whatdotheyknow.com/request/disused_live_stations#incoming-4898
- http://www.whatdotheyknow.com/request/errors_in_list_of_postbox_locati#incoming-3577
-
- http://www.whatdotheyknow.com/request/public_inspection_periods_for_lo_2#outgoing-1707 # square bracket in link
- http://www.whatdotheyknow.com/request/digital_tv_switchover_in_local_a#incoming-4931
- http://www.whatdotheyknow.com/request/local_government_ombudsman_58#incoming-5763
-
- http://www.whatdotheyknow.com/request/415/response/1041/attach/3/CONF%20FOI%209508%20Ian%20Holton.doc
-
- http://www.whatdotheyknow.com/request/function_council_88#incoming-6258
- http://www.whatdotheyknow.com/request/please_submit_the_surveyors_repo#incoming-6334 # charset
- http://www.whatdotheyknow.com/request/archive_record#incoming-7514 # charset
-
- http://www.whatdotheyknow.com/request/enforcement_forders_for_replacin#incoming-6277 # over zealous quoting
- http://www.whatdotheyknow.com/request/renewable_energy_consumption_by # over zealous
-
- http://www.whatdotheyknow.com/request/can_my_mp_ask_questions_on_my_be#incoming-33112 # hyperlink broken
- http://www.whatdotheyknow.com/request/clarification_of_the_igs_to_psw # wrapped link
- http://www.whatdotheyknow.com/request/request_for_details_from_consult # wrapped link
-
- http://www.whatdotheyknow.com/request/independent_psychological_assess#incoming-52956 # shows text as attachment when could be inline due to multipart nature?
-
- http://www.whatdotheyknow.com/request/bnp_membership_list_43#incoming-59204 # not detecting original message
- http://www.whatdotheyknow.com/request/maximum_pedestrian_crossing_wait#incoming-34094 # not detecting original message
-
-
-Display pasted quotes in annotations better:
- http://www.whatdotheyknow.com/request/scientology_incidents#comment-3352
-
-
-Totally new features
---------------------
-
-Publish statistics (stats) on how long it takes bodies to respond. And other
-things (like the WriteToThem pages).
-
-Add interface for editing tags on your own requests so you can keep track of them more easily.
-Lisa asked for this - is definitely only whole requests needed. Tony says
-anyone should be able to edit the tags, but requester should have last say (so
-can prevent a tag being added that they removed).
-
-Read reply - ask for Microsoft Exchange "read receipts", and show if mail was read.
-Or maybe use a webbug.
-
-Telephone numbers. Add advice in workflow to call authority first to check
-form they have info in. Store telephone numbers in database.
-
-Give authorities interface for editing their request email address
-and resend messages to them
-
-Make search know about uncategorised requests and timed out requests.
-And make search able to do *current* status in general as operator.
-
-Test data dumper that removes sensitive data, but lets trusted people play with
-whole database on their own machine without risk of compromise (for Tony)
-- can avoid rebuilding emails, attachments etc. sanitized provided we don't
-mind leaking out email address ot requests etc. to the trusted person (in contrast
-can easily totally remove private emails in the user table)
-
-Have an interface for users to be able to suggest new authorities and give
-their email address (perhaps just have admins validate / approve it)
-
-Detect councils that always send automatic acknowledgements, and notice if they
-do not for a particular request? (e.g. Leicestershire County Council)
-
-Add tips on using the law, e.g.:
-- You can go up and down between local and national - ask local places what
- their policy is, and hwo they are implementing it. Ask national things what
- odcuments set local policies.
-
-Add note by any exemption to the page on FOI Wiki Add note on mention of
-"Re-Use of Public Sector Information Regulations 2005"
-to the appropriate FAQ.
-
-Hyperlink Section 1(3) to the act (or have an automatic tip appear)
- http://www.whatdotheyknow.com/request/university_investment_in_the_arm#incoming-86
-and to guidance notes
- http://www.ico.gov.uk/what_we_cover/freedom_of_information/guidance.aspx
-
-Link to /random jump to a random request somewhere
-
-Do conversion tracking on endpoints in WDTK, advertise perhaps TWFY, or perhaps
- donations to mySociety.
-Advertise WDTK search queries on TWFY
-Advertise alerts on end pages with WDTK
-
-Forms to search this user, this request, and this authority on their pages
-
-Search FAQ and other help pages with normal search
-
-Make text boxes autogrow as you type into them.
-(10:32:14) richard: you just need to count the number of rows of text and compare it to the number of rows in the textbox
-(10:32:29) richard: then increase the height of the textbox by 1em-ish
-(10:32:52) Matthew: their function is called autogrow_textarea() by the way, if you just want to look at it...
- thanks :) I won't do it now as there are more important things, I was just accidentally impressed
-
-"Why not fill in your profile?" not that many people fill in their profile, we could have special
-advert (on page when they are on site) trying to force them to (maybe only if active). Give
-points for doing this.
-Also could offer option of Gravatar during signup, or later (as explicit option, so not leaking private info)
-
-Scoreboards and gamification. Put all admin functions in the main site, and let anyone get
-power to do them by accumulating points doing other useful things. There's lots of stuff!
-
-.tif files are hard for people to view as multi page, consider automatically
-separating out the pages as separate links (to .png files or whatever)
- http://www.whatdotheyknow.com/request/windsor_maidenhead_council_commo#incoming-1910
-Heck, may as well give thumbnails of all images, indeed all docs while you're at it :)
-
-Add geographical location of councils, PCTs etc.
-Have a single button to sign up to alerts on authorities for your postcode
-NHS postcode database:
- http://www.ons.gov.uk/about-statistics/geography/products/geog-products-postcode/nhspd/index.html
-
-Make request preview have a URL so you can show it to someone else before sending it :)
-Proposed request submission queue with comments - new requests don't get sent straight
- away, but are delayed while people help improve them.
-
-Screen scrape ICO's decision notices list and add link to it on the relevant public authority pages
-http://www.ico.gov.uk/Home/tools_and_resources/decision_notices.aspx
-
-Description for each body as to what info it holds
-Link to:
- Company number
- Aliases (not just short name, but multiple real names e.g. for museums)
- Disclosure logs
- Publication schemes (http://www.ico.gov.uk/what_we_cover/freedom_of_information/publication_schemes.aspx)
- TWFY department search
- Complaint email
- Phone number for advice and assistence (House of Lords give one http://www.parliament.uk/parliamentary_publications_and_archives/freedom_of_information_in_the_house_of_lords/lords__foi___how_to_obtain_information.cfm )
-e.g.
- http://www.ordnancesurvey.co.uk/oswebsite/aboutus/foi/index.html
- http://www.ordnancesurvey.co.uk/oswebsite/aboutus/foi/coiindex.html
-Maybe gather this data by letting authorities input it
-
-EU regulation 1049/2001 requests
-US requests (with Sunlight)
-
-OCR all images automatically, even if badly (check for tiffs!)
-
diff --git a/lib/languages.rb b/lib/languages.rb
index 43212a777..474c0e0cb 100644
--- a/lib/languages.rb
+++ b/lib/languages.rb
@@ -1,3 +1,4 @@
+# coding: utf-8
class LanguageNames
def self.get_language_name(locale)
language_names = {
diff --git a/lib/old_rubygems_patch.rb b/lib/old_rubygems_patch.rb
index 5601a5e90..3001a7381 100644
--- a/lib/old_rubygems_patch.rb
+++ b/lib/old_rubygems_patch.rb
@@ -1,4 +1,8 @@
-require File.join(File.dirname(__FILE__),'..','vendor','rails','railties','lib','rails','gem_dependency.rb')
+if File.exist? File.join(File.dirname(__FILE__),'..','vendor','rails','railties','lib','rails','gem_dependency.rb')
+ require File.join(File.dirname(__FILE__),'..','vendor','rails','railties','lib','rails','gem_dependency.rb')
+else
+ require 'rails/gem_dependency'
+end
module Rails
class GemDependency < Gem::Dependency
diff --git a/lib/ruby19.rb b/lib/ruby19.rb
new file mode 100644
index 000000000..39f48d74e
--- /dev/null
+++ b/lib/ruby19.rb
@@ -0,0 +1,8 @@
+if RUBY_VERSION.to_f == 1.9
+ class String
+ # @see syck/lib/syck/rubytypes.rb
+ def is_binary_data?
+ self.count("\x00-\x7F", "^ -~\t\r\n").fdiv(self.size) > 0.3 || self.index("\x00") unless self.empty?
+ end
+ end
+end \ No newline at end of file
diff --git a/lib/sendmail_return_path.rb b/lib/sendmail_return_path.rb
index d8922f78b..23c4d4376 100644
--- a/lib/sendmail_return_path.rb
+++ b/lib/sendmail_return_path.rb
@@ -6,7 +6,7 @@
module ActionMailer
class Base
def perform_delivery_sendmail(mail)
- sender = (mail['return-path'] && mail['return-path'].spec) || mail.from
+ sender = (mail['return-path'] && mail['return-path'].spec) || mail.from.first
sendmail_args = sendmail_settings[:arguments].dup
sendmail_args += " -f \"#{sender}\""
diff --git a/lib/tasks/rspec.rake b/lib/tasks/rspec.rake
index 588c26378..4024a6a6d 100644
--- a/lib/tasks/rspec.rake
+++ b/lib/tasks/rspec.rake
@@ -53,7 +53,8 @@ end
task :default => :spec
task :stats => "spec:statsetup"
-task :spec => ['spec:commonlib']
+# XXX commonlib tests are not Ruby 1.9 compatible
+#task :spec => ['spec:commonlib']
task :test => ['spec']
task :cruise => ['spec']
diff --git a/lib/tnef.rb b/lib/tnef.rb
index ff88b0005..1c941f8b0 100644
--- a/lib/tnef.rb
+++ b/lib/tnef.rb
@@ -9,7 +9,7 @@ class TNEF
main = TMail::Mail.new
main.set_content_type 'multipart', 'mixed', { 'boundary' => TMail.new_boundary }
Dir.mktmpdir do |dir|
- IO.popen("/usr/bin/tnef -K -C #{dir}", "w") do |f|
+ IO.popen("#{`which tnef`.chomp} -K -C #{dir}", "w") do |f|
f.write(content)
f.close
if $?.signaled?
diff --git a/public/images/logo.png b/public/images/logo.png
index 1a865124f..d5e87912c 100644
--- a/public/images/logo.png
+++ b/public/images/logo.png
Binary files differ
diff --git a/public/images/quote-marks.png b/public/images/quote-marks.png
index 752b7d4cf..e2bdfb06d 100644
--- a/public/images/quote-marks.png
+++ b/public/images/quote-marks.png
Binary files differ
diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css
index 35f456e72..1166975d7 100644
--- a/public/stylesheets/main.css
+++ b/public/stylesheets/main.css
@@ -1,1296 +1,1652 @@
-/*------------------------------------------------ global */
-body
-{
- padding: 0px;
- margin: 0px;
- text-align: center;
- font-family: Tahoma, Geneva, sans-serif;
-}
-
-/*------------------------------------------------ banner */
-
-#banner
-{
- position: absolute;
- top: 0px;
- left: 0px;
- width: 100%;
- margin: 0px;
- background-color: #F0F0F0;
- border-color: #993233;
- border-width: 0 0 3px 0;
- border-style: solid;
- height: 100px;
- background-image: url(../images/navimg/bnnr-temp-100pxd.jpg);
- background-repeat: no-repeat;
- background-position: center top;
-
-}
-
-/*------------------------------------------------ header */
-#header
-{
- height: 55px;
- position: absolute;
- top: 0px;
- left: 14px;
- height: 55px;
- width: 500px;
- z-index: 200;
- text-align: left;
-}
- #header h1
- {
- font-size: 0.8em;
- line-height: 0em;
- margin: 0;
- }
-
- #header h1 a
- {
- color: #f0f0f0;
- display: block;
- height: 55px;
- background-image: url(../images/navimg/alaveteli-logo.png);
- background-repeat: no-repeat;
- }
-
- #header #tagline
- {
- font-size: 0.8em;
- font-style: italic;
- text-align: left;
- margin: 2px 0 0 0;
- color: #626262;
- }
-
- #header #user_locale_switcher
- {
- font-size: 0.8em;
- font-style: italic;
- text-align: left;
- margin: 2px 0 0 0;
- color: #626262;
- position: absolute;
- }
-/*------------------------------------------------ temp stuff */
-#staging, #alpha_notice, #beta
-{ }
-
-
-#header h1 #beta, #header h1 #beta a
-{
- display: inline;
- height: 1em;
- background-image: none;
- font-size: 12px;
- color: #A4A4A4;
-}
-
-
-#staging
-{
- visibility: hidden;
- overflow: default;
-}
-
-#alpha_notice
-{
- padding: 0 20px 0 20px;
- margin: 0 0 1em 0;
- border-color: #FF201D;
- border-width: 1px;
- border-style: solid;
- background-color: #f0f0f0;
-}
-
-#downtime {
- border: 2px dashed #993233;
- background-color: #ffcc99;
- padding: 4px;
- margin: 0 auto;
- width: 80%;
- text-align: center;
-}
-
-/*------------------------------------------------ org logo */
- #orglogo
- {
- position: absolute;
- width: 100%;
- left: 0px;
- top: 0;
- z-index: 150;
- text-align: right;
- font-size: 0.8em;
- height: 40px;
- z-index: 100;
- }
- #orglogo a
- {
- color: #f0f0f0;
- display: block;
- float: right;
- clear: none;
- height: 55px;
- width: 265px;
- background-image: url(../images/navimg/alaveteli-logo-header.png);
- background-repeat: no-repeat;
- background-position: 125px 15px;
- }
-/*------------------------------------------------ search */
-
-#navigation_search
-{
- position: absolute;
- width: 100%;
- left: 0px;
- top: 70px;
- z-index: 150;
- text-align: right;
- -moz-opacity: 0.7!important;
- filter: alpha(opacity= 70)!important;
- opacity: 0.7!important;
-}
- #navigation_search input
- {
- border-color: #010101;
- border-width: 1px;
- border-style: solid;
- background-color: #fff;
- color: #000;
- }
- #navigation_search input#navigation_search_query
- {
- width: 14em;
- }
-
-#navigation_search p { margin: 0 0.6em 0 0; }
-
-/*------------------------------------------------ topnav */
-#topnav
-{
- position: relative;
- top: 103px;
- left: 0px;
- width: 100%;
- height: auto;
- overflow: auto;
- padding: 0px 0px 0px 0px;
- z-index: 100;
- background-color: #000;
- font-size: 0.9em;
-}
-
- #topnav ul
- {
- list-style: none;
- margin: 0px;
- padding: 0px;
- }
-
- #topnav li
- {
- float: left;
- }
-
- #topnav li a, #topnav li a:visited
- {
- display: block;
- margin: 0px;
- padding: 0.15em 0.6em 0.25em 0.8em;
- color: #ADADAD;
- text-decoration: none;
- }
-
- #topnav li a:hover
- { color: #fff; }
-
- #topnav li a:active { }
-
- #topnav li a.on, #topnav li a.on:visited
- {
- font-weight: bold;
- color: #000;
- }
-
- #topnav li a.on:hover {}
-
- #topnav li a.on:active {}
-
-/*-------------------------- login/signup */
-#logged_in_bar
-{
- float: right;
- clear: none;
- font-size: 0.9em;
- z-index: 200;
- padding: 0.20em 10px 0.25em 1em;
- color: #444;
-}
-
-#logged_in_bar a, #logged_in_bar a:visited
-{
- color: #92B3FF;
-}
-
-
-/*------------------------------------------------ wrapper round content */
-
-#wrapper
-{
- position: relative;
- clear: both;
- top: 0px;
- padding-top: 100px;
- width: 58em;
- margin: 0px auto 1.2em auto;
- /* = 800px at default size? so 1em = 16px*/
- text-align: left;
- overflow: visible;
-}
-
-/*------------------------------------------------ view as HTML */
-/* XXX this copies lines from #wrapper above, as didn't want to break wrapper
- * right now */
-#wrapper_xlhtml {
- position: relative;
- clear: both;
- top: 0px;
- padding-top: 100px;
- width: 90%;
- margin: 0px auto 1.2em auto;
- /* = 800px at default size? so 1em = 16px*/
- text-align: left;
- overflow: visible;
+body {
+text-align:center;
+color:#444;
+font-size:12px;
+font-family:Arial, sans-serif;
+margin:0;
+padding:0;
+}
+
+#banner {
+position:absolute;
+top:0;
+background-color:#EEE;
+left:0;
+width:100%;
+border:none;
+height:160px;
+border:none;
+margin:0;
+}
+
+#navigation_search {
+position:absolute;
+left:0;
+z-index:150;
+text-align:right;
+-moz-opacity:0.7px;
+filter:alpha(opacity= 70) !important;
+opacity:0.7px;
+width:auto;
+right:0;
+top:10px;
+}
+
+#navigation_search input {
+background-color:#fff;
+color:#000;
+border-color:#010101;
+border-style:solid;
+border-width:1px;
+}
+
+#navigation_search input#navigation_search_query {
+width:14em;
+}
+
+#navigation_search p {
+margin:0 0.6em 0 0;
+}
+
+#topnav {
+position:relative;
+left:0;
+height:auto;
+overflow:auto;
+z-index:100;
+background-color:#000;
+background:transparent;
+top:120px;
+margin-left:115px;
+width:auto;
+font-family:Arial, sans-serif;
+font-size:18px;
+padding:0;
+}
+
+#topnav ul {
+list-style:none;
+margin:0;
+padding:0;
+}
+
+#topnav li a,#topnav li a:visited {
+display:block;
+color:#444;
+text-decoration:none;
+margin:0;
+padding:0;
+}
+
+#topnav li a:hover {
+color:#000;
+}
+
+#logged_in_bar {
+clear:none;
+font-size:0.9em;
+z-index:200;
+color:#444;
+top:18px;
+right:210px;
+float:none;
+position:absolute;
+padding:0.2em 10px 0.25em 1em;
+}
+
+#logged_in_bar a,#logged_in_bar a:visited {
+color:#444;
+}
+
+#wrapper {
+position:relative;
+clear:both;
+top:0;
+text-align:left;
+overflow:visible;
+padding-top:160px;
+width:900px;
+margin:0 auto 1.2em;
}
+
#wrapper_google_embed {
- position: relative;
- clear: both;
- width: 100%;
- height: 90%;
- margin: 0 0 0 0;
- text-align: left;
- overflow: visible;
+position:relative;
+clear:both;
+width:100%;
+height:90%;
+text-align:left;
+overflow:visible;
+margin:0;
}
-#view-html-content table {
- border-collapse: collapse;
- margin-bottom: 1em;
+
+#content {
+position:relative;
+width:875px;
+padding:1em;
}
-#view-html-content td, th {
- border: solid 1px #000000;
+
+h1,h2,h3 {
+font-family:sans-serif;
+font-weight:700;
+line-height:1em;
+letter-spacing:0;
+color:#222;
+clear:left;
}
-#view-html-content td {
- vertical-align: top
+
+h1 {
+font-size:42px;
+margin-bottom:15px;
+margin-top:10px;
}
-#view-html-content td {
- max-width: 30em;
- overflow: auto;
+
+h2 {
+font-size:1.4em;
}
-#view-html-content tr:nth-child(odd) {
- background-color: #bbbbbb;
+
+.highlight {
+background:#FF0;
+border-color:#A3A3A3;
+border-style:dotted;
+border-width:0;
}
-#view-html-content tr:nth-child(even) {
- background-color: #dddddd;
+
+dl {
+margin-top:24px;
+line-height:160%;
}
+dt {
+font-weight:700;
+}
+dd {
+width:auto;
+margin:18px 0 36px;
+}
-/*------------------------------------------------ content */
+#stepwise_make_request {
+background-color:#BBB;
+border:1px solid #222;
+border-radius:5px;
+-moz-border-radius:5px;
+color:#222;
+font-size:18px;
+text-align:left;
+width:412px;
+margin:0 14em 40px 0;
+padding:10px 12px;
+}
-#content
-{
- position: relative;
- padding: 1em 1em 1em 1em;
+#stepwise_make_request_view_email {
+text-align:center;
+background-color:#d0d0d0;
+margin:0;
+padding:1em 0;
}
-h1, h2, h3
-{
- font-family: Trebuchet, Trebuchet MS, Helvetica, sans-serif;
- /*Arial Black, Gadget, sans-serif*/
- font-weight: bold;
- line-height: 1em;
- letter-spacing: 0em;
- color: #555;
- clear: left;
+#frontpage_examples div#examples_0 {
+float:left;
+margin-left:0;
+width:49%;
}
- h1 { font-size: 1.8em;}
- h2 { font-size: 1.4em;}
- h3 { font-size: 1.2em;}
-h4, h5, h6
-{}
+#frontpage_examples div#examples_1 {
+float:right;
+margin-right:0;
+width:49%;
+}
-/* XXX Francis put this here so he could check highlighting worked */
-.highlight
-{
- background-color: #F0F0F0;
- border-color: #A3A3A3;
- border-width: 1px;
- border-style: dotted;
+#frontpage_examples ul {
+text-align:center;
+list-style:none;
+margin:0;
+padding:1em 0;
}
-dl { line-height: 1.2em; }
+div#twitter {
+float:right;
+clear:none;
+width:18em;
+background-color:#EAEAEA;
+background:#FFF;
+margin:30px 0 1em 1em;
+padding:0.5em;
+}
-dt
-{
- font-weight: bold;
+img.twitter-icon {
+vertical-align:middle;
+}
+.blog_post {
+margin-bottom:2em;
}
-dd { margin: 0.6em 0 2em 4em; width: 33em; }
-/*---------------- content : recent requests sidebar */
-#frontpage_search
-{
- text-align: center;
- margin: 3em 0em 1em 0em;
- padding: 1em;
- background-color: #d0d0d0;
+.request_listing,.body_listing,.user_listing {
+font-size:0.8em;
+margin-top:1.5em;
+border-bottom:#9C9C9C;
+overflow:hidden;
+border-style:none none solid;
+border-width:0 0 1px;
+padding:0 0 1.5em;
}
-#stepwise_instructions
-{
- text-align: center;
- margin: 0em 0em 0em 0em;
- padding: 0.2em 0em 0.2em 0em;
- background-color: #d0d0d0;
+
+.body_listing {
+_width:47em;
+padding-bottom:16px;
}
-#stepwise_instructions p
-{
- margin: 0.5em 0em 0em 0em;
- padding: 0em 0em 0em 0em;
+
+span.head {
+display:block;
+font-size:1.4em;
+font-weight:700;
+padding:12px 0 0;
}
-#stepwise_make_request
-{
- text-align: center;
- margin: 0em 14em 0em 0em;
- padding: 1em 1em 1em 1em;
- background-color: #d0d0d0;
+
+.request_listing span.head /* full page request list only */ {
+min-height:32px;
+background-image:url(../images/navimg/request-icon.png);
+background-repeat:no-repeat;
+background-position:4px 0;
+margin:0 0 0.3em;
+padding:8px 0 0 42px;
}
-#stepwise_make_request_view_email
-{
- text-align: center;
- margin: 0em 0em 0em 0em;
- padding: 1em 0em 1em 0em;
- background-color: #d0d0d0;
+
+.body_listing span.head /* full page request list only */ {
+min-height:32px;
+background-image:url(../images/navimg/auth-icon.png);
+background-repeat:no-repeat;
+background-position:4px 0;
+margin:0 0 0.3em;
+padding:8px 0 0 42px;
}
-#frontpage_examples div#examples_0 {
- float: left;
- margin-left: 0%;
- width: 49%;
+
+.user_listing span.head /* full page request list only */ {
+min-height:32px;
+background-image:url(../images/navimg/user-icon.png);
+background-repeat:no-repeat;
+background-position:4px 0;
+margin:0 0 0.3em;
+padding:8px 0 0 42px;
}
-#frontpage_examples div#examples_1 {
- float: right;
- margin-right: 0%;
- width: 49%;
+
+.user_listing span.no_icon /* full page request list only */ {
+background-image:none;
}
-#frontpage_examples p
-{
- text-align: center;
- clear: both;
+
+span.bottomline {
+clear:left;
+display:block;
+padding:10px 0 0 42px;
}
-#frontpage_examples h2 {
- text-align: center;
- clear: both;
+
+.request_listing span.bottomline
+/* full page request list only */ {
+width:35em;
+background-repeat:no-repeat;
+background-position:left center;
+min-height:42px;
+margin:0 0 0.6em;
}
-#frontpage_examples li
-{
+
+.request_icon_line {
+background-repeat:no-repeat;
+background-position:left center;
+min-height:24px;
+clear:left;
+padding:8px 0 10px 42px;
}
-#frontpage_examples ul
-{
- margin: 0 0 0 0;
- padding: 1em 0em 1em 0em;
- text-align: center;
- list-style: none;
+
+.icon_waiting_response,.icon_waiting_classification,.icon_waiting_clarification {
+background-image:url(/images/status-pending.png);
+color:#A68C2E;
}
-/*-----------------------------blog----------------*/
+.icon_rejected {
+background-image:url(../images/navimg/status-icons-fail.png);
+}
-div#twitter
-{
- float: right;
- clear: none;
- width: 18em;
- background-color: #EAEAEA;
- padding: 0.5em;
- margin: 0 0 1em 1em;
+.icon_not_held {
+background-image:url(/images/status-not-held.png);
+color:#A68C2E;
}
-img.twitter-icon {
- vertical-align: middle;
+.icon_successful,.icon_partially_successful {
+background-image:url(/images/status-complete.png);
+color:#69952F;
}
-.blog_post {
- margin-bottom: 2em;
-}
-
-/*-----------------------------list sidebars----------------*/
-#list_sidebar
-{
- width: 14em;
- float: right;
- font-size: 0.85em;
- border-color: #AEAEAE;
- border-width: 1px;
- border-style: solid;
- background-color: #EAEAEA;
- padding: 0.5em;
- margin: 0 0 0 1em;
-}
- #list_sidebar h1, #list_sidebar h2
- {
- font-size: 1.2em;
- line-height: 1em;
- margin: 0px 0px 0.3em 0px;
- }
- #list_sidebar ul
- {
- list-style: none;
- margin: 0px;
- padding: 0px;
- }
-
-/*-----------------------------request sidebars----------------*/
-
- #request_sidebar span.head
- {
- padding: 12px 0 0 0;
- font-weight: bold;
- font-size: 1.2em;
- padding: 8px 0 0 0px;
- background-image: none;
- }
-
- #request_sidebar .request_listing span.desc
- /* sidebar request list only */
- {
- float: left;
- clear: both;
- width: 16.9em;
- background-image: url(../images/navimg/quote-open-small.png);
- background-repeat: no-repeat;
- background-position: 0 0;
- padding: 2px 2px 1em 15px;
- }
-
- #request_sidebar span.bottomline
- {
- float: left;
- clear: both;
- width: 100%;
- margin: 0 0 0.6em 0;
- background-image: none;
- padding: 0px;
- }
-
-
-
-/*--------------------------------- content : full lists */
-
-.request_listing,
-.body_listing,
-.user_listing
-{
- font-size: 0.8em;
- margin-top: 1.5em;
- padding: 0 0 1.5em 0;
- border-bottom: #9C9C9C;
- border-width: 0 0 1px 0;
- border-style: none none solid none;
- overflow: hidden;
-}
- .body_listing
- {
- _width: 47em;
- }
-/*.body_listing,
-.user_listing
-{ float: left; clear: none; width: 50%;}*/
-
- .request_listing a,
- .body_listing a,
- .user_listing a
- { text-decoration: none; }
-
- span.head
- {
- display: block;
- font-size: 1.4em;
- padding: 12px 0 0 0;
- font-weight: bold;
- }
- .request_listing span.head /* full page request list only */
- {
- min-height: 32px;
- margin: 0 0 0.3em 0;
- padding: 8px 0 0 42px;
- background-image: url(../images/navimg/request-icon.png);
- background-repeat: no-repeat;
- background-position: 4px 0px;
- }
- .body_listing span.head /* full page request list only */
- {
- min-height: 32px;
- margin: 0 0 0.3em 0;
- padding: 8px 0 0 42px;
- background-image: url(../images/navimg/auth-icon.png);
- background-repeat: no-repeat;
- background-position: 4px 0px;
- }
- .user_listing span.head /* full page request list only */
- {
- min-height: 32px;
- margin: 0 0 0.3em 0;
- padding: 8px 0 0 42px;
- background-image: url(../images/navimg/user-icon.png);
- background-repeat: no-repeat;
- background-position: 4px 0px;
- }
- .user_listing span.no_icon /* full page request list only */
- {
- background-image: none;
- }
-
- span.bottomline
- {
- clear: left;
- display: block;
- padding: 10px 0 0 42px;
-
- }
- .request_listing span.bottomline
- /* full page request list only */
- {
- width: 35em;
- margin: 0 0 0.6em 0;
- background-repeat: no-repeat;
- background-position: left center;
- min-height: 42px;
- }
-
- span.bottomline a
- {}
-
- .request_icon_line
- {
- background-repeat: no-repeat;
- background-position: left center;
- min-height: 24px;
- padding: 8px 0 10px 42px;
- clear: left;
- }
-
- /* Waiting */
- .icon_waiting_response,
- .icon_waiting_classification,
- .icon_waiting_clarification
- { background-image: url(../images/navimg/status-icons-wait.png);}
- /* Failed */
- .icon_rejected
- { background-image: url(../images/navimg/status-icons-fail.png);}
- /* Not held */
- .icon_not_held
- { background-image: url(../images/navimg/status-icons-not-held.png);}
- /* Successful */
- .icon_successful,
- .icon_partially_successful
- { background-image: url(../images/navimg/status-icons-succeed.png);}
- /* Alert */
- .icon_requires_admin,
- .icon_waiting_response_overdue,
- .icon_waiting_response_very_overdue
- { background-image: url(../images/navimg/status-icons-attn.png);}
- /* Postal */
- .icon_gone_postal
- { background-image: url(../images/navimg/status-icons-post.png);}
- /* Error */
- .icon_error_message
- { background-image: url(../images/navimg/status-icons-error-message.png);}
- /* Interal review */
- .icon_internal_review
- { background-image: url(../images/navimg/status-icons-internal-review.png);}
- /* User withdrawn */
- .icon_user_withdrawn
- { background-image: url(../images/navimg/status-icons-user-withdrawn.png);}
-
- /* span.bottomline.icon_requires_admin,
- span.bottomline.icon_user_withdrawn, */
-
- span.desc
- {
- display: block;
- float: right;
- clear: none;
- font-style: italic;
- color: #3F3F3F;
- overflow: hidden;
- }
- .request_listing span.desc
- /* full page request list only */
- {
- width: 25em;
- background-image: url(../images/navimg/quote-open.png);
- background-repeat: no-repeat;
- background-position: 0 0;
- padding: 8px 0 0 25px;
- }
-
- .body_listing span.desc
- { background-image: none; float: left; clear: both; padding: 0px 0 0 42px;}
-
-/*--------------------------------- content : short lists */
-
-.request_short_listing
-{
- margin-top: 1em;
-}
-
-.request_short_listing h3
-{
- font-size: 1.2em;
-}
-.request_short_listing p
-{
- font-size: 0.8em;
- margin-top: -0.8em;
- margin-bottom: 0;
-}
-
-
-.request_short_listing a
-{ text-decoration: none; }
-
-.request_short_listing
-{
-}
-
-/*---------------- content : lists back/next */
-
-div.pagination { text-align: center; padding-top: 0.3em;}
-
- div.pagination span.current
- {
- padding: 0 0.6em 0.1em 0.6em;
- background-color: #000;
- color: #FFF;
- }
- span.disabled { color: #B2B2B2; padding: 0 0.6em 0.1em 0.6em; }
- div.pagination a, div.pagination a:visited
- {
- text-decoration: none;
- padding: 0 0.6em 0.1em 0.6em;
- }
- div.pagination a:hover
- {
- background-color: #626262;
- color: #FFF;
- }
-
-
-/*---------------- content : find authority (home page) */
-#make_requests
-{
- float: left;
- clear: none;
- width: 26em;
- text-align: center;
-}
-
-.auto_complete
-{
- text-align: left;
- background-color: #FFF;
- border-color: #454545 #282828 #000 #454545;
- border-width: 1px 1px 2px 1px;
- border-style: solid;
-}
-
- .auto_complete ul
- {
- list-style: none;
- margin: 0px;
- padding: 0px;
- }
- .auto_complete ul li
- {
- margin: 0px 0px 0.4em 0px;
- padding: 0.1em 1em 0.3em 1em;
- color: #595959;
- }
- .auto_complete ul li:hover
- {
- color: #000;
- background-color: #D7D7D7;
- cursor: default;
- }
-
-
-
-/*-------------------- Content : form errors */
-#error, .errorExplanation, #hidden_request
-{
- color: #FF0606;
- font-size: 1.4em;
- font-weight: bold;
- border-color: #FF0C11;
- border-width: 1px;
- border-style: solid;
- background-color: #ffeeee;
-}
-#error, #hidden_request {
- padding: 0.5em;
-}
-.fieldWithErrors
-{
- display: block;
- padding: 0.2em;
- border-color: #FF0C11;
- border-width: 1px;
- border-style: solid;
- background-color: #ffeeee;
-}
-
-/*-------------------- Content : action notice */
-#notice, .describe_state_form, .undescribed_requests, .gone_postal_help
-{
- color: #16C132;
- font-size: 1.4em;
- font-weight: bold;
- border-color: #1EFF38;
- border-width: 1px;
- border-style: solid;
- background-color: #D5FFD8;
- padding: 0.5em;
-}
-
-.form_explanation{
- font-size: 0.8em;
-}
-/* This doesn't seem to work, not sure why (if you turn it on, check all
- * flashes with <strong> in them work OK)
-#notice * strong
-{
- font-weight: bolder;
-} */
-.describe_state_form, .undescribed_requests, .gone_postal_help {
- font-weight: normal;
- margin-bottom: 1em;
- font-size: 1.0em;
- color: #454545;
- float: left;
- width: 39em;
-}
-.undescribed_requests {
- clear: both;
+.icon_requires_admin,.icon_waiting_response_overdue,.icon_waiting_response_very_overdue {
+background-image:url(/images/status-overdue.png);
+color:#C1272D;
+}
+
+.icon_gone_postal {
+background-image:url(/images/status-gone-postal.png);
+color:#A68C2E;
+}
+
+.icon_error_message {
+background-image:url(/images/status-error.png);
+color:#C1272D;
+}
+
+.icon_internal_review {
+background-image:url(/images/status-internal-review.png);
+color:#A68C2E;
+}
+
+.icon_user_withdrawn {
+background-image:url(/images/status-withdrawn.png);
+color:#A68C2E;
+}
+
+span.desc {
+display:block;
+float:right;
+clear:none;
+font-style:italic;
+color:#3F3F3F;
+overflow:hidden;
+}
+
+.request_listing span.desc
+/* full page request list only */ {
+width:25em;
+background-image:url(../images/navimg/quote-open.png);
+background-repeat:no-repeat;
+background-position:0 0;
+padding:8px 0 0 25px;
}
+
+.body_listing span.desc {
+background-image:none;
+float:left;
+clear:both;
+padding:0 0 0 42px;
+}
+
+.request_short_listing p {
+font-size:0.8em;
+margin-top:-0.8em;
+margin-bottom:0;
+}
+
+div.pagination {
+text-align:center;
+padding-top:0.3em;
+}
+
+div.pagination span.current {
+background-color:#000;
+color:#FFF;
+padding:0 0.6em 0.1em;
+}
+
+span.disabled {
+color:#B2B2B2;
+padding:0 0.6em 0.1em;
+}
+
+div.pagination a,div.pagination a:visited {
+text-decoration:none;
+padding:0 0.6em 0.1em;
+}
+
+div.pagination a:hover {
+background-color:#626262;
+color:#FFF;
+}
+
+#error,.errorExplanation,#hidden_request {
+color:#FF0606;
+font-size:1.4em;
+font-weight:700;
+background-color:#fee;
+border-color:#FF0C11;
+border-style:solid;
+border-width:1px;
+}
+
+#error,#hidden_request {
+padding:0.5em;
+}
+
+.fieldWithErrors {
+display:block;
+background-color:#fee;
+background:none;
+border:solid 0 #FFF;
+border-color:#FF0C11;
+border-style:solid;
+border-width:1px;
+padding:0.2em;
+}
+
+#notice,.describe_state_form,.undescribed_requests,.gone_postal_help {
+color:#16C132;
+font-size:1.4em;
+font-weight:700;
+background-color:#D5FFD8;
+border-color:#1EFF38;
+border-style:solid;
+border-width:1px;
+padding:0.5em;
+}
+
+.describe_state_form,.undescribed_requests,.gone_postal_help {
+font-weight:400;
+margin-bottom:1em;
+font-size:1em;
+color:#454545;
+float:left;
+width:39em;
+}
+
.requires_admin_details {
- margin-left: 1.8em;
- width: 37em;
-}
-.single_user {
- clear: left;
-}
-
-/*---------------- content : request detail pages */
-
-#request_sidebar
-{
- float: right;
- clear: none;
- width: 14em;
- margin: 0 0 0 0.6em;
- font-size: 0.9em;
-}
-#request_main, #show_response_view
-{
- width: 35em;
-}
-
-#preview_form p {clear: both;}
-
-div.correspondence
-{
- width: 40em;
- float: left;
- padding: 0em 0.5em 0em 0.5em;
- margin: 0 0 1em 0;
- border-color: #5F5F5F;
- border-width: 1px;
- border-style: solid;
- overflow: auto;
-}
-div.correspondence h2
-{ text-align: right; font-size: 1em; }
-
-.event_actions
-{ text-align: right}
-
-div.comment_in_request
-{
- width: 39em;
- float: left;
- padding: 0em 0.5em 0em 0.5em;
- margin: 0 0 1em 0;
- border-color: #5F5F5F;
- border-width: 1px;
- border-style: dotted;
- overflow: auto;
-}
-
-div#after_actions
-{
- float: left;
- margin-bottom: 1em;
- width: 39em;
-}
-
-div#anyone_actions
-{
- margin-bottom: 1em;
-}
-
-/* id starts with... */
-div[id|="outgoing"] { }
- div[id|="outgoing"] p { font-size: 0.95em;}
-
-div[id|="incoming"] { background-color: #E7E7E7; font-family: Times New Roman, Times, serif; }
- div[id|="incoming"] p { font-size: 1.08em;}
-
-div[id|="comment"] { }
- div[id|="comment"] { margin-left: 2em; width: 35em; }
- div[id|="comment"] p { font-size: 0.8em;}
- div[id|="comment"] h2 { font-size: 0.8em; text-align: left; margin-left: 1em; }
-.comment_quote { float: left; margin-right: 0.6em; }
-
-.correspondence_text { margin: 0 1.2em 0 0.8em; }
-.comment_in_request_text { margin: 0 1.2em 0 0.8em; }
-.preview_subject { margin: 1em 1.2em 0 0.8em; }
-
-/*.event_bubble { margin: 3em 0 0 0; font-size: 0.9em;}*/
-
-.attachments {
- border-color: #010101;
- border-width: 1px;
- margin: 0 0 1em 0;
-}
-.attachment {
- clear: both;
+margin-left:1.8em;
+width:37em;
+}
+
+#show_response_view {
+width:35em;
+}
+
+div.correspondence {
+width:40em;
+float:left;
+overflow:auto;
+border-color:#5F5F5F;
+border-style:solid;
+border-width:1px;
+margin:0 0 1em;
+padding:0 0.5em;
+}
+
+div.correspondence h2 {
+text-align:right;
+font-size:1em;
+}
+
+.event_actions {
+text-align:right;
+}
+
+div.comment_in_request {
+float:left;
+overflow:auto;
+width:550px;
+border-color:#5F5F5F;
+border-style:dotted;
+border-width:1px;
+margin:0 0 1em 50px;
+padding:0 0.5em;
+}
+
+div#after_actions {
+float:left;
+margin-bottom:1em;
+width:39em;
+}
+
+div#anyone_actions {
+margin-bottom:1em;
+}
+
+div[id|="outgoing"] p {
+}
+
+div[id|="incoming"] {
+background-color:#DEDEDE;
+}
+
+div[id|="incoming"] p {
+}
+
+div[id|="comment"] {
+width:35em;
+margin-left:50px;
+}
+
+div[id|="comment"] h2 {
+margin-left:1em;
+font-size:1em;
+text-align:right;
+}
+
+.comment_quote {
+float:left;
+margin-right:0.6em;
+}
+
+.preview_subject {
+margin:1em 1.2em 0 0.8em;
+}
+
+.attachments {
+border-color:#010101;
+border-width:1px;
+margin:0 0 1em;
}
+
a img.attachment_image {
- float: left;
- border: 0px;
- vertical-align: middle;
- margin: 0 0.2em 0.2em 0;
+float:left;
+border:0;
+vertical-align:middle;
+margin:0 0.2em 0.2em 0;
}
+
.attachments hr.top {
- margin: 0 0 1em 0;
- clear: both;
+clear:both;
+margin:0 0 1em;
}
+
.attachments hr.bottom {
- margin: 1em 0 0 0;
- clear: both;
+clear:both;
+margin:1em 0 0;
}
-#followup
-{ clear: both; float: left; }
-
-/*------------------------------------------------ view attachment as HTML */
+#followup {
+clear:both;
+float:left;
+}
-.view-html-content {
- margin-left: 1em;
- margin-right: 1em;
+#view-html-content {
+margin-left:1em;
+margin-right:1em;
}
-.view-html-content, img {
- max-width: 50em;
+
+#view-html-content img {
+max-width:50em;
}
.view_html_prefix {
- text-align: left;
- background-color: #E7E7E7;
- border-bottom: 1px solid #5f5f5f;
- padding: 0.5em 1em 0.5em 1em;
- height: 6%;
+text-align:left;
+background-color:#E7E7E7;
+border-bottom:1px solid #5f5f5f;
+height:6%;
+padding:0.5em 1em;
}
+
.view_html_logo {
- float: left;
- margin-right: 1em;
+float:left;
+margin-right:1em;
}
+
.view_html_logo img {
- border: 0;
+border:0;
}
+
.view_html_download_link {
- float: right;
- margin-left: 1em;
+float:right;
+margin-left:1em;
+}
+
+#authority_selection {
+float:left;
+width:40%;
}
-/*------------------------------------------------ authority listings */
-#body_sidebar {
- font-size: 0.85em;
- width: 16em;
- float: right;
- clear:none;
+#authority_search_ahead_results {
+width:26em;
}
-#body_sidebar a { text-decoration: none; }
+#authority_preview {
+width:45%;
+float:right;
+background-color:#FFFFE0;
+padding-left:1em;
+padding-right:1em;
+overflow:hidden;
+margin-top:-67px;
+}
+
+#authority_preview #header_left,#authority_preview.request_left,#authority_preview #stepwise_make_request {
+width:95%;
+}
-/*------------------------------------------------ selecting an authority */
+#request_advice {
+float:right;
+width:250px;
+margin-top:1em;
+}
-#authority_selection
-{
- float: left;
- width: 40%;
+#request_advice ul {
+margin:0 auto;
}
-#authority_search_ahead_results
-{
- width: 26em;
+#request_advice ul li {
+margin:0 0 1em;
}
-#authority_preview
-{
- width: 45%;
- float: right;
- background-color: #FFFFE0;
- padding-left: 1em;
- padding-right: 1em;
- overflow: hidden;
- margin-top: -67px;
+#request_header {
+background-color:#FFFFE0;
+padding-top:0.5em;
+padding-bottom:1em;
}
- #authority_preview #header_left,
- #authority_preview.request_left,
- #authority_preview #stepwise_make_request
- {
- width: 95%;
- }
+#request_form label,label.form_label {
+display:block;
+float:left;
+clear:none;
+width:100px;
+text-align:left;
+margin:2px 0 0;
+padding:0 10px 0 0;
+}
-/*------------------------------------------------ making a request / sign up / sign in */
+.form_item_note,.form_note {
+width:34em;
+margin-left:110px;
+font-size:1em;
+}
-#request_advice
-{
- float: right;
- width: 250px;
- margin-top: 1em;
+.form_item_note {
+margin-top:-1em;
}
- #request_advice ul
- {
- margin: 0 auto 0 auto;
- }
- #request_advice ul li { margin: 0 0 1em 0; }
+.form_button {
+margin:0 0 0 9em;
+}
+
+p#sign_in_reason {
+text-align:center;
+font-size:1.4em;
+font-weight:700;
+line-height:1em;
+}
+
+#signup,#signin {
+clear:none;
+margin-bottom:1em;
+float:none;
+margin-top:20px;
+width:auto;
+}
-#request_header
-{
- background-color: #FFFFE0;
- padding-top: 0.5em;
- padding-bottom: 1em;
+#signup h2,#signin h2 {
+font-size:1.1em;
}
-#request_header_text
-{
- font-size: 0.8em;
- margin-left: 11em;
+#signup {
+float:right;
}
-#request_search_ahead_results
-{
- font-size: 0.8em;
- margin-left: 11em;
+#sign_alone #signin {
+margin-left:25%;
}
-#request_form
-{ margin-top: 1em;}
+#signup .form_item_note,#signin .form_note {
+font-size:0.8em;
+margin-left:11.5em;
+width:24em;
+}
-#request_form label,
-label.form_label
-{
- display: block;
- /*width: 128px;*/ width: 8em;
- float: left;
- clear: none;
- text-align: right;
- padding: 0 10px 0 0;
- margin: 0 0 0 0;
+div.controller_help dt a,div.controller_help h1 a,div#help_unhappy h1 a.hover_a {
+text-decoration:none;
+font-size:0.8em;
+color:#fff;
+background-color:#fff;
}
-.form_item_note, .form_note
-{
- font-size: 0.8em;
- /*width: 432px;*/ width: 34em;
- /*margin-left: 138px;*/ margin-left: 11em;
+div.controller_help dt:hover > a,div.controller_help h1:hover > a,div#help_unhappy h1:hover > a.hover_a {
+color:#777;
}
-.form_item_note
-{
- margin-top: -1.0em;
+
+#hash_link_padding {
+margin-bottom:10em;
}
+#contact_preamble {
+width:auto;
+margin:0 0 30px;
+}
-.form_button
-{
- margin: 0 0 0 9em;
+div.feed_link_main {
+display:inline;
}
-p#sign_in_reason
-{
- text-align: center;
- font-size: 1.4em;
- font-weight: bold;
- line-height: 1em;
+#footer {
+position:relative;
+clear:both;
+float:left;
+width:100%;
+height:2em;
+font-size:0.85em;
+background-color:#F0F0F0;
+border-color:#FFF;
+border-style:solid;
+border-width:3px 0 0;
+margin:60px 0 0;
+padding:0.5em 0;
}
-#signup,
-#signin
-{
- clear: none;
- width: 23em;
- margin-bottom: 1em;
+#everypage {
+background-color:#fc9;
+border:solid 2px #f60;
+border-top:none;
+opacity:0.97px;
+-moz-border-radius-bottomleft:10px;
+-moz-border-radius-bottomright:10px;
+position:fixed;
+width:70%;
+left:15%;
+z-index:200;
+max-height:95%;
+overflow:auto;
+padding:4px;
+}
+
+#everypage h2,#everypage h3 {
+margin:0.5em 0;
+}
+
+#game_sidebar {
+float:right;
+clear:none;
+width:20em;
+font-size:0.8em;
+margin:0 0 2em 2em;
+}
+
+#user_photo_on_profile img,#user_photo_on_profile #set_photo {
+width:96px;
+height:96px;
+float:left;
+vertical-align:middle;
+text-align:center;
+border:1px solid #ddd;
+margin-right:5px;
+padding:2px;
+}
+
+.user_photo_on_request img {
+width:48px;
+height:48px;
+float:left;
+vertical-align:middle;
+border:1px solid #ddd;
+margin-right:5px;
+padding:2px;
+}
+
+.user_photo_on_comment img {
+width:36px;
+height:36px;
+float:left;
+vertical-align:middle;
+border:1px solid #ddd;
+margin-right:5px;
+margin-top:5px;
+padding:2px;
+}
+
+.user_photo_on_search img {
+width:48px;
+height:48px;
+vertical-align:middle;
+border:1px solid #ddd;
+margin-right:5px;
+padding:2px;
+}
+
+div.user_about_me {
+overflow:auto;
+margin:1em 1.5em;
+padding:0 0.5em;
+}
+
+#user_public_banned {
+background-color:#d0d0d0;
+margin:0 14em 0 0;
+padding:0.5em 1em;
+}
+
+#user_public_banned .details {
+margin-left:4em;
+margin-right:4em;
+font-size:0.8em;
+font-style:italic;
}
- #signup h2,
- #signin h2
- { font-size: 1.1em; }
- #signup
- {
- float: right;
- }
+div.lang {
+text-align:right;
+font-size:0.8em;
+right:0;
+z-index:200;
+top:40px;
+position:absolute;
+padding:0;
+}
- #signin
- {
- float: left;
- }
+div#user_locale_switcher {
+margin:5px;
+}
-#sign_alone #signin {
- margin-left: 25%;
+#topnav li,#signin,.user_photo_on_search {
+float:left;
}
-
-#signup .form_item_note,
-#signin .form_note
-{
- font-size: 0.8em;
- width: 16em;
- margin-left: 11em;
+
+#view-html-content table,#request_details table {
+border-collapse:collapse;
+margin-bottom:1em;
}
-/*--------------------------------- content : about pages */
+#view-html-content td,th,#request_details td,th {
+border:solid 1px #000;
+}
-div#about_sidebar
-{
- float: right;
- clear: none;
- width: 14em;
- background-color: #EAEAEA;
- padding: 0.5em;
- margin: 0 0 0 1em;
+#view-html-content td,#request_details td {
+vertical-align:top;
+max-width:30em;
+overflow:auto;
+}
- border-color: #AEAEAE;
- border-width: 1px;
- border-style: solid;
+#view-html-content tr:nth-child(odd),#request_details tr.odd {
+background-color:#bbb;
}
-div.controller_help dt a, div.controller_help h1 a, div#help_unhappy h1 a.hover_a
-{
- text-decoration: none;
- font-size: 0.80em;
- color: #fff;
- background-color: #fff;
+#view-html-content tr:nth-child(even),#request_details tr.even {
+background-color:#ddd;
}
-div.controller_help dt:hover > a, div.controller_help h1:hover > a, div#help_unhappy h1:hover > a.hover_a {
- color: #0000ee;
+
+h3,.request_short_listing h3 {
+font-size:1.2em;
}
-div.controller_help dt:hover > a:hover, div.controller_help h1:hover > a:hover, div#help_unhappy h1:hover > a.hover_a:hover {
- text-decoration: underline;
+
+#frontpage_examples p,#frontpage_examples h2 {
+text-align:center;
+clear:both;
}
-#hash_link_padding
-{
- margin-bottom: 10em;
+.request_short_listing,#request_form {
+margin-top:1em;
}
-#contact_preamble
-{
- /*width: 224px;*/ width: 33em;
- /*margin-left: 142px;*/ margin-left: 8em;
+.form_explanation,div[id|="comment"] p {
+font-size:0.8em;
}
+.undescribed_requests,#preview_form p,.attachment {
+clear:both;
+}
+.single_user,#user_change_password_email,#user_not_logged_in {
+clear:left;
+}
-/*---------------------------------- RSS and email alerts */
+.correspondence_text,.comment_in_request_text {
+margin:0 1.2em 0 0.8em;
+}
-div.feed_link img {
- border: none;
- vertical-align: middle;
- text-decoration: none;
+#request_header_text,#request_search_ahead_results {
+font-size:0.8em;
+margin-left:11em;
}
-div.feed_link_main {
- display: inline;
+
+div.feed_link img,div.act_link img {
+border:none;
+vertical-align:middle;
+text-decoration:none;
+}
+
+h2,dt {
+font-size:21px;
}
-form.feed_form_main {
- display: inline;
+
+h3 {
+text-decoration:none;
+font-size:20px;
+margin-top:3px;
+margin-bottom:10px;
}
-div.act_link img {
- border: none;
- vertical-align: middle;
- text-decoration: none;
+a {
+text-decoration:underline;
}
-/*------------------------------------------------ footer */
+#banner_inner {
+width:890px;
+position:relative;
+margin:auto;
+}
-#footer
-{
- position: relative;
- clear: both;
- float: left;
- width: 100%;
- height: 2em;
- margin: 0px 0 0px 0;
- padding: 0.5em 0 0.5em 0;
- font-size: 0.85em;
- background-color: #F0F0F0;
- border-color: #993233;
- border-width: 3px 0 0 0;
- border-style: solid;
+#banner_inner a#logo {
+position:absolute;
+left:0;
+top:70px;
+z-index:100;
}
-/*------------------------------------------------ interstitial advert */
+a img {
+border:none;
+}
-#everypage {
- background-color: #ffcc99;
- border: solid 2px #ff6600; border-top: none; /* No top border, so looks like coming out of top */
- opacity: 0.97;
- -moz-border-radius-bottomleft: 10px; -moz-border-radius-bottomright: 10px; /* Rounded bottom corners */
- padding: 4px;
- position: fixed;
- width: 70%; left: 15%; /* So centered on screen, always visible */
- z-index: 200; /* So on top */
- max-height: 95%; overflow: auto; /* So on e.g. 800x600 scrollbar appears */
+#navigation_search input[type=image] {
+border:0;
+margin-bottom:-9px;
+margin-left:-4px;
+}
+
+#navigation_search input[type=text] {
+font-size:12px;
+border-radius:5px 0 0 5px;
+-moz-border-radius:5px 0 0 5px;
+border-color:#222;
+padding:5px 5px 4px;
+}
+
+#topnav ul li {
+margin:0 3px;
+padding:10px 15px;
+}
+
+#topnav ul li.selected {
+background:#FFF;
}
-#everypage h2, #everypage h3, #foi2009 h2, #foi2009 h3 {
- margin: 0.5em 0;
+
+.request_right {
+padding-top:5px;
+width:245px;
+float:left;
+}
+
+#request_header_text {
+margin-left:110px;
}
+#stepwise_make_request a img {
+margin-bottom:-10px;
+margin-top:-10px;
+margin-left:6px;
+}
-/*------------------------------------------------ request categorisation game */
+p.subtitle {
+margin-top:10px;
+margin-bottom:20px;
+font-size:18px;
+font-style:normal;
+color:#222;
+}
-#game_buttons {
+.results_section {
+margin-bottom:40px;
}
-#game_sidebar
-{
- float: right;
- clear: none;
- width: 20em;
- margin: 0 0 2em 2em;
- font-size: 0.8em;
+.results_section div:last-child {
+border-bottom-width:0;
+padding-bottom:0;
}
-/*------------------------------------------------ request details */
+.request_listing,.user_listing,.body_listing {
+border-bottom:1px solid #DDD;
+margin:0 0 -1px;
+padding:12px 0 6px;
+}
-#request_details table {
- border-collapse: collapse;
- margin-bottom: 1em;
+.request_listing span.head,.user_listing span.head,.body_listing span.head {
+background:none;
+font-size:21px;
+margin-bottom:6px;
+padding:0;
}
-#request_details td, th {
- border: solid 1px #000000;
+
+.request_listing span.head a,.user_listing span.head a,.body_listing span.head a {
+text-decoration:none;
+font-size:20px;
+margin-top:3px;
+display:block;
+margin-bottom:-6px;
+}
+
+.request_listing .requester {
+font-size:12px;
+padding-bottom:0;
+}
+
+.body_listing span.desc,.body_listing span.bottomline,.user_listing span.bottomline {
+font-style:normal;
+font-size:12px;
+font-weight:400;
+margin:0;
+padding:0;
}
-#request_details td {
- vertical-align: top
+
+.request_listing span.bottomline {
+font-style:normal;
+margin-bottom:0;
+margin-top:12px;
+background-position:top left;
+font-size:14px;
+font-weight:400;
+min-height:36px;
+padding:3px 0 0 27px;
}
-#request_details td {
- max-width: 30em;
- overflow: auto;
+
+.user_listing {
+padding-top:10px;
+padding-bottom:0;
}
-#request_details tr.odd {
- background-color: #bbbbbb;
+
+.icon_failed,.icon_rejected {
+background-image:url(/images/status-denied.png);
+color:#C1272D;
}
-#request_details tr.even {
- background-color: #dddddd;
+
+#request_sidebar {
+width:212px;
+font-size:12px;
}
+.feed_link {
+padding:4px 0;
+}
-/*------------------------------------------------ users */
+.request_listing span.desc {
+background:url(/images/quote-marks.png) no-repeat;
+min-height:60px;
+font-size:12px;
+width:auto;
+color:#444;
+line-height:18px;
+padding:0 0 0 40px;
+}
-#user_photo_on_profile {
+#search_form {
+margin:0 -6px 20px 0;
}
-#user_photo_on_profile img, #user_photo_on_profile #set_photo {
- width: 96px;
- height: 96px;
- float: left;
- vertical-align: middle;
- text-align: center;
- border: 1px solid #dddddd;
- margin-right: 5px;
- padding: 2px;
+#advanced-search input[type=text] {
+width:auto;
}
-.user_photo_on_request img {
- width: 48px;
- height: 48px;
- float: left;
- vertical-align: middle;
- border: 1px solid #dddddd;
- margin-right: 5px;
- padding: 2px;
+#search_form input[type=submit] {
+border-radius:0 2px 2px 0;
+-moz-border-radius:0 2px 2px 0;
}
-.user_photo_on_comment img {
- width: 36px;
- height: 36px;
- float: left;
- vertical-align: middle;
- border: 1px solid #dddddd;
- margin-right: 5px;
- margin-top: 5px;
- padding: 2px;
+#header_right {
+float:right;
+width:230px;
+padding-top:27px;
}
-.user_photo_on_search {
- float: left;
+.feed_link,.act_link {
+display:block !important;
+margin-bottom:10px;
}
-.user_photo_on_search img {
- width: 48px;
- height: 48px;
- vertical-align: middle;
- border: 1px solid #dddddd;
- margin-right: 5px;
- padding: 2px;
+
+.feed_link a,.act_link a,#header_right > a {
+text-decoration:none;
}
-#user_change_password_email, #user_not_logged_in {
- clear: left;
+.feed_link a img,.act_link img,.act_link a img {
+padding-right:2px;
}
-div.user_about_me
-{
- padding: 0em 0.5em 0em 0.5em;
- margin: 1em 1.5em 1em 1.5em;
- overflow: auto;
+form.feed_form input[type="submit"] {
+font-size:12px;
+line-height:12px;
+padding:2px 4px;
}
-#user_public_banned
-{
- margin: 0em 14em 0em 0em;
- padding: 0.5em 1em 0.5em 1em;
- background-color: #d0d0d0;
+#header_right > br {
+line-height:200%;
}
-#user_public_banned .details
-{
- margin-left: 4em;
- margin-right: 4em;
- font-size: 0.8em;
- font-style: italic;
+
+#general_search h2 {
+clear:both;
+margin-top:20px;
}
-div.lang {
- position: absolute;
- text-align: right;
- font-size: 0.8em;
- top: 45px;
- right: 0px;
- padding-right: 5px;
- z-index: 200;
+h2.foi_results,h2.person_results,h2.publicbody_results {
+padding-top:0;
+padding-bottom:15px;
+margin-bottom:0;
+margin-top:0;
}
-div#user_locale_switcher {
- margin: 5px;
+h2.foi_results {
+width:600px;
+}
+
+.list_toggle_controls {
+padding-bottom:20px;
+}
+
+#request_advice ol {
+margin-left:18px;
+margin-top:20px;
+display:block;
+padding:0;
+}
+
+#request_advice ol li {
+padding-bottom:5px;
+}
+
+#request_form label,label.form_label,span#to_public_body {
+font-size:18px;
+}
+
+#date_range label,#filter_requests_form label {
+display:inline;
+float:none;
+padding-right:5px;
+}
+
+#date_range label.title,#filter_requests_form label.title,h3.title {
+display:inline-block;
+float:none;
+width:110px;
+}
+
+h3.title {
+width:114px;
+margin-bottom:5px;
+}
+
+#requests-subfilters div {
+margin-top:10px;
+}
+
+#requests-subfilters #latest_status_0,#requests-subfilters #request_variety_0 {
+margin-left:0;
+}
+
+#requests-subfilters input[type=checkbox] {
+margin-left:117px;
+}
+
+span#to_public_body {
+}
+
+#left_column {
+width:600px;
+float:left;
+}
+
+#right_column_flip {
+width:220px;
+float:left;
+margin-top:20px;
+}
+
+#left_column_flip {
+width:620px;
+float:right;
+margin-top:10px;
+}
+
+#right_column {
+width:220px;
+float:right;
+margin-top:30px;
+}
+
+#left_half {
+width:45%;
+float:left;
+}
+
+#right_half {
+width:45%;
+float:right;
+}
+
+#middle_strip {
+float:left;
+width:10%;
+height:100px;
+text-align:center;
+margin-top:45px;
+font-size:16px;
+font-family:Georgia;
+font-style:italic;
+color:#444;
+}
+
+#sign_together h1 {
+width:320px;
+text-align:center;
+}
+
+#sign_together .form_button {
+margin-left:10.5em;
+}
+
+form input[type=text],form input[type=password] {
+font-size:14px;
+width:200px;
+color:#555;
+border-radius:3px;
+-moz-border-radius:3px;
+border-color:#BBB;
+border-style:solid;
+border-width:1px;
+padding:5px;
+}
+
+form input.use-datepicker[type=text] {
+width:130px !important;
+background:url(/images/calendar.png) no-repeat 115px 3px;
+border-radius:3px !important;
+-moz-border-radius:3px !important;
+font-size:14px !important;
+margin:0 !important;
+}
+
+form input[type=submit],a.link_button_green,a.link_button_green_large {
+background:url(/images/button-gradient.png);
+color:#FFF;
+text-decoration:none;
+display:inline-block;
+line-height:18px;
+border:solid 1px #69952F;
+border-radius:2px;
+-moz-border-radius:2px;
+text-shadow:1px 1px 0 #5B841D;
+font-size:18px;
+cursor:hand;
+padding:5px 11px;
+}
+
+a.link_button_green_large {
+background:url(/images/button-gradient-large.png);
+font-size:22px;
+line-height:22px;
+padding-bottom:7px;
+}
+
+form input[type=submit].small {
+font-size:15px;
+line-height:10px;
+padding:4px 9px;
+}
+
+ul.no_bullets {
+list-style-type:none;
+margin:0 0 30px;
+padding:0;
+}
+
+ul.no_bullets li {
+margin-bottom:6px;
+}
+
+#frontpage_search {
+background:transparent;
+}
+
+#public_body_list #right_column ul {
+list-style:none;
+margin:0;
+padding:0 0 20px;
+}
+
+div.blog_post p {
+line-height:180%;
+}
+
+div.frontpage-box {
+background:url(/images/stripes.png);
+border:1px solid #DEBEDD;
+border-radius:5px;
+-moz-border-radius:5px;
+color:#DDD;
+font-size:18px;
+text-align:center;
+width:255px;
+height:210px;
+float:left;
+padding:15px 12px 0;
+}
+
+#frontpage-box-1 {
+margin-right:10px;
+vertical-align:middle;
+}
+
+#frontpage-box-2 {
+margin-right:10px;
+}
+
+#frontpage-box-3 #search_form input[type=text] {
+width:10em;
+}
+
+#frontpage_examples p,#frontpage_examples ul {
+text-align:left;
+}
+
+#examples_1 ul li {
+border-bottom:1px solid #ddd;
+padding:5px 0;
+}
+
+#frontpage_examples .excerpt {
+cursor:pointer;
+background:url(/images/quote-marks.png) no-repeat;
+font-size:12px;
+color:#444;
+line-height:18px;
+min-height:30px;
+font-style:italic;
+padding:0 0 0 40px;
+}
+
+#set_photo {
+background:url(/images/defaultprofilepic.png);
+}
+
+div.correspondence,div.comment_in_request {
+width:600px;
+font-size:13px;
+border-radius:6px;
+-moz-border-radius:6px;
+border-width:0;
+padding:4px 20px 0 9px;
+}
+
+div.outgoing.correspondence {
+ background: #EFEFEF;
+}
+
+div[id|="comment"] p {
+font-size:13px;
+}
+
+.comment_in_request_text {
+margin:0 0 0 10px;
+}
+
+#frontpage_splash {
+background:url(/images/flying-computer.png) no-repeat 175px bottom;
+height:375px;
+margin-top:-12px;
+margin-bottom:20px;
+width:100%;
+}
+
+#frontpage_splash #left_column {
+line-height:40px;
+margin-top:66px;
+}
+
+#frontpage_splash h1 {
+font-size:39px;
+color:#222;
+font-weight:400;
+margin:0 0 20px;
+}
+
+#frontpage_splash h1 strong {
+font-size:54px;
+color:#222;
+font-weight:400;
+}
+
+#frontpage_splash h1 span {
+font-family:Georgia;
+font-style:italic;
+font-weight:400;
+font-size:25px;
+color:#444;
+}
+
+#frontpage_splash h2 {
+font-size:26px;
+font-weight:400;
+color:#222;
+margin-bottom:10px;
+line-height:28px;
+}
+
+#frontpage_splash h2 strong {
+font-size:31px;
+color:#222;
+}
+
+#frontpage_splash h2 span {
+color:#333;
+font-style:italic;
+font-size:19px;
+font-family:Georgia;
+}
+
+#frontpage_splash #right_column {
+width:265px;
+}
+
+#frontpage_splash #right_column input[type=text] {
+width:180px;
+}
+
+#frontpage_splash #frontpage_search_box {
+margin-bottom:30px;
+margin-top:-10px;
+}
+
+#frontpage_splash #frontpage_right_to_know p {
+line-height:20px;
+}
+
+body.front h3 {
+font-size:28px;
+}
+
+#ui-datepicker-div.ui-widget {
+font-family:Arial, sans-serif;
+color:#93278F;
+}
+
+#ui-datepicker-div .ui-datepicker-header,#ui-datepicker-div .ui-widget-header {
+background:none;
+border:solid 0 #FFF;
+color:#444;
+font-size:17px;
+font-weight:400;
+line-height:1.5em !important;
+}
+
+#ui-datepicker-div .ui-state-default {
+background:#F2F2F2;
+border:solid 0 #FFF;
+border-radius:2px;
+-moz-border-radius:2px;
+}
+
+#ui-datepicker-div .ui-state-default:hover {
+background:#222;
+color:#FFF;
+}
+
+#ui-datepicker-div .ui-state-active {
+background:#222;
+color:#FFF;
+}
+
+#ui-datepicker-div .ui-icon-circle-triangle-w,#ui-datepicker-div .ui-icon-circle-triangle-e {
+background-image:url(/images/ui-icons-theme.png);
+}
+
+#ui-datepicker-div .ui-datepicker-prev-hover {
+left:2px;
+top:2px;
+border:none;
+background:#FFF;
+cursor:pointer;
+opacity:1px;
+}
+
+#ui-datepicker-div .ui-datepicker-next-hover {
+right:2px;
+top:2px;
+border:none;
+background:#FFF;
+cursor:pointer;
+opacity:1px;
+}
+
+#other-country-notice {
+background:#222;
+color:#FFF;
+font-size:16px;
+width:100%;
+z-index:999;
+display:block;
+position:absolute;
+top:0;
+opacity:0.9px;
+}
+
+p.public-body-name-prefix {
+color:#888;
+margin-top:15px;
+margin-bottom:-15px;
+}
+
+#other-country-notice a {
+color:#FFF;
+}
+
+.close-button {
+color:#FFF;
+text-decoration:none;
+display:inline-block;
+border-radius:2px;
+-moz-border-radius:2px;
+cursor:hand;
+background:url(/images/small-white-cross.png) no-repeat;
+width:15px;
+height:15px;
+border:solid 0 #FFF;
+text-indent:-999px;
+overflow:hidden;
+float:right;
+padding:10px 0;
+}
+
+#link_box {
+position:absolute;
+text-align:left;
+background-color:#FFF;
+z-index:999;
+opacity:0.9px;
+border-radius:6px;
+-moz-border-radius:6px;
+border:1px solid #444;
+display:none;
+padding:5px;
+}
+
+#link_box .close-button {
+background-color:#444;
+margin-left:15px;
+padding:0;
+}
+
+a.link_to_this {
+display:inline-block;
+width:20px;
+letter-spacing:-1000em;
+overflow:hidden;
+background:url(/images/link-icon.png) no-repeat;
+}
+
+#to_public_body {
+display:block;
+margin-bottom:15px;
+}
+
+.fieldWithErrors textarea,.fieldWithErrors input {
+border:solid 1px Red !important;
+}
+
+.errorExplanation {
+border-radius:6px;
+-moz-border-radius:6px;
+font-size:12px;
+font-weight:400;
+width:554px;
+margin:20px 0 30px;
+}
+
+#notice,.describe_state_form,#other_recipients {
+font-size:12px;
+font-weight:400;
+background:#E9FDD3 !important;
+color:#517704;
+border-radius:6px;
+-moz-border-radius:6px;
+border-color:#B0CA86;
+margin:15px 0;
+padding:10px 20px;
+}
+
+.describe_state_form hr {
+border-top:0;
+border-color:#B0CA86;
+border-style:dotted;
+margin:20px 0;
+}
+
+.describe_state_form {
+color:#333;
+}
+
+#notice p:first-child {
+margin-top:0;
+}
+
+#notice p:last-child {
+margin-bottom:0;
+}
+
+div.correspondence p.preview_subject {
+font-size:18px !important;
+margin-left:10px;
+line-height:25px;
+}
+
+div.correspondence p.preview_subject strong {
+}
+
+#preview_form ul {
+margin:0;
+padding:1px 32px 10px;
+}
+
+#preview_form ul li {
+margin:10px 0;
+}
+
+div.controller_help h1 a,#logged_in_bar a,#logged_in_bar a:visited,#stepwise_make_request strong {
}
+
+.request_left,#header_left {
+width:625px;
+float:left;
+}
+
+#request_sidebar h2,.list-filter-item {
+margin-bottom:10px;
+}
+
+div.ff-icon-printfix,.comment_in_request_text img.comment_quote,body.front #other-country-notice,#other-country-notice,#authority_preview .public-body-name-prefix,#authority_preview #list-filter,#authority_preview h2.foi_results,div#show_response_view p.event_actions {
+display:none;
+}
+
+#ui-datepicker-div .ui-datepicker-prev,#ui-datepicker-div .ui-datepicker-next {
+margin-top:2px;
+opacity:0.5px;
+}
+
+div.controller_help dt:hover > a:hover,div.controller_help h1:hover > a:hover,div#help_unhappy h1:hover > a.hover_a:hover,h2 a:hover,.request_listing span.head a:hover,.user_listing span.head a:hover,.body_listing span.head a:hover,.request_listing .requester a,.feed_link a:hover,.act_link a:hover,#header_right > a:hover {
+text-decoration:underline;
+}
+
+.request_listing a,.body_listing a,.user_listing a,.request_short_listing a,h2 a,.feed_link a {
+text-decoration:none;
+} \ No newline at end of file
diff --git a/public/stylesheets/print.css b/public/stylesheets/print.css
index 02e0e98c0..d5401ead0 100644
--- a/public/stylesheets/print.css
+++ b/public/stylesheets/print.css
@@ -1,4 +1,4 @@
-div#content, div#left_column, div.entirebodym div#wrapper {
+div#content, div#left_column, div.entirebody div#wrapper {
width: 100%;
margin: 0;
float: none;
diff --git a/public/stylesheets/theme.css b/public/stylesheets/theme.css
deleted file mode 100644
index d00ccdf3d..000000000
--- a/public/stylesheets/theme.css
+++ /dev/null
@@ -1,1141 +0,0 @@
-
-h1 {
- color: #93278F;
- font-size: 42px;
- font-family: 'DeliciousBold', Arial, sans-serif;
- margin-bottom:15px;
- margin-top:10px;
-}
-
-h2 a {
- text-decoration: none;
-}
-
-h2 a:hover {
- text-decoration: underline;
-}
-
-h2, dt {
- color: #93278F;
- font-size: 21px;
- font-family: 'DeliciousBold', Arial, sans-serif;
- font-weight:normal;
-}
-
-h3 {
- color: #6B3C6A;
- font-family: 'DeliciousRoman', Arial, sans-serif;
- font-weight: normal;
- text-decoration: none;
- font-size: 20px;
- margin-top: 3px;
- margin-bottom:10px;
-}
-
-dd {
- margin:18px 0px 36px 0px;
- width:auto;
-}
-
-dl {
- margin-top:24px;
- line-height:160%;
-}
-
-div.controller_help dt:hover > a, div.controller_help h1:hover > a, div#help_unhappy h1:hover > a.hover_a {
- color: #777;
- font-family:Arial, sans-serif;
-}
-
-a {
- color: #93278F;
- text-decoration: underline;
-}
-
-body {
- font-family: Arial, sans-serif;
- color: #444444;
- font-size: 12px;
-}
-
-body.front {
- background: url(/images/home-grad.png) repeat-x 0px 160px;
-}
-
-div.controller_help h1 a
-{
- color: #93278F
-}
-
-#wrapper {
- padding-top:160px;
-}
-
-#banner {
- background: url(/images/stripes.png);
- border: none;
- height:160px;
-}
-
-#banner_inner {
- width: 890px;
- margin: auto;
- position:relative;
-}
-
-#banner_inner a#logo {
- position:absolute;
- left:0px;
- top:70px;
- z-index: 100;
-}
-
-a img {
- border: none
-}
-
-#navigation_search {
- width:auto;
- right:0px;
- top:10px;
-}
-
-#navigation_search input[type=image] {
- border: 0px;
- margin-bottom: -9px;
- margin-left: -4px;
-}
-
-#navigation_search input[type=text] {
- font-size: 12px;
- padding:5px 5px 4px 5px;
- border-color:#BE7DBC;
- border-radius:5px 0px 0px 5px;
- -moz-border-radius:5px 0px 0px 5px;
-}
-
-#logged_in_bar {
- top: 18px;
- right:210px;
- float:none;
- position:absolute;
-}
-
-#logged_in_bar a,
-#logged_in_bar a:visited {
- color: #93278F;
-}
-
-div.lang {
- top:40px;
- position:absolute;
- padding:0px;
-}
-
-#topnav {
- background: transparent;
- top: 120px;
- margin-left: 115px;
- width: auto;
- font-family:'DeliciousRoman', Arial, sans-serif;
- font-size: 18px;
-}
-
-#topnav ul li a {
- color: #6B3C6A !important;
-}
-
-#topnav ul li {
- padding:10px 15px;
- margin: 0px 3px;
-}
-
-#topnav ul li.selected {
- background:#FFF;
-}
-
-#topnav li a, #topnav li a:visited {
- padding:0px;
-}
-
-.request_left {
- width: 625px;
- float:left;
-}
-
-.request_right {
- padding-top:5px;
- width: 245px;
- float:left;
-}
-
-#request_header_text {
- margin-left: 110px;
-}
-
-#wrapper {
- width: 900px;
-}
-
-#content {
- width: 875px;
-}
-
-#stepwise_make_request {
- background: url(/images/stripes.png);
- border: 1px solid #DEBEDD;
- border-radius:5px;
- -moz-border-radius:5px;
- font-family:'DeliciousRoman', Arial, sans-serif;
- color: #6B3C6A;
- font-size:18px;
- padding:10px 12px;
- text-align:left;
- width: 412px;
- margin-bottom:40px;
-}
-
-#stepwise_make_request a img {
- margin-bottom:-10px;
- margin-top: -10px;
- margin-left:6px;
-}
-
-#stepwise_make_request strong {
- color: #93278F;
-}
-
-p.subtitle {
- margin-top:10px;
- margin-bottom:20px;
- font-style: italic;
-}
-
-.results_section {
- margin-bottom:40px;
-}
-
-.results_section div:last-child {
- border-bottom-width:0px;
- padding-bottom:0px;
-}
-
-.request_listing,
-.user_listing,
-.body_listing {
- border-bottom:1px solid #DDD;
- padding:12px 0px 6px;
- margin:0px;
- margin-bottom:-1px;
-}
-
-.body_listing {
- padding-bottom:16px;
-}
-
-.request_listing span.head,
-.user_listing span.head,
-.body_listing span.head {
- background:none;
- padding:0px;
- font-size:21px;
- margin-bottom:6px;
-}
-
-.request_listing span.head a,
-.user_listing span.head a,
-.body_listing span.head a {
- color: #6B3C6A;
- font-family: 'DeliciousRoman', Arial, sans-serif;
- font-weight: normal;
- text-decoration: none;
- font-size: 20px;
- margin-top: 3px;
- display: block;
- margin-bottom: -6px;
-}
-
-.request_listing span.head a:hover,
-.user_listing span.head a:hover,
-.body_listing span.head a:hover {
- text-decoration: underline;
-}
-
-.request_listing .requester {
- font-size: 12px;
- padding-bottom:0px;
-}
-
-.request_listing .requester a {
- text-decoration: underline;
-}
-
-.body_listing span.desc,
-.body_listing span.bottomline,
-.user_listing span.bottomline {
- padding:0px;
- margin:0px;
- font-style: normal;
- font-size: 12px;
- font-weight: normal !important;
-}
-
-.request_listing span.bottomline {
- padding: 3px 0px 0px 27px;
- font-style: normal;
- margin-bottom: 0px;
- margin-top:12px;
- background-position: top left;
- font-size: 14px;
- font-weight: normal !important;
- min-height: 36px;
-}
-
-.user_listing {
- padding-top:10px;
- padding-bottom:0px;
-}
-
-.icon_requires_admin,
-.icon_waiting_response_overdue,
-.icon_waiting_response_very_overdue {
- background-image: url(/images/status-overdue.png);
- color: #C1272D;
-}
-
-.icon_successful,
-.icon_partially_successful {
- background-image: url(/images/status-complete.png);
- color: #69952F;
-}
-
-.icon_waiting_response,
-.icon_waiting_classification,
-.icon_waiting_clarification {
- background-image: url(/images/status-pending.png);
- color: #A68C2E;
-}
-
-.icon_failed,
-.icon_rejected {
- background-image: url(/images/status-denied.png);
- color: #C1272D;
-}
-
-.icon_not_held {
- background-image: url(/images/status-not-held.png);
- color: #A68C2E;
-}
-
-.icon_gone_postal {
- background-image: url(/images/status-gone-postal.png);
- color: #A68C2E;
-}
-
-.icon_error_message {
- background-image: url(/images/status-error.png);
- color: #C1272D;
-}
-
-.icon_internal_review {
- background-image: url(/images/status-internal-review.png);
- color: #A68C2E;
-}
-
-.icon_user_withdrawn {
- background-image: url(/images/status-withdrawn.png);
- color: #A68C2E;
-}
-
-#request_sidebar {
- width: 212px;
- font-size: 12px;
-}
-
-#request_sidebar h2 {
- margin-bottom:10px;
-}
-
-.feed_link {
- padding: 4px 0px;
-}
-
-.feed_link a {
- text-decoration: none;
-}
-
-.request_listing span.desc {
- background: url(/images/quote-marks.png) no-repeat;
- padding: 0px 0px 0px 40px;
- min-height:60px;
- font-size:12px;
- width:auto;
- color:#444;
- line-height:18px;
-}
-
-#footer {
- border-color: #FFF;
- margin-top:60px;
-}
-
-div.ff-icon-printfix {
- display: none;
-}
-#search_form {
- margin:0px -6px 20px 0px;
-}
-
-#advanced-search input[type=text] {
- width: auto;
-}
-
-#search_form input[type=submit] {
- border-radius: 0px 2px 2px 0px;
- -moz-border-radius: 0px 2px 2px 0px;
-}
-
-#header_left {
- width:625px;
- float:left;
-}
-
-#header_right {
- float:right;
- width:230px;
- padding-top:27px;
-}
-
-.feed_link,
-.act_link {
- display:block !important;
- margin-bottom:10px;
-}
-
-.feed_link a,
-.act_link a,
-#header_right > a {
- text-decoration: none;
- color: #6B3C6A;
-}
-
-.feed_link a:hover,
-.act_link a:hover,
-#header_right > a:hover {
- text-decoration: underline;
-}
-
-.feed_link a img,
-.act_link img,
-.act_link a img {
- padding-right:2px;
-}
-
-form.feed_form input[type="submit"] {
- font-size: 12px;
- line-height: 12px;
- padding: 2px 4px;
-}
-
-#header_right > br {
- line-height:200%;
-}
-
-#general_search h2 {
- clear:both;
- margin-top:20px;
-}
-
-.highlight {
- background:#FFFF00;
- border-width:0px;
-}
-
-h2.foi_results,
-h2.person_results,
-h2.publicbody_results {
- padding-top:0px;
- padding-bottom:15px;
- margin-bottom:0px;
- margin-top: 0px;
-}
-
-h2.foi_results {
- width: 600px;
-}
-
-.list_toggle_controls {
- padding-bottom:20px;
-}
-
-#request_advice ol {
- margin-left:18px;
- margin-top:20px;
- display:block;
- padding:0px;
-}
-
-#request_advice ol li {
- padding-bottom:5px;
-}
-
-#request_form label,
-label.form_label {
- width: 100px;
- font-family: 'DeliciousRoman', Arial, sans-serif;
-}
-
-#request_form label,
-label.form_label,
-span#to_public_body {
- color: #6B3C6A;
- font-size: 18px;
-}
-
-#date_range label,
-#filter_requests_form label {
- display: inline;
- float: none;
- padding-right: 5px;
-}
-
-#date_range label.title,
-#filter_requests_form label.title,
-h3.title {
- display: inline-block;
- float: none;
- width:110px;
-}
-
-h3.title {
- width: 114px;
- margin-bottom: 5px;
-}
-
-#requests-subfilters div {
- margin-top: 10px;
-}
-
-#requests-subfilters #latest_status_0,
-#requests-subfilters #request_variety_0 {
- margin-left: 0px;
-}
-
-#requests-subfilters input[type=checkbox] {
- margin-left: 117px;
-}
-
-.list-filter-item {
- margin-bottom: 10px;
-}
-
-span#to_public_body {
- font-family: 'DeliciousBold', Arial, sans-serif;
-}
-
-.form_item_note, .form_note {
- margin-left: 110px;
- font-size: 1em;
-}
-
-#left_column {
- width:600px;
- float:left;
-}
-
-#right_column_flip {
- width:220px;
- float:left;
- margin-top:20px;
-}
-
-#left_column_flip {
- width:620px;
- float:right;
- margin-top: 10px;
-}
-
-#right_column {
- width:220px;
- float:right;
- margin-top:30px;
-}
-
-#left_half {
- width:45%;
- float:left;
-}
-
-#right_half {
- width:45%;
- float:right;
-}
-
-#middle_strip {
- float: left;
- width: 10%;
- height: 100px;
- text-align: center;
- margin-top: 45px;
- font-size: 16px;
- font-family: Georgia;
- font-style: italic;
- color: #93278F;
-}
-
-#signup, #signin {
- float:none;
- margin-top:20px;
- width:auto;
-}
-
-#sign_together h1 {
- width: 320px;
- text-align: center;
-}
-
-#sign_together .form_button {
- margin-left: 10.5em;
-}
-
-#signup .form_item_note, #signin .form_note {
- margin-left:11.5em;
- width:24em;
-}
-
-#request_form label, label.form_label {
- margin-top:2px;
- text-align:left;
-}
-
-form input[type=text],
-form input[type=password] {
- font-size: 14px;
- padding: 5px;
- width:200px;
- color: #555;
- border-radius: 3px;
- -moz-border-radius: 3px;
- border-style: solid;
- border-color: #BBB;
- border-width: 1px;
-}
-
-form input.use-datepicker[type=text] {
- width: 130px !important;
- background: url(/images/calendar.png) no-repeat 115px 3px;
- margin: 0px !important;
- border-radius:3px !important;
- -moz-border-radius:3px !important;
- font-size: 14px !important;
-}
-
-form input[type=submit],
-a.link_button_green,
-a.link_button_green_large {
- background: url(/images/button-gradient.png);
- color: white;
- text-decoration: none;
- padding: 5px 11px;
- display: inline-block;
- line-height: 18px;
- border: solid 1px #69952F;
- border-radius: 2px;
- -moz-border-radius: 2px;
- text-shadow: 1px 1px 0px #5B841D;
- font-family: 'DeliciousRoman', Arial, sans-serif;
- font-size: 18px;
- cursor: pointer;
- cursor: hand;
-}
-
-a.link_button_green_large {
- background: url(/images/button-gradient-large.png);
- font-size: 22px;
- line-height: 22px;
- padding-bottom: 7px;
-}
-
-@-moz-document url-prefix() {
- form input[type=submit],
- a.link_button_green {
- padding: 2px 11px;
- margin-top:1px;
- }
-}
-
-form input[type=submit].small {
- font-size: 15px;
- padding: 4px 9px;
- line-height: 10px;
-}
-
-ul.no_bullets {
- list-style-type:none;
- margin:0px 0px 30px 0px;
- padding:0px;
-}
-
-ul.no_bullets li {
- margin-bottom:6px;
-}
-
-#contact_preamble {
- margin: 0px 0px 30px 0px;
- width:auto;
-}
-
-#frontpage_search {
- background:transparent;
-}
-
-#public_body_list #right_column ul {
- padding: 0px 0px 20px 0px;
- margin: 0px;
- list-style: none;
-}
-
-div#twitter {
- margin-top:30px;
- background:#FFF;
-}
-
-div.blog_post p {
- line-height:180%;
-}
-
-div.frontpage-box {
- background: url(/images/stripes.png);
- border: 1px solid #DEBEDD;
- border-radius:5px;
- -moz-border-radius:5px;
- font-family:'DeliciousRoman', Arial, sans-serif;
- color: #6B3C6A;
- font-size:18px;
- padding:15px 12px 0;
- text-align:center;
- width: 255px;
- height: 210px;
- float: left;
-}
-
-#frontpage-box-1 {
- margin-right: 10px;
- vertical-align: middle;
-}
-
-#frontpage-box-2 {
- margin-right: 10px;
-}
-
-
-#bighand {
- padding: 0;
- margin: 0;
- height: 210px;
- background: url(/images/bighand.png) no-repeat scroll 0 bottom transparent;
-}
-
-#littlehand {
- padding: 0;
- margin: 0;
- height: 210px;
- background: url(/images/littlehand.png) repeat-x scroll 10px bottom transparent;
-}
-
-#frontpage-box-3 {
-}
-
-#frontpage-box-3 #search_form input[type=text] {
- width: 10em;
-}
-
-#frontpage_examples p,
-#frontpage_examples ul {
- text-align: left;
-}
-#examples_1 ul li {
- border-bottom: 1px solid #ddd;
- padding: 5px 0 5px 0;
-}
-
-#frontpage_examples .excerpt {
- cursor: hand;
- cursor: pointer;
- background: url(/images/quote-marks.png) no-repeat;
- padding: 0px 0px 0px 40px;
- font-size:12px;
- color:#444;
- line-height:18px;
- min-height: 30px;
- font-style: italic;
-}
-
-#set_photo {
- background: url(/images/defaultprofilepic.png)
-}
-
-div.correspondence,
-div.comment_in_request {
- width: 600px;
- background: url(/images/stripes-70.png);
- border-width: 0px;
- font-size: 13px;
- border-radius: 6px;
- -moz-border-radius: 6px;
- padding: 4px 20px 0px 9px;
-}
-div.outgoing.correspondence {
- background: url(/images/stripes-70-light.png);
-}
-
-div.comment_in_request {
- background: url(/images/stripes-70-light2.png);
-}
-
-div.comment_in_request {
- margin-left: 50px;
- width: 550px;
-}
-
-div[id|="comment"] {
- margin-left: 50px;
-}
-
-div[id|="comment"] h2 {
- font-size: 1em;
- text-align:right;
-}
-
-div[id|="comment"] p {
- font-size: 13px;
-}
-
-.comment_in_request_text {
- margin: 0px 0px 0px 10px;
-}
-
-.comment_in_request_text img.comment_quote {
- display: none;
-}
-
-/* ---------- Frontpage ----------- */
-
-#frontpage_splash {
- height: 375px;
- margin-top: -12px;
- margin-bottom: 20px;
- width: 100%;
- background: url(/images/flying-computer.png) no-repeat 175px bottom;
-}
-
-#frontpage_splash #left_column {
- line-height: 40px;
- margin-top: 66px;
-}
-
-#frontpage_splash h1 {
- margin: 0px 0px 20px 0px;
- font-family: 'DeliciousRoman', Arial, sans-serif;
- font-size: 39px;
- color: #6B3C6A;
- font-weight:normal;
-}
-
-#frontpage_splash h1 strong {
- font-family: 'DeliciousHeavyRegular', Arial, sans-serif;
- font-size: 54px;
- color: #93278F;
- font-weight: normal;
-}
-
-#frontpage_splash h1 span {
- font-family: Georgia;
- font-style: italic;
- font-weight:normal;
- font-size: 25px;
- color: #6B3C6A;
-}
-
-#frontpage_splash #right_column {
- width: 265px;
-}
-
-#frontpage_splash h2 {
- font-size: 26px;
- font-weight:normal;
- color: #6B3C6A;
- font-family:'DeliciousRoman', Arial, sans-serif;
- margin-bottom: 10px;
- line-height: 28px;
-}
-
-#frontpage_splash h2 strong {
- font-size: 31px;
- color: #93278F;
- font-family:'DeliciousBold', Arial, sans-serif;
-}
-
-#frontpage_splash h2 span {
- color: #6B3C6A;
- font-style: italic;
- font-size: 19px;
- font-family: Georgia;
-}
-
-#frontpage_splash #right_column input[type=text] {
- width: 180px;
-}
-
-#frontpage_splash #frontpage_search_box {
- margin-bottom: 30px;
- margin-top: -10px;
-}
-
-#frontpage_splash #frontpage_right_to_know p {
- line-height: 20px;
-}
-
-body.front h3 {
- font-size: 28px;
-}
-
-/* ---------- Calendar theme ----------- */
-
-#ui-datepicker-div.ui-widget {
- font-family: Arial, sans-serif;
- color: #93278F;
-}
-
-#ui-datepicker-div .ui-datepicker-header,
-#ui-datepicker-div .ui-widget-header {
- background: none;
- border: solid 0px white;
- color: #93278F;
- font-family: 'DeliciousRoman';
- font-size: 17px;
- font-weight: normal;
- line-height: 1.5em !important;
-}
-
-#ui-datepicker-div .ui-state-default {
- background: #F2F2F2;
- border: solid 0px #FFF;
- border-radius: 2px;
- -moz-border-radius: 2px;
-}
-
-#ui-datepicker-div .ui-state-default:hover {
- background: #DEB4D8;
- color: #FFF;
-}
-
-#ui-datepicker-div .ui-state-active {
- background: #D093C7;
- color: #FFF;
-}
-
-#ui-datepicker-div .ui-icon-circle-triangle-w,
-#ui-datepicker-div .ui-icon-circle-triangle-e {
- background-image: url(/images/ui-icons-theme.png);
-}
-
-#ui-datepicker-div .ui-datepicker-prev {
- margin-top: 2px;
- opacity: 0.5;
-}
-
-#ui-datepicker-div .ui-datepicker-prev-hover {
- left: 2px;
- top: 2px;
- border: none;
- background:#FFF;
- cursor:pointer;
- opacity: 1;
-}
-
-#ui-datepicker-div .ui-datepicker-next {
- margin-top: 2px;
- opacity: 0.5;
-}
-
-#ui-datepicker-div .ui-datepicker-next-hover {
- right: 2px;
- top: 2px;
- border: none;
- background:#FFF;
- cursor:pointer;
- opacity: 1;
-}
-
-#other-country-notice {
- position: absolute;
-}
-
-body.front #other-country-notice,
-#other-country-notice {
- display: none;
-}
-
-p.public-body-name-prefix {
- color: #DEB4D8;
- margin-top: 15px;
- margin-bottom: -15px;
-}
-
-#authority_preview .public-body-name-prefix,
-#authority_preview #list-filter,
-#authority_preview h2.foi_results {
- display: none;
-}
-
-p.subtitle {
- font-size: 18px;
- font-family: 'DeliciousRoman';
- font-style: normal;
- color: #6B3C7F;
-}
-
-/*------------- Other countries notice ---------------*/
-#other-country-notice {
- background: #93278F;
- color: #FFF;
- font-size: 16px;
- width: 100%;
- z-index: 999;
- display: block;
- position: absolute;
- top: 0px;
- opacity: 0.9;
-}
-
-#other-country-notice a {
- color: #FFF;
-}
-
-.close-button {
- color: white;
- text-decoration: none;
- display: inline-block;
- border-radius: 2px;
- -moz-border-radius: 2px;
- cursor: pointer;
- cursor: hand;
- background: url(/images/small-white-cross.png) no-repeat;
- padding: 10px 0;
- width: 15px;
- height: 15px;
- border: solid 0px #FFF;
- text-indent: -999px;
- overflow:hidden;
- float:right;
-
-}
-/*------------- Link box ---------------*/
-#link_box {
- position: absolute;
- padding: 5px;
- text-align: left;
- background-color: white;
- z-index: 999;
- opacity: 0.9;
- border-radius: 6px;
- -moz-border-radius: 6px;
- border: 1px solid #93278F;
- display: none;
-}
-
-#link_box .close-button {
- background-color: #93278F;
- padding: 0;
- margin-left: 15px;
-}
-
-a.link_to_this {
- display: inline-block;
- width: 20px;
- letter-spacing: -1000em;
- overflow: hidden;
- background: url(/images/link-icon.png) no-repeat;
-}
-
-/*---------- From tweaks ----------*/
-#to_public_body {
- display: block;
- margin-bottom: 15px;
-}
-
-.fieldWithErrors {
- background: none;
- border: solid 0px #FFF;
-}
-
-.fieldWithErrors textarea,
-.fieldWithErrors input {
- border: solid 1px Red !important;
-}
-
-.errorExplanation {
- border-radius: 6px;
- -moz-border-radius: 6px;
- font-size: 12px;
- font-weight: normal;
- width: 554px;
- margin: 20px 0px 30px 0px;
-}
-
-#notice, .describe_state_form, #other_recipients {
- font-size: 12px;
- font-weight: normal;
- padding: 10px 20px 10px 20px;
- background: #E9FDD3 !important;
- color: #517704;
- border-color: #B0CA86;
- border-radius: 6px;
- -moz-border-radius: 6px;
- margin: 15px 0px;
-}
-
-.describe_state_form hr {
- border-color: #B0CA86;
- border-top: 0px;
- border-style: dotted;
- margin: 20px 0px;
-}
-
-.describe_state_form {
- color: #333;
-}
-
-#notice p:first-child {
- margin-top: 0px;
-}
-
-#notice p:last-child {
- margin-bottom: 0px;
-}
-
-div.correspondence p.preview_subject {
- font-family: 'DeliciousRoman';
- font-size: 18px !important;
- margin-left: 10px;
- color: #6B3C7F;
- line-height: 25px;
-}
-
-div.correspondence p.preview_subject strong {
- color: #6B3C7F;
-}
-
-#preview_form ul {
- margin: 0px;
- padding: 1px 32px 10px;
-}
-
-#preview_form ul li {
- margin: 10px 0px;
-}
-
-div#show_response_view p.event_actions {
- display: none;
-} \ No newline at end of file
diff --git a/script/about b/script/about
index 746e44659..f2b98742d 100755
--- a/script/about
+++ b/script/about
@@ -1,5 +1,3 @@
-#!/usr/bin/ruby
-
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot.rb'
require 'commands/about'
diff --git a/script/breakpointer b/script/breakpointer
index dfe58bf36..609564148 100755
--- a/script/breakpointer
+++ b/script/breakpointer
@@ -1,5 +1,3 @@
-#!/usr/bin/ruby
-
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot.rb'
require 'commands/breakpointer'
diff --git a/script/console b/script/console
index 98f6702bb..83386647f 100755
--- a/script/console
+++ b/script/console
@@ -1,5 +1,3 @@
-#!/usr/bin/ruby
-
#!/usr/bin/env ruby
require File.expand_path(File.dirname(__FILE__) + '/../config/boot.rb')
require 'commands/console'
diff --git a/script/destroy b/script/destroy
index 937962908..e63ac0ef5 100755
--- a/script/destroy
+++ b/script/destroy
@@ -1,5 +1,3 @@
-#!/usr/bin/ruby
-
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot.rb'
require 'commands/destroy'
diff --git a/script/generate b/script/generate
index a765ddcd4..8c0486a09 100755
--- a/script/generate
+++ b/script/generate
@@ -1,5 +1,3 @@
-#!/usr/bin/ruby
-
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot.rb'
require 'commands/generate'
diff --git a/script/handle-mail-replies b/script/handle-mail-replies
index 9b1fb5b29..9451bc9f2 100755
--- a/script/handle-mail-replies
+++ b/script/handle-mail-replies
@@ -1,4 +1,5 @@
-#!/usr/bin/ruby
+#!/usr/bin/env ruby
+# -*- coding: utf-8 -*-
# Handle email responses sent to us.
#
@@ -17,8 +18,13 @@ load "config.rb"
MySociety::Config.set_file(File.join($alaveteli_dir, 'config', 'general'), true)
MySociety::Config.load_default
-$:.push(File.join($alaveteli_dir, "vendor", "rails", "actionmailer", "lib", "action_mailer", "vendor", "tmail-1.2.7"))
-require 'tmail'
+require 'rubygems'
+if File.exist? File.join($alaveteli_dir,'vendor','rails','Rakefile')
+ $:.push(File.join($alaveteli_dir, "vendor", "rails", "actionmailer", "lib", "action_mailer", "vendor", "tmail-1.2.7"))
+ require 'tmail'
+else
+ require 'action_mailer'
+end
def main(in_test_mode)
Dir.chdir($alaveteli_dir) do
diff --git a/script/performance/benchmarker b/script/performance/benchmarker
index c2441c941..a94253aba 100755
--- a/script/performance/benchmarker
+++ b/script/performance/benchmarker
@@ -1,5 +1,3 @@
-#!/usr/bin/ruby
-
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot.rb'
require 'commands/performance/benchmarker'
diff --git a/script/performance/profiler b/script/performance/profiler
index a7ea37a9a..e9e5b071d 100755
--- a/script/performance/profiler
+++ b/script/performance/profiler
@@ -1,5 +1,3 @@
-#!/usr/bin/ruby
-
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot.rb'
require 'commands/performance/profiler'
diff --git a/script/plugin b/script/plugin
index bcc697802..18ae72620 100755
--- a/script/plugin
+++ b/script/plugin
@@ -1,5 +1,3 @@
-#!/usr/bin/ruby
-
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot.rb'
require 'commands/plugin'
diff --git a/script/process/inspector b/script/process/inspector
index 261317109..696551c6b 100755
--- a/script/process/inspector
+++ b/script/process/inspector
@@ -1,5 +1,3 @@
-#!/usr/bin/ruby
-
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot.rb'
require 'commands/process/inspector'
diff --git a/script/process/reaper b/script/process/reaper
index 309764a0d..a03da9387 100755
--- a/script/process/reaper
+++ b/script/process/reaper
@@ -1,5 +1,3 @@
-#!/usr/bin/ruby
-
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot.rb'
require 'commands/process/reaper'
diff --git a/script/process/spawner b/script/process/spawner
index 2768db7fd..6852fba27 100755
--- a/script/process/spawner
+++ b/script/process/spawner
@@ -1,5 +1,3 @@
-#!/usr/bin/ruby
-
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot.rb'
require 'commands/process/spawner'
diff --git a/script/runner b/script/runner
index 5a5254c47..6b0bc0a08 100755
--- a/script/runner
+++ b/script/runner
@@ -1,4 +1,4 @@
-#!/usr/bin/ruby
+#!/usr/bin/env ruby
daemon_mode = !ARGV.empty? && ARGV[0] == "--daemon"
diff --git a/script/server b/script/server
index 9c6088a88..dc3edabd5 100755
--- a/script/server
+++ b/script/server
@@ -1,5 +1,3 @@
-#!/usr/bin/ruby
-
#!/usr/bin/env ruby
require File.expand_path(File.dirname(__FILE__) + '/../config/boot.rb')
require 'commands/server'
diff --git a/script/wraptest b/script/wraptest
index d62e4ce48..780c9b4a2 100755
--- a/script/wraptest
+++ b/script/wraptest
@@ -1,4 +1,4 @@
-#!/usr/bin/ruby
+#!/usr/bin/env ruby
#
# wraptest:
# Test email wrapping function
diff --git a/spec/controllers/admin_public_body_controller_spec.rb b/spec/controllers/admin_public_body_controller_spec.rb
index 0a90cd64b..22af3df80 100644
--- a/spec/controllers/admin_public_body_controller_spec.rb
+++ b/spec/controllers/admin_public_body_controller_spec.rb
@@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe AdminPublicBodyController, "when administering public bodies" do
integrate_views
- fixtures :public_bodies, :public_body_translations
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before do
username = MySociety::Config.get('ADMIN_USERNAME', '')
@@ -57,7 +57,7 @@ end
describe AdminPublicBodyController, "when administering public bodies and paying attention to authentication" do
integrate_views
- fixtures :public_bodies, :public_body_translations
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
it "disallows non-authenticated users to do anything" do
@request.env["HTTP_AUTHORIZATION"] = ""
@@ -107,7 +107,7 @@ end
describe AdminPublicBodyController, "when administering public bodies with i18n" do
integrate_views
- fixtures :public_bodies, :public_body_translations
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before do
username = MySociety::Config.get('ADMIN_USERNAME', '')
@@ -176,7 +176,7 @@ end
describe AdminPublicBodyController, "when creating public bodies with i18n" do
integrate_views
- fixtures :public_bodies, :public_body_translations
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before do
username = MySociety::Config.get('ADMIN_USERNAME', '')
diff --git a/spec/controllers/admin_request_controller_spec.rb b/spec/controllers/admin_request_controller_spec.rb
index 6f9af0525..635d73b9e 100644
--- a/spec/controllers/admin_request_controller_spec.rb
+++ b/spec/controllers/admin_request_controller_spec.rb
@@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe AdminRequestController, "when administering requests" do
integrate_views
- fixtures :info_requests, :outgoing_messages, :users, :info_request_events, :public_bodies, :public_body_translations
+ fixtures :users, :public_bodies, :public_body_translations, :public_body_versions, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before { basic_auth_login @request }
it "shows the index/list page" do
@@ -41,7 +41,7 @@ end
describe AdminRequestController, "when administering the holding pen" do
integrate_views
- fixtures :info_requests, :incoming_messages, :raw_emails, :users, :public_bodies, :public_body_translations
+ fixtures :users, :public_bodies, :public_body_translations, :public_body_versions, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before(:each) do
basic_auth_login @request
load_raw_emails_data(raw_emails)
diff --git a/spec/controllers/admin_track_controller_spec.rb b/spec/controllers/admin_track_controller_spec.rb
index 4d5b0ac5e..b87ee9f0e 100644
--- a/spec/controllers/admin_track_controller_spec.rb
+++ b/spec/controllers/admin_track_controller_spec.rb
@@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe AdminTrackController, "when administering tracks" do
integrate_views
- fixtures :track_things, :users
+ fixtures :users, :info_requests, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
it "shows the list page" do
get :list
diff --git a/spec/controllers/admin_user_controller_spec.rb b/spec/controllers/admin_user_controller_spec.rb
index 313f3f328..b2b2d0626 100644
--- a/spec/controllers/admin_user_controller_spec.rb
+++ b/spec/controllers/admin_user_controller_spec.rb
@@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe AdminUserController, "when administering users" do
integrate_views
- fixtures :users
+ fixtures :users, :info_requests, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before { basic_auth_login @request }
it "shows the index/list page" do
diff --git a/spec/controllers/comment_controller_spec.rb b/spec/controllers/comment_controller_spec.rb
index 2b0f5eee2..4c14b8d24 100644
--- a/spec/controllers/comment_controller_spec.rb
+++ b/spec/controllers/comment_controller_spec.rb
@@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe CommentController, "when commenting on a request" do
integrate_views
- fixtures :info_requests, :outgoing_messages, :public_bodies, :public_body_translations, :users, :comments
+ fixtures :users, :public_bodies, :public_body_translations, :public_body_versions, :info_requests, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
it "should give an error and render 'new' template when body text is just some whitespace" do
post :new, :url_title => info_requests(:naughty_chicken_request).url_title,
diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb
index 1ffbda90d..40a676d61 100644
--- a/spec/controllers/general_controller_spec.rb
+++ b/spec/controllers/general_controller_spec.rb
@@ -2,15 +2,19 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe GeneralController, "when searching" do
integrate_views
- fixtures [ :info_requests,
- :info_request_events,
- :public_bodies,
- :public_body_translations,
- :users,
- :raw_emails,
- :outgoing_messages,
- :incoming_messages,
- :comments ]
+ fixtures [
+ :public_bodies,
+ :public_body_translations,
+ :public_body_versions,
+ :users,
+ :info_requests,
+ :raw_emails,
+ :incoming_messages,
+ :outgoing_messages,
+ :comments,
+ :info_request_events,
+ :track_things,
+ ]
before(:each) do
load_raw_emails_data(raw_emails)
@@ -70,13 +74,13 @@ describe GeneralController, "when searching" do
describe "when using different locale settings" do
home_link_regex = /href=".*\/en"/
it "should generate URLs with a locale prepended when there's more than one locale set" do
- ActionController::Routing::Routes.add_filters(['conditionallyprependlocale'])
+ ActionController::Routing::Routes.add_filters('conditionallyprependlocale')
get :frontpage
response.should have_text(home_link_regex)
end
it "should generate URLs without a locale prepended when there's only one locale set" do
- ActionController::Routing::Routes.add_filters(['conditionallyprependlocale'])
+ ActionController::Routing::Routes.add_filters('conditionallyprependlocale')
old_available_locales = FastGettext.default_available_locales
available_locales = ['en']
FastGettext.default_available_locales = available_locales
diff --git a/spec/controllers/public_body_controller_spec.rb b/spec/controllers/public_body_controller_spec.rb
index c5c9d60e1..53e6c169a 100644
--- a/spec/controllers/public_body_controller_spec.rb
+++ b/spec/controllers/public_body_controller_spec.rb
@@ -4,7 +4,7 @@ require 'json'
describe PublicBodyController, "when showing a body" do
integrate_views
- fixtures :public_bodies, :public_body_translations, :public_body_versions
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
it "should be successful" do
get :show, :url_name => "dfh", :view => 'all'
@@ -61,13 +61,26 @@ end
describe PublicBodyController, "when listing bodies" do
integrate_views
- fixtures :public_bodies, :public_body_translations, :public_body_versions
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
it "should be successful" do
get :list
response.should be_success
end
+ it "should list all bodies even when there are no translations for selected locale" do
+ PublicBody.with_locale(:es) do
+
+ spanish_only = PublicBody.new(:name => 'Spanish only',
+ :short_name => 'SO',
+ :request_email => 'spanish@flourish.org',
+ :last_edit_editor => 'test',
+ :last_edit_comment => '')
+ end
+ get :list
+ assigns[:public_bodies].length.should == 3
+ end
+
it "should list bodies in alphabetical order" do
get :list
@@ -110,7 +123,7 @@ describe PublicBodyController, "when listing bodies" do
get :list, :tag => "other"
response.should render_template('list')
assigns[:public_bodies].should == [ public_bodies(:geraldine_public_body) ]
-
+
get :list
response.should render_template('list')
assigns[:public_bodies].count.should == 2
@@ -142,7 +155,7 @@ end
describe PublicBodyController, "when showing JSON version for API" do
- fixtures :public_bodies, :public_body_translations
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
it "should be successful" do
get :show, :url_name => "dfh", :format => "json", :view => 'all'
@@ -157,7 +170,7 @@ describe PublicBodyController, "when showing JSON version for API" do
end
describe PublicBodyController, "when doing type ahead searches" do
- fixtures :info_requests, :info_request_events, :public_bodies, :public_body_translations, :users, :incoming_messages, :raw_emails, :outgoing_messages, :comments
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
it "should return nothing for the empty query string" do
get :search_typeahead, :q => ""
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index 494713a4a..3420d212e 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -1,9 +1,10 @@
+# -*- coding: utf-8 -*-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require 'json'
describe RequestController, "when listing recent requests" do
- fixtures :info_requests, :outgoing_messages, :users, :info_request_events, :public_bodies, :public_body_translations, :incoming_messages, :raw_emails, :comments
+ fixtures :users, :public_bodies, :public_body_translations, :public_body_versions, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before(:each) do
load_raw_emails_data(raw_emails)
@@ -51,7 +52,7 @@ end
describe RequestController, "when showing one request" do
- fixtures :info_requests, :info_request_events, :public_bodies, :public_body_translations, :public_body_translations, :users, :incoming_messages, :raw_emails, :outgoing_messages, :comments # all needed as integrating views
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things # all needed as integrating views
before(:each) do
load_raw_emails_data(raw_emails)
@@ -137,6 +138,13 @@ describe RequestController, "when showing one request" do
response.should have_text(/First hello/)
end
+ it "should convert message body to UTF8" do
+ ir = info_requests(:fancy_dog_request)
+ receive_incoming_mail('iso8859_2_raw_email.email', ir.incoming_email)
+ get :show, :url_title => 'why_do_you_have_such_a_fancy_dog'
+ response.should have_text(/tënde/u)
+ end
+
it "should generate valid HTML verson of plain text attachments " do
ir = info_requests(:fancy_dog_request)
receive_incoming_mail('incoming-request-two-same-name.email', ir.incoming_email)
@@ -232,17 +240,16 @@ describe RequestController, "when showing one request" do
get :download_entire_request, :url_title => title
assigns[:url_path].should have_text(/#{title}.zip$/)
response.location.should have_text(/#{assigns[:url_path]}/)
- assigns[:url_path].should_not == old_path
zipfile = Zip::ZipFile.open(File.join(File.dirname(__FILE__), "../../cache/zips", assigns[:url_path])) { |zipfile|
zipfile.count.should == 4
-zipfile.entries.each {|x| puts x.name}
}
+ assigns[:url_path].should_not == old_path
end
end
end
describe RequestController, "when changing prominence of a request" do
- fixtures :info_requests, :info_request_events, :public_bodies, :public_body_translations, :users, :incoming_messages, :raw_emails, :outgoing_messages # all needed as integrating views
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :info_request_events, :track_things # all needed as integrating views
before(:each) do
load_raw_emails_data(raw_emails)
@@ -358,7 +365,7 @@ end
describe RequestController, "when creating a new request" do
integrate_views
- fixtures :info_requests, :outgoing_messages, :public_bodies, :public_body_translations, :users
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before do
@user = users(:bob_smith_user)
@@ -542,7 +549,7 @@ end
describe RequestController, "when viewing an individual response for reply/followup" do
integrate_views
- fixtures :info_requests, :info_request_events, :public_bodies, :public_body_translations, :users, :incoming_messages, :raw_emails, :outgoing_messages, :comments # all needed as integrating views
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things # all needed as integrating views
before(:each) do
load_raw_emails_data(raw_emails)
@@ -589,7 +596,7 @@ end
describe RequestController, "when classifying an information request" do
- fixtures :info_requests, :info_request_events, :public_bodies, :public_body_translations, :users, :incoming_messages, :raw_emails, :outgoing_messages, :comments # all needed as integrating views
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things # all needed as integrating views
before(:each) do
@dog_request = info_requests(:fancy_dog_request)
@@ -800,7 +807,7 @@ describe RequestController, "when classifying an information request" do
deliveries.size.should == 1
mail = deliveries[0]
mail.body.should =~ /as needing admin/
- mail.from_addrs.to_s.should == @request_owner.name_and_email
+ mail.from_addrs.first.to_s.should == @request_owner.name_and_email
end
it 'should say it is showing advice as to what to do next' do
@@ -925,7 +932,7 @@ end
describe RequestController, "when sending a followup message" do
integrate_views
- fixtures :info_requests, :info_request_events, :public_bodies, :public_body_translations, :users, :incoming_messages, :raw_emails, :outgoing_messages # all needed as integrating views
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things # all needed as integrating views
before(:each) do
load_raw_emails_data(raw_emails)
@@ -978,7 +985,7 @@ describe RequestController, "when sending a followup message" do
deliveries.size.should == 1
mail = deliveries[0]
mail.body.should =~ /What a useless response! You suck./
- mail.to_addrs.to_s.should == "FOI Person <foiperson@localhost>"
+ mail.to_addrs.first.to_s.should == "FOI Person <foiperson@localhost>"
response.should redirect_to(:action => 'show', :url_title => info_requests(:fancy_dog_request).url_title)
@@ -1008,7 +1015,7 @@ end
describe RequestController, "sending overdue request alerts" do
integrate_views
- fixtures :info_requests, :info_request_events, :public_bodies, :public_body_translations, :users, :incoming_messages, :raw_emails, :outgoing_messages # all needed as integrating views
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things # all needed as integrating views
before(:each) do
load_raw_emails_data(raw_emails)
@@ -1025,7 +1032,7 @@ describe RequestController, "sending overdue request alerts" do
deliveries.size.should == 1
mail = deliveries[0]
mail.body.should =~ /promptly, as normally/
- mail.to_addrs.to_s.should == info_requests(:naughty_chicken_request).user.name_and_email
+ mail.to_addrs.first.to_s.should == info_requests(:naughty_chicken_request).user.name_and_email
mail.body =~ /(http:\/\/.*\/c\/(.*))/
mail_url = $1
@@ -1053,7 +1060,7 @@ describe RequestController, "sending overdue request alerts" do
deliveries.size.should == 1
mail = deliveries[0]
mail.body.should =~ /promptly, as normally/
- mail.to_addrs.to_s.should == info_requests(:naughty_chicken_request).user.name_and_email
+ mail.to_addrs.first.to_s.should == info_requests(:naughty_chicken_request).user.name_and_email
end
it "should send not actually send the overdue alert if the user is banned" do
@@ -1078,7 +1085,7 @@ describe RequestController, "sending overdue request alerts" do
deliveries.size.should == 1
mail = deliveries[0]
mail.body.should =~ /required by law/
- mail.to_addrs.to_s.should == info_requests(:naughty_chicken_request).user.name_and_email
+ mail.to_addrs.first.to_s.should == info_requests(:naughty_chicken_request).user.name_and_email
mail.body =~ /(http:\/\/.*\/c\/(.*))/
mail_url = $1
@@ -1096,7 +1103,7 @@ end
describe RequestController, "sending unclassified new response reminder alerts" do
integrate_views
- fixtures :info_requests, :info_request_events, :public_bodies, :public_body_translations, :users, :incoming_messages, :raw_emails, :outgoing_messages, :comments # all needed as integrating views
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things # all needed as integrating views
before(:each) do
load_raw_emails_data(raw_emails)
@@ -1109,7 +1116,7 @@ describe RequestController, "sending unclassified new response reminder alerts"
deliveries.size.should == 3 # sufficiently late it sends reminders too
mail = deliveries[0]
mail.body.should =~ /To let us know/
- mail.to_addrs.to_s.should == info_requests(:fancy_dog_request).user.name_and_email
+ mail.to_addrs.first.to_s.should == info_requests(:fancy_dog_request).user.name_and_email
mail.body =~ /(http:\/\/.*\/c\/(.*))/
mail_url = $1
mail_token = $2
@@ -1127,7 +1134,7 @@ end
describe RequestController, "clarification required alerts" do
integrate_views
- fixtures :info_requests, :info_request_events, :public_bodies, :public_body_translations, :users, :incoming_messages, :raw_emails, :outgoing_messages # all needed as integrating views
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things # all needed as integrating views
before(:each) do
load_raw_emails_data(raw_emails)
end
@@ -1146,7 +1153,7 @@ describe RequestController, "clarification required alerts" do
deliveries.size.should == 1
mail = deliveries[0]
mail.body.should =~ /asked you to explain/
- mail.to_addrs.to_s.should == info_requests(:fancy_dog_request).user.name_and_email
+ mail.to_addrs.first.to_s.should == info_requests(:fancy_dog_request).user.name_and_email
mail.body =~ /(http:\/\/.*\/c\/(.*))/
mail_url = $1
mail_token = $2
@@ -1181,7 +1188,7 @@ end
describe RequestController, "comment alerts" do
integrate_views
- fixtures :info_requests, :info_request_events, :public_bodies, :public_body_translations, :users, :incoming_messages, :raw_emails, :outgoing_messages, :comments # all needed as integrating views
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things # all needed as integrating views
before(:each) do
load_raw_emails_data(raw_emails)
end
@@ -1200,7 +1207,7 @@ describe RequestController, "comment alerts" do
deliveries = ActionMailer::Base.deliveries
mail = deliveries[0]
mail.body.should =~ /has annotated your/
- mail.to_addrs.to_s.should == info_requests(:fancy_dog_request).user.name_and_email
+ mail.to_addrs.first.to_s.should == info_requests(:fancy_dog_request).user.name_and_email
mail.body =~ /(http:\/\/.*)/
mail_url = $1
@@ -1243,7 +1250,7 @@ describe RequestController, "comment alerts" do
deliveries.size.should == 1
mail = deliveries[0]
mail.body.should =~ /There are 2 new annotations/
- mail.to_addrs.to_s.should == info_requests(:fancy_dog_request).user.name_and_email
+ mail.to_addrs.first.to_s.should == info_requests(:fancy_dog_request).user.name_and_email
mail.body =~ /(http:\/\/.*)/
mail_url = $1
@@ -1256,7 +1263,7 @@ end
describe RequestController, "when viewing comments" do
integrate_views
- fixtures :users, :raw_emails, :incoming_messages, :info_requests
+ fixtures :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before(:each) do
load_raw_emails_data(raw_emails)
end
@@ -1279,7 +1286,7 @@ end
describe RequestController, "authority uploads a response from the web interface" do
- fixtures :info_requests, :info_request_events, :public_bodies, :public_body_translations, :users
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before(:all) do
# domain after the @ is used for authentication of FOI officers, so to test it
@@ -1366,7 +1373,7 @@ end
describe RequestController, "when showing JSON version for API" do
- fixtures :info_requests, :info_request_events, :public_bodies, :public_body_translations, :users, :incoming_messages, :raw_emails, :outgoing_messages, :comments
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before(:each) do
load_raw_emails_data(raw_emails)
@@ -1386,7 +1393,7 @@ describe RequestController, "when showing JSON version for API" do
end
describe RequestController, "when doing type ahead searches" do
- fixtures :info_requests, :info_request_events, :public_bodies, :public_body_translations, :users, :incoming_messages, :raw_emails, :outgoing_messages, :comments
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
it "should return nothing for the empty query string" do
get :search_typeahead, :q => ""
diff --git a/spec/controllers/request_game_controller_spec.rb b/spec/controllers/request_game_controller_spec.rb
index 4883bfdd6..cc0808ef3 100644
--- a/spec/controllers/request_game_controller_spec.rb
+++ b/spec/controllers/request_game_controller_spec.rb
@@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe RequestGameController, "when playing the game" do
- fixtures :info_requests, :info_request_events, :public_bodies, :public_body_translations, :users, :incoming_messages, :raw_emails, :outgoing_messages # all needed as integrating views
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things # all needed as integrating views
before(:each) do
load_raw_emails_data(raw_emails)
end
diff --git a/spec/controllers/track_controller_spec.rb b/spec/controllers/track_controller_spec.rb
index 435d9a0d3..90d13495f 100644
--- a/spec/controllers/track_controller_spec.rb
+++ b/spec/controllers/track_controller_spec.rb
@@ -36,7 +36,7 @@ end
describe TrackController, "when sending alerts for a track" do
integrate_views
- fixtures :comments, :info_requests, :outgoing_messages, :incoming_messages, :raw_emails, :info_request_events, :users, :track_things, :track_things_sent_emails, :public_bodies, :public_body_translations
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things, :track_things_sent_emails
include LinkToHelper # for main_url
before(:each) do
@@ -58,7 +58,7 @@ describe TrackController, "when sending alerts for a track" do
deliveries.size.should == 1
mail = deliveries[0]
mail.body.should =~ /Alter your subscription/
- mail.to_addrs.to_s.should include(users(:silly_name_user).email)
+ mail.to_addrs.first.to_s.should include(users(:silly_name_user).email)
mail.body =~ /(http:\/\/.*\/c\/(.*))/
mail_url = $1
mail_token = $2
@@ -110,7 +110,7 @@ end
describe TrackController, "when viewing RSS feed for a track" do
integrate_views
- fixtures :info_requests, :outgoing_messages, :incoming_messages, :raw_emails, :info_request_events, :users, :track_things, :comments, :public_bodies, :public_body_translations
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before(:each) do
load_raw_emails_data(raw_emails)
@@ -136,7 +136,7 @@ end
describe TrackController, "when viewing JSON version of a track feed" do
integrate_views
- fixtures :info_requests, :outgoing_messages, :incoming_messages, :raw_emails, :info_request_events, :users, :track_things, :comments, :public_bodies, :public_body_translations
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before(:each) do
load_raw_emails_data(raw_emails)
diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb
index b4cc0d6e3..399b275a7 100644
--- a/spec/controllers/user_controller_spec.rb
+++ b/spec/controllers/user_controller_spec.rb
@@ -1,3 +1,4 @@
+# coding: utf-8
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require 'json'
@@ -7,7 +8,7 @@ require 'json'
describe UserController, "when showing a user" do
integrate_views
- fixtures :users, :outgoing_messages, :incoming_messages, :raw_emails, :info_requests, :info_request_events, :comments, :public_bodies, :public_body_translations
+ fixtures :users, :public_bodies, :public_body_translations, :public_body_versions, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before(:each) do
load_raw_emails_data(raw_emails)
end
@@ -260,8 +261,8 @@ describe UserController, "when sending another user a message" do
mail = deliveries[0]
mail.body.should include("Bob Smith has used #{MySociety::Config.get('SITE_NAME')} to send you the message below")
mail.body.should include("Just a test!")
- #mail.to_addrs.to_s.should == users(:silly_name_user).name_and_email # XXX fix some nastiness with quoting name_and_email
- mail.from_addrs.to_s.should == users(:bob_smith_user).name_and_email
+ #mail.to_addrs.first.to_s.should == users(:silly_name_user).name_and_email # XXX fix some nastiness with quoting name_and_email
+ mail.from_addrs.first.to_s.should == users(:bob_smith_user).name_and_email
end
end
diff --git a/spec/fixtures/files/email-folding-example-1.txt b/spec/fixtures/files/email-folding-example-1.txt
new file mode 100644
index 000000000..9d0810a36
--- /dev/null
+++ b/spec/fixtures/files/email-folding-example-1.txt
@@ -0,0 +1,32 @@
+Dear Mr Pollard,
+
+Thank you for your email of 26 February. Please find a response attached.
+
+Yours faithfully,
+
+On behalf of James Hall, Chief Executive
+Identity and Passport Service
+
+<<9032 C Pollard final response.doc>>
+
+**********************************************************************
+
+This email and any files transmitted with it are confidential and
+
+intended solely for the use of the individual or entity to whom they
+
+are addressed. If you have received this email in error please notify
+
+the system manager.
+
+This footnote also confirms that this email message has been swept for the
+presence of computer viruses.
+
+**********************************************************************
+
+The original of this email was scanned for viruses by the Government
+Secure Intranet virus scanning service supplied by Cable&Wireless in
+partnership with MessageLabs. (CCTM Certificate Number 2007/11/0032.) On
+leaving the GSi this email was certified virus free.
+Communications via the GSi may be automatically logged, monitored and/or
+recorded for legal purposes.
diff --git a/spec/fixtures/files/email-folding-example-1.txt.expected b/spec/fixtures/files/email-folding-example-1.txt.expected
new file mode 100644
index 000000000..801542288
--- /dev/null
+++ b/spec/fixtures/files/email-folding-example-1.txt.expected
@@ -0,0 +1,10 @@
+Dear Mr Pollard,
+
+Thank you for your email of 26 February. Please find a response attached.
+
+Yours faithfully,
+
+On behalf of James Hall, Chief Executive
+Identity and Passport Service
+
+<<9032 C Pollard final response.doc>>
diff --git a/spec/fixtures/files/email-folding-example-10.txt b/spec/fixtures/files/email-folding-example-10.txt
new file mode 100644
index 000000000..0fabb7f9c
--- /dev/null
+++ b/spec/fixtures/files/email-folding-example-10.txt
@@ -0,0 +1,52 @@
+Please note: it is not possible to reply to this email. To contact the
+Department of Health, please visit the 'Contact us' page on the
+Department’s website.
+
+-----------------------------------------------------------------------------------------
+
+ Apologies that you were not able to read our previous response of 4
+ October. Please find the text of that email below.
+
+Our ref: DE00000642471
+
+Dear Ms Peters Rock,
+
+You requested your correspondence to be treated under the Freedom of
+Information Act.  However, as your correspondence asked for general
+information, rather than requesting recorded information or documentation,
+I should advise you that on this occasion we have not considered your
+correspondence under the provisions of the Act.
+
+I am sorry I cannot be more helpful.
+
+Yours sincerely,
+Simon Dove
+Customer Service Centre
+Department of Health
+
+
+
+
+-------------------------------------------------------------------------------------------------------------------------
+
+
+Please do not reply to this email. To contact the Department of Health,
+please visit the 'Contact us' page on the Department’s website, where you
+can also view our performance against quarterly service targets.
+
+
+- - Disclaimer - -
+This e-mail and any files transmitted with it are confidential. If you are
+not the intended recipient, any reading, printing, storage, disclosure,
+copying or any other action taken in respect of this e-mail is prohibited
+and may be unlawful. If you are not the intended recipient, please notify
+the sender immediately by using the reply function and then permanently
+delete what you have received.
+
+Incoming and outgoing e-mail messages are routinely monitored for
+compliance with the Department of Health's policy on the use of electronic
+communications. For more information on the Department of Health's e-mail
+policy click here http://www.dh.gov.uk/terms
+
+The original of this email was scanned for viruses by the Government Secure Intranet virus scanning service supplied by Cable&Wireless Worldwide in partnership with MessageLabs. (CCTM Certificate Number 2009/09/0052.) On leaving the GSi this email was certified virus free.
+Communications via the GSi may be automatically logged, monitored and/or recorded for legal purposes.
diff --git a/spec/fixtures/files/email-folding-example-10.txt.expected b/spec/fixtures/files/email-folding-example-10.txt.expected
new file mode 100644
index 000000000..e4f704c0e
--- /dev/null
+++ b/spec/fixtures/files/email-folding-example-10.txt.expected
@@ -0,0 +1,25 @@
+Please note: it is not possible to reply to this email. To contact the
+Department of Health, please visit the 'Contact us' page on the
+Department’s website.
+
+-----------------------------------------------------------------------------------------
+
+ Apologies that you were not able to read our previous response of 4
+ October. Please find the text of that email below.
+
+Our ref: DE00000642471
+
+Dear Ms Peters Rock,
+
+You requested your correspondence to be treated under the Freedom of
+Information Act.  However, as your correspondence asked for general
+information, rather than requesting recorded information or documentation,
+I should advise you that on this occasion we have not considered your
+correspondence under the provisions of the Act.
+
+I am sorry I cannot be more helpful.
+
+Yours sincerely,
+Simon Dove
+Customer Service Centre
+Department of Health
diff --git a/spec/fixtures/files/email-folding-example-2.txt b/spec/fixtures/files/email-folding-example-2.txt
new file mode 100644
index 000000000..13dd39a69
--- /dev/null
+++ b/spec/fixtures/files/email-folding-example-2.txt
@@ -0,0 +1,7 @@
+Preface to the message which we are not interested in
+
+-----------------------------------------------------------------------------------------
+Important message about cheese
+-----------------------------------------------------------------------------------------
+
+Actual footer that contains the word confidential
diff --git a/spec/fixtures/files/email-folding-example-2.txt.expected b/spec/fixtures/files/email-folding-example-2.txt.expected
new file mode 100644
index 000000000..e52fbe443
--- /dev/null
+++ b/spec/fixtures/files/email-folding-example-2.txt.expected
@@ -0,0 +1,4 @@
+Preface to the message which we are not interested in
+
+-----------------------------------------------------------------------------------------
+Important message about cheese
diff --git a/spec/fixtures/files/email-folding-example-3.txt b/spec/fixtures/files/email-folding-example-3.txt
new file mode 100644
index 000000000..28a3861f6
--- /dev/null
+++ b/spec/fixtures/files/email-folding-example-3.txt
@@ -0,0 +1,18 @@
+Reference : T3241/8
+
+Thank you for your e-mail enquiry of 12th February.
+
+A reply is attached.
+
+**********************************************************************
+This email and any files transmitted with it are private and intended
+solely for the use of the individual or entity to whom they are addressed.
+If you have received this email in error please return it to the address
+it came from telling them it is not for you and then delete it from your system.
+
+This email message has been swept for computer viruses.
+
+**********************************************************************
+
+The original of this email was scanned for viruses by the Government Secure Intranet virus scanning service supplied by Cable&Wireless in partnership with MessageLabs. (CCTM Certificate Number 2007/11/0032.) On leaving the GSi this email was certified virus free.
+Communications via the GSi may be automatically logged, monitored and/or recorded for legal purposes.
diff --git a/spec/fixtures/files/email-folding-example-3.txt.expected b/spec/fixtures/files/email-folding-example-3.txt.expected
new file mode 100644
index 000000000..e2cca4933
--- /dev/null
+++ b/spec/fixtures/files/email-folding-example-3.txt.expected
@@ -0,0 +1,5 @@
+Reference : T3241/8
+
+Thank you for your e-mail enquiry of 12th February.
+
+A reply is attached.
diff --git a/spec/fixtures/files/email-folding-example-4.txt b/spec/fixtures/files/email-folding-example-4.txt
new file mode 100644
index 000000000..63b94a35c
--- /dev/null
+++ b/spec/fixtures/files/email-folding-example-4.txt
@@ -0,0 +1,37 @@
+<<Freedom of Information request - Contracts or options with Kimberley
+Developments or Waitrose>>
+
+Arthur Pritchard
+Property & Assets Manager
+Tel: 01625 504234
+Fax: 01625 504268
+e-mail: [1][email address]
+
+***********************************************************************************
+The information in this Email and any attachments is personal to the
+sender and the views of the author may not necessarily reflect those
+of Macclesfield Borough Council. The information is strictly confidential
+and is intended only for the named person or organisation to whom it is
+addressed as it may contain privileged and confidential information. If
+you are not the intended recipient do not copy, distribute or use this
+Email, and please notify the sender. Please note that we cannot
+guarantee that this message or any attachment is virus free or has not
+been intercepted and amended.
+***********************************************************************************
+
+Disclaimer
+
+--------------------------------------------------------------------------
+
+This email message has been scanned for viruses by Mimecast.
+Mimecast delivers a complete managed email solution from a single web
+based platform.
+For more information please visit [2]http://www.mimecast.com
+
+--------------------------------------------------------------------------
+
+References
+
+Visible links
+1. mailto:[email address]
+2. http://www.mimecast.com/
diff --git a/spec/fixtures/files/email-folding-example-4.txt.expected b/spec/fixtures/files/email-folding-example-4.txt.expected
new file mode 100644
index 000000000..42334a290
--- /dev/null
+++ b/spec/fixtures/files/email-folding-example-4.txt.expected
@@ -0,0 +1,15 @@
+<<Freedom of Information request - Contracts or options with Kimberley
+Developments or Waitrose>>
+
+Arthur Pritchard
+Property & Assets Manager
+Tel: 01625 504234
+Fax: 01625 504268
+e-mail: [1][email address]
+FOLDED_QUOTED_SECTION
+FOLDED_QUOTED_SECTION
+References
+
+Visible links
+1. mailto:[email address]
+2. http://www.mimecast.com/
diff --git a/spec/fixtures/files/email-folding-example-5.txt b/spec/fixtures/files/email-folding-example-5.txt
new file mode 100644
index 000000000..3d0964722
--- /dev/null
+++ b/spec/fixtures/files/email-folding-example-5.txt
@@ -0,0 +1,35 @@
+Hi Simon
+
+My apologies for timescale of response. The data forwarded is a public
+register, and is updated on a frequent and regular basis; your request
+unfortunately coincided with annual leave and a monthly update of the
+spreadsheet. As the definition of an HMO under the Housing Act 2004
+differs to that under planning legislation, I have forwarded this and
+your original request on to Andy England, Development Control Manager to
+respond independantly.
+
+If I can be of further assistance please contact me
+
+Barry Turnbull
+Environmental Health Co-ordinator (Housing)
+Housing, Health and Community Safety
+
+--
+
+****************************************************************
+Any opinions expressed are not necessarily those of Penwith
+District Council. This e-mail and any attachments, replies
+and forwarded copies are confidential and are strictly for
+the use of named recipient(s) only. If you have received
+it in error you may not make use of it. Please e-mail us,
+including a copy of the message to, [email address].
+Then delete the e-mail and any copies.
+****************************************************************
+
+**********************************************************************
+This footnote confirms that this message, and any
+attachments, have been screened by McAffee
+Webshield for the presence of virus code.
+
+Penwith District Council
+**********************************************************************
diff --git a/spec/fixtures/files/email-folding-example-5.txt.expected b/spec/fixtures/files/email-folding-example-5.txt.expected
new file mode 100644
index 000000000..fbb0f0f50
--- /dev/null
+++ b/spec/fixtures/files/email-folding-example-5.txt.expected
@@ -0,0 +1,24 @@
+Hi Simon
+
+My apologies for timescale of response. The data forwarded is a public
+register, and is updated on a frequent and regular basis; your request
+unfortunately coincided with annual leave and a monthly update of the
+spreadsheet. As the definition of an HMO under the Housing Act 2004
+differs to that under planning legislation, I have forwarded this and
+your original request on to Andy England, Development Control Manager to
+respond independantly.
+
+If I can be of further assistance please contact me
+
+Barry Turnbull
+Environmental Health Co-ordinator (Housing)
+Housing, Health and Community Safety
+
+--
+FOLDED_QUOTED_SECTION
+This footnote confirms that this message, and any
+attachments, have been screened by McAffee
+Webshield for the presence of virus code.
+
+Penwith District Council
+**********************************************************************
diff --git a/spec/fixtures/files/email-folding-example-6.txt b/spec/fixtures/files/email-folding-example-6.txt
new file mode 100644
index 000000000..272d6c9da
--- /dev/null
+++ b/spec/fixtures/files/email-folding-example-6.txt
@@ -0,0 +1,30 @@
+Dear Mr. Brown,
+
+Please find attached a reply to your FOI request.
+
+Yours ever,
+
+Adetokunbo Ighodaro
+
+<<FOI 0169-08 final.doc>>
+
+***********************************************************************************
+Visit [1]http://www.fco.gov.uk for British foreign policy news and travel
+advice; and [2]http://www.i-uk.com - the essential guide to the UK.
+
+We keep and use information in line with the Data Protection Act 1998. We
+may release this personal information to other UK government departments
+and public authorities.
+
+Please note that all messages sent and received by members of the Foreign
+& Commonwealth Office and its
+missions overseas may be monitored centrally. This is done to ensure the
+integrity of the system.
+
+***********************************************************************************
+
+References
+
+Visible links
+1. http://www.fco.gov.uk/
+2. http://www.i-uk.com/
diff --git a/spec/fixtures/files/email-folding-example-6.txt.expected b/spec/fixtures/files/email-folding-example-6.txt.expected
new file mode 100644
index 000000000..58021ce12
--- /dev/null
+++ b/spec/fixtures/files/email-folding-example-6.txt.expected
@@ -0,0 +1,15 @@
+Dear Mr. Brown,
+
+Please find attached a reply to your FOI request.
+
+Yours ever,
+
+Adetokunbo Ighodaro
+
+<<FOI 0169-08 final.doc>>
+FOLDED_QUOTED_SECTION
+References
+
+Visible links
+1. http://www.fco.gov.uk/
+2. http://www.i-uk.com/ \ No newline at end of file
diff --git a/spec/fixtures/files/email-folding-example-7.txt b/spec/fixtures/files/email-folding-example-7.txt
new file mode 100644
index 000000000..e10fe4657
--- /dev/null
+++ b/spec/fixtures/files/email-folding-example-7.txt
@@ -0,0 +1,30 @@
+Mr Hearne,
+Please see attached our response to your request dated 06 March 2008.
+Kind Regards,
+Linda Dempsey
+
+Information Assistant DP/FOI
+Data Protection/Information Security
+Professional Standards
+Leicestershire Constabulary
+http://www.leics.police.uk
+mailto [Leicestershire Constabulary request email]
+Telephone +44 (0) 116 2222222
+Extn 5221 VM No. 8035
+Fax + 44 (0) 116 2485217
+
+<<0001_00035908_Resp_12RESPONSE LETTER_20080408_112311_01.TIF>>
+
+**********
+
+Internet email is not to be treated as a secure means of communication.
+
+Leicestershire Constabulary monitors all internet email activity and content.
+
+This communication is intended for the addressee(s) only. Please notify the sender if received in error. Unauthorised use or disclosure of the content may be unlawful. Opinions expressed in this document may not be official policy.
+
+Thank you for your co-operation.
+
+© Leicestershire Constabulary
+
+**********
diff --git a/spec/fixtures/files/email-folding-example-7.txt.expected b/spec/fixtures/files/email-folding-example-7.txt.expected
new file mode 100644
index 000000000..0ef8fd82b
--- /dev/null
+++ b/spec/fixtures/files/email-folding-example-7.txt.expected
@@ -0,0 +1,16 @@
+Mr Hearne,
+Please see attached our response to your request dated 06 March 2008.
+Kind Regards,
+Linda Dempsey
+
+Information Assistant DP/FOI
+Data Protection/Information Security
+Professional Standards
+Leicestershire Constabulary
+http://www.leics.police.uk
+mailto [Leicestershire Constabulary request email]
+Telephone +44 (0) 116 2222222
+Extn 5221 VM No. 8035
+Fax + 44 (0) 116 2485217
+
+<<0001_00035908_Resp_12RESPONSE LETTER_20080408_112311_01.TIF>> \ No newline at end of file
diff --git a/spec/fixtures/files/email-folding-example-8.txt b/spec/fixtures/files/email-folding-example-8.txt
new file mode 100644
index 000000000..c1899e7c8
--- /dev/null
+++ b/spec/fixtures/files/email-folding-example-8.txt
@@ -0,0 +1,18 @@
+I will be out of the office starting 11/04/2008 and will not return until
+22/04/2008.
+
+I will respond to your message when I return. If you have any urgent
+queries please ring 02085419088 for Legal Business Support queries or
+contact Eileen Perren for FOI or DP queries
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+This email and any attachments with it are intended for the addressee only.
+It may be confidential and may be the subject of legal and/or professional privilege.
+If you have received this email in error please notify the sender or [email address]
+The content may be personal or contain personal opinions and cannot be taken as an expression of the County Council's position.
+Surrey County Council reserves the right to monitor all incoming and outgoing mail.
+Whilst every care has been taken to check this outgoing e-mail for viruses, it is your responsibility to carry out any checks upon receipt.
+
+Visit the Surrey County Council website - http://www.surreycc.gov.uk
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
diff --git a/spec/fixtures/files/email-folding-example-8.txt.expected b/spec/fixtures/files/email-folding-example-8.txt.expected
new file mode 100644
index 000000000..b5dc10c0d
--- /dev/null
+++ b/spec/fixtures/files/email-folding-example-8.txt.expected
@@ -0,0 +1,6 @@
+I will be out of the office starting 11/04/2008 and will not return until
+22/04/2008.
+
+I will respond to your message when I return. If you have any urgent
+queries please ring 02085419088 for Legal Business Support queries or
+contact Eileen Perren for FOI or DP queries \ No newline at end of file
diff --git a/spec/fixtures/files/email-folding-example-9.txt b/spec/fixtures/files/email-folding-example-9.txt
new file mode 100644
index 000000000..1f3d4c34a
--- /dev/null
+++ b/spec/fixtures/files/email-folding-example-9.txt
@@ -0,0 +1,29 @@
+Dear Mr Cross
+
+Freedom of Information Request Reference No: 2008040590
+
+Yours sincerely
+
+MICHAEL HEGARTY
+
+FOI Officer
+
+**********************************************************************************************
+Please Note: Incoming and Outgoing E-mail messages are routinely monitored
+for compliance with our policy on the use of electronic communications.
+
+Interested in Occupational Health & Safety information?
+Please visit the HSE website at the following address to keep yourself up
+to date
+
+www.hse.gov.uk
+
+Or contact HSE Infoline on 0845 345 0055 or email [HSE request email]
+
+**********************************************************************************************
+The original of this email was scanned for viruses by the Government
+Secure Intranet virus scanning service supplied by Cable&Wireless in
+partnership with MessageLabs. (CCTM Certificate Number 2007/11/0032.) On
+leaving the GSi this email was certified virus free.
+Communications via the GSi may be automatically logged, monitored and/or
+recorded for legal purposes.
diff --git a/spec/fixtures/files/email-folding-example-9.txt.expected b/spec/fixtures/files/email-folding-example-9.txt.expected
new file mode 100644
index 000000000..2d2381a34
--- /dev/null
+++ b/spec/fixtures/files/email-folding-example-9.txt.expected
@@ -0,0 +1,9 @@
+Dear Mr Cross
+
+Freedom of Information Request Reference No: 2008040590
+
+Yours sincerely
+
+MICHAEL HEGARTY
+
+FOI Officer
diff --git a/spec/fixtures/files/iso8859_2_email.html b/spec/fixtures/files/iso8859_2_email.html
new file mode 100644
index 000000000..c7384a831
--- /dev/null
+++ b/spec/fixtures/files/iso8859_2_email.html
@@ -0,0 +1,18 @@
+<html>
+<head>
+<style><!--
+.hmmessage P
+{
+margin:0px;
+padding:0px
+}
+body.hmmessage
+{
+font-size: 10pt;
+font-family:Tahoma
+}
+--></style>
+</head>
+<body class='hmmessage'><div dir='ltr'>
+<div>Faleminderit per kerkesen tënde.</div> </div></body>
+</html>
diff --git a/spec/fixtures/files/iso8859_2_raw_email.email b/spec/fixtures/files/iso8859_2_raw_email.email
new file mode 100644
index 000000000..2ac3b2533
--- /dev/null
+++ b/spec/fixtures/files/iso8859_2_raw_email.email
@@ -0,0 +1,50 @@
+From: EMAIL_FROM
+To: FOI Person <EMAIL_TO>
+Bcc:
+Reply-To:
+In-Reply-To: <471f1eae5d1cb_7347..fdbe67386163@cat.tmail>
+Content-Type: multipart/alternative;
+ boundary="_d47fc84f-c9cd-4fb3-ab16-15de158c8eef_"
+Subject: =?iso-8859-2?Q?RE:_Freedo?= =?iso-8859-2?Q?m_of_Infor?=
+ =?iso-8859-2?Q?mation_req?= =?iso-8859-2?Q?uest_-_Sas?=
+ =?iso-8859-2?Q?ia_e_pulav?= =?iso-8859-2?Q?e_t=EB_impor?=
+ =?iso-8859-2?Q?tuara_gjat?= =?iso-8859-2?Q?=EB_vitit_20?= =?iso-8859-2?Q?10?=
+Date: Fri, 30 Sep 2011 11:06:39 +0200
+
+--_d47fc84f-c9cd-4fb3-ab16-15de158c8eef_
+Content-Type: text/plain; charset="iso-8859-2"
+Content-Transfer-Encoding: quoted-printable
+
+
+I nderuari Besnik=2C=20
+Faleminderit per kerkesen t=EBnde.Numri i puleve te importuara ne vitin 201=
+0 ka qene 5 milion e treqind mije sosh (me numra 3=2C500=2C000)
+
+
+--_d47fc84f-c9cd-4fb3-ab16-15de158c8eef_
+Content-Type: text/html; charset="iso-8859-2"
+Content-Transfer-Encoding: quoted-printable
+
+<html>
+<head>
+<style><!--
+.hmmessage P
+{
+margin:0px=3B
+padding:0px
+}
+body.hmmessage
+{
+font-size: 10pt=3B
+font-family:Tahoma
+}
+--></style>
+</head>
+<body class=3D'hmmessage'><div dir=3D'ltr'>
+<div>I nderuari Besnik=2C&nbsp=3B</div><div><br></div><div>Faleminderit per=
+ kerkesen t=EBnde.</div>Numri i puleve te importuara ne vitin 2010 ka qene =
+5 milion e treqind mije sosh (me numra 3=2C500=2C000)<br><br></body>
+</html>=
+
+--_d47fc84f-c9cd-4fb3-ab16-15de158c8eef_--
+
diff --git a/spec/integration/errors_spec.rb b/spec/integration/errors_spec.rb
index c64ca79e8..bfb7e5fb5 100644
--- a/spec/integration/errors_spec.rb
+++ b/spec/integration/errors_spec.rb
@@ -2,15 +2,19 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe "When rendering errors" do
- fixtures [ :info_requests,
- :info_request_events,
- :public_bodies,
- :public_body_translations,
- :users,
- :raw_emails,
- :outgoing_messages,
- :incoming_messages,
- :comments ]
+ fixtures [
+ :users,
+ :public_bodies,
+ :public_body_translations,
+ :public_body_versions,
+ :info_requests,
+ :raw_emails,
+ :outgoing_messages,
+ :incoming_messages,
+ :comments,
+ :info_request_events,
+ :track_things,
+ ]
before(:each) do
load_raw_emails_data(raw_emails)
diff --git a/spec/integration/search_request_spec.rb b/spec/integration/search_request_spec.rb
index dcd20c7bd..07839af32 100644
--- a/spec/integration/search_request_spec.rb
+++ b/spec/integration/search_request_spec.rb
@@ -2,15 +2,19 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe "When searching" do
- fixtures [ :info_requests,
- :info_request_events,
- :public_bodies,
- :public_body_translations,
- :users,
- :raw_emails,
- :outgoing_messages,
- :incoming_messages,
- :comments ]
+ fixtures [
+ :users,
+ :public_bodies,
+ :public_body_translations,
+ :public_body_versions,
+ :info_requests,
+ :raw_emails,
+ :outgoing_messages,
+ :incoming_messages,
+ :comments,
+ :info_request_events,
+ :track_things,
+ ]
before(:each) do
emails = raw_emails.clone
diff --git a/spec/lib/tmail_extensions_spec.rb b/spec/lib/tmail_extensions_spec.rb
index c647fe522..6a55c34da 100644
--- a/spec/lib/tmail_extensions_spec.rb
+++ b/spec/lib/tmail_extensions_spec.rb
@@ -1,3 +1,4 @@
+# coding: utf-8
# This is a test of the set_content_type monkey patch in
# lib/tmail_extensions.rb
@@ -27,5 +28,14 @@ describe "when using TMail" do
mail.to.should == ["request-66666-caa77777@whatdotheyknow.com", "foi@example.com"]
end
+ it 'should convert to utf8' do
+ # NB this isn't actually a TMail extension, but is core TMail;
+ # this was just a convenient place to assert the UTF8
+ # conversion is working
+ mail = TMail::Mail.parse(load_file_fixture('iso8859_2_raw_email.email'))
+ mail.subject.should have_text(/gjatë/u)
+ mail.body.is_utf8?.should == true
+ end
+
end
diff --git a/spec/lib/whatdotheyknow/strip_empty_sessions_spec.rb b/spec/lib/whatdotheyknow/strip_empty_sessions_spec.rb
index 1cf5e3d25..9bd5ccb93 100644
--- a/spec/lib/whatdotheyknow/strip_empty_sessions_spec.rb
+++ b/spec/lib/whatdotheyknow/strip_empty_sessions_spec.rb
@@ -1,4 +1,4 @@
-require 'spec_helper'
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
describe WhatDoTheyKnow::StripEmptySessions do
def make_response(session_data, response_headers)
diff --git a/spec/models/has_tag_string_tag_spec.rb b/spec/models/has_tag_string_tag_spec.rb
index ba439acb8..1acd2e27d 100644
--- a/spec/models/has_tag_string_tag_spec.rb
+++ b/spec/models/has_tag_string_tag_spec.rb
@@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe HasTagString::HasTagStringTag, " when fiddling with tag strings " do
- fixtures :public_bodies, :public_body_translations
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
it "should be able to make a new tag and save it" do
@tag = HasTagString::HasTagStringTag.new
diff --git a/spec/models/incoming_message_spec.rb b/spec/models/incoming_message_spec.rb
index d6923da21..1a4baca0b 100644
--- a/spec/models/incoming_message_spec.rb
+++ b/spec/models/incoming_message_spec.rb
@@ -1,7 +1,8 @@
+# coding: utf-8
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe IncomingMessage, " when dealing with incoming mail" do
- fixtures :incoming_messages, :raw_emails, :info_requests
+ fixtures :users, :raw_emails, :public_bodies, :public_body_translations, :public_body_versions, :info_requests, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before(:each) do
@im = incoming_messages(:useless_incoming_message)
@@ -17,6 +18,27 @@ describe IncomingMessage, " when dealing with incoming mail" do
TMail::Address.parse(em)
end
+ it "should correctly fold various types of footer" do
+ Dir.glob(File.join(Spec::Runner.configuration.fixture_path, "files", "email-folding-example-*.txt")).each do |file|
+ message = File.read(file)
+ parsed = IncomingMessage.remove_quoted_sections(message)
+ expected = File.read("#{file}.expected")
+ parsed.should include(expected)
+ end
+ end
+
+ it "should fold multiline sections" do
+ {
+ "foo\n--------\nconfidential" => "foo\nFOLDED_QUOTED_SECTION\n", # basic test
+ "foo\n--------\nbar - confidential" => "foo\nFOLDED_QUOTED_SECTION\n", # allow scorechar inside folded section
+ "foo\n--------\nbar\n--------\nconfidential" => "foo\n--------\nbar\nFOLDED_QUOTED_SECTION\n", # don't assume that anything after a score is a folded section
+ "foo\n--------\nbar\n--------\nconfidential\n--------\nrest" => "foo\n--------\nbar\nFOLDED_QUOTED_SECTION\nrest", # don't assume that a folded section continues to the end of the message
+ "foo\n--------\nbar\n- - - - - - - -\nconfidential\n--------\nrest" => "foo\n--------\nbar\nFOLDED_QUOTED_SECTION\nrest", # allow spaces in the score
+ }.each do |input,output|
+ IncomingMessage.remove_quoted_sections(input).should == output
+ end
+ end
+
end
describe IncomingMessage, "when parsing HTML mail" do
@@ -139,7 +161,7 @@ describe IncomingMessage, " checking validity to reply to" do
end
describe IncomingMessage, " checking validity to reply to with real emails" do
- fixtures :incoming_messages, :raw_emails, :public_bodies, :public_body_translations, :info_requests, :users
+ fixtures :users, :raw_emails, :public_bodies, :public_body_translations, :info_requests, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
after(:all) do
ActionMailer::Base.deliveries.clear
@@ -163,7 +185,7 @@ describe IncomingMessage, " checking validity to reply to with real emails" do
end
describe IncomingMessage, " when censoring data" do
- fixtures :incoming_messages, :raw_emails, :public_bodies, :public_body_translations, :info_requests, :users
+ fixtures :users, :raw_emails, :public_bodies, :public_body_translations, :public_body_versions, :info_requests, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before(:each) do
@test_data = "There was a mouse called Stilton, he wished that he was blue."
@@ -273,7 +295,7 @@ describe IncomingMessage, " when censoring data" do
end
describe IncomingMessage, " when censoring whole users" do
- fixtures :incoming_messages, :raw_emails, :public_bodies, :public_body_translations, :info_requests, :users
+ fixtures :users, :raw_emails, :public_bodies, :public_body_translations, :public_body_versions, :info_requests, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before(:each) do
@test_data = "There was a mouse called Stilton, he wished that he was blue."
diff --git a/spec/models/info_request_spec.rb b/spec/models/info_request_spec.rb
index b82052a0f..409d48ede 100644
--- a/spec/models/info_request_spec.rb
+++ b/spec/models/info_request_spec.rb
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe InfoRequest do
describe "guessing a request from an email" do
- fixtures :info_requests, :public_bodies, :incoming_messages, :raw_emails
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before(:each) do
@im = incoming_messages(:useless_incoming_message)
@@ -74,7 +74,7 @@ describe InfoRequest do
describe " when emailing" do
- fixtures :info_requests, :info_request_events, :outgoing_messages, :public_bodies, :public_body_translations, :users, :comments
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before do
@info_request = info_requests(:fancy_dog_request)
@@ -154,7 +154,7 @@ describe InfoRequest do
end
describe "when calculating the status" do
- fixtures :info_requests, :info_request_events, :holidays, :public_bodies, :public_body_translations, :outgoing_messages
+ fixtures :holidays, :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before do
@ir = info_requests(:naughty_chicken_request)
@@ -196,7 +196,7 @@ describe InfoRequest do
describe "when using a plugin and calculating the status" do
- fixtures :info_requests
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before do
InfoRequest.send(:require, File.expand_path(File.dirname(__FILE__) + '/customstates'))
@@ -231,7 +231,7 @@ describe InfoRequest do
describe "when calculating the status for a school" do
- fixtures :info_requests, :info_request_events, :holidays, :public_bodies, :public_body_translations
+ fixtures :holidays, :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before do
@ir = info_requests(:naughty_chicken_request)
@@ -380,8 +380,8 @@ describe InfoRequest do
before do
Time.stub!(:now).and_return(Time.utc(2007, 11, 9, 23, 59))
- @mock_comment_event = mock_model(InfoRequestEvent, :created_at => Time.now - 23.days, :event_type => 'comment')
- @mock_response_event = mock_model(InfoRequestEvent, :created_at => Time.now - 22.days, :event_type => 'response')
+ @mock_comment_event = safe_mock_model(InfoRequestEvent, :created_at => Time.now - 23.days, :event_type => 'comment')
+ @mock_response_event = safe_mock_model(InfoRequestEvent, :created_at => Time.now - 22.days, :event_type => 'response')
@info_request = InfoRequest.new(:prominence => 'normal',
:awaiting_description => true,
:info_request_events => [@mock_response_event, @mock_comment_event])
diff --git a/spec/models/outgoing_mailer_spec.rb b/spec/models/outgoing_mailer_spec.rb
index c96a3fb74..75c8053b4 100644
--- a/spec/models/outgoing_mailer_spec.rb
+++ b/spec/models/outgoing_mailer_spec.rb
@@ -4,7 +4,7 @@ describe OutgoingMailer, " when working out follow up addresses" do
# This is done with fixtures as the code is a bit tangled with the way it
# calls TMail. XXX untangle it and make these tests spread out and using
# mocks. Put parts of the tests in spec/lib/tmail_extensions.rb
- fixtures :info_requests, :incoming_messages, :raw_emails, :public_bodies, :public_body_translations
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before(:each) do
load_raw_emails_data(raw_emails)
end
@@ -70,7 +70,7 @@ describe OutgoingMailer, " when working out follow up addresses" do
end
describe OutgoingMailer, "when working out follow up subjects" do
- fixtures :info_requests, :incoming_messages, :outgoing_messages, :raw_emails
+ fixtures :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before(:each) do
load_raw_emails_data(raw_emails)
diff --git a/spec/models/outgoing_message_spec.rb b/spec/models/outgoing_message_spec.rb
index 1956c4d73..58d9f398e 100644
--- a/spec/models/outgoing_message_spec.rb
+++ b/spec/models/outgoing_message_spec.rb
@@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe OutgoingMessage, " when making an outgoing message" do
- fixtures :outgoing_messages, :info_requests, :incoming_messages, :public_bodies, :public_body_translations
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :info_requests, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before do
@om = outgoing_messages(:useless_outgoing_message)
@@ -38,7 +38,7 @@ end
describe IncomingMessage, " when censoring data" do
- fixtures :outgoing_messages, :info_requests
+ fixtures :info_requests, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before do
@om = outgoing_messages(:useless_outgoing_message)
diff --git a/spec/models/public_body_spec.rb b/spec/models/public_body_spec.rb
index 33ab8ffdb..07e8f291d 100644
--- a/spec/models/public_body_spec.rb
+++ b/spec/models/public_body_spec.rb
@@ -95,7 +95,7 @@ describe PublicBody, " using machine tags" do
end
describe PublicBody, "when finding_by_tags" do
- fixtures :public_bodies, :public_body_translations
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :info_requests, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before do
@geraldine = public_bodies(:geraldine_public_body)
@@ -173,7 +173,7 @@ describe PublicBody, " when saving" do
end
describe PublicBody, "when searching" do
- fixtures :public_bodies, :public_body_translations, :public_body_versions
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :info_requests, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
it "should find by existing url name" do
body = PublicBody.find_by_url_name_with_historic('dfh')
@@ -226,6 +226,18 @@ describe PublicBody, "when searching" do
end
end
+describe PublicBody, " when dealing public body locales" do
+ it "shouldn't fail if it internal_admin_body was created in a locale other than the default" do
+ # first time, do it with the non-default locale
+ PublicBody.with_locale(:es) do
+ PublicBody.internal_admin_body
+ end
+
+ # second time
+ lambda {PublicBody.internal_admin_body }.should_not raise_error(ActiveRecord::RecordInvalid)
+ end
+end
+
describe PublicBody, " when loading CSV files" do
before(:each) do
# InternalBody is created the first time it's accessed, which happens sometimes during imports,
@@ -302,8 +314,8 @@ describe PublicBody, " when loading CSV files" do
notes.size.should == 4
notes.should == [
"line 2: creating new authority 'North West Fake Authority' (locale: en):\n\t\{\"name\":\"North West Fake Authority\",\"request_email\":\"north_west_foi@localhost\",\"home_page\":\"http://northwest.org\"\}",
- "line 3: creating new authority 'Scottish Fake Authority' (locale: en):\n\t\{\"tag_string\":\"scottish\",\"name\":\"Scottish Fake Authority\",\"request_email\":\"scottish_foi@localhost\",\"home_page\":\"http://scottish.org\"\}",
- "line 4: creating new authority 'Fake Authority of Northern Ireland' (locale: en):\n\t\{\"tag_string\":\"fake aTag\",\"name\":\"Fake Authority of Northern Ireland\",\"request_email\":\"ni_foi@localhost\"\}",
+ "line 3: creating new authority 'Scottish Fake Authority' (locale: en):\n\t\{\"name\":\"Scottish Fake Authority\",\"request_email\":\"scottish_foi@localhost\",\"home_page\":\"http://scottish.org\",\"tag_string\":\"scottish\"\}",
+ "line 4: creating new authority 'Fake Authority of Northern Ireland' (locale: en):\n\t\{\"name\":\"Fake Authority of Northern Ireland\",\"request_email\":\"ni_foi@localhost\",\"tag_string\":\"fake aTag\"\}",
"Notes: Some bodies are in database, but not in CSV file:\n Department for Humpadinking\n Geraldine Quango\nYou may want to delete them manually.\n"
]
@@ -316,7 +328,7 @@ describe PublicBody, " when loading CSV files" do
PublicBody.find_by_name('North West Fake Authority').tag_array_for_search.should == []
PublicBody.find_by_name('Scottish Fake Authority').tag_array_for_search.should == ['scottish']
- PublicBody.find_by_name('Fake Authority of Northern Ireland').tag_array_for_search.should == ['fake', 'aTag']
+ PublicBody.find_by_name('Fake Authority of Northern Ireland').tag_array_for_search.should == ['aTag', 'fake']
# Import again to check the 'add' tag functionality works
new_tags_file = load_file_fixture('fake-authority-add-tags.rb')
@@ -324,8 +336,8 @@ describe PublicBody, " when loading CSV files" do
# Check tags were added successfully
PublicBody.find_by_name('North West Fake Authority').tag_array_for_search.should == ['aTag']
- PublicBody.find_by_name('Scottish Fake Authority').tag_array_for_search.should == ['scottish', 'aTag']
- PublicBody.find_by_name('Fake Authority of Northern Ireland').tag_array_for_search.should == ['fake', 'aTag']
+ PublicBody.find_by_name('Scottish Fake Authority').tag_array_for_search.should == ['aTag', 'scottish']
+ PublicBody.find_by_name('Fake Authority of Northern Ireland').tag_array_for_search.should == ['aTag', 'fake']
end
it "should import tags successfully when the import tag is set" do
@@ -334,8 +346,8 @@ describe PublicBody, " when loading CSV files" do
# Check new bodies were imported successfully
PublicBody.find_by_name('North West Fake Authority').tag_array_for_search.should == ['fake']
- PublicBody.find_by_name('Scottish Fake Authority').tag_array_for_search.should == ['scottish', 'fake']
- PublicBody.find_by_name('Fake Authority of Northern Ireland').tag_array_for_search.should == ['fake', 'aTag']
+ PublicBody.find_by_name('Scottish Fake Authority').tag_array_for_search.should == ['fake', 'scottish']
+ PublicBody.find_by_name('Fake Authority of Northern Ireland').tag_array_for_search.should == ['aTag', 'fake']
# Import again to check the 'replace' tag functionality works
new_tags_file = load_file_fixture('fake-authority-add-tags.rb')
@@ -344,7 +356,7 @@ describe PublicBody, " when loading CSV files" do
# Check tags were added successfully
PublicBody.find_by_name('North West Fake Authority').tag_array_for_search.should == ['aTag']
PublicBody.find_by_name('Scottish Fake Authority').tag_array_for_search.should == ['aTag']
- PublicBody.find_by_name('Fake Authority of Northern Ireland').tag_array_for_search.should == ['fake', 'aTag']
+ PublicBody.find_by_name('Fake Authority of Northern Ireland').tag_array_for_search.should == ['aTag', 'fake']
end
it "should create bodies with names in multiple locales" do
@@ -357,9 +369,9 @@ describe PublicBody, " when loading CSV files" do
notes.should == [
"line 2: creating new authority 'North West Fake Authority' (locale: en):\n\t{\"name\":\"North West Fake Authority\",\"request_email\":\"north_west_foi@localhost\",\"home_page\":\"http://northwest.org\"}",
"line 2: creating new authority 'North West Fake Authority' (locale: es):\n\t{\"name\":\"Autoridad del Nordeste\"}",
- "line 3: creating new authority 'Scottish Fake Authority' (locale: en):\n\t{\"tag_string\":\"scottish\",\"name\":\"Scottish Fake Authority\",\"request_email\":\"scottish_foi@localhost\",\"home_page\":\"http://scottish.org\"}",
+ "line 3: creating new authority 'Scottish Fake Authority' (locale: en):\n\t{\"name\":\"Scottish Fake Authority\",\"request_email\":\"scottish_foi@localhost\",\"home_page\":\"http://scottish.org\",\"tag_string\":\"scottish\"}",
"line 3: creating new authority 'Scottish Fake Authority' (locale: es):\n\t{\"name\":\"Autoridad Escocesa\"}",
- "line 4: creating new authority 'Fake Authority of Northern Ireland' (locale: en):\n\t{\"tag_string\":\"fake aTag\",\"name\":\"Fake Authority of Northern Ireland\",\"request_email\":\"ni_foi@localhost\"}",
+ "line 4: creating new authority 'Fake Authority of Northern Ireland' (locale: en):\n\t{\"name\":\"Fake Authority of Northern Ireland\",\"request_email\":\"ni_foi@localhost\",\"tag_string\":\"fake aTag\"}",
"line 4: creating new authority 'Fake Authority of Northern Ireland' (locale: es):\n\t{\"name\":\"Autoridad Irlandesa\"}",
"Notes: Some bodies are in database, but not in CSV file:\n Department for Humpadinking\n Geraldine Quango\nYou may want to delete them manually.\n"
]
@@ -385,8 +397,8 @@ describe PublicBody, " when loading CSV files" do
notes.size.should == 4
notes.should == [
"line 2: creating new authority 'North West Fake Authority' (locale: en):\n\t{\"name\":\"North West Fake Authority\",\"request_email\":\"north_west_foi@localhost\",\"home_page\":\"http://northwest.org\"}",
- "line 3: creating new authority 'Scottish Fake Authority' (locale: en):\n\t{\"tag_string\":\"scottish\",\"name\":\"Scottish Fake Authority\",\"request_email\":\"scottish_foi@localhost\",\"home_page\":\"http://scottish.org\"}",
- "line 4: creating new authority 'Fake Authority of Northern Ireland' (locale: en):\n\t{\"tag_string\":\"fake aTag\",\"name\":\"Fake Authority of Northern Ireland\",\"request_email\":\"ni_foi@localhost\"}",
+ "line 3: creating new authority 'Scottish Fake Authority' (locale: en):\n\t{\"name\":\"Scottish Fake Authority\",\"request_email\":\"scottish_foi@localhost\",\"home_page\":\"http://scottish.org\",\"tag_string\":\"scottish\"}",
+ "line 4: creating new authority 'Fake Authority of Northern Ireland' (locale: en):\n\t{\"name\":\"Fake Authority of Northern Ireland\",\"request_email\":\"ni_foi@localhost\",\"tag_string\":\"fake aTag\"}",
"Notes: Some bodies are in database, but not in CSV file:\n Department for Humpadinking\n Geraldine Quango\nYou may want to delete them manually.\n"
]
diff --git a/spec/models/request_mailer_spec.rb b/spec/models/request_mailer_spec.rb
index fbe22c220..ef4ed8074 100644
--- a/spec/models/request_mailer_spec.rb
+++ b/spec/models/request_mailer_spec.rb
@@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe RequestMailer, " when receiving incoming mail" do
- fixtures :info_requests, :incoming_messages, :raw_emails, :users, :public_bodies, :public_body_translations
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before(:each) do
load_raw_emails_data(raw_emails)
end
diff --git a/spec/models/track_thing_spec.rb b/spec/models/track_thing_spec.rb
index 1a0324a78..4922a96c7 100644
--- a/spec/models/track_thing_spec.rb
+++ b/spec/models/track_thing_spec.rb
@@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe TrackThing, "when tracking changes" do
- fixtures :track_things, :users
+ fixtures :users, :info_requests, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before do
@track_thing = track_things(:track_fancy_dog_search)
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 751a61060..e0a6c649e 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -152,10 +152,10 @@ end
describe User, "when reindexing referencing models" do
before do
- @request_event = mock_model(InfoRequestEvent, :xapian_mark_needs_index => true)
- @request = mock_model(InfoRequest, :info_request_events => [@request_event])
- @comment_event = mock_model(InfoRequestEvent, :xapian_mark_needs_index => true)
- @comment = mock_model(Comment, :info_request_events => [@comment_event])
+ @request_event = safe_mock_model(InfoRequestEvent, :xapian_mark_needs_index => true)
+ @request = safe_mock_model(InfoRequest, :info_request_events => [@request_event])
+ @comment_event = safe_mock_model(InfoRequestEvent, :xapian_mark_needs_index => true)
+ @comment = safe_mock_model(Comment, :info_request_events => [@comment_event])
@user = User.new(:comments => [@comment], :info_requests => [@request])
end
@@ -193,7 +193,7 @@ describe User, "when reindexing referencing models" do
end
describe User, "when checking abilities" do
- fixtures :users
+ fixtures :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before do
@user = users(:bob_smith_user)
@@ -283,7 +283,7 @@ describe User, "when setting a profile photo" do
end
describe User, "when unconfirmed" do
- fixtures :users
+ fixtures :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before do
@user = users(:unconfirmed_user)
@@ -295,7 +295,7 @@ describe User, "when unconfirmed" do
end
describe User, "when emails have bounced" do
- fixtures :users
+ fixtures :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
it "should record bounces" do
User.record_bounce_for_email("bob@localhost", "The reason we think the email bounced (e.g. a bounce message)")
diff --git a/spec/models/xapian_spec.rb b/spec/models/xapian_spec.rb
index 0c6fa6bb6..932966dfb 100644
--- a/spec/models/xapian_spec.rb
+++ b/spec/models/xapian_spec.rb
@@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe User, " when indexing users with Xapian" do
- fixtures :users
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
it "should search by name" do
rebuild_xapian_index
@@ -14,7 +14,6 @@ describe User, " when indexing users with Xapian" do
it "should search by 'about me' text" do
user = users(:bob_smith_user)
- rebuild_xapian_index
# def InfoRequest.full_search(models, query, order, ascending, collapse, per_page, page)
xapian_object = InfoRequest.full_search([User], "stuff", 'created_at', true, nil, 100, 1)
xapian_object.results.size.should == 1
@@ -34,7 +33,7 @@ describe User, " when indexing users with Xapian" do
end
describe PublicBody, " when indexing public bodies with Xapian" do
- fixtures :public_bodies, :public_body_translations, :incoming_messages, :outgoing_messages, :raw_emails, :comments, :info_requests
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before(:each) do
load_raw_emails_data(raw_emails)
end
@@ -72,7 +71,7 @@ describe PublicBody, " when indexing public bodies with Xapian" do
end
describe PublicBody, " when indexing requests by body they are to" do
- fixtures :public_bodies, :public_body_translations, :info_request_events, :info_requests, :raw_emails, :comments
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before(:each) do
load_raw_emails_data(raw_emails)
@@ -132,7 +131,7 @@ describe PublicBody, " when indexing requests by body they are to" do
end
describe User, " when indexing requests by user they are from" do
- fixtures :users, :info_request_events, :info_requests, :incoming_messages, :outgoing_messages, :raw_emails, :comments
+ fixtures :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before(:each) do
load_raw_emails_data(raw_emails)
end
@@ -219,7 +218,7 @@ describe User, " when indexing requests by user they are from" do
end
describe User, " when indexing comments by user they are by" do
- fixtures :users, :info_request_events, :info_requests, :comments, :incoming_messages, :outgoing_messages, :raw_emails, :comments
+ fixtures :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before(:each) do
load_raw_emails_data(raw_emails)
end
@@ -256,7 +255,7 @@ describe User, " when indexing comments by user they are by" do
end
describe InfoRequest, " when indexing requests by their title" do
- fixtures :info_request_events, :info_requests, :incoming_messages, :raw_emails, :comments
+ fixtures :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before(:each) do
load_raw_emails_data(raw_emails)
end
@@ -287,7 +286,7 @@ describe InfoRequest, " when indexing requests by their title" do
end
describe InfoRequest, " when indexing requests by tag" do
- fixtures :info_request_events, :info_requests, :incoming_messages, :raw_emails, :comments
+ fixtures :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before(:each) do
load_raw_emails_data(raw_emails)
end
@@ -309,7 +308,7 @@ describe InfoRequest, " when indexing requests by tag" do
end
describe PublicBody, " when indexing authorities by tag" do
- fixtures :public_bodies, :public_body_translations, :incoming_messages, :outgoing_messages, :raw_emails, :comments
+ fixtures :public_bodies, :public_body_translations, :public_body_versions, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
before(:each) do
load_raw_emails_data(raw_emails)
end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index ffe48c731..ecb67a3b4 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,7 +1,7 @@
# This file is copied to ~/spec when you run 'ruby script/generate rspec'
# from the project root directory.
ENV["RAILS_ENV"] ||= 'test'
-require File.expand_path(File.join(File.dirname(__FILE__),'..','config','environment'))
+require File.expand_path(File.join('..', '..', 'config', 'environment'), __FILE__)
require 'spec/autorun'
require 'spec/rails'
@@ -17,16 +17,13 @@ config['REPLY_LATE_AFTER_DAYS'] = 20
# Uncomment the next line to use webrat's matchers
#require 'webrat/integrations/rspec-rails'
-# Requires supporting files with custom matchers and macros, etc,
-# in ./support/ and its subdirectories.
-Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
-
Spec::Runner.configure do |config|
# If you're not using ActiveRecord you should remove these
# lines, delete config/database.yml and disable :active_record
# in your config/boot.rb
- config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
+ # fixture_path must end in a separator
+ config.fixture_path = File.join(Rails.root, 'spec', 'fixtures') + File::SEPARATOR
# == Fixtures
#
@@ -81,11 +78,11 @@ def load_file_fixture(file_name)
end
def rebuild_xapian_index
- # XXX could for speed call ActsAsXapian.rebuild_index directly, but would
- # need model name list, and would need to fix acts_as_xapian so can call writes
- # and reads mixed up (it asserts where it thinks it can't do this)
- rebuild_name = File.dirname(__FILE__) + '/../script/rebuild-xapian-index'
- Kernel.system(rebuild_name) or raise "failed to launch #{rebuild_name}, error bitcode #{$?}, exit status: #{$?.exitstatus}"
+ verbose = false
+ # safe_rebuild=true, which involves forking to avoid memory leaks, doesn't work well with rspec.
+ # unsafe is significantly faster, and we can afford possible memory leaks while testing.
+ safe_rebuild = false
+ ActsAsXapian.rebuild_index(["PublicBody", "User", "InfoRequestEvent"].map{|m| m.constantize}, verbose, safe_rebuild)
end
def update_xapian_index
@@ -114,7 +111,7 @@ def validate_as_body(html)
end
def basic_auth_login(request, username = nil, password = nil)
- username = MySociety::Config.get('ADMIN_USERNAME') if username.nil?
+ username = MySociety::Config.get('ADMIN_USERNAME') if username.nil?
password = MySociety::Config.get('ADMIN_PASSWORD') if password.nil?
request.env["HTTP_AUTHORIZATION"] = "Basic " + Base64::encode64("#{username}:#{password}")
end
@@ -147,6 +144,14 @@ if $tempfilecount.nil?
end
end
+# to_ary differs in Ruby 1.8 and 1.9
+# @see http://yehudakatz.com/2010/01/02/the-craziest-fing-bug-ive-ever-seen/
+def safe_mock_model(model, args = {})
+ mock = mock_model(model, args)
+ mock.should_receive(:to_ary).any_number_of_times
+ mock
+end
+
def load_raw_emails_data(raw_emails)
raw_email = raw_emails(:useless_raw_email)
begin
diff --git a/spec/views/public_body/show.rhtml_spec.rb b/spec/views/public_body/show.rhtml_spec.rb
index cd81888eb..a37d8be0d 100644
--- a/spec/views/public_body/show.rhtml_spec.rb
+++ b/spec/views/public_body/show.rhtml_spec.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path(File.join('..', '..', '..', 'spec_helper'), __FILE__)
describe "when viewing a body" do
before do
diff --git a/spec/views/request/_after_actions.rhtml_spec.rb b/spec/views/request/_after_actions.rhtml_spec.rb
index c73f35d33..6a56e7a71 100644
--- a/spec/views/request/_after_actions.rhtml_spec.rb
+++ b/spec/views/request/_after_actions.rhtml_spec.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path(File.join('..', '..', '..', 'spec_helper'), __FILE__)
describe 'when displaying actions that can be taken with regard to a request' do
diff --git a/spec/views/request/_describe_state.rhtml_spec.rb b/spec/views/request/_describe_state.rhtml_spec.rb
index 9fb776db3..ccf653b1b 100644
--- a/spec/views/request/_describe_state.rhtml_spec.rb
+++ b/spec/views/request/_describe_state.rhtml_spec.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path(File.join('..', '..', '..', 'spec_helper'), __FILE__)
describe 'when showing the form for describing the state of a request' do
diff --git a/spec/views/request/list.rhtml_spec.rb b/spec/views/request/list.rhtml_spec.rb
index 60a28eec5..1f86ec641 100644
--- a/spec/views/request/list.rhtml_spec.rb
+++ b/spec/views/request/list.rhtml_spec.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path(File.join('..', '..', '..', 'spec_helper'), __FILE__)
describe "when listing recent requests" do
diff --git a/spec/views/request/show.rhtml_spec.rb b/spec/views/request/show.rhtml_spec.rb
index ca4663afc..adb244f47 100644
--- a/spec/views/request/show.rhtml_spec.rb
+++ b/spec/views/request/show.rhtml_spec.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path(File.join('..', '..', '..', 'spec_helper'), __FILE__)
describe 'when viewing an information request' do
diff --git a/spec/views/request_game/play.rhtml_spec.rb b/spec/views/request_game/play.rhtml_spec.rb
index e90861e34..24fb6d75d 100644
--- a/spec/views/request_game/play.rhtml_spec.rb
+++ b/spec/views/request_game/play.rhtml_spec.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
+require File.expand_path(File.join('..', '..', '..', 'spec_helper'), __FILE__)
describe 'when viewing the request game' do
diff --git a/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb b/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb
index 4671b79da..0af49dffd 100644
--- a/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb
+++ b/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb
@@ -35,7 +35,6 @@ module ActsAsXapian
@@db = nil
@@db_path = nil
@@writable_db = nil
- @@writable_suffix = nil
@@init_values = []
$acts_as_xapian_class_var_init = true
end
@@ -217,7 +216,6 @@ module ActsAsXapian
prepare_environment
full_path = @@db_path + suffix
- raise "writable_suffix/suffix inconsistency" if @@writable_suffix && @@writable_suffix != suffix
# for indexing
@@writable_db = Xapian::flint_open(full_path, Xapian::DB_CREATE_OR_OPEN)
@@ -225,7 +223,6 @@ module ActsAsXapian
@@term_generator.set_flags(Xapian::TermGenerator::FLAG_SPELLING, 0)
@@term_generator.database = @@writable_db
@@term_generator.stemmer = @@stemmer
- @@writable_suffix = suffix
end
######################################################################
@@ -580,16 +577,20 @@ module ActsAsXapian
STDERR.puts(detail.backtrace.join("\n") + "\nFAILED ActsAsXapian.update_index job #{id} #{$!} " + (job.nil? ? "" : "model " + job.model + " id " + job.model_id.to_s))
end
end
- end
+ # We close the database when we're finished to remove the lock file. Since writable_init
+ # reopens it and recreates the environment every time we don't need to do further cleanup
+ ActsAsXapian.writable_db.close
+ end
+
# You must specify *all* the models here, this totally rebuilds the Xapian
# database. You'll want any readers to reopen the database after this.
#
# Incremental update_index calls above are suspended while this rebuild
# happens (i.e. while the .new database is there) - any index update jobs
# are left in the database, and will run after the rebuild has finished.
- def ActsAsXapian.rebuild_index(model_classes, verbose = false)
- raise "when rebuilding all, please call as first and only thing done in process / task" if not ActsAsXapian.writable_db.nil?
+ def ActsAsXapian.rebuild_index(model_classes, verbose = false, safe_rebuild = true)
+ #raise "when rebuilding all, please call as first and only thing done in process / task" if not ActsAsXapian.writable_db.nil?
prepare_environment
@@ -600,7 +601,47 @@ module ActsAsXapian
FileUtils.rm_r(new_path)
end
- # Index everything
+ # Index everything
+ if safe_rebuild
+ _rebuild_index_safely(model_classes, verbose)
+ else
+ # Save time by running the indexing in one go and in-process
+ ActsAsXapian.writable_init(".new")
+ for model_class in model_classes
+ STDOUT.puts("ActsAsXapian.rebuild_index: Rebuilding #{model_class.to_s}") if verbose
+ model_class.find(:all).each do |model|
+ STDOUT.puts("ActsAsXapian.rebuild_index #{model_class} #{model.id}") if verbose
+ model.xapian_index
+ end
+ end
+ # make sure everything is written and close
+ ActsAsXapian.writable_db.flush
+ ActsAsXapian.writable_db.close
+ end
+
+ # Rename into place
+ old_path = ActsAsXapian.db_path
+ temp_path = ActsAsXapian.db_path + ".tmp"
+ if File.exist?(temp_path)
+ raise "temporary database found " + temp_path + " which is not Xapian flint database, please delete for me" if not File.exist?(File.join(temp_path, "iamflint"))
+ FileUtils.rm_r(temp_path)
+ end
+ if File.exist?(old_path)
+ FileUtils.mv old_path, temp_path
+ end
+ FileUtils.mv new_path, old_path
+
+ # Delete old database
+ if File.exist?(temp_path)
+ raise "old database now at " + temp_path + " is not Xapian flint database, please delete for me" if not File.exist?(File.join(temp_path, "iamflint"))
+ FileUtils.rm_r(temp_path)
+ end
+
+ # You'll want to restart your FastCGI or Mongrel processes after this,
+ # so they get the new db
+ end
+
+ def ActsAsXapian._rebuild_index_safely(model_classes, verbose)
batch_size = 1000
for model_class in model_classes
model_class_count = model_class.count
@@ -621,13 +662,14 @@ module ActsAsXapian
# (so doc ids and so on aren't preserved across the fork)
ActsAsXapian.writable_init(".new")
STDOUT.puts("ActsAsXapian.rebuild_index: New batch. #{model_class.to_s} from #{i} to #{i + batch_size} of #{model_class_count} pid #{Process.pid.to_s}") if verbose
- models = model_class.find(:all, :limit => batch_size, :offset => i, :order => :id)
- for model in models
+ model_class.find(:all, :limit => batch_size, :offset => i, :order => :id).each do |model|
STDOUT.puts("ActsAsXapian.rebuild_index #{model_class} #{model.id}") if verbose
model.xapian_index
end
# make sure everything is written
ActsAsXapian.writable_db.flush
+ # close database
+ ActsAsXapian.writable_db.close
# database connection won't survive a fork, so shut it down
ActiveRecord::Base.connection.disconnect!
# brutal exit, so other shutdown code not run (for speed and safety)
@@ -636,27 +678,6 @@ module ActsAsXapian
end
end
-
- # Rename into place
- old_path = ActsAsXapian.db_path
- temp_path = ActsAsXapian.db_path + ".tmp"
- if File.exist?(temp_path)
- raise "temporary database found " + temp_path + " which is not Xapian flint database, please delete for me" if not File.exist?(File.join(temp_path, "iamflint"))
- FileUtils.rm_r(temp_path)
- end
- if File.exist?(old_path)
- FileUtils.mv old_path, temp_path
- end
- FileUtils.mv new_path, old_path
-
- # Delete old database
- if File.exist?(temp_path)
- raise "old database now at " + temp_path + " is not Xapian flint database, please delete for me" if not File.exist?(File.join(temp_path, "iamflint"))
- FileUtils.rm_r(temp_path)
- end
-
- # You'll want to restart your FastCGI or Mongrel processes after this,
- # so they get the new db
end
######################################################################
diff --git a/vendor/plugins/has_tag_string/lib/has_tag_string.rb b/vendor/plugins/has_tag_string/lib/has_tag_string.rb
index 49b82ca0d..b982bc3a0 100644
--- a/vendor/plugins/has_tag_string/lib/has_tag_string.rb
+++ b/vendor/plugins/has_tag_string/lib/has_tag_string.rb
@@ -98,7 +98,7 @@ module HasTagString
ret[tag.name_and_value] = 1
end
- return ret.keys
+ return ret.keys.sort
end
# Test to see if class is tagged with the given tag
diff --git a/vendor/rails-locales b/vendor/rails-locales
-Subproject d0fb0563129001c6114e351ba5738655733b833
+Subproject 7b769690775e9705f82da75aee3435e8dadebec