diff --git a/app/controllers/data_files_controller.rb b/app/controllers/data_files_controller.rb index de751f1388..b0f5ff67c2 100644 --- a/app/controllers/data_files_controller.rb +++ b/app/controllers/data_files_controller.rb @@ -145,12 +145,19 @@ def filter end end - def samples_table + def extracted_samples + @samples = @data_file.extracted_samples.includes(:sample_type) + respond_to do |format| + format.html + end + end + + def extracted_samples_table respond_to do |format| format.html do render(partial: 'samples/table_view', locals: { samples: @data_file.extracted_samples.includes(:sample_type), - source_url: samples_table_data_file_path(@data_file) + source_url: extracted_samples_table_data_file_path(@data_file) }) end format.json { @samples = @data_file.extracted_samples.select([:id, :title, :json_metadata]) } diff --git a/app/views/assets/_asset_buttons.html.erb b/app/views/assets/_asset_buttons.html.erb index 4138e3b706..697f78c874 100644 --- a/app/views/assets/_asset_buttons.html.erb +++ b/app/views/assets/_asset_buttons.html.erb @@ -20,7 +20,7 @@ <% end %> <% if asset.extracted_samples.any? %> - <%= button_link_to("View samples", 'view_samples', data_file_samples_path(asset)) %> + <%= button_link_to("View extracted samples", 'view_samples', extracted_samples_data_file_path(asset)) %> <% end %> <% if attempt_to_show_extract_samples_button?(asset, display_asset) %> diff --git a/app/views/data_files/_sample_persistence_status.html.erb b/app/views/data_files/_sample_persistence_status.html.erb index 44bc8f12be..093e078339 100644 --- a/app/views/data_files/_sample_persistence_status.html.erb +++ b/app/views/data_files/_sample_persistence_status.html.erb @@ -42,7 +42,7 @@
You can view the new samples by clicking the button below.
- <%= link_to('View Created Samples', data_file_samples_path(data_file), + <%= link_to('View Created Samples', extracted_samples_data_file_path(data_file), class: 'btn btn-primary') %> <% end %> <% end %> diff --git a/app/views/data_files/extracted_samples.html.erb b/app/views/data_files/extracted_samples.html.erb new file mode 100644 index 0000000000..849b9eff92 --- /dev/null +++ b/app/views/data_files/extracted_samples.html.erb @@ -0,0 +1,14 @@ +<% if @samples.any? %> +