Skip to content

Commit

Permalink
Fixes #3164 - Collection Thumbnails don't show in search results.
Browse files Browse the repository at this point in the history
  • Loading branch information
hweng committed Sep 24, 2018
1 parent 6e1970b commit c6c3f26
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion app/views/catalog/_thumbnail_list_collection.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<div class="col-md-2">
<span class="<%= Hyrax::ModelIcon.css_class_for(Collection) %> collection-icon-search" aria-hidden="true"></span>
<% collection_presenter = Hyrax::CollectionPresenter.new(document, current_ability) %>
<% if (collection_presenter.thumbnail_path == nil) %>
<span class="<%= Hyrax::ModelIcon.css_class_for(Collection) %> collection-icon-search" aria-hidden="true"></span>
<% else %>
<%= image_tag(collection_presenter.thumbnail_path) %>
<% end %>
</div>

2 changes: 1 addition & 1 deletion spec/features/search_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
expect(page).to have_content('Search Results')
expect(page).to have_content "Toothbrush"
expect(page).to have_content('collection title abc')
expect(page).to have_css("span.collection-icon-search")
expect(page).to have_selector("//img")

expect(page.body).to include "<span itemprop=\"keywords\"><a href=\"/catalog?f%5Bkeyword_sim%5D%5B%5D=taco&amp;locale=en\">taco</a></span>"
expect(page.body).to include "<span itemprop=\"keywords\"><a href=\"/catalog?f%5Bkeyword_sim%5D%5B%5D=mustache&amp;locale=en\">mustache</a></span>"
Expand Down

0 comments on commit c6c3f26

Please sign in to comment.