diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/admin_request_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/request_controller.rb | 2 | ||||
-rw-r--r-- | app/models/incoming_message.rb | 8 | ||||
-rw-r--r-- | app/models/info_request.rb | 14 | ||||
-rw-r--r-- | app/models/outgoing_mailer.rb | 2 | ||||
-rw-r--r-- | app/views/help/about.rhtml | 39 | ||||
-rw-r--r-- | app/views/public_body/show.rhtml | 2 |
7 files changed, 53 insertions, 18 deletions
diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb index ff2772b0e..f077691ff 100644 --- a/app/controllers/admin_request_controller.rb +++ b/app/controllers/admin_request_controller.rb @@ -215,10 +215,10 @@ class AdminRequestController < AdminController # Bejeeps, look, sometimes a URL is something that belongs in a controller, jesus. # XXX hammer this square peg into the round MVC hole - should be calling main_url(upload_response_url()) post_redirect = PostRedirect.new( - :uri => upload_response_url(:url_title => info_request.url_title), + :uri => main_url(upload_response_url(:url_title => info_request.url_title, :only_path => true)), :user_id => user.id) post_redirect.save! - url = confirm_url(:email_token => post_redirect.email_token) + url = main_url(confirm_url(:email_token => post_redirect.email_token, :only_path => true)) flash[:notice] = 'Send "' + name + '" <<a href="mailto:' + email + '">' + email + '</a>> this URL: <a href="' + url + '">' + url + "</a> - it will log them in and let them upload a response to this request." redirect_to request_admin_url(info_request) diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 29bdb5c88..5a03f0317 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -650,7 +650,7 @@ class RequestController < ApplicationController if params[:submitted_upload_response] file_name = nil file_content = nil - if params[:file_1].class.to_s == "ActionController::UploadedTempfile" + if !params[:file_1].nil? file_name = params[:file_1].original_filename file_content = params[:file_1].read end diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index 1990af2c5..003499344 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -919,9 +919,13 @@ class IncomingMessage < ActiveRecord::Base def get_main_body_text_part leaves = get_attachment_leaves - # Find first part which is text/plain + # Find first part which is text/plain or text/html + # (We have to include HTML, as increasingly there are mail clients that + # include no text alternative for the main part, and we don't want to + # instead use the first text attachment + # e.g. http://www.whatdotheyknow.com/request/list_of_public_authorties) leaves.each do |p| - if p.content_type == 'text/plain' + if p.content_type == 'text/plain' or p.content_type == 'text/html' return p end end diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 8cfc61c4e..6faf0dbad 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -202,6 +202,8 @@ public # Subject lines for emails about the request def email_subject_request + # XXX pull out this general_register_office specialisation + # into some sort of separate jurisdiction dependent file if self.public_body.url_name == 'general_register_office' # without GQ in the subject, you just get an auto response self.law_used_full + ' request GQ - ' + self.title @@ -209,11 +211,15 @@ public self.law_used_full + ' request - ' + self.title end end - def email_subject_followup - if self.public_body.url_name == 'general_register_office' - 'Re: ' + self.law_used_full + ' request GQ - ' + self.title + def email_subject_followup(incoming_message = nil) + if incoming_message.nil? + 'Re: ' + self.email_subject_request else - 'Re: ' + self.law_used_full + ' request - ' + self.title + if incoming_message.mail.subject.match(/^Re:/i) + incoming_message.mail.subject + else + 'Re: ' + incoming_message.mail.subject + end end end diff --git a/app/models/outgoing_mailer.rb b/app/models/outgoing_mailer.rb index ae7e86f4e..1546d3fd0 100644 --- a/app/models/outgoing_mailer.rb +++ b/app/models/outgoing_mailer.rb @@ -73,7 +73,7 @@ class OutgoingMailer < ApplicationMailer if outgoing_message.what_doing == 'internal_review' return "Internal review of " + info_request.email_subject_request else - return info_request.email_subject_followup + return info_request.email_subject_followup(outgoing_message.incoming_message_followup) end end # Whether we have a valid email address for a followup diff --git a/app/views/help/about.rhtml b/app/views/help/about.rhtml index 0dd540bcb..629e24cf1 100644 --- a/app/views/help/about.rhtml +++ b/app/views/help/about.rhtml @@ -58,6 +58,28 @@ If you like what we're doing, then you can <h1 id="making_requests">Making requests <a href="#making_requests">#</a> </h1> <dl> +<dt id="which_authority">I'm not sure which authority to make my request to, how can I find out? <a href="#which_authority">#</a> </dt> + +<dd> +<p>It can be hard to untangle government's complicated structured, and work out +who knows the information that you want. Here are a few tips: +<ul> +<li>Browse or search WhatDoTheyKnow looking for similar requests to yours.</li> +<li>When you've found an authority you think might have the information, use +the "home page" link on the right hand side of their page to check what they do +on their website.</li> +<li>Contact the authority by phone or email to ask if they hold the kind of +information you're after.</li> +<li>Don't worry excessively about getting the right authority. If you get it +wrong, they ought to advise you who to make the request to instead. +</li> +<li>If you've got a thorny case, please <a href="/help/contact">contact us</a> for help.</li> +</ul> + +</dd> + + + <dt id="missing_body">You're missing the public authority that I want to request from! <a href="#missing_body">#</a> </dt> <dd> @@ -344,7 +366,7 @@ Information Commissioner later about the handling of your request. <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 not as "Arthur" or "A.T.R.". +"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 @@ -652,12 +674,14 @@ that authorities resend these with the personal information removed.</p> <dt id="mobiles">Do you publish email addresses or mobile phone numbers? <a href="#mobiles">#</a> </dt> -<dd><p>We automatically remove most emails and mobile numbers from responses to requests. -Please <a href="/help/contact">contact us</a> if we've missed one. -For technical reasons we don't always remove them from attachments, such as some PDFs.</p> +<dd><p>To prevent spam, we automatically remove most emails and some mobile numbers from +responses to requests. Please <a href="/help/contact">contact us</a> if we've +missed one. +For technical reasons we don't always remove them from attachments, such as certain PDFs.</p> <p>If you need to know what an address was that we've removed, please <a - href="/help/contact">get in touch with us</a>. Sometimes they form an important part -of a response. + href="/help/contact">get in touch with us</a>. Occasionally, an email address +forms an important part of a response and we will post it up in an obscured +form in an annotation. </dd> <dt id="copyright"><a name="commercial"></a>What is your policy on copyright of documents?<a href="#copyright">#</a> </dt> @@ -714,7 +738,8 @@ requests, and for good public relations, we'd advise you not to do that. <li> The amazing team of volunteers who run the site, answer your support emails, maintain the database of public authorities and so much more. - Thanks to Tony Bowden, John Cross, Adam McGreggor, Alex Skene, Richard Taylor. + Thanks to Tony Bowden, John Cross, Ben Harris, Adam McGreggor, Alex Skene, + Richard Taylor. </li> <li> Everyone who has helped look up FOI email addresses. diff --git a/app/views/public_body/show.rhtml b/app/views/public_body/show.rhtml index f28581cdd..788d83912 100644 --- a/app/views/public_body/show.rhtml +++ b/app/views/public_body/show.rhtml @@ -5,7 +5,7 @@ <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'sidebar' } %> <h2>More about this authority</h2> <% if !@public_body.calculated_home_page.nil? %> - <%= link_to "Home page", @public_body.calculated_home_page %><br> + <%= link_to "Home page of authority", @public_body.calculated_home_page %><br> <% end %> <% if !@public_body.publication_scheme.empty? %> <%= link_to "Publication scheme", @public_body.publication_scheme %><br> |