X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/4609a76d9b84e0f63233cdf6dcbef376b1686b69..42c20b25e1325124b88e3b9b285544dc41122b56:/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 fc81e705e4..3d8ea3fff1 100644 --- a/apps/workbench/app/views/collections/_sharing_button.html.erb +++ b/apps/workbench/app/views/collections/_sharing_button.html.erb @@ -1,21 +1,21 @@ -<%# 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 %> +<%# Copyright (C) The Arvados Authors. All rights reserved. + +SPDX-License-Identifier: AGPL-3.0 %> + +<% 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 %>