X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/b870e7c0be3457257ea445fe54a1893e874530e1..224f384d411bb1b4cccc7165c55bb64fd5c695ad:/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 ae915523b3..4050e3aee4 100644 --- a/apps/workbench/app/views/collections/_sharing_button.html.erb +++ b/apps/workbench/app/views/collections/_sharing_button.html.erb @@ -1,21 +1,17 @@ -<%# 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 %> +<% button_attrs = { + class: 'btn btn-xs btn-info', + remote: true, + method: :post, + } %> +<% if @search_sharing.nil? %> +

Your API token is not authorized to manage collection sharing links.

+<% elsif @search_sharing.empty? %> + <%= button_to("Create sharing link", {action: "share"}, button_attrs) %> +<% else %> +
+ <% button_attrs[:class] += " pull-right" %> + <%= button_to("Unshare", {action: "unshare"}, button_attrs) %> + Shared at: +
<%= link_to download_link, download_link %>
+
<% end %>