aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-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.rb18
-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--config/environment.rb17
-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--doc/CHANGES.md17
-rw-r--r--doc/INSTALL.md42
-rw-r--r--doc/THEMES.md33
-rw-r--r--lib/languages.rb1
-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.rb52
-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/integration/errors_spec.rb22
-rw-r--r--spec/integration/search_request_spec.rb22
-rw-r--r--spec/lib/tmail_extensions_spec.rb1
-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.rb9
-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
76 files changed, 2126 insertions, 2560 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/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 97e4a6c09..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)
@@ -1112,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
@@ -1137,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/config/environment.rb b/config/environment.rb
index 91839c043..d15ee9a0e 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -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/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 bb8c7de21..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
@@ -278,4 +295,21 @@ is supplied in `../conf/varnish-alaveteli.vcl`.
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/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/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 441b1b91d..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 :users, :public_bodies, :public_body_translations, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events
+ 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 :users, :public_bodies, :public_body_translations, :info_requests, :raw_emails, :incoming_messages
+ 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 3db242f73..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 :users, :track_things
+ 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 054b9881f..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 [ :public_bodies,
- :public_body_translations,
- :users,
- :raw_emails,
- :info_requests,
- :info_request_events,
- :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 efcbc7d57..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 :public_bodies, :public_body_translations, :users, :raw_emails, :info_requests, :incoming_messages, :outgoing_messages, :comments, :info_request_events
+ 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 8e1e4589f..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 :users, :public_bodies, :public_body_translations, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events
+ 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 :public_bodies, :public_body_translations, :public_body_translations, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events # 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)
@@ -239,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 :public_bodies, :public_body_translations, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :info_request_events # 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)
@@ -365,7 +365,7 @@ end
describe RequestController, "when creating a new request" do
integrate_views
- fixtures :public_bodies, :public_body_translations, :users, :info_requests, :outgoing_messages
+ 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)
@@ -549,7 +549,7 @@ end
describe RequestController, "when viewing an individual response for reply/followup" do
integrate_views
- fixtures :public_bodies, :public_body_translations, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events # 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)
@@ -596,7 +596,7 @@ end
describe RequestController, "when classifying an information request" do
- fixtures :public_bodies, :public_body_translations, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events # 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)
@@ -807,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
@@ -932,7 +932,7 @@ end
describe RequestController, "when sending a followup message" do
integrate_views
- fixtures :public_bodies, :public_body_translations, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :info_request_events # 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)
@@ -985,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)
@@ -1015,7 +1015,7 @@ end
describe RequestController, "sending overdue request alerts" do
integrate_views
- fixtures :public_bodies, :public_body_translations, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :info_request_events # 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)
@@ -1032,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
@@ -1060,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
@@ -1085,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
@@ -1103,7 +1103,7 @@ end
describe RequestController, "sending unclassified new response reminder alerts" do
integrate_views
- fixtures :public_bodies, :public_body_translations, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events # 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)
@@ -1116,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
@@ -1134,7 +1134,7 @@ end
describe RequestController, "clarification required alerts" do
integrate_views
- fixtures :public_bodies, :public_body_translations, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :info_request_events # 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
@@ -1153,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
@@ -1188,7 +1188,7 @@ end
describe RequestController, "comment alerts" do
integrate_views
- fixtures :public_bodies, :public_body_translations, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events # 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
@@ -1207,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
@@ -1250,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
@@ -1263,7 +1263,7 @@ end
describe RequestController, "when viewing comments" do
integrate_views
- fixtures :users, :info_requests, :raw_emails, :incoming_messages
+ 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
@@ -1286,7 +1286,7 @@ end
describe RequestController, "authority uploads a response from the web interface" do
- fixtures :public_bodies, :public_body_translations, :users, :info_requests, :info_request_events
+ 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
@@ -1373,7 +1373,7 @@ end
describe RequestController, "when showing JSON version for API" do
- fixtures :public_bodies, :public_body_translations, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events
+ 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)
@@ -1393,7 +1393,7 @@ describe RequestController, "when showing JSON version for API" do
end
describe RequestController, "when doing type ahead searches" do
- fixtures :public_bodies, :public_body_translations, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events
+ 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 0b8f5751c..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 :public_bodies, :public_body_translations, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :info_request_events # 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 617e36213..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 :public_bodies, :public_body_translations, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things, :track_things_sent_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, :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 :public_bodies, :public_body_translations, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
+ 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 :public_bodies, :public_body_translations, :users, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things
+ 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 ae771da04..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, :public_bodies, :public_body_translations, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :info_request_events, :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)
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/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 ffb8cb178..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
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 a8411bc34..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 :users, :raw_emails, :public_bodies, :public_body_translations, :info_requests, :incoming_messages
+ 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)
@@ -160,7 +161,7 @@ describe IncomingMessage, " checking validity to reply to" do
end
describe IncomingMessage, " checking validity to reply to with real emails" do
- fixtures :users, :raw_emails, :public_bodies, :public_body_translations, :info_requests, :incoming_messages
+ 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
@@ -184,7 +185,7 @@ describe IncomingMessage, " checking validity to reply to with real emails" do
end
describe IncomingMessage, " when censoring data" do
- fixtures :users, :raw_emails, :public_bodies, :public_body_translations, :info_requests, :incoming_messages
+ 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."
@@ -294,7 +295,7 @@ describe IncomingMessage, " when censoring data" do
end
describe IncomingMessage, " when censoring whole users" do
- fixtures :users, :raw_emails, :public_bodies, :public_body_translations, :info_requests, :incoming_messages
+ 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 d50d6dace..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 :public_bodies, :info_requests, :raw_emails, :incoming_messages
+ 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 :public_bodies, :public_body_translations, :users, :info_requests, :outgoing_messages, :info_request_events, :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 :holidays, :public_bodies, :public_body_translations, :info_requests, :outgoing_messages, :info_request_events
+ 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 :holidays, :public_bodies, :public_body_translations, :info_requests, :info_request_events
+ 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 51d410660..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, :info_requests, :raw_emails, :incoming_messages, :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)
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_requests, :raw_emails, :comments, :info_request_events
+ 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_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events
+ 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_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events
+ 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_requests, :raw_emails, :incoming_messages, :comments, :info_request_events
+ 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_requests, :raw_emails, :incoming_messages, :comments, :info_request_events
+ 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, :raw_emails, :incoming_messages, :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)
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