X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c32f6dd4fffe1d2b5fc34f42e447e7b5c8fc5b92..fe81ac334cfef04751a959297dca24e472cb025f:/app/controllers/issues_controller.rb diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 1baf533f4..516fb68ce 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -18,8 +18,8 @@ class IssuesController < ApplicationController @title = t ".title" @issue_types = [] - @issue_types.push("Note", "User") if current_user.moderator? - @issue_types.push("DiaryEntry", "DiaryComment", "User") if current_user.administrator? + @issue_types |= %w[Note User] if current_user.moderator? + @issue_types |= %w[DiaryEntry DiaryComment User] if current_user.administrator? @users = User.joins(:roles).where(:user_roles => { :role => current_user.roles.map(&:role) }).distinct @issues = Issue.visible_to(current_user) @@ -27,12 +27,11 @@ class IssuesController < ApplicationController # If search if params[:search_by_user].present? @find_user = User.find_by(:display_name => params[:search_by_user]) - if @find_user - @issues = @issues.where(:reported_user => @find_user) - else - @issues = @issues.none - flash.now[:warning] = t(".user_not_found") - end + @issues = if @find_user + @issues.where(:reported_user => @find_user) + else + @issues.none + end end @issues = @issues.where(:status => params[:status]) if params[:status].present? @@ -45,6 +44,7 @@ class IssuesController < ApplicationController end @issues, @newer_issues_id, @older_issues_id = get_page_items(@issues, :limit => @params[:limit]) + render :partial => "page" if turbo_frame_request_id == "pagination" end def show