diff options
-rw-r--r-- | app/controllers/comment_controller.rb | 3 | ||||
-rw-r--r-- | app/views/comment/_comment_form.rhtml | 2 | ||||
-rw-r--r-- | app/views/comment/new.rhtml | 2 | ||||
-rw-r--r-- | app/views/request/show.rhtml | 2 | ||||
-rw-r--r-- | todo.txt | 3 |
5 files changed, 6 insertions, 6 deletions
diff --git a/app/controllers/comment_controller.rb b/app/controllers/comment_controller.rb index 94abfe142..8ac6d3850 100644 --- a/app/controllers/comment_controller.rb +++ b/app/controllers/comment_controller.rb @@ -4,13 +4,14 @@ # 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.4 2008-08-29 11:57:57 francis Exp $ +# $Id: comment_controller.rb,v 1.5 2008-08-29 12:03:40 francis Exp $ class CommentController < ApplicationController def new if params[:type] == 'request' @info_request = InfoRequest.find_by_url_title(params[:url_title]) + @track_thing = TrackThing.create_track_for_request(@info_request) @comment = Comment.new(params[:comment].merge({ :comment_type => 'request', :user => @user diff --git a/app/views/comment/_comment_form.rhtml b/app/views/comment/_comment_form.rhtml index fce96d567..7ce6ac99a 100644 --- a/app/views/comment/_comment_form.rhtml +++ b/app/views/comment/_comment_form.rhtml @@ -4,9 +4,11 @@ <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> + <% if !TrackThing.find_by_existing_track(@user, track_thing) %> <p> <%= 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> + <% end %> <p> <%= hidden_field_tag 'submitted_comment', 1 %> diff --git a/app/views/comment/new.rhtml b/app/views/comment/new.rhtml index b377f82fa..3109af360 100644 --- a/app/views/comment/new.rhtml +++ b/app/views/comment/new.rhtml @@ -13,4 +13,4 @@ <h1>Add an annotation</h1> -<%= render :partial => 'comment/comment_form', :locals => { } %> +<%= render :partial => 'comment/comment_form', :locals => { :track_thing => @track_thing } %> diff --git a/app/views/request/show.rhtml b/app/views/request/show.rhtml index c119ebbaa..5e4b28d2b 100644 --- a/app/views/request/show.rhtml +++ b/app/views/request/show.rhtml @@ -148,7 +148,7 @@ </ul> - <%= render :partial => 'comment/comment_form', :locals => { } %> + <%= render :partial => 'comment/comment_form', :locals => { :track_thing => @track_thing } %> </div> </div> @@ -29,9 +29,6 @@ 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 - - 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 - Delete comments from admin interface |