Sha256: 1b5c1c120a9b773d7997a228f476f5b54fe454167daa4f7b9b9c98a915c86fac

Contents?: true

Size: 1.41 KB

Versions: 25

Compression:

Stored size: 1.41 KB

Contents

<% if current_or_guest_user %>
  <%- 
  # Note these two forms are pretty similar but for different :methods, classes, and labels. 
  # but it was simpler to leave them seperate instead of DRYing them, got confusing trying that.
  # the data-doc-id attribute is used by our JS that converts to a checkbox/label.
  -%>  
  <% unless current_or_guest_user.document_is_bookmarked? document.id %>  

      <%= form_tag( bookmark_path( document ), :method => :put, :class => "bookmark_toggle", "data-doc-id" => document.id, :'data-present' => t('blacklight.search.bookmarks.present'), :'data-absent' => t('blacklight.search.bookmarks.absent'), :'data-inprogress' => t('blacklight.search.bookmarks.inprogress')) do %>   
        <%= submit_tag(t('blacklight.bookmarks.add.button'), :id => "bookmark_toggle_#{document.id.to_s.parameterize}", :class => "bookmark_add") %>
      <% end %>
  
  <% else %>
  
      <%= form_tag( bookmark_path( document ), :method => :delete, :class => "bookmark_toggle", "data-doc-id" => document.id, :'data-present' => t('blacklight.search.bookmarks.present'), :'data-absent' => t('blacklight.search.bookmarks.absent'), :'data-inprogress' => t('blacklight.search.bookmarks.inprogress')) do %>  
        <%= submit_tag(t('blacklight.bookmarks.remove.button'), :id => "bookmark_toggle_#{document.id.to_s.parameterize}", :class => "bookmark_remove") %>
      <% end %>
      
  <% end %>
<% else %>
  &nbsp;
<% end %>

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
blacklight-4.9.0 app/views/catalog/_bookmark_control.html.erb
blacklight-4.8.0 app/views/catalog/_bookmark_control.html.erb
blacklight-5.3.0 app/views/catalog/_bookmark_control.html.erb
blacklight-5.0.3 app/views/catalog/_bookmark_control.html.erb
blacklight-5.1.1 app/views/catalog/_bookmark_control.html.erb
blacklight-5.2.0 app/views/catalog/_bookmark_control.html.erb
blacklight-5.1.0 app/views/catalog/_bookmark_control.html.erb
blacklight-5.0.2 app/views/catalog/_bookmark_control.html.erb
blacklight-5.0.1 app/views/catalog/_bookmark_control.html.erb
blacklight-5.0.0 app/views/catalog/_bookmark_control.html.erb
blacklight-4.7.0 app/views/catalog/_bookmark_control.html.erb
blacklight-4.7.0.pre1 app/views/catalog/_bookmark_control.html.erb
blacklight-5.0.0.pre4 app/views/catalog/_bookmark_control.html.erb
blacklight-4.6.3 app/views/catalog/_bookmark_control.html.erb
blacklight-5.0.0.pre3 app/views/catalog/_bookmark_control.html.erb
blacklight-4.6.2 app/views/catalog/_bookmark_control.html.erb
blacklight-5.0.0.pre2 app/views/catalog/_bookmark_control.html.erb
blacklight-4.6.1 app/views/catalog/_bookmark_control.html.erb
blacklight-5.0.0.pre1 app/views/catalog/_bookmark_control.html.erb
blacklight-4.6.0 app/views/catalog/_bookmark_control.html.erb