From: Andy Allan Date: Wed, 13 Sep 2017 15:12:36 +0000 (+0100) Subject: Rework the 'issues not found' notice slightly. X-Git-Tag: live~3002^2~95 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/7ffec2eb389a446b583f6768934b273d665ec2a3 Rework the 'issues not found' notice slightly. Previously it would go into a redirect loop if there were no issues in the database. --- diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 67c0d5b6e..534cc2fde 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -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) diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index f9f2c28f9..a490223ae 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -1,5 +1,3 @@ -

<%= notice %>

- <% content_for :heading do %>

List of <%= @user_role %> issues:

<% end %> @@ -13,6 +11,11 @@ Search for a particular issue(s):
<%= submit_tag "Search" %> <% end %>
+ +<% if @issues.length == 0 %> +

<%= t ".search.issues_not_found" %>

+<% end %> +