aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfrancis <francis>2008-04-01 16:40:37 +0000
committerfrancis <francis>2008-04-01 16:40:37 +0000
commitbaa530c0c8f5fb1e12173fbfde8f722ebeffe5be (patch)
treed80dd72953de39723d3208f78247052352e85fb1
parent708480da65908e38e00cfa1eaef9b7f04cc9a4a6 (diff)
Skeleton of tracking / alerting / email.
-rw-r--r--app/controllers/general_controller.rb4
-rw-r--r--app/controllers/track_controller.rb43
-rw-r--r--app/models/contact_validator.rb4
-rw-r--r--app/models/incoming_message.rb4
-rw-r--r--app/models/info_request.rb4
-rw-r--r--app/models/info_request_event.rb19
-rw-r--r--app/models/outgoing_message.rb4
-rw-r--r--app/models/post_redirect.rb4
-rw-r--r--app/models/public_body.rb4
-rw-r--r--app/models/public_body_tag.rb4
-rw-r--r--app/models/track_thing.rb54
-rw-r--r--app/models/track_things_sent_email.rb27
-rw-r--r--app/models/user.rb4
-rw-r--r--app/models/user_info_request_sent_alert.rb4
-rw-r--r--app/views/help/about.rhtml9
-rw-r--r--app/views/request/show.rhtml8
-rw-r--r--app/views/track/track_set.rhtml35
-rw-r--r--config/routes.rb46
-rw-r--r--db/migrate/049_track_things.rb37
-rw-r--r--db/schema.rb18
-rw-r--r--todo.txt26
21 files changed, 307 insertions, 55 deletions
diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb
index 21450fddc..9b9e311e7 100644
--- a/app/controllers/general_controller.rb
+++ b/app/controllers/general_controller.rb
@@ -5,7 +5,7 @@
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: general_controller.rb,v 1.16 2008-04-01 05:43:40 francis Exp $
+# $Id: general_controller.rb,v 1.17 2008-04-01 16:40:37 francis Exp $
class GeneralController < ApplicationController
@@ -57,7 +57,7 @@ class GeneralController < ApplicationController
sortby = params[:sortby]
perform_search(query, sortby)
end
-
+
# For debugging
def fai_test
sleep 10
diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb
new file mode 100644
index 000000000..0ad3ae740
--- /dev/null
+++ b/app/controllers/track_controller.rb
@@ -0,0 +1,43 @@
+# app/controllers/track_controller.rb:
+# Publically visible email alerts and RSS - think an alert system crossed with
+# social bookmarking.
+#
+# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
+# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
+#
+# $Id: track_controller.rb,v 1.1 2008-04-01 16:40:37 francis Exp $
+
+class TrackController < ApplicationController
+
+ # Track all updates to a particular request
+ def track_request
+ @info_request = InfoRequest.find_by_url_title(params[:url_title])
+ @track_thing = TrackThing.create_track_for_request(@info_request)
+ if self.track_set
+ flash[:notice] = "You are now tracking this request!"
+ redirect_to request_url(@info_request)
+ end
+ end
+
+ # Generic request tracker - set @track_thing before calling
+ def track_set
+ @title = @track_thing.params[:title]
+ @track_thing.track_medium = params[:track_thing][:track_medium]
+
+ if not params[:submitted_track_request] or not @track_thing.valid?
+ render :template => 'track/track_set'
+ return false
+ end
+
+ if not authenticated?(@track_thing.params)
+ return false
+ end
+
+ @track_thing.tracking_user_id = @user.id
+ @track_thing.save!
+
+ return true
+ end
+
+end
+
diff --git a/app/models/contact_validator.rb b/app/models/contact_validator.rb
index 1ed55e34f..3af6ee2e8 100644
--- a/app/models/contact_validator.rb
+++ b/app/models/contact_validator.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 47
+# Schema version: 49
#
# 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.9 2008-03-31 19:15:38 francis Exp $
+# $Id: contact_validator.rb,v 1.10 2008-04-01 16:40:37 francis Exp $
class ContactValidator < ActiveRecord::BaseWithoutTable
column :name, :string
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index bb286dc14..41ffa029c 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 47
+# Schema version: 49
#
# Table name: incoming_messages
#
@@ -17,7 +17,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.71 2008-03-31 19:15:38 francis Exp $
+# $Id: incoming_message.rb,v 1.72 2008-04-01 16:40:37 francis Exp $
# TODO
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index 1bc6004aa..1633aec3d 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 47
+# Schema version: 49
#
# Table name: info_requests
#
@@ -22,7 +22,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.78 2008-03-31 23:19:16 francis Exp $
+# $Id: info_request.rb,v 1.79 2008-04-01 16:40:37 francis Exp $
require 'digest/sha1'
diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb
index ef3d729f6..e07d645dd 100644
--- a/app/models/info_request_event.rb
+++ b/app/models/info_request_event.rb
@@ -1,15 +1,16 @@
# == Schema Information
-# Schema version: 47
+# Schema version: 49
#
# Table name: info_request_events
#
-# id :integer not null, primary key
-# info_request_id :integer not null
-# event_type :text not null
-# params_yaml :text not null
-# created_at :datetime not null
-# described_state :string(255)
-# calculated_state :string(255)
+# id :integer not null, primary key
+# info_request_id :integer not null
+# event_type :text not null
+# params_yaml :text not null
+# created_at :datetime not null
+# described_state :string(255)
+# calculated_state :string(255)
+# last_described_at :datetime
#
# models/info_request_event.rb:
@@ -17,7 +18,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.32 2008-04-01 06:13:02 francis Exp $
+# $Id: info_request_event.rb,v 1.33 2008-04-01 16:40:37 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 568115d7b..f651aea08 100644
--- a/app/models/outgoing_message.rb
+++ b/app/models/outgoing_message.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 47
+# Schema version: 49
#
# 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.40 2008-03-31 19:15:38 francis Exp $
+# $Id: outgoing_message.rb,v 1.41 2008-04-01 16:40:37 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 d1a8a8eb7..03fcbe564 100644
--- a/app/models/post_redirect.rb
+++ b/app/models/post_redirect.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 47
+# Schema version: 49
#
# 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.27 2008-03-31 19:15:38 francis Exp $
+# $Id: post_redirect.rb,v 1.28 2008-04-01 16:40:37 francis Exp $
require 'openssl' # for random bytes function
diff --git a/app/models/public_body.rb b/app/models/public_body.rb
index 2c31278bb..f82e17038 100644
--- a/app/models/public_body.rb
+++ b/app/models/public_body.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 47
+# Schema version: 49
#
# Table name: public_bodies
#
@@ -21,7 +21,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.49 2008-03-31 19:15:38 francis Exp $
+# $Id: public_body.rb,v 1.50 2008-04-01 16:40:37 francis Exp $
require 'csv'
require 'set'
diff --git a/app/models/public_body_tag.rb b/app/models/public_body_tag.rb
index e7c2c7024..b2e287d95 100644
--- a/app/models/public_body_tag.rb
+++ b/app/models/public_body_tag.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 47
+# Schema version: 49
#
# 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.7 2008-03-31 19:15:38 francis Exp $
+# $Id: public_body_tag.rb,v 1.8 2008-04-01 16:40:37 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
new file mode 100644
index 000000000..35f384e5c
--- /dev/null
+++ b/app/models/track_thing.rb
@@ -0,0 +1,54 @@
+# == Schema Information
+# Schema version: 49
+#
+# Table name: track_things
+#
+# id :integer not null, primary key
+# tracking_user_id :integer not null
+# track_query :string(255) not null
+# info_request_id :integer
+# tracked_user_id :integer
+# public_body_id :integer
+# track_medium :string(255) not null
+#
+
+# models/track_thing.rb:
+# When somebody is getting alerts for something.
+#
+# 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.1 2008-04-01 16:40:37 francis Exp $
+
+class TrackThing < ActiveRecord::Base
+ belongs_to :user, :foreign_key => 'tracking_user_id'
+ validates_presence_of :track_query
+
+ belongs_to :info_request
+ belongs_to :public_body
+ belongs_to :user, :foreign_key => 'tracked_user_id'
+
+ validates_inclusion_of :track_medium, :in => [
+ 'email_daily',
+ ]
+
+ attr_accessor :params
+
+ def TrackThing.create_track_for_request(info_request)
+ track_thing = TrackThing.new
+ track_thing.info_request = info_request
+ track_thing.params = {
+ :title => "Track the request '" + CGI.escapeHTML(info_request.title) + "'",
+ :feed_sortby => 'described',
+
+ :web => "To follow updates to the request '" + CGI.escapeHTML(info_request.title) + "'",
+ :email => "Then you will be emailed whenever the request '" + CGI.escapeHTML(info_request.title) + "' is updated.",
+ :email_subject => "Confirm you want to follow updates to the request '" + CGI.escapeHTML(info_request.title) + "'",
+ }
+ track_thing.track_query = "request:" + info_request.url_title
+ return track_thing
+ end
+
+end
+
+
diff --git a/app/models/track_things_sent_email.rb b/app/models/track_things_sent_email.rb
new file mode 100644
index 000000000..d177d427c
--- /dev/null
+++ b/app/models/track_things_sent_email.rb
@@ -0,0 +1,27 @@
+# == Schema Information
+# Schema version: 49
+#
+# Table name: track_things_sent_emails
+#
+# id :integer not null, primary key
+# track_thing_id :integer not null
+# info_request_event_id :integer
+# user_id :integer
+# public_body_id :integer
+#
+
+# models/track_things_sent_email.rb:
+# Record that alert has arrived.
+#
+# 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.1 2008-04-01 16:40:37 francis Exp $
+
+class TrackThingsSentEmail < ActiveRecord::Base
+ belongs_to :info_request_event
+ belongs_to :user
+ belongs_to :public_body
+end
+
+
diff --git a/app/models/user.rb b/app/models/user.rb
index 4d62d0b93..28b1e5b28 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 47
+# Schema version: 49
#
# Table name: users
#
@@ -20,7 +20,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.43 2008-03-31 19:15:38 francis Exp $
+# $Id: user.rb,v 1.44 2008-04-01 16:40:37 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 e83c2b57f..485620805 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: 47
+# Schema version: 49
#
# 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.9 2008-03-31 19:15:38 francis Exp $
+# $Id: user_info_request_sent_alert.rb,v 1.10 2008-04-01 16:40:37 francis Exp $
class UserInfoRequestSentAlert < ActiveRecord::Base
belongs_to :user
diff --git a/app/views/help/about.rhtml b/app/views/help/about.rhtml
index 41bd84b60..39b7e7684 100644
--- a/app/views/help/about.rhtml
+++ b/app/views/help/about.rhtml
@@ -125,6 +125,15 @@ Therefore, we encourage you to use your real name, but you may use a pseudonym
if you would like to be anonymous.
</dd>
+<dt id="tracking">Why does the list of things that I'm tracking appear publically on the site?</dt>
+
+<dd>This helps you find others who are researching the same area of government,
+so you can form groups to investigate or campaign together. It also helps us
+show requests which are related to other requests. If you've ever used a
+"social bookmarking" website such as Delicious, Digg or reddit, think of it like
+that.
+</dd>
+
</dl>
<div id="hash_link_padding"></div>
diff --git a/app/views/request/show.rhtml b/app/views/request/show.rhtml
index 8e5ac5f4f..1bb926b57 100644
--- a/app/views/request/show.rhtml
+++ b/app/views/request/show.rhtml
@@ -66,6 +66,14 @@
</div>
<div id="request_sidebar">
+<!-- <h2>Actions</h2>
+
+ <p>
+ <%= link_to "Track updates to this request", track_request_url(:url_title => @info_request.url_title) %>
+ (by email or RSS)
+ </p>
+ -->
+
<% if @info_requests_same_user_same_body.size > 0 %>
<h2>Some other requests made by
<%= user_link(@info_request.user) %> to <%= public_body_link(@info_request.public_body) %></h2>
diff --git a/app/views/track/track_set.rhtml b/app/views/track/track_set.rhtml
new file mode 100644
index 000000000..380d1dd64
--- /dev/null
+++ b/app/views/track/track_set.rhtml
@@ -0,0 +1,35 @@
+<div id="track_set">
+
+<% form_tag({:id => "track_set_form"}) do %>
+ <%= foi_error_messages_for :track_thing %>
+
+ <div class="form_note">
+ <h1><%=@title %></h1>
+ </div>
+
+ <div class="form_note">
+ <!--<%= radio_button "track_thing", "track_medium", "email_immediate" %>
+ <label for="track_track_medium_email">Send me emails shortly after there are updates</label>
+ <br> -->
+ <%= radio_button "track_thing", "track_medium", "email_daily" %>
+ <label for="track_thing_track_medium_email">Send me emails at most once a day</label>
+ <!--
+ <br>
+ <%= radio_button "track_thing", "track_medium", "rss" %>
+ <label for="track__thingtrack_medium_rss">Give me a feed to use in my news reader (RSS)</label>
+ -->
+ </div>
+
+ <p class="form_note">
+ <strong>Privacy note:</strong> It will appear publically on your user page that
+ you are tracking this request (<a href="/help/about/#tracking">details</a>).
+ </p>
+
+ <div class="form_button">
+ <%= hidden_field_tag 'submitted_track_request', 1 %>
+ <%= submit_tag "Subscribe" %>
+ </div>
+<% end %>
+
+</div>
+
diff --git a/config/routes.rb b/config/routes.rb
index 2a4a10daa..5b7d224ea 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -4,7 +4,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: routes.rb,v 1.48 2008-04-01 00:36:56 francis Exp $
+# $Id: routes.rb,v 1.49 2008-04-01 16:40:38 francis Exp $
ActionController::Routing::Routes.draw do |map|
@@ -15,36 +15,36 @@ ActionController::Routing::Routes.draw do |map|
# Keep in mind you can assign values other than :controller and :action
map.with_options :controller => 'general' do |general|
- general.frontpage '/', :action => 'frontpage'
- general.auto_complete_for_public_body_query 'auto_complete_for_public_body_query', :action => 'auto_complete_for_public_body_query'
+ general.frontpage '/', :action => 'frontpage'
+ general.auto_complete_for_public_body_query 'auto_complete_for_public_body_query', :action => 'auto_complete_for_public_body_query'
- general.search_redirect '/search', :action => 'search_redirect'
- general.search '/search/:query/:sortby', :action => 'search', :sortby => nil
+ general.search_redirect '/search', :action => 'search_redirect'
+ general.search '/search/:query/:sortby', :action => 'search', :sortby => nil
- general.fai_test '/test', :action => 'fai_test'
+ general.fai_test '/test', :action => 'fai_test'
end
map.with_options :controller => 'request' do |request|
- request.request_list '/list/:view', :action => 'list', :view => nil
+ request.request_list '/list/:view', :action => 'list', :view => nil
- request.new_request '/new', :action => 'new'
- request.new_request_to_body '/new/:public_body_id', :action => 'new'
+ request.new_request '/new', :action => 'new'
+ request.new_request_to_body '/new/:public_body_id', :action => 'new'
- request.show_request '/request/:url_title', :action => 'show'
- request.describe_state '/request/:id/describe', :action => 'describe_state'
- request.show_response_no_followup '/request/:id/response', :action => 'show_response'
- request.show_response '/request/:id/response/:incoming_message_id', :action => 'show_response'
- request.get_attachment '/request/:id/response/:incoming_message_id/attach/:part/*file_name', :action => 'get_attachment'
+ request.show_request '/request/:url_title', :action => 'show'
+ request.describe_state '/request/:id/describe', :action => 'describe_state'
+ request.show_response_no_followup '/request/:id/response', :action => 'show_response'
+ request.show_response '/request/:id/response/:incoming_message_id', :action => 'show_response'
+ request.get_attachment '/request/:id/response/:incoming_message_id/attach/:part/*file_name', :action => 'get_attachment'
end
map.with_options :controller => 'user' do |user|
- user.signin '/signin', :action => 'signin'
- user.signup '/signup', :action => 'signup'
- user.signout '/signout', :action => 'signout'
- user.signchange '/signchange', :action => 'signchange'
- user.confirm '/c/:email_token', :action => 'confirm'
- user.show_user '/user/:url_name', :action => 'show'
- user.contact_user '/user/contact/:id', :action => 'contact'
+ user.signin '/signin', :action => 'signin'
+ user.signup '/signup', :action => 'signup'
+ user.signout '/signout', :action => 'signout'
+ user.signchange '/signchange', :action => 'signchange'
+ user.confirm '/c/:email_token', :action => 'confirm'
+ user.show_user '/user/:url_name', :action => 'show'
+ user.contact_user '/user/contact/:id', :action => 'contact'
end
map.with_options :controller => 'body' do |body|
@@ -53,6 +53,10 @@ ActionController::Routing::Routes.draw do |map|
body.show_public_body "/body/:url_name", :action => 'show'
end
+ map.with_options :controller => 'track' do |track|
+ track.track_request 'track/request/:url_title', :action => 'track_request'
+ end
+
map.with_options :controller => 'help' do |help|
help.help_general '/help/:action', :action => :action
end
diff --git a/db/migrate/049_track_things.rb b/db/migrate/049_track_things.rb
new file mode 100644
index 000000000..65871bc73
--- /dev/null
+++ b/db/migrate/049_track_things.rb
@@ -0,0 +1,37 @@
+class TrackThings < ActiveRecord::Migration
+ def self.up
+ create_table :track_things do |t|
+ t.column :tracking_user_id, :integer, :null => false
+ t.column :track_query, :string, :null => false
+
+ # optional foreign key links, for displaying people who are tracking this on pages
+ t.column :info_request_id, :integer, :default => nil
+ t.column :tracked_user_id, :integer, :default => nil
+ t.column :public_body_id, :integer, :default => nil
+
+ t.column :track_medium, :string, :null => false
+ end
+
+ execute "ALTER TABLE track_things ADD CONSTRAINT fk_track_request_tracking_user FOREIGN KEY (tracking_user_id) REFERENCES users(id)"
+ execute "ALTER TABLE track_things ADD CONSTRAINT fk_track_request_tracked_user FOREIGN KEY (tracked_user_id) REFERENCES users(id)"
+ execute "ALTER TABLE track_things ADD CONSTRAINT fk_track_request_info_request FOREIGN KEY (info_request_id) REFERENCES info_requests(id)"
+ execute "ALTER TABLE track_things ADD CONSTRAINT fk_track_request_public_body FOREIGN KEY (public_body_id) REFERENCES public_bodies(id)"
+
+ create_table :track_things_sent_emails do |t|
+ t.column :track_thing_id, :integer, :null => false
+
+ t.column :info_request_event_id, :integer, :default => nil
+ t.column :user_id, :integer, :default => nil
+ t.column :public_body_id, :integer, :default => nil
+ end
+
+ execute "ALTER TABLE track_things_sent_emails ADD CONSTRAINT fk_track_request_info_request_event FOREIGN KEY (info_request_event_id) REFERENCES info_request_events(id)"
+ execute "ALTER TABLE track_things_sent_emails ADD CONSTRAINT fk_track_request_user FOREIGN KEY (user_id) REFERENCES users(id)"
+ execute "ALTER TABLE track_things_sent_emails ADD CONSTRAINT fk_track_request_public_body FOREIGN KEY (user_id) REFERENCES users(id)"
+ end
+
+ def self.down
+ drop_table :track_things
+ drop_table :track_things_sent_emails
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 7083fbfd6..e800b916d 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 => 48) do
+ActiveRecord::Schema.define(:version => 49) do
create_table "incoming_messages", :force => true do |t|
t.integer "info_request_id", :null => false
@@ -117,6 +117,22 @@ ActiveRecord::Schema.define(:version => 48) do
add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"
+ create_table "track_things", :force => true do |t|
+ t.integer "tracking_user_id", :null => false
+ t.string "track_query", :null => false
+ t.integer "info_request_id"
+ t.integer "tracked_user_id"
+ t.integer "public_body_id"
+ t.string "track_medium", :null => false
+ end
+
+ create_table "track_things_sent_emails", :force => true do |t|
+ t.integer "track_thing_id", :null => false
+ t.integer "info_request_event_id"
+ t.integer "user_id"
+ t.integer "public_body_id"
+ end
+
create_table "user_info_request_sent_alerts", :force => true do |t|
t.integer "user_id", :null => false
t.integer "info_request_id", :null => false
diff --git a/todo.txt b/todo.txt
index 130dc4c1a..a46d61637 100644
--- a/todo.txt
+++ b/todo.txt
@@ -13,6 +13,16 @@ BAILII - relationship with law courts, robots.txt ?
Next
====
+Read how Matthew's alert thang works
+
+Overdue response events, so search / RSS picks up when response is late
+
+Fix search to deal with overdue message query that TOmski asks for
+
+If you edit needs anim to waiting_response it doesn't edit the value in the event history, so screws up search stuff?
+https://secure.mysociety.org/admin/foi/request/show/37
+https://secure.mysociety.org/admin/foi/request/show/137
+
Search and replace text "FOI" and "Freedom of Information" out the way more
- but put it in the title tag
"public body" --> "public authority"?
@@ -25,13 +35,14 @@ Tom's request to Parliament:
http://foi.mysociety.org/request/8
Consider removing login links from notifications of new responses
-Consider password change code in relation to this
-
-Now of course when ids go into requests/users for new ones it just adds an _ on end which is crap!
Later
=====
+Wrapping long URLs in emails breaks the h off http off the beginning nastily
+
+Use :order in the info_request.events belongs_to clause instead of each time it is queried
+
Offer search on 404s
RDAs need their short names somehow in CSV import?
@@ -82,6 +93,12 @@ Show public body email address on their public page, with a link to say "this is
Email me updates on this request
Generic alerting/tracking system including
- email alerts and RSS
+Things to track:
+ - updates to a particular request
+ - new requests
+ - new requests with keyword
+ - successful responses
+
- new requests, new good responses etc.
- new responses to a particular request
@@ -149,8 +166,9 @@ Quoting fixing TODO:
http://www.whatdotheyknow.com/request/71/response/108
http://www.whatdotheyknow.com/request/police_powers_to_inform_car_insu
http://www.whatdotheyknow.com/request/30/response/166
-Char encoding:
+Char encoding and other bad formatting:
http://www.whatdotheyknow.com/request/107/response/144
+ http://www.whatdotheyknow.com/request/35/response/177
Sources of public bodies
========================