Sha256: 15cec44e87d95138e79924db6935e20204cffdbbe90ad1c20eb71ea2a9cde6af

Contents?: true

Size: 1.48 KB

Versions: 30

Compression:

Stored size: 1.48 KB

Contents

<% # This template overrides Blacklight to provide the main_app scope to the links %>
<% 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(main_app.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-secondary") %>
      <% end %>

  <% else %>

      <%= form_tag(main_app.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-secondary") %>
      <% end %>

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

Version data entries

30 entries across 15 versions & 1 rubygems

Version Path
hyrax-5.1.0.pre.beta1 app/views/hyrax/dashboard/collections/_bookmark_control.html.erb
hyrax-5.1.0.pre.beta1 app/views/hyrax/collections/_bookmark_control.html.erb
hyrax-5.0.4 app/views/hyrax/dashboard/collections/_bookmark_control.html.erb
hyrax-5.0.4 app/views/hyrax/collections/_bookmark_control.html.erb
hyrax-5.0.3 app/views/hyrax/collections/_bookmark_control.html.erb
hyrax-5.0.3 app/views/hyrax/dashboard/collections/_bookmark_control.html.erb
hyrax-5.0.2 app/views/hyrax/collections/_bookmark_control.html.erb
hyrax-5.0.2 app/views/hyrax/dashboard/collections/_bookmark_control.html.erb
hyrax-5.0.1 app/views/hyrax/dashboard/collections/_bookmark_control.html.erb
hyrax-5.0.1 app/views/hyrax/collections/_bookmark_control.html.erb
hyrax-5.0.0 app/views/hyrax/collections/_bookmark_control.html.erb
hyrax-5.0.0 app/views/hyrax/dashboard/collections/_bookmark_control.html.erb
hyrax-5.0.0.rc3 app/views/hyrax/dashboard/collections/_bookmark_control.html.erb
hyrax-5.0.0.rc3 app/views/hyrax/collections/_bookmark_control.html.erb
hyrax-5.0.0.rc2 app/views/hyrax/dashboard/collections/_bookmark_control.html.erb
hyrax-5.0.0.rc2 app/views/hyrax/collections/_bookmark_control.html.erb
hyrax-5.0.0.rc1 app/views/hyrax/dashboard/collections/_bookmark_control.html.erb
hyrax-5.0.0.rc1 app/views/hyrax/collections/_bookmark_control.html.erb
hyrax-4.0.0 app/views/hyrax/collections/_bookmark_control.html.erb
hyrax-4.0.0 app/views/hyrax/dashboard/collections/_bookmark_control.html.erb