]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/issues_controller.rb
Merge branch 'master' into moderation
[rails.git] / app / controllers / issues_controller.rb
index 67c0d5b6ef8fe0d670a0a512c06ba95231ca67cc..e156ea004ba651face0adc69355894f69803930a 100644 (file)
@@ -45,8 +45,6 @@ class IssuesController < ApplicationController
       @issues = @issues.where(:updated_by => last_updated_by)
     end
 
-    notice = t("issues.index.search.issues_not_found") if @issues.first.nil?
-
     if params[:last_reported_by] && params[:last_reported_by][0].present?
       last_reported_by = params[:last_reported_by][0].to_s == "nil" ? nil : params[:last_reported_by][0].to_i
       @issues = @issues.where(:updated_by => last_reported_by)
@@ -60,6 +58,7 @@ class IssuesController < ApplicationController
     @unread_reports = @issue.unread_reports
     @comments = @issue.comments
     @related_issues = @issue.reported_user.issues.where(:issue_type => @user_role)
+    @new_comment = IssueComment.new(:issue => @issue)
   end
 
   def update
@@ -96,25 +95,6 @@ class IssuesController < ApplicationController
     end
   end
 
-  def comment
-    @issue = Issue.find(params[:id])
-    if issue_comment_params.blank?
-      notice = t("issues.comment.provide_details")
-    else
-      @issue_comment = @issue.comments.build(issue_comment_params)
-      @issue_comment.commenter_user_id = current_user.id
-      if params[:reassign]
-        reassign_issue
-        @issue_comment.reassign = true
-      end
-      @issue_comment.save!
-      @issue.updated_by = current_user.id
-      @issue.save!
-      notice = t("issues.comment.comment_created")
-    end
-    redirect_to @issue, :notice => notice
-  end
-
   # Status Transistions
   def resolve
     if @issue.resolve