diff options
-rw-r--r-- | app/models/contact_validator.rb | 4 | ||||
-rw-r--r-- | app/models/incoming_message.rb | 4 | ||||
-rw-r--r-- | app/models/info_request.rb | 5 | ||||
-rw-r--r-- | app/models/info_request_event.rb | 4 | ||||
-rw-r--r-- | app/models/outgoing_message.rb | 4 | ||||
-rw-r--r-- | app/models/post_redirect.rb | 4 | ||||
-rw-r--r-- | app/models/public_body.rb | 35 | ||||
-rw-r--r-- | app/models/public_body_tag.rb | 4 | ||||
-rw-r--r-- | app/models/track_thing.rb | 4 | ||||
-rw-r--r-- | app/models/track_things_sent_email.rb | 4 | ||||
-rw-r--r-- | app/models/user.rb | 4 | ||||
-rw-r--r-- | app/models/user_info_request_sent_alert.rb | 4 | ||||
-rw-r--r-- | app/views/admin_public_body/_form.rhtml | 16 | ||||
-rw-r--r-- | app/views/admin_public_body/show.rhtml | 3 | ||||
-rw-r--r-- | app/views/body/show.rhtml | 9 | ||||
-rw-r--r-- | app/views/request/new.rhtml | 7 | ||||
-rw-r--r-- | db/migrate/059_add_url_notes.rb | 15 | ||||
-rw-r--r-- | db/schema.rb | 24 | ||||
-rw-r--r-- | todo.txt | 20 |
19 files changed, 127 insertions, 47 deletions
diff --git a/app/models/contact_validator.rb b/app/models/contact_validator.rb index f07d643fa..78c30e553 100644 --- a/app/models/contact_validator.rb +++ b/app/models/contact_validator.rb @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 56 +# Schema version: 59 # # Table name: contact_validators # @@ -15,7 +15,7 @@ # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: contact_validator.rb,v 1.16 2008-07-09 07:39:08 francis Exp $ +# $Id: contact_validator.rb,v 1.17 2008-07-16 23:45:41 francis Exp $ class ContactValidator < ActiveRecord::BaseWithoutTable column :name, :string diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index 0917d4ac6..385657704 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 56 +# Schema version: 59 # # Table name: incoming_messages # @@ -18,7 +18,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: incoming_message.rb,v 1.119 2008-07-10 13:32:01 francis Exp $ +# $Id: incoming_message.rb,v 1.120 2008-07-16 23:45:41 francis Exp $ # TODO # Move some of the (e.g. quoting) functions here into rblib, as they feel diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 400b3a11e..60e2a15d8 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 56 +# Schema version: 59 # # Table name: info_requests # @@ -14,6 +14,7 @@ # prominence :string(255) default("normal"), not null # url_title :text not null # stop_new_responses :boolean default(false), not null +# law_used :string(255) default("foi"), not null # # models/info_request.rb: @@ -22,7 +23,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: info_request.rb,v 1.120 2008-07-15 17:24:25 francis Exp $ +# $Id: info_request.rb,v 1.121 2008-07-16 23:45:41 francis Exp $ require 'digest/sha1' require File.join(File.dirname(__FILE__),'../../vendor/plugins/acts_as_xapian/lib/acts_as_xapian') diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb index dfb930358..a5eb308c6 100644 --- a/app/models/info_request_event.rb +++ b/app/models/info_request_event.rb @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 56 +# Schema version: 59 # # Table name: info_request_events # @@ -20,7 +20,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: info_request_event.rb,v 1.46 2008-05-21 10:51:24 francis Exp $ +# $Id: info_request_event.rb,v 1.47 2008-07-16 23:45:41 francis Exp $ class InfoRequestEvent < ActiveRecord::Base belongs_to :info_request diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb index 6cc8b2368..74a3f0f6d 100644 --- a/app/models/outgoing_message.rb +++ b/app/models/outgoing_message.rb @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 56 +# Schema version: 59 # # Table name: outgoing_messages # @@ -21,7 +21,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: outgoing_message.rb,v 1.54 2008-07-10 08:26:08 francis Exp $ +# $Id: outgoing_message.rb,v 1.55 2008-07-16 23:45:41 francis Exp $ class OutgoingMessage < ActiveRecord::Base belongs_to :info_request diff --git a/app/models/post_redirect.rb b/app/models/post_redirect.rb index fa00bb8ac..487b5b74d 100644 --- a/app/models/post_redirect.rb +++ b/app/models/post_redirect.rb @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 56 +# Schema version: 59 # # Table name: post_redirects # @@ -26,7 +26,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: post_redirect.rb,v 1.34 2008-06-12 14:17:30 francis Exp $ +# $Id: post_redirect.rb,v 1.35 2008-07-16 23:45:41 francis Exp $ require 'openssl' # for random bytes function diff --git a/app/models/public_body.rb b/app/models/public_body.rb index 39c442710..073304852 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 56 +# Schema version: 59 # # Table name: public_bodies # @@ -13,6 +13,8 @@ # created_at :datetime not null # updated_at :datetime not null # url_name :text not null +# home_page :text default(""), not null +# notes :text default(""), not null # # models/public_body.rb: @@ -21,7 +23,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: public_body.rb,v 1.84 2008-07-10 08:45:46 francis Exp $ +# $Id: public_body.rb,v 1.85 2008-07-16 23:45:41 francis Exp $ require 'csv' require 'set' @@ -109,7 +111,6 @@ class PublicBody < ActiveRecord::Base end end - acts_as_versioned self.non_versioned_columns << 'created_at' << 'updated_at' class Version @@ -202,6 +203,30 @@ class PublicBody < ActiveRecord::Base end end + # Calculate home page, or nil if not known + def calculated_home_page + # manual override for ones we calculate wrongly + if self.home_page != '' + return self.home_page + end + + # extract the domain name + url = self.request_email + url =~ /@(.*)/ + if $1.nil? + return nil + end + url = $1 + + # remove special email domains for UK Government addresses + url.sub!(".gsi.", ".") + url.sub!(".x.", ".") + url.sub!(".pnn.", ".") + + # add standard URL prefix + return "http://www." + url + end + # Are all requests to this body under the Environmental Information Regulations? def eir_only? return self.has_tag?('eir_only') @@ -222,6 +247,8 @@ class PublicBody < ActiveRecord::Base :name => 'Internal admin authority', :short_name => "", :request_email => MySociety::Config.get("CONTACT_EMAIL", 'contact@localhost'), + :home_page => "", + :notes => "", :last_edit_editor => "internal_admin", :last_edit_comment => "Made by PublicBody.internal_admin_body" ) @@ -286,7 +313,7 @@ class PublicBody < ActiveRecord::Base 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 => "", :last_edit_editor => editor, :last_edit_comment => 'Created from spreadsheet') + public_body = PublicBody.new(:name => name, :request_email => email, :short_name => "", :home_page => "", :notes => "", :last_edit_editor => editor, :last_edit_comment => 'Created from spreadsheet') public_body.tag_string = tag public_body.save! end diff --git a/app/models/public_body_tag.rb b/app/models/public_body_tag.rb index 414b903fb..927ad01f6 100644 --- a/app/models/public_body_tag.rb +++ b/app/models/public_body_tag.rb @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 56 +# Schema version: 59 # # Table name: public_body_tags # @@ -15,7 +15,7 @@ # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: public_body_tag.rb,v 1.13 2008-05-21 10:51:24 francis Exp $ +# $Id: public_body_tag.rb,v 1.14 2008-07-16 23:45:41 francis Exp $ class PublicBodyTag < ActiveRecord::Base validates_presence_of :public_body diff --git a/app/models/track_thing.rb b/app/models/track_thing.rb index 3d4e782af..ec7fe271c 100644 --- a/app/models/track_thing.rb +++ b/app/models/track_thing.rb @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 56 +# Schema version: 59 # # Table name: track_things # @@ -21,7 +21,7 @@ # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: track_thing.rb,v 1.24 2008-05-27 01:25:09 francis Exp $ +# $Id: track_thing.rb,v 1.25 2008-07-16 23:45:41 francis Exp $ class TrackThing < ActiveRecord::Base belongs_to :tracking_user, :class_name => 'User' diff --git a/app/models/track_things_sent_email.rb b/app/models/track_things_sent_email.rb index 850f64880..f9fea165a 100644 --- a/app/models/track_things_sent_email.rb +++ b/app/models/track_things_sent_email.rb @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 56 +# Schema version: 59 # # Table name: track_things_sent_emails # @@ -18,7 +18,7 @@ # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: track_things_sent_email.rb,v 1.7 2008-05-21 10:51:24 francis Exp $ +# $Id: track_things_sent_email.rb,v 1.8 2008-07-16 23:45:41 francis Exp $ class TrackThingsSentEmail < ActiveRecord::Base belongs_to :info_request_event diff --git a/app/models/user.rb b/app/models/user.rb index aa7014a54..5f7f45d04 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 56 +# Schema version: 59 # # Table name: users # @@ -21,7 +21,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: user.rb,v 1.57 2008-07-08 09:41:04 francis Exp $ +# $Id: user.rb,v 1.58 2008-07-16 23:45:41 francis Exp $ require 'digest/sha1' diff --git a/app/models/user_info_request_sent_alert.rb b/app/models/user_info_request_sent_alert.rb index e314f541e..e940df2a0 100644 --- a/app/models/user_info_request_sent_alert.rb +++ b/app/models/user_info_request_sent_alert.rb @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 56 +# Schema version: 59 # # Table name: user_info_request_sent_alerts # @@ -17,7 +17,7 @@ # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: user_info_request_sent_alert.rb,v 1.17 2008-07-14 12:06:51 francis Exp $ +# $Id: user_info_request_sent_alert.rb,v 1.18 2008-07-16 23:45:41 francis Exp $ class UserInfoRequestSentAlert < ActiveRecord::Base belongs_to :user diff --git a/app/views/admin_public_body/_form.rhtml b/app/views/admin_public_body/_form.rhtml index fa84a2e96..504b01fa0 100644 --- a/app/views/admin_public_body/_form.rhtml +++ b/app/views/admin_public_body/_form.rhtml @@ -1,10 +1,19 @@ <%= error_messages_for 'public_body' %> <!--[form:public_body]--> + <p><label for="public_body_name">Name</label><br/> <%= text_field 'public_body', 'name', :size => 60 %></p> + <p><label for="public_body_short_name">Short name (only put in abbreviations which are really used, otherwise leave blank. Short or long name is used in the URL - don't worry about breaking URLs through renaming, as the history is used to redirect)</label><br/> <%= text_field 'public_body', 'short_name', :size => 60 %></p> + +<p><label for="public_body_request_email">Request email (set to <strong>blank</strong> (empty string) if can't find an address; to <strong>not_apply</strong> if FOI no longer / never did apply to authority)</label><br/> +<%= text_field 'public_body', 'request_email', :size => 40 %></p> + +<p><label for="public_body_home_page">Home page (set to <strong>blank</strong> to guess it from the email)</label><br/> +<%= text_field 'public_body', 'home_page', :size => 60 %></p> + <p><label for="public_body_tag_string">Tags (space separated: <% for category, description in PublicBody.categories_by_tag %> <% if category != "other" %> @@ -14,12 +23,11 @@ )</label><br/> <%= text_field 'public_body', 'tag_string', :size => 80 %></p> - -<p><label for="public_body_request_email">Request email (set to <strong>blank</strong> (empty string) if can't find an address; to <strong>not_apply</strong> if FOI no longer / never did apply to authority)</label><br/> -<%= text_field 'public_body', 'request_email', :size => 40 %></p> +<p><label for="public_body_notes">Notes</label> (for users to consider when making FOI requests to the authority)<br/> +<%= text_area 'public_body', 'notes', :rows => 4, :cols => 60 %></p> <p><label for="public_body_last_edit_comment">Comment for this edit</label> (put URL or other source of new info)<br/> -<%= text_area 'public_body', 'last_edit_comment', :rows => 3, :cols => 60 %></p> +<%= text_area 'public_body', 'last_edit_comment', :rows => 2, :cols => 60 %></p> <!--[eoform:public_body]--> <p><strong>Privacy note:</strong> The email addresses are assumed public data, diff --git a/app/views/admin_public_body/show.rhtml b/app/views/admin_public_body/show.rhtml index baa3a9918..9791a9155 100644 --- a/app/views/admin_public_body/show.rhtml +++ b/app/views/admin_public_body/show.rhtml @@ -7,7 +7,8 @@ <b><%= column.human_name %>:</b> <%=h @public_body.send(column.name) %> <br/> <% end %> -<b>Tags:</b> <%=h @public_body.tag_string %> +<b>Calculated home page:</b> <%= link_to(h(@public_body.calculated_home_page), @public_body.calculated_home_page) %> +<br/><b>Tags:</b> <%=h @public_body.tag_string %> <br/> </p> diff --git a/app/views/body/show.rhtml b/app/views/body/show.rhtml index 380141340..c7dc49dbf 100644 --- a/app/views/body/show.rhtml +++ b/app/views/body/show.rhtml @@ -9,17 +9,22 @@ <p class="subtitle"> <%=@public_body.type_of_authority(true)%> in the UK<% if not @public_body.short_name.empty? %>, also called <%= h(@public_body.short_name) %><% end %> +(<%= link_to "home page", @public_body.calculated_home_page %>) </p> +<% if @public_body.notes != "" %> +<p><%=@public_body.notes%></p> +<% end %> + <% if @public_body.eir_only? %> <p>You can only request information about the environment from this authority.</p> <% end %> <p> <% if @public_body.eir_only? %> -<%= link_to "Make new EIR request to " + @public_body.short_or_long_name, new_request_to_body_url(:public_body_id => @public_body.id.to_s)%> +<%= link_to "Make new EIR request to " + h(@public_body.short_or_long_name), new_request_to_body_url(:public_body_id => @public_body.id.to_s)%> <% else %> -<%= link_to "Make new FOI request to " + @public_body.short_or_long_name, new_request_to_body_url(:public_body_id => @public_body.id.to_s)%> +<%= link_to "Make new FOI request to " + h(@public_body.short_or_long_name), new_request_to_body_url(:public_body_id => @public_body.id.to_s)%> <% end %> </p> diff --git a/app/views/request/new.rhtml b/app/views/request/new.rhtml index d8b18df81..1ba68c99a 100644 --- a/app/views/request/new.rhtml +++ b/app/views/request/new.rhtml @@ -39,6 +39,13 @@ </li> </ul> + <% if @info_request.public_body.notes != "" %> + <h1>Please note for this authorite</h1> + <ul> + <li><%=@info_request.public_body.notes %></li> + </ul> + <% end %> + <% if @info_request.public_body.eir_only? %> <h1>Please ask for environmental information only</h1> diff --git a/db/migrate/059_add_url_notes.rb b/db/migrate/059_add_url_notes.rb new file mode 100644 index 000000000..ae6a998aa --- /dev/null +++ b/db/migrate/059_add_url_notes.rb @@ -0,0 +1,15 @@ +class AddUrlNotes < ActiveRecord::Migration + def self.up + add_column :public_bodies, :home_page, :text, :null => false, :default => "" + add_column :public_bodies, :notes, :text, :null => false, :default => "" + add_column :public_body_versions, :home_page, :text + add_column :public_body_versions, :notes, :text + end + + def self.down + remove_column :public_bodies, :home_page + remove_column :public_bodies, :notes + remove_column :public_body_versions, :home_page + remove_column :public_body_versions, :notes + end +end diff --git a/db/schema.rb b/db/schema.rb index 6c71d1ef0..939a07c2b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -9,7 +9,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 58) do +ActiveRecord::Schema.define(:version => 59) do create_table "acts_as_xapian_jobs", :force => true do |t| t.string "model", :null => false @@ -85,15 +85,17 @@ ActiveRecord::Schema.define(:version => 58) do add_index "post_redirects", ["updated_at"], :name => "index_post_redirects_on_updated_at" create_table "public_bodies", :force => true do |t| - t.text "name", :null => false - t.text "short_name", :null => false - t.text "request_email", :null => false - t.integer "version", :null => false - t.string "last_edit_editor", :null => false - t.text "last_edit_comment", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "url_name", :null => false + t.text "name", :null => false + t.text "short_name", :null => false + t.text "request_email", :null => false + t.integer "version", :null => false + t.string "last_edit_editor", :null => false + t.text "last_edit_comment", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.text "url_name", :null => false + t.text "home_page", :default => "", :null => false + t.text "notes", :default => "", :null => false end add_index "public_bodies", ["url_name"], :name => "index_public_bodies_on_url_name", :unique => true @@ -116,6 +118,8 @@ ActiveRecord::Schema.define(:version => 58) do t.string "last_edit_editor" t.text "last_edit_comment" t.text "url_name" + t.text "home_page" + t.text "notes" end create_table "track_things", :force => true do |t| @@ -39,9 +39,6 @@ https://secure.mysociety.org/cvstrac/tktview?tn=1032 This infers the wrong calculated state due to followups https://secure.mysociety.org/admin/foi/request/show/619 -In flow, encourage people to make new requests rather than file new requests as -follow ups on existing one. - Show similar requests after you have filed yours - maybe on preview too. Advertise WDTK search queries on TWFY @@ -51,6 +48,11 @@ Internal review status/marker? Request withdrawn by user status/marker? Redo the RSS feeds +- One click "track this" then single feed based on your preferences +- Page tracking things within the site +Maybe remove public tracking completely + +Comments interleaved with body Antispam on contact form Incoming email to unknown FOI is a bit rubbish @@ -70,10 +72,18 @@ Show list of popular tracks somewhere (finds most popular requests in a way) user/show.rhtml sidebar vs. generic sidebar? (ask Tommy) Needs tagline that v. quickly explains what site is on each page +There is grey on grey text in header? bad idea? Later ===== +Find a way to get corrected email addresses from responses - somehow getting +user to send them in? +e.g. as in http://www.whatdotheyknow.com/request/1071/response/1870 which +we found largely by accident. + +For followups, have radio button to say is it a new request or followup? + Alert you when someone you're tracking starts tracking another request Catch query parser error, e.g. for this query @@ -181,6 +191,8 @@ Quoting fixing TODO: http://www.whatdotheyknow.com/request/council_housing_accommodation # over zealous half cuts http://www.whatdotheyknow.com/request/621/response/1131 # virus footer http://www.whatdotheyknow.com/request/231/response/338 + http://www.whatdotheyknow.com/request/930/response/1609 + http://www.whatdotheyknow.com/request/1102/response/2067 http://www.whatdotheyknow.com/request/415/response/1041/attach/3/CONF%20FOI%209508%20Ian%20Holton.doc @@ -208,10 +220,10 @@ http://www.ico.gov.uk/Home/tools_and_resources/decision_notices.aspx Description for each body as to what info it holds Link to: + Website itself (for general search) XXX can get this from domain of email and some scanning, with override needed Aliases (not just short name, but multiple real names e.g. for museums) Disclosure logs Publication schemes (http://www.ico.gov.uk/what_we_cover/freedom_of_information/publication_schemes.aspx) - Website itself (for general search) XXX can get this from domain of email and some scanning Google search within website? TWFY department search Complaint email |