Rework the 'issues not found' notice slightly.

Previously it would go into a redirect loop if there were no issues
in the database.
This commit is contained in:
Andy Allan 2017-09-13 16:12:36 +01:00
parent 659270dafe
commit 7ffec2eb38
2 changed files with 5 additions and 4 deletions

View 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)

View file

@ -1,5 +1,3 @@
<p id= "notice"><%= notice %></p>
<% content_for :heading do %>
<h1>List of <%= @user_role %> issues:</h1>
<% end %>
@ -13,6 +11,11 @@ Search for a particular issue(s): <br/>
<%= submit_tag "Search" %>
<% end %>
<br/>
<% if @issues.length == 0 %>
<p><%= t ".search.issues_not_found" %></p>
<% end %>
<br/>
<table>