Skip to content

Commit

Permalink
Showing 4 changed files with 27 additions and 19 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -7,8 +7,10 @@ and releases in Jupiter project adheres to [Semantic Versioning](http://semver.o
## [Unreleased]

### Added
- regression tests for downloading restricted items from search results [PR#1070](https://github.com/ualbertalib/jupiter/pull/1070)

- regression tests for downloading restricted items from search results [PR#1070](https://github.com/ualbertalib/jupiter/pull/1069)
### Fixed
- use the download url helper on the search results page [PR#1079](https://github.com/ualbertalib/jupiter/pull/1079)

## [1.2.11] - 2019-04-05

21 changes: 11 additions & 10 deletions app/views/application/_item.html.erb
Original file line number Diff line number Diff line change
@@ -6,18 +6,19 @@
<div class="media-body ml-3">
<div class="d-flex flex-wrap flex-lg-nowrap align-items-start">
<h3 class="mt-0 h5 mr-auto"><%= link_to item.title, item_path(item) %></h3>

<% primary_file = item.files.first %>
<% if policy(item).download? && primary_file.present?%>
<%= link_to url_for(primary_file),
class: 'btn btn-secondary mr-2 mb-2 mb-md-0',
rel: 'nofollow',
download: primary_file.filename.to_s do %>
<%= fa_icon 'cloud-download' %>
<%= t('download') %>
<% if policy(item).download? %>
<% primary_file = item.files.first %>
<% if primary_file.present? && primary_file.fileset_uuid.present? %>
<%= link_to file_download_item_url(id: primary_file.record.owner.id,
file_set_id: primary_file.fileset_uuid),
class: 'btn btn-secondary mr-2 mb-2 mb-md-0',
rel: 'nofollow',
download: primary_file.filename.to_s do %>
<%= fa_icon 'cloud-download' %>
<%= t('download') %>
<% end %>
<% end %>
<% end %>

<% if policy(item).update? || policy(item).destroy? %>
<div class="btn-group">
<% if policy(item).update? %>
19 changes: 11 additions & 8 deletions app/views/application/_thesis.html.erb
Original file line number Diff line number Diff line change
@@ -6,14 +6,17 @@
<div class="d-flex flex-wrap flex-lg-nowrap align-items-start">
<h3 class="mt-0 h5 mr-auto"><%= link_to thesis.title, item_path(thesis) %></h3>

<% primary_file = thesis.files.first %>
<% if primary_file.present? %>
<%= link_to url_for(primary_file),
class: 'btn btn-secondary mr-2 mb-2 mb-md-0',
rel: 'nofollow',
download: primary_file.filename.to_s do %>
<%= fa_icon 'cloud-download' %>
<%= t('download') %>
<% if policy(thesis).download? %>
<% primary_file = thesis.files.first %>
<% if primary_file.present? && primary_file.fileset_uuid.present? %>
<%= link_to file_download_item_url(id: primary_file.record.owner.id,
file_set_id: primary_file.fileset_uuid),
class: 'btn btn-secondary mr-2 mb-2 mb-md-0',
rel: 'nofollow',
download: primary_file.filename.to_s do %>
<%= fa_icon 'cloud-download' %>
<%= t('download') %>
<% end %>
<% end %>
<% end %>

2 changes: 2 additions & 0 deletions test/system/search_test.rb
Original file line number Diff line number Diff line change
@@ -361,6 +361,8 @@ def before_all
# Should see the download link for CCID item
within '.list-group-item', text: 'Fancy CCID Item' do
assert_selector 'a', text: 'Download'
assert_link href: /download/
assert_no_link href: /active_storage/
end

# A checkbox for the facet should be unchecked, and link should turn on facet

0 comments on commit f410e69

Please sign in to comment.