diff options
-rw-r--r-- | app/controllers/body_controller.rb | 3 | ||||
-rw-r--r-- | app/controllers/general_controller.rb | 3 | ||||
-rw-r--r-- | app/controllers/request_controller.rb | 5 | ||||
-rw-r--r-- | app/controllers/user_controller.rb | 3 | ||||
-rw-r--r-- | app/helpers/link_to_helper.rb | 4 | ||||
-rw-r--r-- | app/models/track_thing.rb | 36 | ||||
-rw-r--r-- | app/views/layouts/default.rhtml | 6 | ||||
-rw-r--r-- | app/views/track/_tracking_people_and_link.rhtml | 10 | ||||
-rw-r--r-- | db/migrate/061_include_responses_in_tracks.rb | 9 | ||||
-rw-r--r-- | db/schema.rb | 2 | ||||
-rw-r--r-- | public/images/email-16.png | bin | 0 -> 593 bytes | |||
-rw-r--r-- | public/images/feed-16.png | bin | 0 -> 764 bytes | |||
-rw-r--r-- | public/stylesheets/main.css | 9 | ||||
-rw-r--r-- | todo.txt | 8 |
14 files changed, 65 insertions, 33 deletions
diff --git a/app/controllers/body_controller.rb b/app/controllers/body_controller.rb index 866cfa8aa..a1b08448e 100644 --- a/app/controllers/body_controller.rb +++ b/app/controllers/body_controller.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: body_controller.rb,v 1.12 2008-05-12 10:21:34 francis Exp $ +# $Id: body_controller.rb,v 1.13 2008-08-07 00:24:51 francis Exp $ class BodyController < ApplicationController # XXX tidy this up with better error messages, and a more standard infrastructure for the redirect to canonical URL @@ -34,6 +34,7 @@ class BodyController < ApplicationController @public_body = @public_bodies[0] @track_thing = TrackThing.create_track_for_public_body(@public_body) + @feed_autodetect = [ { :url => do_track_url(@track_thing, 'feed'), :title => @track_thing.params[:title_in_rss] } ] end def list diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb index c01683c03..e7da01417 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.30 2008-07-28 18:04:38 francis Exp $ +# $Id: general_controller.rb,v 1.31 2008-08-07 00:24:51 francis Exp $ class GeneralController < ApplicationController @@ -83,6 +83,7 @@ class GeneralController < ApplicationController @highlight_words = @xapian_requests.words_to_highlight @track_thing = TrackThing.create_track_for_search_query(query) + @feed_autodetect = [ { :url => do_track_url(@track_thing, 'feed'), :title => @track_thing.params[:title_in_rss] } ] end # For debugging diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index f01f514a1..4cb3e497d 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.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: request_controller.rb,v 1.94 2008-06-23 23:20:45 francis Exp $ +# $Id: request_controller.rb,v 1.95 2008-08-07 00:24:51 francis Exp $ class RequestController < ApplicationController @@ -38,6 +38,7 @@ class RequestController < ApplicationController # Track corresponding to this page @track_thing = TrackThing.create_track_for_request(@info_request) + @feed_autodetect = [ { :url => do_track_url(@track_thing, 'feed'), :title => @track_thing.params[:title_in_rss] } ] end # Requests similar to this one @@ -66,6 +67,8 @@ class RequestController < ApplicationController raise "unknown request list view " + @view.to_s end @xapian_object = perform_search([InfoRequestEvent], query, sortby, 'request_collapse') + + @feed_autodetect = [ { :url => do_track_url(@track_thing, 'feed'), :title => @track_thing.params[:title_in_rss] } ] end # Page new form posts to diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 7e3b0643d..d5726ed44 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.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: user_controller.rb,v 1.51 2008-07-30 13:37:21 francis Exp $ +# $Id: user_controller.rb,v 1.52 2008-08-07 00:24:51 francis Exp $ class UserController < ApplicationController # Show page about a set of users with same url name @@ -24,6 +24,7 @@ class UserController < ApplicationController # Track corresponding to this page @track_thing = TrackThing.create_track_for_user(@display_user) + @feed_autodetect = [ { :url => do_track_url(@track_thing, 'feed'), :title => @track_thing.params[:title_in_rss] } ] end # Login form diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb index d78ca26d7..b255885cb 100644 --- a/app/helpers/link_to_helper.rb +++ b/app/helpers/link_to_helper.rb @@ -5,7 +5,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: link_to_helper.rb,v 1.34 2008-07-18 22:22:58 francis Exp $ +# $Id: link_to_helper.rb,v 1.35 2008-08-07 00:24:51 francis Exp $ module LinkToHelper @@ -97,7 +97,7 @@ module LinkToHelper elsif track_thing.track_type == 'user_updates' track_user_url(:url_name => track_thing.tracked_user.url_name, :feed => feed) elsif track_thing.track_type == 'search_query' - track_search_url(track_thing.track_query, :feed => feed) + track_search_url(:query_array => track_thing.track_query, :feed => feed) else raise "unknown tracking type " + track_thing.track_type end diff --git a/app/models/track_thing.rb b/app/models/track_thing.rb index 7165719db..632f55f1c 100644 --- a/app/models/track_thing.rb +++ b/app/models/track_thing.rb @@ -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.27 2008-07-17 11:24:03 francis Exp $ +# $Id: track_thing.rb,v 1.28 2008-08-07 00:24:52 francis Exp $ class TrackThing < ActiveRecord::Base belongs_to :tracking_user, :class_name => 'User' @@ -74,7 +74,7 @@ class TrackThing < ActiveRecord::Base track_thing = TrackThing.new track_thing.track_type = 'public_body_updates' track_thing.public_body = public_body - track_thing.track_query = "variety:sent requested_from:" + public_body.url_name + track_thing.track_query = "requested_from:" + public_body.url_name return track_thing end @@ -82,7 +82,7 @@ class TrackThing < ActiveRecord::Base track_thing = TrackThing.new track_thing.track_type = 'user_updates' track_thing.tracked_user = user - track_thing.track_query = "variety:sent requested_by:" + user.url_name + track_thing.track_query = "requested_by:" + user.url_name return track_thing end @@ -154,17 +154,17 @@ class TrackThing < ActiveRecord::Base elsif self.track_type == 'public_body_updates' @params = { # Website - :set_title => "How would you like to be told about new requests to the public authority '" + CGI.escapeHTML(self.public_body.name) + "'?", + :set_title => "How would you like to track the public authority '" + CGI.escapeHTML(self.public_body.name) + "'?", :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 => "Be told about new requests to " + CGI.escapeHTML(self.public_body.name), - :verb_on_page_already => "being told about new requests to " + CGI.escapeHTML(self.public_body.name), + :verb_on_page => "Be told about requests to " + CGI.escapeHTML(self.public_body.name), + :verb_on_page_already => "being told about requests to " + CGI.escapeHTML(self.public_body.name), # Email - :title_in_email => "New " + self.public_body.law_only_short + " requests to '" + self.public_body.name + "'", - :title_in_rss => "New " + self.public_body.law_only_short + " requests to '" + self.public_body.name + "'", + :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 told about new requests to the public authority '" + CGI.escapeHTML(self.public_body.name) + "'", - :email => "Then you will be emailed whenever someone requests something from '" + CGI.escapeHTML(self.public_body.name) + "'.", - :email_subject => "Confirm you want to be told about new requests to '" + CGI.escapeHTML(self.public_body.name) + "'", + :web => "To be told about requests 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 told about requests to '" + CGI.escapeHTML(self.public_body.name) + "'", # RSS sorting :feed_sortby => 'newest' } @@ -173,15 +173,15 @@ class TrackThing < ActiveRecord::Base # Website :set_title => "How would you like track the person '" + CGI.escapeHTML(self.tracked_user.name) + "'?", :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 => "Be told about new requests by this person", - :verb_on_page_already => "being told about new requests by this person", + :verb_on_page => "Be told about requests by this person", + :verb_on_page_already => "being told about requests by this person", # Email - :title_in_email => "New FOI requests by '" + self.tracked_user.name + "'", - :title_in_rss => "New FOI requests by '" + self.tracked_user.name + "'", + :title_in_email => "FOI requests by '" + self.tracked_user.name + "'", + :title_in_rss => "FOI requests by '" + self.tracked_user.name + "'", # Authentication - :web => "To be told about new requests by '" + CGI.escapeHTML(self.tracked_user.name) + "'", - :email => "Then you will be emailed whenever '" + CGI.escapeHTML(self.tracked_user.name) + "' requests something", - :email_subject => "Confirm you want to be told about new requests by '" + CGI.escapeHTML(self.tracked_user.name) + "'", + :web => "To be told 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 told about requests by '" + CGI.escapeHTML(self.tracked_user.name) + "'", # RSS sorting :feed_sortby => 'newest' } diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml index 564903f0d..3f7f15dc4 100644 --- a/app/views/layouts/default.rhtml +++ b/app/views/layouts/default.rhtml @@ -16,6 +16,12 @@ %> <%= stylesheet_link_tag 'yucky-green', :title => "Yucky Green", :rel => yucky ? "stylesheet" : "alternate stylesheet" %> <%= stylesheet_link_tag 'main', :title => "Main", :rel => yucky ? "alternate stylesheet" : "stylesheet" %> + + <% if @feed_autodetect %> + <% for feed in @feed_autodetect %> + <link rel="alternate" type="application/atom+xml" title="<%=h feed[:title] %>" href="<%=h feed[:url]%>"> + <% end %> + <% end %> </head> <body> <div id="banner"> diff --git a/app/views/track/_tracking_people_and_link.rhtml b/app/views/track/_tracking_people_and_link.rhtml index fb59ca85c..3c8953336 100644 --- a/app/views/track/_tracking_people_and_link.rhtml +++ b/app/views/track/_tracking_people_and_link.rhtml @@ -22,10 +22,10 @@ <% if own_request %> <p>You will be emailed when there are updates to your own request.</p> <p>You may also <%= link_to "get an RSS feed", do_track_url(track_thing) %> - <img src="/images/feed-14.png" alt="" class="rss"></p> + <img src="/images/feed-16.png" alt="" class="rss"></p> <% else %> <%= link_to track_thing.params[:verb_on_page], do_track_url(track_thing) %> - (by email or RSS feed <img src="/images/feed-14.png" alt="" class="rss">) + (by email or RSS feed <img src="/images/feed-16.png" alt="" class="rss">) <% end %> <% end %> </p> @@ -33,13 +33,13 @@ <% if own_request %> <p>You will be emailed when there are updates to your own request.</p> <p>You may also get an <%= link_to 'RSS feed', do_track_url(track_thing) %> - <img src="/images/feed-14.png" alt="" class="rss"></p> + <img src="/images/feed-16.png" alt="" class="rss"></p> <% else %> <p>Be the first to <%= link_to MySociety::Format.lcfirst(track_thing.params[:verb_on_page]), do_track_url(track_thing) %> - (by email or RSS feed <img src="/images/feed-14.png" alt="" class="rss">)</p> + (by email or RSS feed <img src="/images/feed-16.png" alt="" class="rss">)</p> <% end %> <% end %> -<!-- <p><%= link_to '<img src="/images/feed-14.png" alt="" class="rss"> RSS feed', do_track_url(track_thing, 'feed') %></p> --> +<div class="feed_link"><%= link_to '<img src="/images/feed-16.png" alt="" class="rss">', do_track_url(track_thing, 'feed') %> <%= link_to 'RSS feed', do_track_url(track_thing, 'feed') %></div> diff --git a/db/migrate/061_include_responses_in_tracks.rb b/db/migrate/061_include_responses_in_tracks.rb new file mode 100644 index 000000000..f357e57c2 --- /dev/null +++ b/db/migrate/061_include_responses_in_tracks.rb @@ -0,0 +1,9 @@ +class IncludeResponsesInTracks < ActiveRecord::Migration + def self.up + TrackThing.update_all "track_query = replace(track_query, 'variety:sent ', '') where track_type in ('public_body_updates', 'user_updates')" + end + + def self.down + # XXX forget it + end +end diff --git a/db/schema.rb b/db/schema.rb index 3212913c8..7c94e4622 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 => 60) do +ActiveRecord::Schema.define(:version => 61) do create_table "acts_as_xapian_jobs", :force => true do |t| t.string "model", :null => false diff --git a/public/images/email-16.png b/public/images/email-16.png Binary files differnew file mode 100644 index 000000000..030eafde6 --- /dev/null +++ b/public/images/email-16.png diff --git a/public/images/feed-16.png b/public/images/feed-16.png Binary files differnew file mode 100644 index 000000000..1679ab05b --- /dev/null +++ b/public/images/feed-16.png diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css index 58da80f37..676f1ddeb 100644 --- a/public/stylesheets/main.css +++ b/public/stylesheets/main.css @@ -776,6 +776,15 @@ div#about_sidebar margin: 1.2em 0 1.2em 2em; } +/*---------------------------------- RSS and email alerts */ + +div.feed_link img { + border: none; + vertical-align: middle; + text-decoration: none; +} + + /*------------------------------------------------ footer */ #footer @@ -1,5 +1,6 @@ RSS move: Can remove "if @track_thing.track_medium == 'feed'" bits from track controller + views/user/show.rhtml feed Site move: @@ -40,14 +41,14 @@ Clear out all the need classifying requests Internal review status/marker? Request withdrawn by user status/marker? +Comments interleaved with body + Redo the RSS feeds - Look at Rob's TWFY.nz interface - 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 - Do something about shared spreadsheet user/show.rhtml sidebar vs. generic sidebar? (ask Tommy) @@ -56,6 +57,7 @@ There is grey on grey text in header? bad idea? Make it clearer people should ask for documents http://www.whatdotheyknow.com/request/unusual_markings_in_the_uk_skies + Later ===== @@ -100,7 +102,7 @@ today, or last week, or more recently. Do you think it would be worthwhile appending "($days days ago)" to the date of each message, and "($days days to go)" to the due dates? Saves people having to work out (in their heads or otherwise) how long they need to wait for -a response. (Etienne) +a response. (Etienne) Use distance_of_time_in_words to do this Maybe set it up to email team@ website errors? |