]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/issues_controller.rb
Use lazy lookups for translations in issues
[rails.git] / app / controllers / issues_controller.rb
index deec96b7a4f11c8391738fd3ef4ebd22659cd5e1..72952894624195f734efc61925c363492a458c22 100644 (file)
@@ -22,7 +22,8 @@ class IssuesController < ApplicationController
       if @find_user
         @issues = @issues.where(:reported_user_id => @find_user.id)
       else
-        notice = t("issues.index.user_not_found")
+        @issues = @issues.none
+        flash.now[:warning] = t(".user_not_found")
       end
     end
 
@@ -34,8 +35,6 @@ class IssuesController < ApplicationController
       last_updated_by = params[:last_updated_by].to_s == "nil" ? nil : params[:last_updated_by].to_i
       @issues = @issues.where(:updated_by => last_updated_by)
     end
-
-    redirect_to issues_path, :notice => notice if notice
   end
 
   def show
@@ -50,7 +49,7 @@ class IssuesController < ApplicationController
   def resolve
     if @issue.resolve
       @issue.save!
-      redirect_to @issue, :notice => t("issues.resolved")
+      redirect_to @issue, :notice => t(".resolved")
     else
       render :show
     end
@@ -60,7 +59,7 @@ class IssuesController < ApplicationController
     if @issue.ignore
       @issue.updated_by = current_user.id
       @issue.save!
-      redirect_to @issue, :notice => t("issues.ignored")
+      redirect_to @issue, :notice => t(".ignored")
     else
       render :show
     end
@@ -70,7 +69,7 @@ class IssuesController < ApplicationController
     if @issue.reopen
       @issue.updated_by = current_user.id
       @issue.save!
-      redirect_to @issue, :notice => t("issues.reopened")
+      redirect_to @issue, :notice => t(".reopened")
     else
       render :show
     end