From 4f02cb989cd3eb0f01bd6dad1d13400f57c1e745 Mon Sep 17 00:00:00 2001 From: francis Date: Thu, 2 Oct 2008 23:11:39 +0000 Subject: Option to hide comments. --- app/controllers/admin_request_controller.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'app/controllers/admin_request_controller.rb') diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb index 446b5263c..70db7cd8a 100644 --- a/app/controllers/admin_request_controller.rb +++ b/app/controllers/admin_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: admin_request_controller.rb,v 1.23 2008-09-24 19:43:21 francis Exp $ +# $Id: admin_request_controller.rb,v 1.24 2008-10-02 23:11:40 francis Exp $ class AdminRequestController < ApplicationController layout "admin" @@ -110,11 +110,15 @@ class AdminRequestController < ApplicationController @comment = Comment.find(params[:id]) old_body = @comment.body + old_visible = @comment.visible + @comment.visible = params[:comment][:visible] == "true" ? true : false if @comment.update_attributes(params[:comment]) @comment.info_request.log_event("edit_comment", { :comment_if => @comment.id, :editor => admin_http_auth_user(), - :old_body => old_body, :body => @comment.body }) + :old_body => old_body, :body => @comment.body, + :old_visible => old_visible, :visible => @comment.visible, + }) flash[:notice] = 'Comment successfully updated.' redirect_to request_admin_url(@comment.info_request) else -- cgit v1.2.3