diff options
Diffstat (limited to 'app')
66 files changed, 537 insertions, 371 deletions
diff --git a/app/controllers/admin_general_controller.rb b/app/controllers/admin_general_controller.rb index 5073cdc5b..ae51e0923 100644 --- a/app/controllers/admin_general_controller.rb +++ b/app/controllers/admin_general_controller.rb @@ -8,6 +8,13 @@ class AdminGeneralController < AdminController def index + # ensure we have a trailing slash + current_uri = request.env['REQUEST_URI'] + if params[:suppress_redirect].nil? && !(current_uri =~ /\/$/) + redirect_to admin_general_index_url + "/" + return + end + # Overview counts of things @public_body_count = PublicBody.count diff --git a/app/controllers/admin_public_body_controller.rb b/app/controllers/admin_public_body_controller.rb index f88b25572..021122734 100644 --- a/app/controllers/admin_public_body_controller.rb +++ b/app/controllers/admin_public_body_controller.rb @@ -154,10 +154,10 @@ class AdminPublicBodyController < AdminController else raise "internal error, unknown button label" end - + # Try with dry run first csv_contents = params[:csv_file].read - en = PublicBody.import_csv(csv_contents, params[:tag], true, admin_http_auth_user()) + en = PublicBody.import_csv(csv_contents, params[:tag], true, admin_http_auth_user(), I18n.available_locales) errors = en[0] notes = en[1] @@ -166,7 +166,7 @@ class AdminPublicBodyController < AdminController notes.push("Dry run was successful, real run would do as above.") else # And if OK, with real run - en = PublicBody.import_csv(csv_contents, params[:tag], false, admin_http_auth_user()) + en = PublicBody.import_csv(csv_contents, params[:tag], false, admin_http_auth_user(), available_locales) errors = en[0] notes = en[1] if errors.size != 0 diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb index d5bd4c4d6..e5de4f8b7 100644 --- a/app/controllers/admin_request_controller.rb +++ b/app/controllers/admin_request_controller.rb @@ -177,7 +177,7 @@ class AdminRequestController < AdminController raw_email_data = incoming_message.raw_email.data mail = TMail::Mail.parse(raw_email_data) mail.base64_decode - destination_request.receive(mail, raw_email_data) + destination_request.receive(mail, raw_email_data, true) incoming_message_id = incoming_message.id incoming_message.fully_destroy @@ -275,7 +275,6 @@ class AdminRequestController < AdminController def show_raw_email @raw_email = RawEmail.find(params[:id]) - # For the holding pen, try to guess where it should be ... @holding_pen = false if (@raw_email.incoming_message.info_request == InfoRequest.holding_pen_request && !@raw_email.incoming_message.mail.from_addrs.nil? && @raw_email.incoming_message.mail.from_addrs.size > 0) @@ -294,15 +293,11 @@ class AdminRequestController < AdminController end # 2. Match the email address in the message without matching the hash - @info_requests = [] - addresses = - (@raw_email.incoming_message.mail.to || []) + - (@raw_email.incoming_message.mail.cc || []) + - (@raw_email.incoming_message.mail.envelope_to || []) - addresses.uniq! - for address in addresses - @info_requests += InfoRequest.guess_by_incoming_email(address) - end + @info_requests = InfoRequest.guess_by_incoming_email(@raw_email.incoming_message) + + # 3. Give a reason why it's in the holding pen + last_event = InfoRequestEvent.find_by_incoming_message_id(@raw_email.incoming_message.id) + @rejected_reason = last_event.params[:rejected_reason] end end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5f18be2e5..0df3e22da 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -42,18 +42,18 @@ class ApplicationController < ActionController::Base end def set_gettext_locale - requested_locale = params[:locale] || session[:locale] || cookies[:locale] || request.env['HTTP_ACCEPT_LANGUAGE'] + if MySociety::Config.get('USE_DEFAULT_BROWSER_LANGUAGE', true) + requested_locale = params[:locale] || session[:locale] || cookies[:locale] || request.env['HTTP_ACCEPT_LANGUAGE'] || I18n.default_locale + else + requested_locale = params[:locale] || session[:locale] || cookies[:locale] || I18n.default_locale + end session[:locale] = FastGettext.set_locale(requested_locale) end # scrub sensitive parameters from the logs filter_parameter_logging :password - helper_method :site_name, :locale_from_params - def site_name - site_name = MySociety::Config.get('SITE_NAME', 'Alaveteli') - return site_name - end + helper_method :locale_from_params # Help work out which request causes RAM spike. # http://www.codeweblog.com/rails-to-monitor-the-process-of-memory-leaks-skills/ @@ -221,7 +221,11 @@ class ApplicationController < ActionController::Base if session[:user_id].nil? return nil else - return User.find(session[:user_id]) + begin + return User.find(session[:user_id]) + rescue ActiveRecord::RecordNotFound + return nil + end end end @@ -272,7 +276,9 @@ class ApplicationController < ActionController::Base def check_read_only read_only = MySociety::Config.get('READ_ONLY', '') if !read_only.empty? - flash[:notice] = "<p>WhatDoTheyKnow is currently in maintenance. You can only view existing requests. You cannot make new ones, add followups or annotations, or otherwise change the database.</p> <p>" + read_only + "</p>" + flash[:notice] = _("<p>{{site_name}} is currently in maintenance. You can only view existing requests. You cannot make new ones, add followups or annotations, or otherwise change the database.</p> <p>{{read_only}}</p>", + :site_name => site_name, + :read_only => read_only) redirect_to frontpage_url end @@ -347,6 +353,9 @@ class ApplicationController < ActionController::Base # views (for links) and mailers (for use in emails), so include them into # all of all. include LinkToHelper + + # Site-wide access to configuration settings + include ConfigHelper end diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb index ffc97237a..4fa603aab 100644 --- a/app/controllers/general_controller.rb +++ b/app/controllers/general_controller.rb @@ -63,7 +63,7 @@ class GeneralController < ApplicationController end end - # Display WhatDoTheyKnow category from mySociety blog + # Display blog entries def blog medium_cache @feed_autodetect = [] @@ -73,7 +73,7 @@ class GeneralController < ApplicationController @data = XmlSimple.xml_in(content) @channel = @data['channel'][0] @blog_items = @channel['item'] - @feed_autodetect = [ { :url => feed_url, :title => "WhatDoTheyKnow blog"} ] + @feed_autodetect = [{:url => feed_url, :title => "#{site_name} blog"}] else @blog_items = [] end diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index e446854ab..c1a13273a 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -393,29 +393,31 @@ class RequestController < ApplicationController flash[:notice] = _("<p>Thank you! Hope you don't have to wait much longer.</p> <p>By law, you should have got a response promptly, and normally before the end of <strong>{{date_response_required_by}}</strong>.</p>",:date_response_required_by=>simple_date(@info_request.date_response_required_by)) redirect_to request_url(@info_request) elsif @info_request.calculate_status == 'waiting_response_very_overdue' - flash[:notice] = _("<p>Thank you! Your request is long overdue, by more than 40 working days. Most requests should be answered within 20 working days. You might like to complain about this, see below.</p>") + flash[:notice] = _("<p>Thank you! Your request is long overdue, by more than {{very_late_number_of_days}} working days. Most requests should be answered within {{late_number_of_days}} working days. You might like to complain about this, see below.</p>", :very_late_number_of_days => MySociety::Config.get('REPLY_VERY_LATE_AFTER_DAYS', 40), :late_number_of_days => MySociety::Config.get('REPLY_LATE_AFTER_DAYS', 20)) redirect_to unhappy_url(@info_request) elsif @info_request.calculate_status == 'not_held' flash[:notice] = _("<p>Thank you! Here are some ideas on what to do next:</p> <ul> - <li>To send your request to another authority, first copy the text of your request below, then <a href=\"%s\">find the other authority</a>.</li> + <li>To send your request to another authority, first copy the text of your request below, then <a href=\"{{find_authority_url}}\">find the other authority</a>.</li> <li>If you would like to contest the authority's claim that they do not hold the information, here is - <a href=\"%s\">how to complain</a>. + <a href=\"{{complain_url}}\">how to complain</a>. </li> - <li>We have <a href=\"%s\">suggestions</a> + <li>We have <a href=\"{{other_means_url}}\">suggestions</a> on other means to answer your question. </li> - </ul> - ") % ["/new",CGI.escapeHTML(unhappy_url(@info_request)),CGI.escapeHTML(unhappy_url(@info_request)) + "#other_means"] + </ul>", + :find_authority_url => "/new", + :complain_url => CGI.escapeHTML(unhappy_url(@info_request)), + :other_means_url => CGI.escapeHTML(unhappy_url(@info_request)) + "#other_means") redirect_to request_url(@info_request) elsif @info_request.calculate_status == 'rejected' flash[:notice] = _("Oh no! Sorry to hear that your request was refused. Here is what to do now.") redirect_to unhappy_url(@info_request) elsif @info_request.calculate_status == 'successful' - flash[:notice] = _("<p>We're glad you got all the information that you wanted. If you write about or make use of the information, please come back and add an annotation below saying what you did.</p><p>If you found WhatDoTheyKnow useful, <a href=\"%s\">make a donation</a> to the charity which runs it.</p>") % ["http://www.mysociety.org/donate/"] + flash[:notice] = _("<p>We're glad you got all the information that you wanted. If you write about or make use of the information, please come back and add an annotation below saying what you did.</p><p>If you found {{site_name}} useful, <a href=\"{{donation_url}}\">make a donation</a> to the charity which runs it.</p>", :site_name=>site_name, :donation_url => "http://www.mysociety.org/donate/") redirect_to request_url(@info_request) elsif @info_request.calculate_status == 'partially_successful' - flash[:notice] = _("<p>We're glad you got some of the information that you wanted. If you found WhatDoTheyKnow useful, <a href=\"%s\">make a donation</a> to the charity which runs it.</p><p>If you want to try and get the rest of the information, here's what to do now.</p>") % ["http://www.mysociety.org/donate/"] + flash[:notice] = _("<p>We're glad you got some of the information that you wanted. If you found {{site_name}} useful, <a href=\"{{donation_url}}\">make a donation</a> to the charity which runs it.</p><p>If you want to try and get the rest of the information, here's what to do now.</p>", :site_name=>site_name, :donation_url=>"http://www.mysociety.org/donate/") redirect_to unhappy_url(@info_request) elsif @info_request.calculate_status == 'waiting_clarification' flash[:notice] = _("Please write your follow up message containing the necessary clarifications below.") @@ -423,7 +425,7 @@ class RequestController < ApplicationController elsif @info_request.calculate_status == 'gone_postal' redirect_to respond_to_last_url(@info_request) + "?gone_postal=1" elsif @info_request.calculate_status == 'internal_review' - flash[:notice] = _("<p>Thank you! Hopefully your wait isn't too long.</p><p>You should get a response within 20 days, or be told if it will take longer (<a href=\"%s\">details</a>).</p>") % [unhappy_url(@info_request) + "#internal_review"] + flash[:notice] = _("<p>Thank you! Hopefully your wait isn't too long.</p><p>You should get a response within {{late_number_of_days}} days, or be told if it will take longer (<a href=\"{{review_url}}\">details</a>).</p>",:late_number_of_days => MySociety::Config.get('REPLY_LATE_AFTER_DAYS', 20), :review_url => unhappy_url(@info_request) + "#internal_review") redirect_to request_url(@info_request) elsif @info_request.calculate_status == 'error_message' flash[:notice] = _("<p>Thank you! We'll look into what happened and try and fix it up.</p><p>If the error was a delivery failure, and you can find an up to date FOI email address for the authority, please tell us using the form below.</p>") @@ -602,23 +604,29 @@ class RequestController < ApplicationController # special caching code so mime types are handled right around_filter :cache_attachments, :only => [ :get_attachment, :get_attachment_as_html ] def cache_attachments - key = params.merge(:only_path => true) - key_path = foi_fragment_cache_path(key) + if !params[:skip_cache].nil? + yield + else + key = params.merge(:only_path => true) + key_path = foi_fragment_cache_path(key) - if foi_fragment_cache_exists?(key_path) - cached = foi_fragment_cache_read(key_path) - response.content_type = AlaveteliFileTypes.filename_to_mimetype(params[:file_name].join("/")) || 'application/octet-stream' - render_for_text(cached) - return - end + if foi_fragment_cache_exists?(key_path) + cached = foi_fragment_cache_read(key_path) + response.content_type = AlaveteliFileTypes.filename_to_mimetype(params[:file_name].join("/")) || 'application/octet-stream' + render_for_text(cached) + return + end - yield + yield - # write it to the fileystem ourselves, so is just a plain file. (The - # various fragment cache functions using Ruby Marshall to write the file - # which adds a header, so isnt compatible with images that have been - # extracted elsewhere from PDFs) - foi_fragment_cache_write(key_path, response.body) + if params[:skip_cache].nil? + # write it to the fileystem ourselves, so is just a plain file. (The + # various fragment cache functions using Ruby Marshall to write the file + # which adds a header, so isnt compatible with images that have been + # extracted elsewhere from PDFs) + foi_fragment_cache_write(key_path, response.body) + end + end end def get_attachment @@ -647,7 +655,7 @@ class RequestController < ApplicationController view_html_stylesheet = render_to_string :partial => "request/view_html_stylesheet" html.sub!(/<head>/i, "<head>" + view_html_stylesheet) - html.sub!(/<body[^>]*>/i, '<body><prefix-here><div id="' + wrapper_id + '"><div id="view_html_content">') + html.sub!(/<body[^>]*>/i, '<body><prefix-here><div id="' + wrapper_id + '"><div id="view-html-content">') html.sub!(/<\/body[^>]*>/i, '</div></div></body>') view_html_prefix = render_to_string :partial => "request/view_html_prefix" @@ -655,7 +663,6 @@ class RequestController < ApplicationController html.sub!("<attachment-url-here>", CGI.escape(@attachment_url)) @incoming_message.html_mask_stuff!(html) - response.content_type = 'text/html' render :text => html end diff --git a/app/controllers/request_game_controller.rb b/app/controllers/request_game_controller.rb index b9440a906..8a84575bb 100644 --- a/app/controllers/request_game_controller.rb +++ b/app/controllers/request_game_controller.rb @@ -20,7 +20,9 @@ class RequestGameController < ApplicationController @requests = old.sort_by{ rand }.slice(0..2) if @missing == 0 - flash[:notice] = _('<p>All done! Thank you very much for your help.</p><p>There are <a href="%s">more things you can do</a> to help WhatDoTheyKnow.</p>') % [help_credits_path+"#helpus"] + flash[:notice] = _('<p>All done! Thank you very much for your help.</p><p>There are <a href="{{helpus_url}}">more things you can do</a> to help {{site_name}}.</p>', + :helpus_url => help_credits_path+"#helpus", + :site_name => site_name) end @league_table_28_days = InfoRequestEvent.make_league_table( diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9bdcb98cd..ec56566a9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -14,6 +14,9 @@ module ApplicationHelper # all of all. include LinkToHelper + # Site-wide access to configuration settings + include ConfigHelper + # Copied from error_messages_for in active_record_helper.rb def foi_error_messages_for(*params) options = params.last.is_a?(Hash) ? params.pop.symbolize_keys : {} @@ -45,7 +48,7 @@ module ApplicationHelper '' end end - + # Highlight words, also escapes HTML (other than spans that we add) def highlight_words(t, words, html = true) if html diff --git a/app/helpers/config_helper.rb b/app/helpers/config_helper.rb new file mode 100644 index 000000000..80f2deed2 --- /dev/null +++ b/app/helpers/config_helper.rb @@ -0,0 +1,5 @@ +module ConfigHelper + def site_name + MySociety::Config.get('SITE_NAME', 'Alaveteli') + end +end
\ No newline at end of file diff --git a/app/models/application_mailer.rb b/app/models/application_mailer.rb index 508ff2016..9628d7339 100644 --- a/app/models/application_mailer.rb +++ b/app/models/application_mailer.rb @@ -28,5 +28,8 @@ class ApplicationMailer < ActionMailer::Base # views (for links) and mailers (for use in emails), so include them into # all of all. include LinkToHelper + + # Site-wide access to configuration settings + include ConfigHelper end diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index 581c73f8b..16ae38b92 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -255,7 +255,8 @@ class FOIAttachment text = CGI.escapeHTML(text) text = MySociety::Format.make_clickable(text) html = text.gsub(/\n/, '<br>') - return "<html><head></head><body>" + html + "</body></html>", wrapper_id + return '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"><html><head><title></title></head><body>' + html + "</body></html>", wrapper_id end # the extractions will also produce image files, which go in the @@ -431,7 +432,7 @@ class IncomingMessage < ActiveRecord::Base text.gsub!(self.info_request.public_body.request_email, "[" + self.info_request.public_body.short_or_long_name + " request email]") end text.gsub!(self.info_request.incoming_email, "[FOI #" + self.info_request.id.to_s + " email]") - text.gsub!(MySociety::Config.get("CONTACT_EMAIL", 'contact@localhost'), "[WhatDoTheyKnow contact email]") + text.gsub!(MySociety::Config.get("CONTACT_EMAIL", 'contact@localhost'), "[#{MySociety::Config.get('SITE_NAME', 'Alaveteli')} contact email]") end # Replaces all email addresses in (possibly binary data) with equal length alternative ones. @@ -461,11 +462,23 @@ class IncomingMessage < ActiveRecord::Base if censored_uncompressed_text != uncompressed_text # then use the altered file (recompressed) recompressed_text = nil - IO.popen("/usr/bin/pdftk - output - compress", "r+") do |child| + 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" + end + IO.popen(command, "r+") do |child| child.write(censored_uncompressed_text) child.close_write() recompressed_text = child.read() end + if recompressed_text.nil? || recompressed_text.empty? + # buggy versions of pdftk sometimes fail on + # compression, I don't see it's a disaster in + # these cases to save an uncompressed version? + recompressed_text = censored_uncompressed_text + logger.warn "Unable to compress PDF; problem with your pdftk version?" + end if !recompressed_text.nil? && !recompressed_text.empty? text[0..-1] = recompressed_text # [0..-1] makes it change the 'text' string in place end @@ -557,7 +570,8 @@ class IncomingMessage < ActiveRecord::Base text.gsub!(/(Complaints and Corporate Affairs Officer)\s+Westminster Primary Care Trust.+/ms, "\\1") # Remove WhatDoTheyKnow signup links - text.gsub!(/http:\/\/www.whatdotheyknow.com\/c\/[^\s]+/, "[WDTK login link]") + domain = MySociety::Config.get('DOMAIN') + text.gsub!(/http:\/\/#{domain}\/c\/[^\s]+/, "[WDTK login link]") # Remove Home Office survey links # e.g. http://www.whatdotheyknow.com/request/serious_crime_act_2007_section_7#incoming-12650 @@ -850,7 +864,9 @@ class IncomingMessage < ActiveRecord::Base text = Iconv.conv('utf-8', 'windows-1252', text) rescue Iconv::IllegalSequence # Text looks like unlabelled nonsense, strip out anything that isn't UTF-8 - text = Iconv.conv('utf-8//IGNORE', 'utf-8', text) + "\n\n[ WhatDoTheyKnow note: The above text was badly encoded, and has had strange characters removed. ]" + text = Iconv.conv('utf-8//IGNORE', 'utf-8', text) + + _("\n\n[ {{site_name}} note: The above text was badly encoded, and has had strange characters removed. ]", + :site_name => MySociety::Config.get('SITE_NAME', 'Alaveteli')) end end end @@ -972,7 +988,6 @@ class IncomingMessage < ActiveRecord::Base attachment.filename = _get_censored_part_file_name(leaf) if leaf.within_rfc822_attachment attachment.within_rfc822_subject = leaf.within_rfc822_attachment.subject - # Test to see if we are in the first part of the attached # RFC822 message and it is text, if so add headers. # XXX should probably use hunting algorithm to find main text part, rather than @@ -1119,8 +1134,8 @@ class IncomingMessage < ActiveRecord::Base external_command("/usr/bin/catdoc", tempfile.path, :append_to => text) elsif content_type == 'text/html' # lynx wordwraps links in its output, which then don't get formatted properly - # by WhatDoTheyKnow. We use elinks instead, which doesn't do that. - external_command("/usr/bin/elinks", "-dump-charset", "utf-8", "-force-html", "-dump", + # by Alaveteli. We use elinks instead, which doesn't do that. + external_command("/usr/bin/elinks", "-eval", "'set document.codepage.assume = \"utf-8\"'", "-dump-charset", "utf-8", "-force-html", "-dump", tempfile.path, :append_to => text) elsif content_type == 'application/vnd.ms-excel' # Bit crazy using /usr/bin/strings - but xls2csv, xlhtml and @@ -1237,9 +1252,8 @@ class IncomingMessage < ActiveRecord::Base info_request_event.track_things_sent_emails.each { |a| a.destroy } info_request_event.user_info_request_sent_alerts.each { |a| a.destroy } info_request_event.destroy - raw_email = self.raw_email + self.raw_email.destroy_file_representation! self.destroy - self.raw_email.destroy end end diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 209954b16..c667e1499 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -17,7 +17,6 @@ # allow_new_responses_from :string(255) default("anybody"), not null # handle_rejected_responses :string(255) default("bounce"), not null # - # models/info_request.rb: # A Freedom of Information request. # @@ -309,13 +308,20 @@ public # Return list of info requests which *might* be right given email address # e.g. For the id-hash email addresses, don't match the hash. - def InfoRequest.guess_by_incoming_email(incoming_email) - id, hash = InfoRequest._extract_id_hash_from_email(incoming_email) - begin - return [InfoRequest.find(id)] - rescue ActiveRecord::RecordNotFound - return [] + def InfoRequest.guess_by_incoming_email(incoming_message) + guesses = [] + # 1. Try to guess based on the email address(es) + addresses = + (incoming_message.mail.to || []) + + (incoming_message.mail.cc || []) + + (incoming_message.mail.envelope_to || []) + addresses.uniq! + for address in addresses + id, hash = InfoRequest._extract_id_hash_from_email(address) + guesses.push(InfoRequest.find_by_id(id)) + guesses.push(InfoRequest.find_by_idhash(hash)) end + return guesses.select{|x| !x.nil?}.uniq end # Internal function used by find_by_magic_email and guess_by_incoming_email @@ -326,7 +332,7 @@ public # The optional bounce- dates from when we used to have separate emails for the envelope from. # (that was abandoned because councils would send hand written responses to them, not just # bounce messages) - incoming_email =~ /request-(?:bounce-)?(\d+)-([a-z0-9]+)/ + incoming_email =~ /request-(?:bounce-)?([a-z0-9]+)-([a-z0-9]+)/ id = $1.to_i hash = $2 @@ -379,21 +385,24 @@ public end # A new incoming email to this request - def receive(email, raw_email_data, override_stop_new_responses = false) + def receive(email, raw_email_data, override_stop_new_responses = false, rejected_reason = "") if !override_stop_new_responses allow = nil - + reason = nil # See if new responses are prevented for spam reasons if self.allow_new_responses_from == 'nobody' allow = false + reason = _('This request has been set by an administrator to "allow new responses from nobody"') elsif self.allow_new_responses_from == 'anybody' allow = true elsif self.allow_new_responses_from == 'authority_only' if email.from_addrs.nil? || email.from_addrs.size == 0 allow = false + reason = _('Only the authority can reply to this request, but there is no "From" address to check against') else sender_email = email.from_addrs[0].spec sender_domain = PublicBody.extract_domain_from_email(sender_email) + reason = _("Only the authority can reply to this request, and I don't recognise the address this reply was sent from") allow = false # Allow any domain that has already sent reply for row in self.who_can_followup_to @@ -411,7 +420,7 @@ public if self.handle_rejected_responses == 'bounce' RequestMailer.deliver_stopped_responses(self, email, raw_email_data) elsif self.handle_rejected_responses == 'holding_pen' - InfoRequest.holding_pen_request.receive(email, raw_email_data) + InfoRequest.holding_pen_request.receive(email, raw_email_data, false, reason) elsif self.handle_rejected_responses == 'blackhole' # do nothing - just lose the message (Note: a copy will be # in the backup mailbox if the server is configured to send @@ -435,7 +444,11 @@ public raw_email.save! self.awaiting_description = true - self.log_event("response", { :incoming_message_id => incoming_message.id }) + params = { :incoming_message_id => incoming_message.id } + if !rejected_reason.empty? + params[:rejected_reason] = rejected_reason + end + self.log_event("response", params) self.save! end @@ -638,6 +651,8 @@ public # days is a very long time. def date_very_overdue_after last_sent = last_event_forming_initial_request + very_late_days_later = MySociety::Config.get('REPLY_VERY_LATE_AFTER_DAYS', 40) + school_very_late_days_later = MySociety::Config.get('SPECIAL_REPLY_VERY_LATE_AFTER_DAYS', 60) if self.public_body.is_school? # schools have 60 working days maximum (even over a long holiday) return Holiday.due_date_from(self.date_initial_request_last_sent_at, 60) @@ -671,6 +686,7 @@ public end end return nil + end def get_last_response_event for e in self.info_request_events.reverse @@ -831,15 +847,25 @@ public def InfoRequest.magic_email_for_id(prefix_part, id) magic_email = MySociety::Config.get("INCOMING_EMAIL_PREFIX", "") magic_email += prefix_part + id.to_s - magic_email += "-" + Digest::SHA1.hexdigest(id.to_s + MySociety::Config.get("INCOMING_EMAIL_SECRET", 'dummysecret'))[0,8] + magic_email += "-" + InfoRequest.hash_from_id(id) magic_email += "@" + MySociety::Config.get("INCOMING_EMAIL_DOMAIN", "localhost") return magic_email end + before_validation :compute_idhash + + def compute_idhash + self.idhash = InfoRequest.hash_from_id(self.id) + end + + def InfoRequest.hash_from_id(id) + return Digest::SHA1.hexdigest(id.to_s + MySociety::Config.get("INCOMING_EMAIL_SECRET", 'dummysecret'))[0,8] + end + # Called by find_by_incoming_email - and used to be called by separate # function for envelope from address, until we abandoned it. def InfoRequest.find_by_magic_email(id, hash) - expected_hash = Digest::SHA1.hexdigest(id.to_s + MySociety::Config.get("INCOMING_EMAIL_SECRET", 'dummysecret'))[0,8] + expected_hash = InfoRequest.hash_from_id(id) #print "expected: " + expected_hash + "\nhash: " + hash + "\n" if hash != expected_hash return nil diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb index 02b9a34ac..d79647c98 100644 --- a/app/models/info_request_event.rb +++ b/app/models/info_request_event.rb @@ -121,7 +121,12 @@ class InfoRequestEvent < ActiveRecord::Base self.info_request.user.url_name end def requested_from - self.info_request.public_body.url_name + # acts_as_xapian will detect translated fields via Globalize and add all the + # available locales to the index. But 'requested_from' is not translated directly, + # although it relies on a translated field in PublicBody. Hence, we need to + # manually add all the localized values to the index (Xapian can handle a list + # of values in a term, btw) + self.info_request.public_body.translations.map {|t| t.url_name} end def commented_by if self.event_type == 'comment' diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb index c7ba362e0..b7e310b1e 100644 --- a/app/models/outgoing_message.rb +++ b/app/models/outgoing_message.rb @@ -54,14 +54,15 @@ class OutgoingMessage < ActiveRecord::Base # How the default letter starts and ends def get_salutation - ret = _("Dear ") + ret = "" if self.message_type == 'followup' && !self.incoming_message_followup.nil? && !self.incoming_message_followup.safe_mail_from.nil? && self.incoming_message_followup.valid_to_reply_to? ret = ret + OutgoingMailer.name_for_followup(self.info_request, self.incoming_message_followup) else ret = ret + self.info_request.public_body.name end - return ret + "," + salutation = _("Dear {{public_body_name}},", :public_body_name => ret) end + def get_signoff if self.message_type == 'followup' && !self.incoming_message_followup.nil? && !self.incoming_message_followup.safe_mail_from.nil? && self.incoming_message_followup.valid_to_reply_to? return _("Yours sincerely,") diff --git a/app/models/public_body.rb b/app/models/public_body.rb index 0e32a5164..b75da4331 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -54,15 +54,16 @@ class PublicBody < ActiveRecord::Base # like find_by_url_name but also search historic url_name if none found def self.find_by_url_name_with_historic(name) - @locale = I18n.locale.to_s - PublicBody.with_locale(@locale) do + locale = self.locale || I18n.locale + PublicBody.with_locale(locale) do found = PublicBody.find(:all, :conditions => ["public_body_translations.url_name='#{name}'"], :joins => :translations, :readonly => false) - return found.first if found.size == 1 - # Shouldn't we just make url_name unique? - raise "Two bodies with the same URL name: #{name}" if found.size > 1 + # If many bodies are found (usually because the url_name is the same across + # locales) return any of them + return found.first if found.size >= 1 + # If none found, then search the history of short names old = PublicBody::Version.find_all_by_url_name(name) # Find unique public bodies in it @@ -138,7 +139,7 @@ class PublicBody < ActiveRecord::Base return 'defunct' elsif self.not_apply? return 'not_apply' - elsif self.request_email.empty? or self.request_email == 'blank' + elsif self.request_email.nil? or self.request_email.empty? or self.request_email == 'blank' return 'bad_contact' else raise "requestable_failure_reason called with type that has no reason" @@ -310,29 +311,39 @@ class PublicBody < ActiveRecord::Base # Import from CSV. Just tests things and returns messages if dry_run is true. # Returns an array of [array of errors, array of notes]. If there are errors, # always rolls back (as with dry_run). - def self.import_csv(csv, tag, dry_run, editor) + def self.import_csv(csv, tag, dry_run, editor, additional_locales = []) errors = [] notes = [] begin ActiveRecord::Base.transaction do - existing_bodies = PublicBody.find_by_tag(tag) - + # Use the default locale when retrieving existing bodies; otherwise + # matching names won't work afterwards, and we'll create new bodies instead + # of updating them bodies_by_name = {} set_of_existing = Set.new() - for existing_body in existing_bodies - bodies_by_name[existing_body.name] = existing_body - set_of_existing.add(existing_body.name) + PublicBody.with_locale(I18n.default_locale) do + for existing_body in PublicBody.find_by_tag(tag) + bodies_by_name[existing_body.name] = existing_body + set_of_existing.add(existing_body.name) + end end - + set_of_importing = Set.new() + field_names = { 'name'=>1, 'email'=>2 } # Default values in case no field list is given line = 0 - CSV::Reader.parse(csv) do |row| line = line + 1 - name = row[1] - email = row[2] + # Parse the first line as a field list if it starts with '#' + if line==1 and row.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 + end + + name = row[field_names['name']] + email = row[field_names['email']] next if name.nil? if email.nil? email = '' # unknown/bad contact is empty string @@ -353,15 +364,38 @@ class PublicBody < ActiveRecord::Base notes.push "line " + line.to_s + ": updating email for '" + name + "' from " + public_body.request_email + " to " + email public_body.request_email = email public_body.last_edit_editor = editor - public_body.last_edit_comment = 'Updated from spreadsheet' + public_body.last_edit_comment = 'Updated from spreadsheet' public_body.save! end + + additional_locales.each do |locale| + localized_name = field_names["name.#{locale}"] && row[field_names["name.#{locale}"]] + PublicBody.with_locale(locale) do + if !localized_name.nil? and public_body.name != localized_name + notes.push "line " + line.to_s + ": updating name for '#{name}' from '#{public_body.name}' to '#{localized_name}' (locale: #{locale})." + public_body.name = localized_name + public_body.save! + end + end + end else # New public body notes.push "line " + line.to_s + ": new authority '" + name + "' with email " + email public_body = PublicBody.new(:name => name, :request_email => email, :short_name => "", :home_page => "", :publication_scheme => "", :notes => "", :last_edit_editor => editor, :last_edit_comment => 'Created from spreadsheet') public_body.tag_string = tag public_body.save! + + additional_locales.each do |locale| + localized_name = field_names["name.#{locale}"] && row[field_names["name.#{locale}"]] + if !localized_name.nil? + PublicBody.with_locale(locale) do + notes.push "line " + line.to_s + ": (aka '#{localized_name}' in locale #{locale})" + public_body.name = localized_name + public_body.publication_scheme = "" + public_body.save! + end + end + end end set_of_importing.add(name) diff --git a/app/models/raw_email.rb b/app/models/raw_email.rb index eb36053c1..c6066cbf4 100644 --- a/app/models/raw_email.rb +++ b/app/models/raw_email.rb @@ -20,8 +20,6 @@ class RawEmail < ActiveRecord::Base has_one :incoming_message - before_destroy :destroy_file_representation! - # We keep the old data_text field (which is of type text) for backwards # compatibility. We use the new data_binary field because only it works # properly in recent versions of PostgreSQL (get seg faults escaping diff --git a/app/models/request_mailer.rb b/app/models/request_mailer.rb index e73b153b9..fc317d20d 100644 --- a/app/models/request_mailer.rb +++ b/app/models/request_mailer.rb @@ -205,10 +205,11 @@ class RequestMailer < ApplicationMailer def receive(email, raw_email) # Find which info requests the email is for reply_info_requests = self.requests_matching_email(email) - # Nothing found, so save in holding pen if reply_info_requests.size == 0 - InfoRequest.holding_pen_request.receive(email, raw_email) + reason = _("Could not identify the request from the email address") + request = InfoRequest.holding_pen_request + request.receive(email, raw_email, false, reason) return end diff --git a/app/models/track_mailer.rb b/app/models/track_mailer.rb index 6901a834d..4b7c603a7 100644 --- a/app/models/track_mailer.rb +++ b/app/models/track_mailer.rb @@ -22,7 +22,7 @@ class TrackMailer < ApplicationMailer # etc. don't decide we are spammers.) @recipients = user.name_and_email - @subject = "Your WhatDoTheyKnow.com email alert" + @subject = _("Your {{site_name}} email alert", :site_name => site_name) @body = { :user => user, :email_about_things => email_about_things, :unsubscribe_url => unsubscribe_url } end diff --git a/app/models/track_thing.rb b/app/models/track_thing.rb index aee1ed1da..16a0dab87 100644 --- a/app/models/track_thing.rb +++ b/app/models/track_thing.rb @@ -120,8 +120,8 @@ class TrackThing < ActiveRecord::Base @params = { # Website :list_description => "'<a href=\"/request/" + CGI.escapeHTML(self.info_request.url_title) + "\">" + CGI.escapeHTML(self.info_request.title) + "</a>', a request", # XXX yeuch, sometimes I just want to call view helpers from the model, sorry! can't work out how - :verb_on_page => "Track this request by email", - :verb_on_page_already => "You are already tracking this request by email", + :verb_on_page => _("Track this request by email"), + :verb_on_page_already => _("You are already tracking this request by email"), # Email :title_in_email => "New updates for the request '" + self.info_request.title + "'", :title_in_rss => "New updates for the request '" + self.info_request.title + "'", @@ -135,23 +135,23 @@ class TrackThing < ActiveRecord::Base elsif self.track_type == 'all_new_requests' @params = { # Website - :list_description => "any <a href=\"/list\">new requests</a>", - :verb_on_page => "Email me when there are new requests", - :verb_on_page_already => "You are being emailed when there are new requests", + :list_description => _("any <a href=\"/list\">new requests</a>"), + :verb_on_page => _("Email me when there are new requests"), + :verb_on_page_already => _("You are being emailed when there are new requests"), # Email - :title_in_email => "New Freedom of Information requests", - :title_in_rss => "New Freedom of Information requests", + :title_in_email => _("New Freedom of Information requests"), + :title_in_rss => _("New Freedom of Information requests"), # Authentication - :web => "To be emailed about any new requests", - :email => "Then you will be emailed whenever anyone makes a new FOI request.", - :email_subject => "Confirm you want to be emailed about new requests", + :web => _("To be emailed about any new requests"), + :email => _("Then you will be emailed whenever anyone makes a new FOI request."), + :email_subject => _("Confirm you want to be emailed about new requests"), # RSS sorting :feed_sortby => 'newest' } elsif self.track_type == 'all_successful_requests' @params = { # Website - :list_description => "any <a href=\"/list/successful\">successful requests</a>", + :list_description => _("any <a href=\"/list/successful\">successful requests</a>"), :verb_on_page => _("Email me new successful responses "), :verb_on_page_already => _("You are being emailed about any new successful responses"), # Email @@ -172,14 +172,14 @@ class TrackThing < ActiveRecord::Base # Website :list_description => "'<a href=\"/body/" + CGI.escapeHTML(self.public_body.url_name) + "\">" + CGI.escapeHTML(self.public_body.name) + "</a>', a public authority", # XXX yeuch, sometimes I just want to call view helpers from the model, sorry! can't work out how :verb_on_page => _("Track requests to {{public_body_name}} by email",:public_body_name=>CGI.escapeHTML(self.public_body.name)), - :verb_on_page_already => "You are already tracking requests to " + CGI.escapeHTML(self.public_body.name) + " by email", + :verb_on_page_already => _("You are already tracking requests to {{public_body_name}} by email", :public_body_name=>CGI.escapeHTML(self.public_body.name)), # Email :title_in_email => self.public_body.law_only_short + " requests to '" + self.public_body.name + "'", :title_in_rss => self.public_body.law_only_short + " requests to '" + self.public_body.name + "'", # Authentication - :web => "To be emailed about requests made using WhatDoTheyKnow to the public authority '" + CGI.escapeHTML(self.public_body.name) + "'", - :email => "Then you will be emailed whenever someone requests something or gets a response from '" + CGI.escapeHTML(self.public_body.name) + "'.", - :email_subject => "Confirm you want to be emailed about requests to '" + self.public_body.name + "'", + :web => _("To be emailed about requests made using {{site_name}} to the public authority '{{public_body_name}}'", :site_name=>MySociety::Config.get('SITE_NAME', 'Alaveteli'), :public_body_name=>CGI.escapeHTML(self.public_body.name)), + :email => _("Then you will be emailed whenever someone requests something or gets a response from '{{public_body_name}}'.", :public_body_name=>CGI.escapeHTML(self.public_body.name)), + :email_subject => _("Confirm you want to be emailed about requests to '{{public_body_name}}'", :public_body_name=>self.public_body.name), # RSS sorting :feed_sortby => 'newest' } @@ -187,15 +187,15 @@ class TrackThing < ActiveRecord::Base @params = { # Website :list_description => "'<a href=\"/user/" + CGI.escapeHTML(self.tracked_user.url_name) + "\">" + CGI.escapeHTML(self.tracked_user.name) + "</a>', a person", # XXX yeuch, sometimes I just want to call view helpers from the model, sorry! can't work out how - :verb_on_page => "Track this person by email", - :verb_on_page_already => "You are already tracking this person by email", + :verb_on_page => _("Track this person by email"), + :verb_on_page_already => _("You are already tracking this person by email"), # Email - :title_in_email => "FOI requests by '" + self.tracked_user.name + "'", - :title_in_rss => "FOI requests by '" + self.tracked_user.name + "'", + :title_in_email => _("FOI requests by '{{user_name}}'", :user_name=>self.tracked_user.name), + :title_in_rss => _("FOI requests by '{{user_name}}'", :user_name=>self.tracked_user.name), # Authentication - :web => "To be emailed about requests by '" + CGI.escapeHTML(self.tracked_user.name) + "'", - :email => "Then you will be emailed whenever '" + CGI.escapeHTML(self.tracked_user.name) + "' requests something or gets a response.", - :email_subject => "Confirm you want to be emailed about requests by '" + self.tracked_user.name + "'", + :web => _("To be emailed about requests by '{{user_name}}'", :user_name=>CGI.escapeHTML(self.tracked_user.name)), + :email => _("Then you will be emailed whenever '{{user_name}}' requests something or gets a response.", :user_name=>CGI.escapeHTML(self.tracked_user.name)), + :email_subject => _("Confirm you want to be emailed about requests by '{{user_name}}'", :user_name=>self.tracked_user.name), # RSS sorting :feed_sortby => 'newest' } @@ -203,15 +203,15 @@ class TrackThing < ActiveRecord::Base @params = { # Website :list_description => "'<a href=\"/search/" + CGI.escapeHTML(self.track_query) + "/newest\">" + CGI.escapeHTML(self.track_query) + "</a>' in new requests/responses", # XXX yeuch, sometimes I just want to call view helpers from the model, sorry! can't work out how - :verb_on_page => "Track things matching '" + CGI.escapeHTML(self.track_query) + "' by email", - :verb_on_page_already => "You are already tracking things matching '" + CGI.escapeHTML(self.track_query) + "' by email", + :verb_on_page => _("Track things matching '{{query}}' by email", :query=>CGI.escapeHTML(self.track_query)), + :verb_on_page_already => _("You are already tracking things matching '{{query}}' by email", :query=>CGI.escapeHTML(self.track_query)), # Email - :title_in_email => "Requests or responses matching '" + self.track_query + "'", - :title_in_rss => "Requests or responses matching '" + self.track_query + "'", + :title_in_email => _("Requests or responses matching '{{query}}'", :query=>self.track_query), + :title_in_rss => _("Requests or responses matching '{{query}}'", :query=>self.track_query), # Authentication - :web => "To follow requests and responses matching '" + CGI.escapeHTML(self.track_query) + "'", - :email => "Then you will be emailed whenever a new request or response matches '" + CGI.escapeHTML(self.track_query) + "'.", - :email_subject => "Confirm you want to be emailed about new requests or responses matching '" + self.track_query + "'", + :web => _("To follow requests and responses matching '{{query}}'", :query=>CGI.escapeHTML(self.track_query)), + :email => _("Then you will be emailed whenever a new request or response matches '{{query}}'.", :query=>CGI.escapeHTML(self.track_query)), + :email_subject => _("Confirm you want to be emailed about new requests or responses matching '{{query}}'", :query=>self.track_query), # RSS sorting - XXX hmmm, we don't really know which to use # here for sorting. Might be a query term (e.g. 'cctv'), in # which case newest is good, or might be something like diff --git a/app/models/user_mailer.rb b/app/models/user_mailer.rb index f164f684e..0972e167d 100644 --- a/app/models/user_mailer.rb +++ b/app/models/user_mailer.rb @@ -31,7 +31,7 @@ class UserMailer < ApplicationMailer @from = contact_from_name_and_email headers 'Return-Path' => blackhole_email, 'Reply-To' => @from # we don't care about bounces when people are fiddling with their account @recipients = new_email - @subject = _("Confirm your new email address on WhatDoTheyKnow.com") + @subject = _("Confirm your new email address on {{site_name}}", :site_name=>site_name) @body[:name] = user.name @body[:url] = url @body[:old_email] = user.email @@ -42,7 +42,7 @@ class UserMailer < ApplicationMailer @from = contact_from_name_and_email headers 'Return-Path' => blackhole_email, 'Reply-To' => @from # we don't care about bounces when people are fiddling with their account @recipients = new_email - @subject = _("Unable to change email address on WhatDoTheyKnow.com") + @subject = _("Unable to change email address on {{site_name}}", :site_name=>site_name) @body[:old_email] = old_email @body[:new_email] = new_email end diff --git a/app/views/admin_public_body/import_csv.rhtml b/app/views/admin_public_body/import_csv.rhtml index 75981a501..50a4b951a 100644 --- a/app/views/admin_public_body/import_csv.rhtml +++ b/app/views/admin_public_body/import_csv.rhtml @@ -17,10 +17,21 @@ </p> <p> - <label for="csv_file">CSV file (no header rows; unused first column; name second column; email third column):</label> - <br/> - <%= file_field_tag :csv_file, :size => 60 %> + <label for="csv_file">CSV file:</label> + <%= file_field_tag :csv_file, :size => 40 %> </p> + + <p><strong>CSV file format:</strong> A first row with the list of fields, + starting with '#', is optional but highly recommended. The fields 'name' + and 'email' are required; additionaly, translated values are supported by + adding the locale name to the field name, e.g. 'name.es', 'name.de'... Example: + </p> + + <blockquote> + #id,name,email,name.es<br/> + 1,An Authority,a@example.com,Un organismo<br/> + 2,Another One,another@example.com,Otro organismo<br/> + </blockquote> <p><strong>Note:</strong> Choose <strong>dry run</strong> to test, without actually altering the database. Choose <strong>upload</strong> to actually diff --git a/app/views/admin_request/show_raw_email.rhtml b/app/views/admin_request/show_raw_email.rhtml index 10b97f4fd..fa1470e77 100644 --- a/app/views/admin_request/show_raw_email.rhtml +++ b/app/views/admin_request/show_raw_email.rhtml @@ -3,8 +3,9 @@ <h1>Incoming message <%=@raw_email.incoming_message.id.to_s %></h1> <p> - FOI request: <%= link_to request_both_links(@raw_email.incoming_message.info_request) %> + FOI request: <%= request_both_links(@raw_email.incoming_message.info_request) %> <% if @holding_pen %> + <br>This is in the holding pen because: <strong><%= @rejected_reason %></strong> <% if @public_bodies.size > 0 %> <br>Guessed authority: <% for public_body in @public_bodies %> @@ -30,7 +31,7 @@ <h2>Raw email</h2> -<%= link_to "Download", "../download_raw_email/" + @raw_email.id.to_s %> +<p><%= link_to "Download", "../download_raw_email/" + @raw_email.id.to_s %></p> <pre><%=h(@raw_email.data).gsub(/\n/, '<br>') %></pre> diff --git a/app/views/comment/new.rhtml b/app/views/comment/new.rhtml index 25380d23f..1a4f2c0dc 100644 --- a/app/views/comment/new.rhtml +++ b/app/views/comment/new.rhtml @@ -59,7 +59,7 @@ <li> <%= _('You know what caused the error, and can <strong>suggest a solution</strong>, such as a working email address.')%> </li> <% end %> <% if [ 'requires_admin' ].include?(@info_request.described_state) %> - <li> <%= _('Your thoughts on what the WhatDoTheyKnow <strong>administrators</strong> should do about the request.') %> </li> + <li> <%= _('Your thoughts on what the {{site_name}} <strong>administrators</strong> should do about the request.', :site_name=>site_name) %> </li> <% end %> diff --git a/app/views/contact_mailer/message.rhtml b/app/views/contact_mailer/message.rhtml index a28d9603b..9c0a74c02 100644 --- a/app/views/contact_mailer/message.rhtml +++ b/app/views/contact_mailer/message.rhtml @@ -1,7 +1,7 @@ <%= @message.strip %> --------------------------------------------------------------------- -<%= _('Message sent using WhatDoTheyKnow contact form, ')%> +<%= _('Message sent using {{site_name}} contact form, ', :site_name=>site_name)%> <%=(@logged_in_user ? ("logged in as user " + main_url(user_url(@logged_in_user))) : "not logged in")%><% if !@last_request.nil? %> <%= _('Last request viewed: ')%><%= main_url(request_url(@last_request)) %> diff --git a/app/views/contact_mailer/user_message.rhtml b/app/views/contact_mailer/user_message.rhtml index 7a685c452..fe1f47518 100644 --- a/app/views/contact_mailer/user_message.rhtml +++ b/app/views/contact_mailer/user_message.rhtml @@ -1,5 +1,5 @@ --------------------------------------------------------------------- -<%=@from_user.name%> has used WhatDoTheyKnow to send you the message below. +<%= _('{{user_name}} has used {{site_name}} to send you the message below.', :user_name=>@from_user.name, :site_name=>site_name) %> <%= _('Your details have not been given to anyone, unless you choose to reply to this message, which will then go directly to the person who wrote the message.')%> --------------------------------------------------------------------- @@ -7,6 +7,6 @@ message, which will then go directly to the person who wrote the message.')%> <%= @message.strip %> --------------------------------------------------------------------- -<%= _('View Freedom of Information requests made by')%> <%=@from_user.name %>: +<%= _('View Freedom of Information requests made by {{user_name}}:', :user_name=>@from_user.name)%> <%= @from_user_url %> --------------------------------------------------------------------- diff --git a/app/views/general/_frontpage_intro_sentence.rhtml b/app/views/general/_frontpage_intro_sentence.rhtml new file mode 100644 index 000000000..2c3bcaf83 --- /dev/null +++ b/app/views/general/_frontpage_intro_sentence.rhtml @@ -0,0 +1,3 @@ +First, type in the <strong>name of the UK public authority</strong> you'd +<br>like information from. <strong>By law, they have to respond</strong> +(<a href="<%= help_about_url %>">why?</a>). diff --git a/app/views/general/blog.rhtml b/app/views/general/blog.rhtml index cbd37240e..c9387c24f 100644 --- a/app/views/general/blog.rhtml +++ b/app/views/general/blog.rhtml @@ -1,8 +1,8 @@ <% @title = "#{site_name} blog and tweets" %> <h1><%=@title %></h1> - <img src="/images/twitter.png" alt="twitter icon" valign="middle"> <a href="http://www.twitter.com/whatdotheyknow">Follow us on twitter</a> - <img src="/images/rss.png" alt="RSS icon" valign="middle"> <a href="http://www.mysociety.org/category/projects/whatdotheyknow/feed/">Subscribe to blog</a> + <img src="/images/twitter.png" alt="twitter icon" valign="middle"> <a href="http://www.twitter.com/<%= MySociety::Config.get('TWITTER_USERNAME') %>">Follow us on twitter</a> + <img src="/images/rss.png" alt="RSS icon" valign="middle"> <a href="<%= MySociety::Config.get('BLOG_FEED') %>">Subscribe to blog</a> <% if !@twitter_user.empty? %> <div id="twitter"> <script src="http://widgets.twimg.com/j/2/widget.js"></script> @@ -52,8 +52,5 @@ new TWTR.Widget({ </p> </div> <% end %> - <p> - <a href="http://www.mysociety.org/category/projects/whatdotheyknow/">All blog posts</a> - </p> </div> diff --git a/app/views/general/frontpage.rhtml b/app/views/general/frontpage.rhtml index 52b99affe..e8ab7849a 100644 --- a/app/views/general/frontpage.rhtml +++ b/app/views/general/frontpage.rhtml @@ -5,9 +5,7 @@ <% form_tag({:action => "search_redirect"}, {:id => "search_form"}) do %> <p> - <%= _('First, type in the <strong>name of the UK public authority</strong> you\'d - <br>like information from. <strong>By law, they have to respond</strong> - (<a href="%s">why?</a>).') % help_about_url %> + <%= render :partial => 'frontpage_intro_sentence' %> <br> <br> diff --git a/app/views/general/search.rhtml b/app/views/general/search.rhtml index 607631adb..cc522b367 100644 --- a/app/views/general/search.rhtml +++ b/app/views/general/search.rhtml @@ -116,8 +116,8 @@ <li><%= _("Enter words that you want to find separated by spaces, e.g. <strong>climbing lane</strong>") %></li> <li><%= _('Use OR (in capital letters) where you don\'t mind which word, e.g. <strong><code>commons OR lords</code></strong>') %> <li><%= _('Use quotes when you want to find an exact phrase, e.g. <strong><code>"Liverpool City Council"</code></strong>') %></li> - <li><%= _('<strong><code>status:</code></strong> to select based on the status or historical status of the request, see the <a href="%s">table of statuses</a> below.') % "#statuses" %></li> - <li><%= _('<strong><code>variety:</code></strong> to select type of thing to search for, see the <a href="%s">table of varieties</a> below.') % "#varieties" %></li> + <li><%= _('<strong><code>status:</code></strong> to select based on the status or historical status of the request, see the <a href="{{statuses_url}}">table of statuses</a> below.', :statuses_url => "#statuses") %></li> + <li><%= _('<strong><code>variety:</code></strong> to select type of thing to search for, see the <a href="{{varieties_url}}">table of varieties</a> below.', :varieties_url => "#varieties") %></li> <li><%= _('<strong><code>requested_from:home_office</code></strong> to search requests from the Home Office, typing the name as in the URL.')%></li> <li><%= _('<strong><code>requested_by:julian_todd</code></strong> to search requests made by Julian Todd, typing the name as in the URL.') %></li> <li><%= _('<strong><code>commented_by:tony_bowden</code></strong> to search annotations made by Tony Bowden, typing the name as in the URL.')%></li> @@ -127,33 +127,33 @@ <li><%= _('<strong><code>tag:charity</code></strong> to find all public bodies or requests with a given tag. You can include multiple tags, and tag values, e.g. <code>tag:openlylocal AND tag:financial_transaction:335633</code>. Note that by default any of the tags can be present, you have to put <code>AND</code> explicitly if you only want results them all present.')%></li> - <li><%= _('Read about <a href="%s">advanced search operators</a>, such as proximity and wildcards.') % "http://www.xapian.org/docs/queryparser.html" %></li> + <li><%= _('Read about <a href="{{advanced_search_url}}">advanced search operators</a>, such as proximity and wildcards.', :advanced_search_url => "http://www.xapian.org/docs/queryparser.html") %></li> </ul> <h2 id="statuses"><%= _('Table of statuses') %></h2> <table class="status_table"> - <tr><td><strong><%=search_link('status:waiting_response')%></strong></td><td> Waiting for the public authority to reply </td></tr> - <tr><td><strong><%=search_link('status:not_held')%></strong></td><td> The public authority does not have the information requested </td></tr> - <tr><td><strong><%=search_link('status:rejected')%></strong></td><td> The request was refused by the public authority </td></tr> - <tr><td><strong><%=search_link('status:partially_successful')%></strong></td><td> Some of the information requested has been received </td></tr> - <tr><td><strong><%=search_link('status:successful')%></strong></td><td> All of the information requested has been received </td></tr> - <tr><td><strong><%=search_link('status:waiting_clarification')%></strong></td><td> The public authority would like part of the request explained </td></tr> - <tr><td><strong><%=search_link('status:gone_postal')%></strong></td><td> The public authority would like to / has responded by post </td></tr> - <tr><td><strong><%=search_link('status:internal_review')%></strong></td><td> Waiting for the public authority to complete an internal review of their handling of the request</td></tr> - <tr><td><strong><%=search_link('status:error_message')%></strong></td><td> Received an error message, such as delivery failure.</td></tr> - <tr><td><strong><%=search_link('status:requires_admin')%></strong></td><td> A strange reponse, required attention by the WhatDoTheyKnow team </td></tr> - <tr><td><strong><%=search_link('status:user_withdrawn')%></strong></td><td> The requester has abandoned this request for some reason </td></tr> + <tr><td><strong><%=search_link('status:waiting_response')%></strong></td><td><%= _('Waiting for the public authority to reply') %></td></tr> + <tr><td><strong><%=search_link('status:not_held')%></strong></td><td><%= _('The public authority does not have the information requested') %></td></tr> + <tr><td><strong><%=search_link('status:rejected')%></strong></td><td><%= _('The request was refused by the public authority') %></td></tr> + <tr><td><strong><%=search_link('status:partially_successful')%></strong></td><td><%= _('Some of the information requested has been received') %></td></tr> + <tr><td><strong><%=search_link('status:successful')%></strong></td><td><%= _('All of the information requested has been received') %></td></tr> + <tr><td><strong><%=search_link('status:waiting_clarification')%></strong></td><td><%= _('The public authority would like part of the request explained') %></td></tr> + <tr><td><strong><%=search_link('status:gone_postal')%></strong></td><td><%= _('The public authority would like to / has responded by post') %></td></tr> + <tr><td><strong><%=search_link('status:internal_review')%></strong></td><td><%= _('Waiting for the public authority to complete an internal review of their handling of the request') %></td></tr> + <tr><td><strong><%=search_link('status:error_message')%></strong></td><td><%= _('Received an error message, such as delivery failure.') %></td></tr> + <tr><td><strong><%=search_link('status:requires_admin')%></strong></td><td><%= _('A strange reponse, required attention by the {{site_name}} team', :site_name=>site_name) %></td></tr> + <tr><td><strong><%=search_link('status:user_withdrawn')%></strong></td><td><%= _('The requester has abandoned this request for some reason') %></td></tr> </table> - <h2 id="varieties">Table of varieties</h2> + <h2 id="varieties"><%= _('Table of varieties') %></h2> <table class="status_table"> - <tr><td><strong><%=search_link('variety:sent')%></strong></td><td> Original request sent</td></tr> - <tr><td><strong><%=search_link('variety:followup_sent')%></strong></td><td> Follow up message sent by requester</td></tr> - <tr><td><strong><%=search_link('variety:response')%></strong></td><td> Response from a public authority </td></tr> - <tr><td><strong><%=search_link('variety:comment')%></strong></td><td> Annotation added to request</td></tr> - <tr><td><strong><%=search_link('variety:authority')%></strong></td><td> A public authority </td></tr> - <tr><td><strong><%=search_link('variety:user')%></strong></td><td> A WhatDoTheyKnow user </td></tr> + <tr><td><strong><%=search_link('variety:sent')%></strong></td><td><%= _('Original request sent') %></td></tr> + <tr><td><strong><%=search_link('variety:followup_sent')%></strong></td><td><%= _('Follow up message sent by requester') %></td></tr> + <tr><td><strong><%=search_link('variety:response')%></strong></td><td><%= _('Response from a public authority') %></td></tr> + <tr><td><strong><%=search_link('variety:comment')%></strong></td><td><%= _('Annotation added to request') %></td></tr> + <tr><td><strong><%=search_link('variety:authority')%></strong></td><td><%= _('A public authority') %></td></tr> + <tr><td><strong><%=search_link('variety:user')%></strong></td><td><%= _('A {{site_name}} user', :site_name=>site_name) %></td></tr> </table> <% end %> diff --git a/app/views/help/_why_they_should_reply_by_email.rhtml b/app/views/help/_why_they_should_reply_by_email.rhtml new file mode 100644 index 000000000..faaa2b2e2 --- /dev/null +++ b/app/views/help/_why_they_should_reply_by_email.rhtml @@ -0,0 +1,3 @@ +The law, the Ministry of Justice and the Information Commissioner all say that an email is sufficient (<a href="<%= help_page_url %>#full_address">more details</a>). + +At the bottom of this page, write a reply to the authority explaining this to them. diff --git a/app/views/help/about.rhtml b/app/views/help/about.rhtml index 648ca1fb2..b7fc51234 100644 --- a/app/views/help/about.rhtml +++ b/app/views/help/about.rhtml @@ -51,3 +51,49 @@ <div id="hash_link_padding"></div> </div> + +<dt id="purpose">What is <%= site_name %> for? <a href="#purpose">#</a> </dt> +<dd>To help you find out inside information about what the UK government +is doing. +</dd> + +<dt id="premise">How does the site work? <a href="#premise">#</a> </dt> +<dd>You choose the public authority that you would like information from, then +write a brief note describing what you want to know. We then send your request +to the public authority. Any response they make is automatically published on the +website for you and anyone else to find and read. +</dd> + +<dt id="whybother_me">Why would I bother to do this? <a href="#whybother_me">#</a> </dt> +<dd>You pay taxes, and then government does things with the money. All sorts of +things that affect your life, from healthcare through to national defence. Some +it does badly, some it does well. The more we find out about how government +works, the better able we are to make suggestions to improve the things that +are done badly, and to celebrate the things that are done well. +</dd> + +<dt id="whybother_them">Why would the public authority bother to reply? <a href="#whybother_them">#</a> </dt> +<dd>Under Freedom of Information (FOI) law, they have to respond. The response +will either contain the information you want, or give a valid legal reason why +it must be kept confidential. +</dd> + +<dt id="who">Who makes <%= site_name %>? <a href="#who">#</a> </dt> +<dd><%= site_name %> is created and run by <a href="http://www.mysociety.org">mySociety</a>, +and was initially <a href="http://www.mysociety.org/2006/12/06/funding-for-freedom-of-information/">funded by the JRSST Charitable Trust</a>. mySociety is a project of the +registered charity <a href="http://www.ukcod.org.uk/UK_Citizens_Online_Democracy">UK Citizens Online Democracy</a>. +If you like what we're doing, then you can +<a href="https://secure.mysociety.org/donate/">make a donation</a>. +</dd> + +<dt id="updates">How can I keep up with news about <%= site_name %>?<a href="#updates">#</a> </dt> +<dd>We have a <a href="/blog">blog</a> and a <a href="http://www.twitter.com/whatdotheyknow">twitter feed</a>. +</dd> + + +</dl> + +<p><strong>Next</strong>, read about <a href="/help/requesting">making requests</a> --> + + <div id="hash_link_padding"></div> +</div> diff --git a/app/views/help/privacy.rhtml b/app/views/help/privacy.rhtml index e7bb4cfca..d62afa45b 100644 --- a/app/views/help/privacy.rhtml +++ b/app/views/help/privacy.rhtml @@ -51,133 +51,133 @@ <a href="http://www.ico.gov.uk/upload/documents/library/freedom_of_information/detailed_specialist_guides/name_of_applicant_fop083_v1.pdf">guidance from the Information Commissioner</a> (January 2009). </p> - <p>However, the same guidance also says it is good practice for the public - authority to still consider a request made using an obvious pseudonym. - You should refer to this if a public authority refuses a request because you - used a pseudonym.</p> - - <p>Be careful though, even if the authority follows this good practice, the - pseudonym will probably make it impossible for you to complain to the - Information Commissioner later about the handling of your request. - </p> - - <p>There are several good alternatives to using a pseudonym.</p> - - <ul> - <li>Use a different form of your name. The guidance says - that "Mr Arthur Thomas Roberts" can make a valid request as "Arthur Roberts", - "A. T. Roberts", or "Mr Roberts", but <strong>not</strong> as "Arthur" or "A.T.R.". - </li> - <li>Women may use their maiden name.</li> - <li>In most cases, you may use any name by which you are "widely known and/or - is regularly used". - <li>Use the name of an organisation, the name of a company, the trading name of - a company, or the trading name of a sole trader. - <li>Ask someone else to make the request on your behalf. - <li>You may, if you are really stuck, ask us to make the request on - your behalf. Please <a href="/help/contact">contact us</a> with - a good reason why you cannot make the request yourself and cannot - ask a friend to. We don't have the resources to do this for everyone. - </ul> - - <p>Please do not try to impersonate someone else.</p> - - </dd> - - <dt id="full_address">They've asked for my postal address! <a href="#full_address">#</a> </dt> - - <dd> - <p>If a public authority asks you for your full, physical address, reply to them saying - that section 8.1.b of the FOI Act asks for an "address for correspondence", - and that the email address you are using is sufficient. - </p> - <p> - The Ministry of Justice has <a href="http://www.justice.gov.uk/guidance/foi-procedural-what.htm">guidance - on this</a> – - <em>"As well as hard copy written correspondence, requests that are - transmitted electronically (for example, in emails) are acceptable - ... If a request is received by email and no postal address is given, the email - address should be treated as the return address." - </em> - </p> - <p>As if that isn't enough, the Information Commissioner's - <a href="http://www.ico.gov.uk/upload/documents/library/freedom_of_information/practical_application/foi_hints_for_practitioners_handing_foi_and_eir_requests_2008_final.pdf">Hints for Practitioners</a> say - <em>"Any correspondence could include a request for information. If it is written (this includes e-mail), legible, gives the name of the applicant, an address for reply (which could be electronic), and includes a description of the information required, then it will fall within the scope of the legislation."</em> - </p> - </dd> - - <dt id="postal_answer">No no, they need a postal address to send a paper response! <a href="#postal_answer">#</a> </dt> - - <dd> - <p>If an authority only has a paper copy of the information that you want, - they may ask you for a postal address. To start with, try persuading them - to scan in the documents for you. You can even <a href="http://www.whatdotheyknow.com/request/car_parking_charges_policy_and_a#outgoing-532">offer to gift them a scanner</a>, which in that particular case - embarrassed the authority into finding one they had already.</p> - - <p>If that doesn't work, and you want to provide your postal address privately - in order to receive the documents, mark your request as "They are going to reply by post", and it will - give you an email address to use for that purpose.</p> - </dd> - - <dt id="delete_requests">Can you delete my requests, or alter my name? <a href="#delete_requests">#</a> </dt> - - <dd> - - <p>WhatDoTheyKnow is a permanent, public archive of Freedom of - Information requests. Even though you may not find the response to - a request useful any more, it may be of interest to others. For this - reason, we will not delete requests. - </p> - - <p>Under exceptional circumstances we may remove or change your name - on the website, <a href="#takedown">see the next question</a>. - Similarly, we may also remove other personal information. - </p> - - <p>If you're worried about this before you make your request, - see the section on <a href="#real_name">pseudonyms</a>.</p> - - </dd> - - <dt id="takedown">Can you take down personal information about me? <a href="#takedown">#</a> </dt> - - <dd> - - <p>If you see any personal information about you on the site which you'd like - us to remove or hide, then please <a href="/help/contact">let us know</a>. - Specify exactly what information you believe to be problematic and why, and - where it appears on the site.</p> - - <p>If it is sensitive personal information that has been accidentally - posted, then we will usually remove it. Normally we will only consider - requests to remove personal information which come from the individual - concerned, but for sensitive information we would appreciate anyone - pointing out anything they see.</p> - - <p>We consider that there is a strong public interest in - retaining the names of officers or servants of public authorities. We will only - remove such names in exceptional circumstances, such as where the disclosure of - a name and position of employment would substantially risk an individual's - safety. If you are such an official and you wish to have your name removed for - such an urgent reason, you must supply us with a request to do so from your - line manager. This request must demonstrate that a risk has been perceived - which outweighs the public interest, and must demonstrate that efforts have - been made to conceal the name on the organisation's own website.</p> - - <p>For all other requests we apply a public interest test to decide - whether information should be removed. - <a href="http://www.statutelaw.gov.uk/content.aspx?ActiveTextDocId=3190650"> Section 32</a> - of the Data Protection Act 1998 permits us to do this, as the material we - publish is journalistic. We cannot easily edit many types of attachments (such - as PDFs, or Microsoft Word or Excel files), so we will usually ask - that authorities resend these with the personal information removed.</p> - - </dd> - - - </dl> - - <p><strong>Learn more</strong> from the help for <a href="/help/officers">FOI officers</a> --> +<p>However, the same guidance also says it is good practice for the public +authority to still consider a request made using an obvious pseudonym. +You should refer to this if a public authority refuses a request because you +used a pseudonym.</p> + +<p>Be careful though, even if the authority follows this good practice, the +pseudonym will probably make it impossible for you to complain to the +Information Commissioner later about the handling of your request. +</p> + +<p>There are several good alternatives to using a pseudonym.</p> + +<ul> +<li>Use a different form of your name. The guidance says +that "Mr Arthur Thomas Roberts" can make a valid request as "Arthur Roberts", +"A. T. Roberts", or "Mr Roberts", but <strong>not</strong> as "Arthur" or "A.T.R.". +</li> +<li>Women may use their maiden name.</li> +<li>In most cases, you may use any name by which you are "widely known and/or +is regularly used". +<li>Use the name of an organisation, the name of a company, the trading name of +a company, or the trading name of a sole trader. +<li>Ask someone else to make the request on your behalf. +<li>You may, if you are really stuck, ask us to make the request on +your behalf. Please <a href="/help/contact">contact us</a> with +a good reason why you cannot make the request yourself and cannot +ask a friend to. We don't have the resources to do this for everyone. +</ul> + +<p>Please do not try to impersonate someone else.</p> + +</dd> + +<dt id="full_address">They've asked for my postal address! <a href="#full_address">#</a> </dt> + +<dd> +<p>If a public authority asks you for your full, physical address, reply to them saying +that section 8.1.b of the FOI Act asks for an "address for correspondence", +and that the email address you are using is sufficient. +</p> +<p> +The Ministry of Justice has <a href="http://www.justice.gov.uk/guidance/foi-procedural-what.htm">guidance +on this</a> – +<em>"As well as hard copy written correspondence, requests that are +transmitted electronically (for example, in emails) are acceptable +... If a request is received by email and no postal address is given, the email +address should be treated as the return address." +</em> +</p> +<p>As if that isn't enough, the Information Commissioner's +<a href="http://www.ico.gov.uk/upload/documents/library/freedom_of_information/practical_application/foi_hints_for_practitioners_handing_foi_and_eir_requests_2008_final.pdf">Hints for Practitioners</a> say +<em>"Any correspondence could include a request for information. If it is written (this includes e-mail), legible, gives the name of the applicant, an address for reply (which could be electronic), and includes a description of the information required, then it will fall within the scope of the legislation."</em> +</p> +</dd> + +<dt id="postal_answer">No no, they need a postal address to send a paper response! <a href="#postal_answer">#</a> </dt> + +<dd> +<p>If an authority only has a paper copy of the information that you want, +they may ask you for a postal address. To start with, try persuading them +to scan in the documents for you. You can even <a href="http://www.whatdotheyknow.com/request/car_parking_charges_policy_and_a#outgoing-532">offer to gift them a scanner</a>, which in that particular case +embarrassed the authority into finding one they had already.</p> + +<p>If that doesn't work, and you want to provide your postal address privately +in order to receive the documents, mark your request as "They are going to reply by post", and it will +give you an email address to use for that purpose.</p> +</dd> + +<dt id="delete_requests">Can you delete my requests, or alter my name? <a href="#delete_requests">#</a> </dt> + +<dd> + +<p><%= site_name %> is a permanent, public archive of Freedom of +Information requests. Even though you may not find the response to +a request useful any more, it may be of interest to others. For this +reason, we will not delete requests. +</p> + +<p>Under exceptional circumstances we may remove or change your name +on the website, <a href="#takedown">see the next question</a>. +Similarly, we may also remove other personal information. +</p> + +<p>If you're worried about this before you make your request, +see the section on <a href="#real_name">pseudonyms</a>.</p> + +</dd> + +<dt id="takedown">Can you take down personal information about me? <a href="#takedown">#</a> </dt> + +<dd> + +<p>If you see any personal information about you on the site which you'd like +us to remove or hide, then please <a href="/help/contact">let us know</a>. +Specify exactly what information you believe to be problematic and why, and +where it appears on the site.</p> + +<p>If it is sensitive personal information that has been accidentally +posted, then we will usually remove it. Normally we will only consider +requests to remove personal information which come from the individual +concerned, but for sensitive information we would appreciate anyone +pointing out anything they see.</p> + +<p>We consider that there is a strong public interest in +retaining the names of officers or servants of public authorities. We will only +remove such names in exceptional circumstances, such as where the disclosure of +a name and position of employment would substantially risk an individual's +safety. If you are such an official and you wish to have your name removed for +such an urgent reason, you must supply us with a request to do so from your +line manager. This request must demonstrate that a risk has been perceived +which outweighs the public interest, and must demonstrate that efforts have +been made to conceal the name on the organisation's own website.</p> + +<p>For all other requests we apply a public interest test to decide +whether information should be removed. +<a href="http://www.statutelaw.gov.uk/content.aspx?ActiveTextDocId=3190650"> Section 32</a> +of the Data Protection Act 1998 permits us to do this, as the material we +publish is journalistic. We cannot easily edit many types of attachments (such +as PDFs, or Microsoft Word or Excel files), so we will usually ask +that authorities resend these with the personal information removed.</p> + +</dd> + + +</dl> + +<p><strong>Learn more</strong> from the help for <a href="/help/officers">FOI officers</a> --> <div id="hash_link_padding"></div> </div> diff --git a/app/views/help/unhappy.rhtml b/app/views/help/unhappy.rhtml index 432c00f2e..86ded2e59 100644 --- a/app/views/help/unhappy.rhtml +++ b/app/views/help/unhappy.rhtml @@ -31,7 +31,7 @@ to your request '<%=request_link(@info_request) %>'? <% if !@info_request.nil? %> Choose <%= link_to "request an internal review", show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup" %> and then write a message asking the authority to review your request. <% else %> - At the bottom of the relevant request page on WhatDoTheyKnow choose + At the bottom of the relevant request page on <%= site_name %> choose "request an internal review". Then write a message asking for an internal review of your request. You may want to include a link to the request page, to make it clear which request you are talking about. @@ -64,12 +64,12 @@ Information Commissioner, either include a link to your request <strong><%=h main_url(request_url(@info_request)) %></strong> <% else %> - include a link to your request on WhatDoTheyKnow + include a link to your request on <%= site_name %> <% end %> in your complaint or print out the whole page of your request and all attachments. </p> -<p>WhatDoTheyKnow has no special facilities for handling a request at this stage - it +<p><%= site_name %> has no special facilities for handling a request at this stage - it passes into the Information Commissioner's system. You can leave annotations on your request keeping people informed of progress.</p> diff --git a/app/views/layouts/admin.rhtml b/app/views/layouts/admin.rhtml index 5fe75fc97..f0e9a7019 100644 --- a/app/views/layouts/admin.rhtml +++ b/app/views/layouts/admin.rhtml @@ -2,7 +2,7 @@ <html lang="en-gb"> <head> <meta http-equiv="content-type" content="text/html;charset=UTF-8" > - <title>WhatDoTheyKnow admin<%= @title ? ":" : "" %> <%=@title%></title> + <title><%= site_name %> admin<%= @title ? ":" : "" %> <%=@title%></title> <%= stylesheet_link_tag 'admin', :title => "Main", :rel => "stylesheet" %> </head> <body> diff --git a/app/views/outgoing_mailer/initial_request.rhtml b/app/views/outgoing_mailer/initial_request.rhtml index 13b356c6e..83e5b794b 100644 --- a/app/views/outgoing_mailer/initial_request.rhtml +++ b/app/views/outgoing_mailer/initial_request.rhtml @@ -5,7 +5,7 @@ <%= _('Please use this email address for all replies to this request:')%> <%= @info_request.incoming_email %> -<%= _('Is {{email_address}} the wrong address for {{type_of_request}} requests tp {{public_body_name}}? If so, please contact us using this form:', :email_address => @info_request.public_body.request_email, :type_of_request => @info_request.law_used_full, :public_body_name => @info_request.public_body.name)%> +<%= _('Is {{email_address}} the wrong address for {{type_of_request}} requests to {{public_body_name}}? If so, please contact us using this form:', :email_address => @info_request.public_body.request_email, :type_of_request => @info_request.law_used_full, :public_body_name => @info_request.public_body.name)%> <%= render :partial => 'followup_footer' %> diff --git a/app/views/public_body/_body_listing_single.rhtml b/app/views/public_body/_body_listing_single.rhtml index 97cfd2e71..7637a1077 100644 --- a/app/views/public_body/_body_listing_single.rhtml +++ b/app/views/public_body/_body_listing_single.rhtml @@ -9,7 +9,7 @@ <span class="desc"> <% if !public_body.short_name.empty? || !public_body.notes_without_html.empty? %> <% if !public_body.short_name.empty? %> - Also called <%=highlight_words(public_body.short_name, @highlight_words) %>. + <%= _("Also called {{other_name}}.", :other_name => highlight_words(public_body.short_name, @highlight_words)) %> <% end %> <% if !public_body.notes_without_html.empty? %> <%= highlight_and_excerpt(public_body.notes_without_html, @highlight_words, 150) %> @@ -18,12 +18,12 @@ <% end %> </span> <span class="bottomline"> - <%= pluralize(public_body.info_requests.size, "request") %> made. + <%= n_('%d request made.', '%d requests made.', public_body.info_requests.size) % public_body.info_requests.size %> <% if !@include_request_link_in_authority_listing.nil? %> <%= link_to _("Make your own request"), public_body_url(public_body) %>. <% end %> <br> - Added on <%= simple_date(public_body.created_at) %>. + <%= _("Added on {{date}}", :date => simple_date(public_body.created_at)) %>. </span> </div> diff --git a/app/views/public_body/show.rhtml b/app/views/public_body/show.rhtml index 69be52160..cfdf37935 100644 --- a/app/views/public_body/show.rhtml +++ b/app/views/public_body/show.rhtml @@ -78,7 +78,7 @@ <% if @public_body.eir_only? %> <%= pluralize(@public_body.info_requests.size, "Environmental Information Regulations request made using this site") %> <% else %> - <%= n_('%d Freedom of Information request', '%d Freedom of Information requests', @public_body.info_requests.size) % @public_body.info_requests.size %> made using this site + <%= n_('%d Freedom of Information request made using this site', '%d Freedom of Information requests made using this site', @public_body.info_requests.size) % @public_body.info_requests.size %> <% end %> <%= @page_desc %> </h2> diff --git a/app/views/public_body/view_email.rhtml b/app/views/public_body/view_email.rhtml index d6c8d85fe..50601069f 100644 --- a/app/views/public_body/view_email.rhtml +++ b/app/views/public_body/view_email.rhtml @@ -4,7 +4,7 @@ <p> <% if @public_body.is_requestable? %> -<%= _('WhatDoTheyKnow sends new requests to <strong>{{request_email}}</strong> for this authority.',:request_email=> h(@public_body.request_email))%> +<%= _('{{site_name}} sends new requests to <strong>{{request_email}}</strong> for this authority.', :site_name=>site_name, :request_email=> h(@public_body.request_email))%> <% else %> <% if @public_body.not_requestable_reason == 'not_apply' %> <p><%= _('Freedom of Information law no longer applies to this authority.Follow up messages to existing requests are sent to ')%><strong><%=h @public_body.request_email%></strong>. diff --git a/app/views/request/_describe_state.rhtml b/app/views/request/_describe_state.rhtml index 052833a67..71699835c 100644 --- a/app/views/request/_describe_state.rhtml +++ b/app/views/request/_describe_state.rhtml @@ -4,7 +4,7 @@ <h2><%= _('What best describes the status of this request now?') %></h2> <hr> <!------------------------------------------------> - <h3>This request is still in progress:</h3> + <h3><%= _('This request is still in progress:') %></h3> <% if @info_request.described_state != 'internal_review' %> <div> <%= radio_button "incoming_message", "described_state", "waiting_response", :id => 'waiting_response' + id_suffix %> @@ -41,7 +41,7 @@ <%= render :partial => 'general/custom_state_transitions_pending', :locals => {:id_suffix => id_suffix } %> <hr> <!------------------------------------------------> - <h3>This particular request is finished:</h3> + <h3><%= _('This particular request is finished:') %></h3> <% if @info_request.described_state == 'internal_review' %> <p><%= _('The <strong>review has finished</strong> and overall:') %></p> @@ -68,7 +68,7 @@ <hr> <!------------------------------------------------> - <h3>Other:</h3> + <h3><%= _('Other:') %></h3> <div> <%= radio_button "incoming_message", "described_state", "error_message", :id => 'error_message' + id_suffix %> diff --git a/app/views/request/_other_describe_state.rhtml b/app/views/request/_other_describe_state.rhtml index 1c88f97f8..e274fe8c9 100644 --- a/app/views/request/_other_describe_state.rhtml +++ b/app/views/request/_other_describe_state.rhtml @@ -7,7 +7,7 @@ Thanks.') %></h2> <hr> <!------------------------------------------------> - <h3>This request is still in progress:</h3> + <h3><%= _('This request is still in progress:') %></h3> <% if @info_request.described_state != 'internal_review' %> <div> <%= radio_button "incoming_message", "described_state", "waiting_response", :id => 'waiting_response' + id_suffix %> @@ -37,7 +37,7 @@ <%= render :partial => 'general/custom_state_transitions_pending', :locals => {:id_suffix => id_suffix } %> <hr> <!------------------------------------------------> - <h3>This particular request is finished:</h3> + <h3><%= _('This particular request is finished:') %></h3> <% if @info_request.described_state == 'internal_review' %> <p><%= _('The <strong>review has finished</strong> and overall:') %></p> diff --git a/app/views/request/_view_html_prefix.rhtml b/app/views/request/_view_html_prefix.rhtml index f425735cd..b29830ac7 100644 --- a/app/views/request/_view_html_prefix.rhtml +++ b/app/views/request/_view_html_prefix.rhtml @@ -1,6 +1,6 @@ <div class="view_html_prefix"> <div class="view_html_logo"> - <a href="/"><img src="/images/navimg/logo-trans-small.png" alt="WhatDotheyKnow?"></a> + <a href="/"><img src="/images/navimg/logo-trans-small.png" alt="<%= site_name %>"></a> </div> <div class="view_html_download_link"> <%=link_to _("Download original attachment"), @attachment_url %> diff --git a/app/views/request/details.rhtml b/app/views/request/details.rhtml index 94d87306d..d4c63902f 100644 --- a/app/views/request/details.rhtml +++ b/app/views/request/details.rhtml @@ -4,17 +4,17 @@ <h2><%= _('Event history') %></h2> <p><%= _('This table shows the technical details of the internal events that happened -to this request on WhatDoTheyKnow. This could be used to generate information about +to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests -which require a postal response and much more.') %> +which require a postal response and much more.', :site_name=>site_name) %> </p> <p><%= _('<strong>Caveat emptor!</strong> To use this data in an honourable way, you will need -a good internal knowledge of user behaviour on WhatDoTheyKnow. How, +a good internal knowledge of user behaviour on {{site_name}}. How, why and by whom requests are categorised is not straightforward, and there will be user error and ambiguity. You will also need to understand FOI law, and the way authorities use it. Plus you\'ll need to be an elite statistician. Please -<a href="%s">contact us</a> with questions.') % [help_contact_path] %> +<a href="{{contact_path}}">contact us</a> with questions.', :site_name=>site_name, :contact_path=>help_contact_path) %> </p> <% columns = ['id', 'event_type', 'created_at', 'described_state', 'calculated_state', 'last_described_at' ] %> @@ -49,11 +49,12 @@ way authorities use it. Plus you\'ll need to be an elite statistician. Please <p> <%= _('Here <strong>described</strong> means when a user selected a status for the request, and the most recent event had its status updated to that value. <strong>calculated</strong> is then inferred by -WhatDoTheyKnow for intermediate events, which weren\'t given an explicit -description by a user. See the <a href="%s">search tips</a> for description of the states.') % [search_redirect_path] %> +{{site_name}} for intermediate events, which weren\'t given an explicit +description by a user. See the <a href="{{search_path}}">search tips</a> for description of the states.', +:site_name=>site_name, :search_path=>search_redirect_path) %> </p> <p> <%= _('You can get this page in computer-readable format as part of the main JSON -page for the request. See the <a href="%s">API documentation</a>.') % [help_api_path] %> +page for the request. See the <a href="{{api_path}}">API documentation</a>.', :api_path=>help_api_path) %> </p> diff --git a/app/views/request/new_bad_contact.rhtml b/app/views/request/new_bad_contact.rhtml index 41a2cef4d..56f3f4168 100644 --- a/app/views/request/new_bad_contact.rhtml +++ b/app/views/request/new_bad_contact.rhtml @@ -3,8 +3,8 @@ <h1><%=@title%></h1> <p><%= _('Unfortunately, we do not have a working {{info_request_law_used_full}} -address for'),:info_request_law_used_full => @info_request.law_used_full %> <%=h @info_request.public_body.name %>. <%= _('You may be able to find +address for', :info_request_law_used_full => @info_request.law_used_full) %> <%=h @info_request.public_body.name %>. <%= _('You may be able to find one on their website, or by phoning them up and asking. If you manage -to find one, then please <a href="%s">send it to us</a>.') % [help_contact_path] %> +to find one, then please <a href="{{help_url}}">send it to us</a>.', :help_url => help_contact_path) %> </p> diff --git a/app/views/request/show.rhtml b/app/views/request/show.rhtml index 1993ee6b2..2897a3564 100644 --- a/app/views/request/show.rhtml +++ b/app/views/request/show.rhtml @@ -110,9 +110,9 @@ <% elsif @status == 'internal_review' %> <%= _('Waiting for an <strong>internal review</strong> by {{public_body_link}} of their handling of this request.',:public_body_link=>public_body_link(@info_request.public_body)) %> <% elsif @status == 'error_message' %> - <%= _('There was a <strong>delivery error</strong> or similar, which needs fixing by the WhatDoTheyKnow team.') %> + <%= _('There was a <strong>delivery error</strong> or similar, which needs fixing by the {{site_name}} team.', :site_name=>site_name) %> <% elsif @status == 'requires_admin' %> - <%= _('This request has had an unusual response, and <strong>requires attention</strong> from the WhatDoTheyKnow team.') %> + <%= _('This request has had an unusual response, and <strong>requires attention</strong> from the {{site_name}} team.', :site_name=>site_name) %> <% elsif @status == 'user_withdrawn' %> <%= _('This request has been <strong>withdrawn</strong> by the person who made it. There may be an explanation in the correspondence below.') %> diff --git a/app/views/request/show_response.rhtml b/app/views/request/show_response.rhtml index 40c3b3d5b..d8647d1ec 100644 --- a/app/views/request/show_response.rhtml +++ b/app/views/request/show_response.rhtml @@ -19,9 +19,7 @@ address</strong>, not just an email, for it to be a valid FOI request') %> </dt> <dd> - <%= _('The law, the Ministry of Justice and the Information Commissioner - all say that an email is sufficient (<a href="%s">more details</a>). - At the bottom of this page, write a reply to the authority explaining this to them.') % [help_privacy_path + '#full_address'] %> + <%= render :partial => 'help/why_they_should_reply_by_email', :locals => {:help_page_url => help_privacy_path } %> </dd> <dt> diff --git a/app/views/request_mailer/comment_on_alert.rhtml b/app/views/request_mailer/comment_on_alert.rhtml index 46cee3b1a..691e6f9bb 100644 --- a/app/views/request_mailer/comment_on_alert.rhtml +++ b/app/views/request_mailer/comment_on_alert.rhtml @@ -3,4 +3,4 @@ request. Follow this link to see what they wrote.',:user_name=>@comment.user.nam <%=@url%> --- <%= _('the WhatDoTheyKnow team') %> +-- <%= _('the {{site_name}} team', :site_name=>site_name) %> diff --git a/app/views/request_mailer/comment_on_alert_plural.rhtml b/app/views/request_mailer/comment_on_alert_plural.rhtml index 3871a9598..a495b8e08 100644 --- a/app/views/request_mailer/comment_on_alert_plural.rhtml +++ b/app/views/request_mailer/comment_on_alert_plural.rhtml @@ -2,6 +2,6 @@ <%=@url%> --- <%= _('the WhatDoTheyKnow team') %> +-- <%= _('the {{site_name}} team', :site_name=>site_name) %> diff --git a/app/views/request_mailer/new_response.rhtml b/app/views/request_mailer/new_response.rhtml index c3e979cd6..083f873b4 100644 --- a/app/views/request_mailer/new_response.rhtml +++ b/app/views/request_mailer/new_response.rhtml @@ -12,6 +12,6 @@ contains any useful information.' )%> <%= _('Although all responses are automatically published, we depend on you, the original requester, to evaluate them.')%> --- <%= _('the WhatDoTheyKnow team') %> +-- <%= _('the {{site_name}} team', :site_name=>site_name) %> diff --git a/app/views/request_mailer/new_response_reminder_alert.rhtml b/app/views/request_mailer/new_response_reminder_alert.rhtml index cde7851db..5f07e8559 100644 --- a/app/views/request_mailer/new_response_reminder_alert.rhtml +++ b/app/views/request_mailer/new_response_reminder_alert.rhtml @@ -5,6 +5,6 @@ <%= _('Your request was called {{info_request}}. Letting everyone know whether you got the information will help us keep tabs on',:info_request=>@info_request.title)%> <%= @info_request.public_body.name %>. --- <%= _('the WhatDoTheyKnow team') %> +-- <%= _('the {{site_name}} team', :site_name=>site_name) %> diff --git a/app/views/request_mailer/not_clarified_alert.rhtml b/app/views/request_mailer/not_clarified_alert.rhtml index 2e6cf6a05..82d15ba76 100644 --- a/app/views/request_mailer/not_clarified_alert.rhtml +++ b/app/views/request_mailer/not_clarified_alert.rhtml @@ -6,4 +6,4 @@ <%= _('You will only get an answer to your request if you follow up with the clarification.')%> --- <%= _('the WhatDoTheyKnow team') %> +-- <%= _('the {{site_name}} team', :site_name=>site_name) %> diff --git a/app/views/request_mailer/old_unclassified_updated.rhtml b/app/views/request_mailer/old_unclassified_updated.rhtml index afaa0cf1c..5b8534832 100644 --- a/app/views/request_mailer/old_unclassified_updated.rhtml +++ b/app/views/request_mailer/old_unclassified_updated.rhtml @@ -5,5 +5,5 @@ <%= @url %> --- <%= _('the WhatDoTheyKnow team') %> +-- <%= _('the {{site_name}} team', :site_name=>site_name) %> diff --git a/app/views/request_mailer/overdue_alert.rhtml b/app/views/request_mailer/overdue_alert.rhtml index 70b6ffcf1..b8a9ba525 100644 --- a/app/views/request_mailer/overdue_alert.rhtml +++ b/app/views/request_mailer/overdue_alert.rhtml @@ -6,6 +6,6 @@ <%=@url%> --- <%= _('the WhatDoTheyKnow team') %> +-- <%= _('the {{site_name}} team', :site_name=>site_name) %> diff --git a/app/views/request_mailer/stopped_responses.rhtml b/app/views/request_mailer/stopped_responses.rhtml index eb53cee1c..9cd156860 100644 --- a/app/views/request_mailer/stopped_responses.rhtml +++ b/app/views/request_mailer/stopped_responses.rhtml @@ -13,7 +13,7 @@ email {{contact_email}} for help.',:user=>@info_request.user.name,:contact_email <%= _('Your original message is attached.')%> --- <%= _('the WhatDoTheyKnow team') %> +-- <%= _('the {{site_name}} team', :site_name=>site_name) %> diff --git a/app/views/request_mailer/very_overdue_alert.rhtml b/app/views/request_mailer/very_overdue_alert.rhtml index e61b3a206..6abd198a0 100644 --- a/app/views/request_mailer/very_overdue_alert.rhtml +++ b/app/views/request_mailer/very_overdue_alert.rhtml @@ -8,4 +8,4 @@ review, asking them to find out why response to the request has been so slow.',: <%=@url%> --- <%= _('the WhatDoTheyKnow team') %> +-- <%= _('the {{site_name}} team', :site_name=>site_name) %> diff --git a/app/views/track_mailer/event_digest.rhtml b/app/views/track_mailer/event_digest.rhtml index df27a5cbd..46f230da1 100644 --- a/app/views/track_mailer/event_digest.rhtml +++ b/app/views/track_mailer/event_digest.rhtml @@ -63,4 +63,4 @@ Please click on the link below to cancel or alter these emails. <%=@unsubscribe_url%> --- the WhatDoTheyKnow team +-- <%= _('the {{site_name}} team', :site_name=>site_name) %> diff --git a/app/views/user/_signin.rhtml b/app/views/user/_signin.rhtml index c6661696e..79628b3a9 100644 --- a/app/views/user/_signin.rhtml +++ b/app/views/user/_signin.rhtml @@ -4,7 +4,7 @@ <%= foi_error_messages_for :user_signin %> <% if not sign_in_as_existing_user %> - <h2><%= _('If you\'ve used WhatDoTheyKnow before')%></h2> + <h2><%= _('If you\'ve used {{site_name}} before', :site_name=>site_name)%></h2> <% end %> <p> diff --git a/app/views/user/_signup.rhtml b/app/views/user/_signup.rhtml index 70120bc5f..6b0a1f8c7 100644 --- a/app/views/user/_signup.rhtml +++ b/app/views/user/_signup.rhtml @@ -3,7 +3,7 @@ <% form_tag({:action => "signup"}, {:id => "signup_form"}) do %> <%= foi_error_messages_for :user_signup %> - <h2><%= _('If you\'re new to WhatDoTheyKnow')%></h2> + <h2><%= _('If you\'re new to {{site_name}}', :site_name=>site_name)%></h2> <p> <label class="form_label" for="user_signup_email"><%= _('Your e-mail:')%></label> diff --git a/app/views/user/set_crop_profile_photo.rhtml b/app/views/user/set_crop_profile_photo.rhtml index 33b78e193..db18d10a1 100644 --- a/app/views/user/set_crop_profile_photo.rhtml +++ b/app/views/user/set_crop_profile_photo.rhtml @@ -33,7 +33,7 @@ <%= hidden_field_tag 'draft_profile_photo_id', @draft_profile_photo.id %> <p><%= _('<strong>Privacy note:</strong> Your photo will be shown in public on the Internet, - wherever you do something on WhatDoTheyKnow.')%> + wherever you do something on {{site_name}}.', :site_name=>site_name)%> <p> <%= hidden_field_tag 'submitted_crop_profile_photo', 1 %> diff --git a/app/views/user/set_draft_profile_photo.rhtml b/app/views/user/set_draft_profile_photo.rhtml index b6a39df5e..70d27074b 100644 --- a/app/views/user/set_draft_profile_photo.rhtml +++ b/app/views/user/set_draft_profile_photo.rhtml @@ -16,7 +16,7 @@ <ul> <li><%= _('Your photo will be shown in public <strong>on the Internet</strong>, - wherever you do something on WhatDoTheyKnow.')%> + wherever you do something on {{site_name}}.', :site_name=>site_name)%> </li> <li><%= _('Please don\'t upload offensive pictures. We will take down images diff --git a/app/views/user/set_profile_about_me.rhtml b/app/views/user/set_profile_about_me.rhtml index aa53d6720..6c1edc254 100644 --- a/app/views/user/set_profile_about_me.rhtml +++ b/app/views/user/set_profile_about_me.rhtml @@ -1,4 +1,4 @@ -<% @title = _('Change the text about you on your profile at WhatDoTheyKnow.com') %> +<% @title = _('Change the text about you on your profile at {{site_name}}', :site_name=>site_name) %> <% raise _('internal error') if not @user %> @@ -11,8 +11,8 @@ <%= _(' What are you investigating using Freedom of Information? ')%> </p> <p> - <%= _(' This will appear on your WhatDoTheyKnow profile, to make it - easier for others to get involved with what you\'re doing.')%> + <%= _(' This will appear on your {{site_name}} profile, to make it + easier for others to get involved with what you\'re doing.', :site_name=>site_name)%> </p> </div> @@ -26,7 +26,7 @@ <%= _(' Include relevant links, such as to a campaign page, your blog or a twitter account. They will be made clickable. e.g.')%> - <a href="http://www.twitter.com/whatdotheyknow">http://www.twitter.com/whatdotheyknow</a> + <a href="http://www.twitter.com/<%= MySociety::Config.get('TWITTER_USERNAME') %>">http://www.twitter.com/<%= MySociety::Config.get('TWITTER_USERNAME') %></a> </p> </div> diff --git a/app/views/user/show.rhtml b/app/views/user/show.rhtml index 09bf3de5f..8fd6c52ad 100644 --- a/app/views/user/show.rhtml +++ b/app/views/user/show.rhtml @@ -59,7 +59,7 @@ <h1> <%= h(@display_user.name) + (@is_you ? _(" (you)") : "") %></h1> <p class="subtitle"> - <%= _('Joined WhatDoTheyKnow in') %> <%= year_from_date(@display_user.created_at) %> + <%= _('Joined {{site_name}} in', :site_name=>site_name) %> <%= year_from_date(@display_user.created_at) %> <% if !@user.nil? && @user.admin_page_links? %> (<%= link_to "admin", user_admin_url(@display_user) %>) <% end %> @@ -76,7 +76,7 @@ <div id="user_public_banned"> <p> <strong> - <%= _('This user has been banned from WhatDoTheyKnow.com ')%> + <%= _('This user has been banned from {{site_name}} ', :site_name=>site_name)%> </strong> </p> <p> @@ -110,22 +110,19 @@ <% if not @is_you %> <p id="user_not_logged_in"> - <%= link_to _('Sign in'), signin_url(:r => request.request_uri) %><%= _('to change password, - subscriptions and more')%> (<%=h @display_user.name %> <%= _('only')%>) + <%= _('<a href="%s">Sign in</a> to change password, subscriptions and more ({{user_name}} only)',:user_name=>h(@display_user.name)) % [signin_url(:r => request.request_uri)]%> </p> <% end %> <% if !@xapian_requests.nil? %> <% if @xapian_requests.results.empty? %> <% if @page == 1 %> - <h2 id="foi_requests"><%= _('Freedom of Information requests made by')%> <%= @is_you ? 'you' : 'this person' %> </h2> - <p><%= @is_you ? _('You have') : _('This person has') %> - <%= _(' made no Freedom of Information requests using this site.')%></p> + <h2 id="foi_requests"><%= @is_you ? 'Freedom of Information requests made by you' : 'Freedom of Information requests made by this person' %> </h2> + <p><%= @is_you ? _('You have made no Freedom of Information requests using this site.') : _('This person has made no Freedom of Information requests using this site.') %> <% end %> <% else %> <h2 id="foi_requests"> - <%= @is_you ? 'Your ' : "This person's " %> - <%=pluralize(@display_user.info_requests.size, _('Freedom of Information request')) %> + <%= @is_you ? n_('Your %d Freedom of Information request', 'Your %d Freedom of Information requests', @display_user.info_requests.size) % @display_user.info_requests.size : n_('This person\'s %d Freedom of Information request', 'This person\'s %d Freedom of Information requests', @display_user.info_requests.size) % @display_user.info_requests.size %> <!-- matches_estimated <%=@xapian_requests.matches_estimated%> --> <%= @page_desc %> </h2> @@ -137,21 +134,20 @@ <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @display_user.info_requests.size) %> <% end %> <% else %> - <h2 id="foi_requests"><%= _('Freedom of Information requests made by')%> <%= @is_you ? _('you') : _('this person') %> </h2> + <h2 id="foi_requests"><%= @is_you ? _('Freedom of Information requests made by you') : _('Freedom of Information requests made by this person') %> </h2> <p><%= _('The search index is currently offline, so we can\'t show the Freedom of Information requests this person has made.')%></p> <% end %> <% if !@xapian_comments.nil? %> <% if @xapian_comments.results.empty? %> <% if @page == 1 %> - <h2><%= @is_you ? 'Your' : 'This person\'s' %> <%= _('annotations')%> </h2> - <p>None made.</p> + <h2><%= @is_you ? _('Your annotations') : _('This person\'s annotations') %></h2> + <p><%= _('None made.')%></p> <% end %> <% else %> <h2 id="annotations"> - <%= @is_you ? _('Your ') : _('This person\'s') %> - <%=pluralize(@display_user.visible_comments.size, _('annotation')) %> - <!-- matches_estimated <%=@xapian_comments.matches_estimated%> --> + <%= @is_you ? n_('Your %d annotation', 'Your %d annotations', @display_user.visible_comments.size) % @display_user.visible_comments.size : n_('This person\'s %d annotation', 'This person\'s %d annotations', @display_user.visible_comments.size) % @display_user.visible_comments.size %> + <!-- matches_estimated <%=@xapian_comments.matches_estimated%> --> <%= @page_desc %> </h2> @@ -166,7 +162,7 @@ <% if @is_you %> <% if @track_things.empty? %> <h2 id="email_subscriptions"> <%= _('Your email subscriptions')%></h2> - <p>None made.</p> + <p><%= _('None made.')%></p> <% else %> <h2 id="email_subscriptions"> Your <%=pluralize(@track_things.size, _('email subscription')) %> </h2> <% if @track_things_grouped.size == 1 %> diff --git a/app/views/user/signchangeemail.rhtml b/app/views/user/signchangeemail.rhtml index c0c559380..0f8b76bc5 100644 --- a/app/views/user/signchangeemail.rhtml +++ b/app/views/user/signchangeemail.rhtml @@ -34,7 +34,7 @@ <div class="form_button"> <%= hidden_field_tag 'submitted_signchangeemail_do', 1 %> - <%= submit_tag "Change email on WhatDoTheyKnow.com" %> + <%= submit_tag _("Change email on {{site_name}}", :site_name=>site_name) %> </div> <% end %> diff --git a/app/views/user_mailer/already_registered.rhtml b/app/views/user_mailer/already_registered.rhtml index 3bdb3d04b..59ffcbf94 100644 --- a/app/views/user_mailer/already_registered.rhtml +++ b/app/views/user_mailer/already_registered.rhtml @@ -1,11 +1,11 @@ <%= @name %>, -<%= _('You just tried to sign up to WhatDoTheyKnow.com, when you +<%= _('You just tried to sign up to {{site_name}}, when you already have an account. Your name and password have been left as they previously were. -Please click on the link below.')%> <%=@reasons[:email]%> +Please click on the link below.', :site_name=>site_name)%> <%=@reasons[:email]%> <%=@url%> --- <%= _('the WhatDoTheyKnow team') %> +-- <%= _('the {{site_name}} team', :site_name=>site_name) %> diff --git a/app/views/user_mailer/changeemail_already_used.rhtml b/app/views/user_mailer/changeemail_already_used.rhtml index 011c6ee81..1d74dda35 100644 --- a/app/views/user_mailer/changeemail_already_used.rhtml +++ b/app/views/user_mailer/changeemail_already_used.rhtml @@ -1,9 +1,10 @@ <%= _('Someone, perhaps you, just tried to change their email address on -WhatDoTheyKnow.com from ')%><%=@old_email%> <%= _('to')%> <%=@new_email%>. +{{site_name}} from {{old_email}} to {{new_email}}.', :site_name=>site_name, +:old_email=>@old_email, :new_email=>@new_email) %> <%= _('This was not possible because there is already an account using -the email address ')%><%=@new_email%>. +the email address {{email}}.', :email=>@new_email)%>. <%= _('The accounts have been left as they previously were.')%> --- <%= _('the WhatDoTheyKnow team') %> +-- <%= _('the {{site_name}} team', :site_name=>site_name) %> diff --git a/app/views/user_mailer/changeemail_confirm.rhtml b/app/views/user_mailer/changeemail_confirm.rhtml index b7eff308d..ffb9737f7 100644 --- a/app/views/user_mailer/changeemail_confirm.rhtml +++ b/app/views/user_mailer/changeemail_confirm.rhtml @@ -1,12 +1,13 @@ <%= @name %>, <%= _('Please click on the link below to confirm that you want to -change the email address that you use for WhatDoTheyKnow -from ')%><%=@old_email%> <%= _('to ')%><%=@new_email%> +change the email address that you use for {{site_name}} +from {{old_email}} to {{new_email}}', +:site_name=>site_name, :old_email=>@old_email, :new_email=>@new_email) %> <%=@url%> <%= _('We will not reveal your email addresses to anybody unless you or the law tell us to.')%> --- <%= _('the WhatDoTheyKnow team') %> +-- <%= _('the {{site_name}} team', :site_name=>site_name) %> diff --git a/app/views/user_mailer/confirm_login.rhtml b/app/views/user_mailer/confirm_login.rhtml index b68e9abb1..6f4feff00 100644 --- a/app/views/user_mailer/confirm_login.rhtml +++ b/app/views/user_mailer/confirm_login.rhtml @@ -8,4 +8,4 @@ <%= _('We will not reveal your email address to anybody unless you or the law tell us to.')%> --- <%= _('the WhatDoTheyKnow team') %> +-- <%= _('the {{site_name}} team', :site_name=>site_name) %> |