-<% 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? %>
+ <div>Shared at:
+ <span class="pull-right">
+ <%= link_to "Unshare", unshare_collection_url, {
+ class: 'btn-xs btn-info',
+ remote: true,
+ method: 'post'
+ } %></span>
+ <div class="smaller-text" style="word-break: break-all"><%= link_to download_link, download_link %></div>
+ </div>
+ <% 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'} %>