Skip to content
Browse files

add no results for [blank] message for searches with no result.

Conflicts:
	app/views/refinery/search/show.html.erb
  • Loading branch information...
1 parent 41cc12a commit 2b4f16ac10d891e436845367cc9c3c78ea65d2de @chrisftw chrisftw committed with ugisozols
Showing with 14 additions and 10 deletions.
  1. +13 −10 app/views/refinery/search/show.html.erb
  2. +1 −0 config/locales/en.yml
View
23 app/views/refinery/search/show.html.erb
@@ -2,18 +2,21 @@
<%= t('.search_results_for', :what => params[:query]) %>
<% end %>
-<% content_for :body_content_left do %>
- <ul id="search_results">
- <% @results.each do |result| %>
- <li>
- <span class='result_type'>
- <%= result_type result %>
- </span>
- <%= link_to result_title(result).html_safe, result_url(result) %>
- </li>
+<% content_for :body do %>
+ <% if @results.empty? %>
+ <%= t('.no_results_for', :what => params[:query]) %>
+ <% else %>
+ <ul id="search_results">
+ <% @results.each do |result| %>
+ <li>
+ <span class='result_type'>
+ <%= result_type result %>
+ </span>
+ <%= link_to result_title(result).html_safe, result_url(result) %>
+ </li>
+ <% end %>
<% end %>
</ul>
-
<% end %>
<%= render :partial => "/refinery/content_page" %>
View
1 config/locales/en.yml
@@ -7,3 +7,4 @@ en:
search:
show:
search_results_for: Search Results for '%{what}'
+ no_results_for: No results found for your search '%{what}'.

0 comments on commit 2b4f16a

Please sign in to comment.
Something went wrong with that request. Please try again.