Sha256: 135a928470ce04e80307cfc0b8d099a472739e95c785d3ca1a7a24a2068a97ab

Contents?: true

Size: 1.35 KB

Versions: 27

Compression:

Stored size: 1.35 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 bookmarked? document %>

      <%= 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

27 entries across 27 versions & 1 rubygems

Version Path
blacklight-5.19.2 app/views/catalog/_bookmark_control.html.erb
blacklight-5.19.1 app/views/catalog/_bookmark_control.html.erb
blacklight-5.19.0 app/views/catalog/_bookmark_control.html.erb
blacklight-6.3.1 app/views/catalog/_bookmark_control.html.erb
blacklight-6.3.0 app/views/catalog/_bookmark_control.html.erb
blacklight-6.2.0 app/views/catalog/_bookmark_control.html.erb
blacklight-6.1.0 app/views/catalog/_bookmark_control.html.erb
blacklight-6.0.2 app/views/catalog/_bookmark_control.html.erb
blacklight-6.0.1 app/views/catalog/_bookmark_control.html.erb
blacklight-5.18.0 app/views/catalog/_bookmark_control.html.erb
blacklight-6.0.0 app/views/catalog/_bookmark_control.html.erb
blacklight-5.17.2 app/views/catalog/_bookmark_control.html.erb
blacklight-6.0.0.pre5 app/views/catalog/_bookmark_control.html.erb
blacklight-5.17.1 app/views/catalog/_bookmark_control.html.erb
blacklight-5.17.0 app/views/catalog/_bookmark_control.html.erb
blacklight-6.0.0.pre4 app/views/catalog/_bookmark_control.html.erb
blacklight-5.16.4 app/views/catalog/_bookmark_control.html.erb
blacklight-6.0.0.pre3 app/views/catalog/_bookmark_control.html.erb
blacklight-5.16.3 app/views/catalog/_bookmark_control.html.erb
blacklight-5.16.2 app/views/catalog/_bookmark_control.html.erb