diff --git a/app/views/stash_engine/user_admin/_user_datasets.erb b/app/views/stash_engine/user_admin/_user_datasets.erb index 6e95a9013f..c4a8fb1615 100644 --- a/app/views/stash_engine/user_admin/_user_datasets.erb +++ b/app/views/stash_engine/user_admin/_user_datasets.erb @@ -29,15 +29,16 @@
- <%= link_to truncate(p.title), stash_url_helpers.edit_histories_path(resource_id: p.resource.id) %> -
- <% if (p.resource.submitted? && current_user.min_curator?) || p.resource.dataset_in_progress_editor&.id == current_user.id %> -
- <%= form_with(url: stash_url_helpers.metadata_entry_pages_new_version_path, method: :post) do -%> - - <%= hidden_field_tag :resource_id, p.resource.id %> - <% end %> + <%= link_to truncate(p.title), stash_url_helpers.show_path(id: p.resource.identifier_str), target: '_blank' %>
+ <% if policy([:stash_engine, :admin_datasets]).curation_actions? && ((p.resource.permission_to_edit?(user: current_user) && p.resource.last_curation_activity.status == 'submitted') || (p.resource.last_curation_activity.status == 'in_progress' && p.resource.current_editor_id == current_user.id)) %> +
+ <%= form_with(url: stash_url_helpers.metadata_entry_pages_new_version_path, method: :post) do %> + <%= hidden_field_tag :resource_id, p.resource.id, id: "resource_id_#{p.resource.id}" %> + <%= hidden_field_tag :return_url, '/stash/dashboard' %> + + <% end %> +
<% end %>
@@ -58,12 +59,13 @@
<%= p.edited_by_name_w_role %>
-
- <%= form_with(url: stash_url_helpers.edit_histories_path, method: :get) do -%> - <%= hidden_field_tag :resource_id, p.resource.id %> - + <% if policy([:stash_engine, :admin_datasets]).activity_log? %> +
+ + + +
<% end %> -