Skip to content

Commit

Permalink
restore multi-downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Cain committed Nov 21, 2023
1 parent 361b5ec commit 6f2e6c7
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 23 deletions.
32 changes: 32 additions & 0 deletions app/views/catalog/_downloads_collapse.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<%# Renders the options of the downloads dropdown button %>
<% document ||= @document %>

<% if document.multi_direct_downloads.present? %>
<% document.multi_direct_downloads.each do |download| %>
<%= download_link_file(download[0], document.id, download[1]) %>
<% end %>
<% end %>
<% if document.direct_download.present? %>
<% if document.direct_download[:download].is_a? Array %>
<% document.direct_download[:download].each do |download| %>
<%= download_link_file(download['label'], document.id, download['url']) %>
<% end %>
<% end %>
<% if document.direct_download[:download].is_a? String %>
<%= download_link_file(download_text(document.file_format), document.id, document.direct_download[:download]) %>
<% end %>
<% end %>

<% if document.hgl_download.present? %>
<%= download_link_hgl(download_text(document.download_types.first[0]), document) %>
<% end %>

<% if document.iiif_download.present? %>
<%= download_link_iiif %>
<% end %>

<% if document.download_types.present? %>
<% document.download_types.each do |type| %>
<%= download_link_generated(type.first, document) %>
<% end %>
<% end %>
24 changes: 1 addition & 23 deletions spec/features/show_page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,34 +51,12 @@
click_on 'Download'

expect(page).to have_content('LAZ (Point-cloud)')
expect(page).to have_link(
'Export', href: 'https://archive.nyu.edu/retrieve/80003/nyu_2451_38645_pc_F_150326_120403.zip'
)

expect(page).to have_content('LAS (Full-waveform)')
expect(page).to have_link(
'Export', href: 'https://archive.nyu.edu/retrieve/80002/nyu_2451_38645_fwf_las_F_150326_120403.zip'
)

expect(page).to have_content('Pulsewaves (Full-waveform)')
expect(page).to have_link(
'Export', href: 'https://archive.nyu.edu/retrieve/80005/nyu_2451_38645_fwf_plswvs_F_150326_120403.zip'
)

expect(page).to have_content('GeoTIFF (Geo-referenced RGB)')
expect(page).to have_link(
'Export', href: 'https://archive.nyu.edu/retrieve/80240/nyu_2451_38645_rgb_F_150326_120403.zip'
)

expect(page).to have_content('GeoTIFF (Geo-referenced CIR)')
expect(page).to have_link(
'Export', href: 'https://archive.nyu.edu/retrieve/80001/nyu_2451_38645_cir_F_150326_120403.zip'
)

expect(page).to have_content('JPG (Oblique photos)')
expect(page).to have_link(
'Export', href: 'https://archive.nyu.edu/retrieve/80004/nyu_2451_38645_oblique_F_150326_120403.zip'
)

end
end
# rubocop:enable RSpec/ExampleLength, RSpec/MultipleExpectations
Expand Down

0 comments on commit 6f2e6c7

Please sign in to comment.