X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/06a0c1d9f2e6cf1d5a9fd00b53071d857252f9fa..370df5a95b6b143885fa4d96be90c51f25f8ad14:/apps/workbench/app/views/collections/_sharing_button.html.erb diff --git a/apps/workbench/app/views/collections/_sharing_button.html.erb b/apps/workbench/app/views/collections/_sharing_button.html.erb index b4f59f7015..fc81e705e4 100644 --- a/apps/workbench/app/views/collections/_sharing_button.html.erb +++ b/apps/workbench/app/views/collections/_sharing_button.html.erb @@ -1,8 +1,21 @@ -<% if @search_sharing.any? %> - <% linktext = "Shared" %> - <% btnstyle = "btn-success" %> -<% else %> - <% linktext = "Share" %> - <% btnstyle = "btn-info" %> +<%# a nil @search_sharing means we got an AccessForbiddenException and should +disable this feature entirely. %> +<% if @search_sharing != nil %> + <% if @search_sharing.any? %> +
Shared at: + + <%= link_to "Unshare", unshare_collection_url, { + class: 'btn-xs btn-info', + remote: true, + method: 'post' + } %> +
<%= link_to download_link, download_link %>
+
+ <% else %> + <%= link_to "Create sharing link", share_collection_url, { + class: 'btn-xs btn-info', + remote: true, + method: 'post' + } %> + <% end %> <% end %> -<%= link_to linktext, sharing_popup_collection_url(id: @object.uuid), {class: "btn-xs #{btnstyle}", :remote => true, 'data-toggle' => "modal", 'data-target' => '#collection-sharing-modal-window'} %>