<% document ||= @document %>
Tools
    <%= render_show_doc_actions @document, wrapping_class: 'list-group-item' %> <% if @document.respond_to?( :to_email_text ) %> <%= link_to email_helper, email_catalog_path(:id => @document), {:id => 'emailLink', :data => {:ajax_modal => "trigger"}, :class => 'list-group-item'} %> <%- end -%> <%- if @document.respond_to?( :to_sms_text ) -%> <%= link_to sms_helper, sms_catalog_path(:id => @document), {:id => 'smsLink', :data => {:ajax_modal => "trigger"}, :class => 'list-group-item'} %> <%- end -%>
<% if document_downloadable? %>
<% if document.direct_download.present? %> <%= link_to(download_text(@document[:dc_format_s]), document.direct_download[:download], class: 'btn btn-default', 'contentUrl' => document.direct_download[:download], data: { download: 'trigger', download_type: 'direct', download_id: document[:layer_slug_s] }) %> <% elsif document.hgl_download.present? %> <%= link_to(download_text(document.download_types.first[0]), download_hgl_path(id: document), data: {ajax_modal: 'trigger', download: 'trigger', download_type: 'harvard-hgl', download_id: document[:layer_slug_s] }, class: 'btn btn-default') %> <% else %> <%= link_to(download_text(document.download_types.first[0]), '', data: { download_path: "#{download_path(document[:layer_slug_s], type: document.download_types.first[0])}", download: 'trigger', download_type: document.download_types.first[0], download_id: document[:layer_slug_s] }, class: 'btn btn-default') %> <% end %>
<% elsif document.restricted? && document.same_institution? %> <%= link_to t('geoblacklight.tools.login_to_view'), new_user_session_path(referrer: request.original_url) %> <% end %>