Sha256: e0f14d3b03972cac9bccd0f992451830e7fbfd654d8e15e574f35855b1414fe6

Contents?: true

Size: 1.38 KB

Versions: 36

Compression:

Stored size: 1.38 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 btn btn-default") %>
      <% 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 btn btn-default") %>
      <% end %>

  <% end %>
<% else %>
  &nbsp;
<% end %>

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
blacklight-6.25.0 app/views/catalog/_bookmark_control.html.erb
blacklight-6.24.0 app/views/catalog/_bookmark_control.html.erb
blacklight-6.23.0 app/views/catalog/_bookmark_control.html.erb
blacklight-6.22.0 app/views/catalog/_bookmark_control.html.erb
blacklight-6.21.0 app/views/catalog/_bookmark_control.html.erb
blacklight-6.20.0 app/views/catalog/_bookmark_control.html.erb
blacklight-6.19.2 app/views/catalog/_bookmark_control.html.erb
blacklight-6.19.1 app/views/catalog/_bookmark_control.html.erb
blacklight-6.19.0 app/views/catalog/_bookmark_control.html.erb
blacklight-6.18.0 app/views/catalog/_bookmark_control.html.erb
blacklight-6.17.0 app/views/catalog/_bookmark_control.html.erb
blacklight-6.16.0 app/views/catalog/_bookmark_control.html.erb
blacklight-6.15.0 app/views/catalog/_bookmark_control.html.erb
blacklight-6.14.1 app/views/catalog/_bookmark_control.html.erb
blacklight-6.14.0 app/views/catalog/_bookmark_control.html.erb
blacklight-6.13.0 app/views/catalog/_bookmark_control.html.erb
blacklight-6.12.0 app/views/catalog/_bookmark_control.html.erb
blacklight-6.11.2 app/views/catalog/_bookmark_control.html.erb
blacklight-6.11.1 app/views/catalog/_bookmark_control.html.erb
blacklight-6.11.0 app/views/catalog/_bookmark_control.html.erb