X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/675794872a5d064cf0a8177d662555c04b0dae51..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 36952d69d0..3d8ea3fff1 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" %> +<%# 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 %> - <% linktext = "Share" %> - <% btnstyle = "btn-info" %> +
+ <% button_attrs[:class] += " pull-right" %> + <%= button_to("Unshare", {action: "unshare"}, button_attrs) %> + Shared at: +
<%= link_to download_link, download_link %>
+
<% end %> -<%= link_to linktext, sharing_popup_collection_url(id: @object.uuid), {class: "btn #{btnstyle}", :remote => true, 'data-toggle' => "modal", 'data-target' => '#collection-sharing-modal-window'} %>