Skip to content

Commit

Permalink
Merge pull request #1456 from pulibrary/i1368_clickable_badge
Browse files Browse the repository at this point in the history
Added link to restrictions badge
  • Loading branch information
tpendragon authored Nov 19, 2024
2 parents 6d06e42 + d64af50 commit 77c9316
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/assets/stylesheets/modules/_document_access_badge.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
color: #8B640E;
background-color: #FCECBD;
border-color: #8B640E;
& a {
color: #8B640E;
}
}

&.restricted {
Expand Down
5 changes: 4 additions & 1 deletion app/views/catalog/_restricted_badge.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
</div>
<% elsif document.review? %>
<div class="document-access review">
<span class="media-body al-review-icon" aria-hidden="true"><%= blacklight_icon :"icon-review" %></span>Restrictions may apply. See Access Note.
<span class="media-body al-review-icon" aria-hidden="true">
<%= blacklight_icon :"icon-review" %>
</span>
<%= link_to("Restrictions may apply. See Access Note.", "#access" ) %>
</div>
<% end %>
7 changes: 7 additions & 0 deletions spec/features/catalog_view_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@
expect(page).to have_selector(".document-access.review", text: "Restrictions may apply. See Access Note.")
expect(page).to have_selector("#component-summary .document-access.restricted", text: "Restricted Content")
end
it "lets someone click on the access restrictions badge", js: true do
visit "/catalog/AC136_c2889"
click_on "Restrictions may apply. See Access Note."
# most of the access fields are also included on the main collection page
# used Location: because it was only showing on this tab
expect(page).to have_content("Location:")
end
end
context "with a no-digital-content collection show page" do
it "doesn't display Has Online Content", js: false do
Expand Down

0 comments on commit 77c9316

Please sign in to comment.