-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Delete unused template * Do not show SubGuide heading if there are not any SubGuide cards * Removed home link from the show pages Co-authored-by: Anna Headley <hackartisan@users.noreply.github.com> Co-authored-by: Bess Sadler <bess@users.noreply.github.com>
- Loading branch information
1 parent
a38160c
commit 58c3ccc
Showing
7 changed files
with
48 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
<h2>Guide: <%= @guide_card.heading %></h2> | ||
|
||
<%= render "shared/return_to_home" %> | ||
<% if @sub_guide_cards.present? %> | ||
<h3>SubGuide Cards</h3> | ||
<ul id="sg_index"> | ||
<% @sub_guide_cards.each do |sub_guide| %> | ||
<li> <%= link_to sub_guide.heading, sub_guide_card_path(sub_guide.id) %> </li> | ||
<% end %> | ||
</ul> | ||
<% end %> | ||
|
||
<h3>List of SubGuide Cards</h3> | ||
<ul id="sg_index"> | ||
<% @sub_guide_cards.each do |sub_guide| %> | ||
<li> <%= link_to sub_guide.heading, sub_guide_card_path(sub_guide.id) %> </li> | ||
<% end %> | ||
</ul> | ||
|
||
<% @card_images.each do |image| %> | ||
<% @card_images.each do |image| %> | ||
<ul> | ||
<%= image_tag(image.iiif_url, alt: "Catalog Card") %> | ||
</ul> | ||
<% end %> | ||
<% end %> | ||
|
||
<%= paginate @card_images %> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
RSpec.describe 'Card Images Pagination', type: :system, js: true do | ||
let(:guide_card_fixture) { Rails.root.join('spec', 'fixtures', 'guide_card_fixture.csv') } | ||
before do | ||
GuideCardLoadingService.new(csv_location: guide_card_fixture).import | ||
(1..21).each do |i| | ||
ci = CardImage.new | ||
ci.path = '14/0001/B4491' | ||
ci.image_name = "fake_image_#{i}.jpg" | ||
ci.save | ||
end | ||
end | ||
|
||
describe 'GuideCards show page' do | ||
it 'displays and paginates through card images' do | ||
visit '/guide_cards/2' | ||
expect(page.all('div#main-content ul img').count).to eq 10 | ||
expect(page.all('div#main-content ul img').last[:src]).to match(/fake_image_10.jpg/) | ||
expect(page).to have_link('Next', href: '/guide_cards/2?page=2') | ||
click_link('Next') | ||
expect(page.all('div#main-content ul img')[3][:src]).to match(/fake_image_14.jpg/) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters