diff options
-rw-r--r-- | app/controllers/comment_controller.rb | 20 | ||||
-rw-r--r-- | app/controllers/request_controller.rb | 5 | ||||
-rw-r--r-- | app/views/comment/_comment_form.rhtml | 8 | ||||
-rw-r--r-- | app/views/comment/preview.rhtml | 6 | ||||
-rw-r--r-- | app/views/help/about.rhtml | 13 | ||||
-rw-r--r-- | app/views/request/show.rhtml | 4 | ||||
-rw-r--r-- | public/stylesheets/main.css | 2 | ||||
-rw-r--r-- | todo.txt | 4 |
8 files changed, 39 insertions, 23 deletions
diff --git a/app/controllers/comment_controller.rb b/app/controllers/comment_controller.rb index fe2b31daf..94abfe142 100644 --- a/app/controllers/comment_controller.rb +++ b/app/controllers/comment_controller.rb @@ -4,7 +4,7 @@ # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: comment_controller.rb,v 1.3 2008-08-26 22:54:45 francis Exp $ +# $Id: comment_controller.rb,v 1.4 2008-08-29 11:57:57 francis Exp $ class CommentController < ApplicationController @@ -43,7 +43,23 @@ class CommentController < ApplicationController # This automatically saves dependent objects in the same transaction @info_request.save! flash[:notice] = "Thank you for making an annotation!" - redirect_to comment_url(@comment) + + # Also subscribe to track for this request, so they get updates + if params[:subscribe_to_request] + @track_thing = TrackThing.create_track_for_request(@info_request) + @existing_track = TrackThing.find_by_existing_track(@user, @track_thing) + if not @existing_track + @track_thing.track_medium = 'email_daily' + @track_thing.tracking_user_id = @user.id + @track_thing.save! + flash[:notice] += " You will also be emailed updates about the request." + else + flash[:notice] += " You are already being emailed updates about the request." + end + end + + # we don't use comment_url here, as then you don't see the flash at top of page + redirect_to request_url(@info_request) else # do nothing - as "authenticated?" has done the redirect to signin page for us end diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 41c48dee3..e1df1287a 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.96 2008-08-27 00:39:03 francis Exp $ +# $Id: request_controller.rb,v 1.97 2008-08-29 11:57:57 francis Exp $ class RequestController < ApplicationController @@ -39,6 +39,9 @@ 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] } ] + + # Default to subscribing to requests + params[:subscribe_to_request] = true end # Requests similar to this one diff --git a/app/views/comment/_comment_form.rhtml b/app/views/comment/_comment_form.rhtml index 434a3ac3b..fce96d567 100644 --- a/app/views/comment/_comment_form.rhtml +++ b/app/views/comment/_comment_form.rhtml @@ -1,20 +1,18 @@ <% form_for(:comment, @comment, :url => { :controller => "comment", :action => "new", :type => "request" }, :html => { :id => 'comment_form' } ) do |f| %> <p> <%= f.text_area :body, :rows => 10, :cols => 55 %> + <br><script type="text/javascript">document.write('<input name="doSpell" type="button" value="Check spelling" onClick="openSpellChecker(document.getElementById(\'comment_form\').body);"/> (optional)')</script> </p> <p> - <script type="text/javascript">document.write('<input name="doSpell" type="button" value="Check spelling" onClick="openSpellChecker(document.getElementById(\'comment_form\').body);"/> (optional)')</script> - </p> - - <p> - Don't bother annotating with nonsense (<a href="/help/about#moderation">like what sort of nonsense?</a>). + <%= check_box_tag 'subscribe_to_request', "1", params[:subscribe_to_request] ? true : false %> <label for="subscribe_to_request">Email me future updates to this request</label> </p> <p> <%= hidden_field_tag 'submitted_comment', 1 %> <%= hidden_field_tag 'preview', 1 %> <%= submit_tag "Preview your annotation" %> + (<strong>no ranty</strong> politics, read our <a href="/help/about#moderation">moderation policy</a>) </p> <% end %> diff --git a/app/views/comment/preview.rhtml b/app/views/comment/preview.rhtml index a724d9117..38c5fe1ff 100644 --- a/app/views/comment/preview.rhtml +++ b/app/views/comment/preview.rhtml @@ -7,10 +7,14 @@ <%= render :partial => 'comment/single_comment', :locals => { :comment => @comment } %> <p> - Your name and annotation will appear in <strong>search engines</strong>. + Your name and annotation will appear in <strong>search engines</strong>. + </p> <p> <%= f.hidden_field(:body) %> + <% if params[:subscribe_to_request] %> + <%= hidden_field_tag(:subscribe_to_request, "1") %> + <% end %> <%= hidden_field_tag(:submitted_comment, 1) %> <%= hidden_field_tag(:preview, 0 ) %> <%= submit_tag "Re-edit this annotation", :name => 'reedit' %> diff --git a/app/views/help/about.rhtml b/app/views/help/about.rhtml index 0dcc16af0..0cdab2933 100644 --- a/app/views/help/about.rhtml +++ b/app/views/help/about.rhtml @@ -189,20 +189,15 @@ address should be treated as the return address." </p> </dd> -<dt id="moderation">What will you do to me if I annotate requests with nonsense?</dt> +<dt id="moderation">How do you moderate request annotations?</dt> <dd> -<p>It won't be pretty :). </p> -<p>Seriously, annotations on WhatDoTheyKnow are to help +<p>Annotations on WhatDoTheyKnow are to help people get the information they want, or to give them pointers to places they can go to help them act on it. We reserve the right to remove anything else. -Endless, content-free political discussions are not allowed, but -do post a link to a suitable forum elsewhere.</p> -<p>For example, if you think you know the reason someone posted a request, -and you don't approve of it, do not write a complex rant in the annotation. -Instead, simply write a short sentence, and link to another website which -already explains it in detail. </p> +<p>Endless, political discussions are not allowed. +Post a link to a suitable forum or campaign site elsewhere.</p> <dd> </dl> diff --git a/app/views/request/show.rhtml b/app/views/request/show.rhtml index c070faf97..c119ebbaa 100644 --- a/app/views/request/show.rhtml +++ b/app/views/request/show.rhtml @@ -101,7 +101,7 @@ <%= render :partial => 'correspondence', :locals => { :info_request_event => info_request_event } %> <% end %> - <div id="comment_container"> + <div id="add_annotation"> <h2>Add an annotation</h2> <p> @@ -147,7 +147,7 @@ <% end %> </ul> - + <%= render :partial => 'comment/comment_form', :locals => { } %> </div> </div> diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css index cfa3dc45b..633191c7a 100644 --- a/public/stylesheets/main.css +++ b/public/stylesheets/main.css @@ -648,7 +648,7 @@ div.comment_in_request margin: 0 0 0 0; overflow: auto; } -div#comment_container +div#add_annotation { clear: both; } @@ -29,8 +29,8 @@ Search for other extensions that we have now Comments interleaved with body - Annotation thing too far down when much sidebar e.g. http://localhost:3000/request/heya#outgoing-199 - - Email people when comments on their own request - - Email people when responses to their own comment, or warn them they need to sign up + - Refactor track/_tracking_links.rhtml so existing_track not calculated there + - Do not show track checkbox if already tracking - Test spell checker - Flag bad comments |