Skip to content

Commit

Permalink
Merge pull request #1139 from sul-dlss/t1134-version-banner-link
Browse files Browse the repository at this point in the history
Add link to old version banner
  • Loading branch information
jcoyne authored Aug 16, 2024
2 parents 405af5d + 41930ea commit 523e1de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/controllers/purl_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ def maybe_add_flash_message!
flash.now[:alert] = '<b>This version has been withdrawn</b><br>' \
"Please visit #{view_context.link_to purl_url(@purl), purl_url(@purl)} to view the other versions of this item."
elsif !@version.head?
flash.now[:alert] = 'A newer version of this item is available'
flash.now[:alert] = 'A newer version of this item is available.<br>' \
"#{view_context.link_to 'View latest version', purl_url(@purl)}"
end
end

Expand Down
1 change: 1 addition & 0 deletions spec/requests/purl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
'Compressed Sensing Phase Transitions of Gaussian Random Matrices.&quot; -- VERSION 1'
)
expect(response.body).to include('A newer version of this item is available')
expect(response.body).to have_link('View latest version', href: 'http://www.example.com/wp335yr5649')
expect(response.body).to have_css('div.upper-record-metadata')
expect(response.body).to have_css('div.record-metadata')
end
Expand Down

0 comments on commit 523e1de

Please sign in to comment.