Skip to content
This repository has been archived by the owner on May 14, 2022. It is now read-only.

Commit

Permalink
Merge pull request #779 from pulibrary/thumbnail_edit
Browse files Browse the repository at this point in the history
add back to search links
  • Loading branch information
Trey Pendragon committed Oct 20, 2016
2 parents 73c2132 + 485e24c commit 916e67d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
4 changes: 4 additions & 0 deletions app/assets/stylesheets/components/catalog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ dl.document-metadata {
padding-left: 0;
}
}

.back-to-search {
margin-bottom: 10px;
}
2 changes: 2 additions & 0 deletions app/views/collections/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<%= render 'search_sidebar' %>
<% end %>
<%= render 'shared/back_to_search' %>

<div id="content">
<% @presenter.title.each do |title| %>
<h1 class="lower"><%= title %></h1>
Expand Down
7 changes: 4 additions & 3 deletions app/views/curation_concerns/base/_title_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% @presenter.title.each do |title| %>
<h1 dir="<%= title.dir %>"><%= title %></h1>
<% end %>
<%= render 'shared/back_to_search' %>
<% @presenter.title.each do |title| %>
<h1 dir="<%= title.dir %>"><%= title %></h1>
<% end %>
3 changes: 3 additions & 0 deletions app/views/shared/_back_to_search.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<% if current_search_session and current_search_session.query_params %>
<%= link_to t('blacklight.back_to_search'), Rails.application.routes.url_for(current_search_session.query_params.symbolize_keys), class: 'btn btn-default back-to-search' %>
<% end %>
9 changes: 8 additions & 1 deletion spec/features/scanned_resource_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,18 @@
scanned_resource
end

scenario "Viewing a scanned resource it should display both titles" do
scenario "Viewing a scanned resource directly it should display both titles" do
visit polymorphic_path [scanned_resource]
expect(page).to have_selector "h1", text: "first title"
expect(page).to have_selector "h1", text: "second title"
expect(page).not_to have_selector "h1", text: "first title, second title"
expect(page).not_to have_selector "a", text: I18n.t('blacklight.back_to_search')
end

scenario "Viewing a scanned resource from a search it should include link back to search" do
visit search_catalog_path q: "title"
first('.index_title > a').click
expect(page).to have_selector "a", text: I18n.t('blacklight.back_to_search')
end
end
end

0 comments on commit 916e67d

Please sign in to comment.