Skip to content

Commit

Permalink
Merge pull request #236 from sul-dlss/modify-zero-results
Browse files Browse the repository at this point in the history
adds feedback link to zero results page
  • Loading branch information
Darren Hardy committed Apr 9, 2015
2 parents 30bc7ab + ff09d18 commit 44d775e
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/assets/stylesheets/earthworks.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
@import 'modules/show';
@import 'modules/sul_footer';
@import 'modules/top_navbar';
@import 'modules/zero_results';


#su-wrap {
Expand Down
9 changes: 9 additions & 0 deletions app/assets/stylesheets/modules/zero_results.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.noresults {
.modify-search:before {
@extend .fa, .fa-search;
}

.ask-for-dataset:before {
@extend .fa, .fa-bullhorn;
}
}
18 changes: 18 additions & 0 deletions app/views/catalog/_zero_results.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<h2><%= t 'blacklight.search.zero_results.title' %></h2>
<div id="documents" class="noresults">
<h3 class='modify-search'> <%= t 'blacklight.search.zero_results.modify_search' %></h3>
<ul>
<li><%= t 'blacklight.search.zero_results.use_fewer_keywords' %></li>

<% if params[:q] and params[:search_field] and params[:search_field] != blacklight_config.default_search_field.try(:key) %>
<li><%= t 'blacklight.search.zero_results.search_fields', :search_fields => search_field_label(params) %> -
<%= link_to t('blacklight.search.zero_results.search_everything', field: blacklight_config.default_search_field.label), url_for(params_for_search(:search_field=>blacklight_config.default_search_field.key)) %>
</li>
<% end %>
</ul>
<h3 class='ask-for-dataset'> Ask for a dataset to be added</h3>
<p>You can submit <%= link_to feedback_path, data: { toggle: 'collapse', target: '#feedback-form' } do %>
feedback
<% end %> to the <%= link_to 'EarthWorks', root_path %> team requesting data to be added.
</p>
</div>
11 changes: 11 additions & 0 deletions spec/features/zero_results_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require 'rails_helper'

feature 'Zero results' do
scenario 'includes feedback text and link' do
visit catalog_index_path q: 'xyz'
within '.noresults' do
expect(page).to have_css '.ask-for-dataset'
expect(page).to have_css 'a', text: 'feedback'
end
end
end

0 comments on commit 44d775e

Please sign in to comment.