Sha256: 6bc45bbcf48c57d81c4d21db4944d28c3c8a48a4340235efc49eb1e18d88445b

Contents?: true

Size: 1.25 KB

Versions: 11

Compression:

Stored size: 1.25 KB

Contents

<%-
# the data-doc-id attribute is used by our JS that converts to a checkbox/label.
# we don't use the per-form csrf token
-%>
<%= form_tag(bookmark_path,
             authenticity_token: false,
             method:  bookmarked? ? :delete : :put,
             class: "bookmark-toggle",
             data: {
               'doc-id' => @document.id,
               present: t('blacklight.search.bookmarks.present'),
               absent: t('blacklight.search.bookmarks.absent'),
               inprogress: t('blacklight.search.bookmarks.inprogress')
            }) do %>
  <div class="checkbox toggle-bookmark">
    <label class="toggle-bookmark" data-checkboxsubmit-target="label">
      <input type="checkbox" class="toggle-bookmark" data-checkboxsubmit-target="checkbox" <%= 'checked="checked"' if bookmarked? %>>
      <span data-checkboxsubmit-target="span"><%= bookmarked? ? t('blacklight.search.bookmarks.present') : t('blacklight.search.bookmarks.absent') %></span>
    </label>
  </div>

  <%= submit_tag(t(bookmarked? ? 'remove.button' : 'add.button', scope: 'blacklight.bookmarks'),
                 id: "bookmark_toggle_#{@document.id.to_s.parameterize}",
                 class: "bookmark-#{bookmarked? ? 'remove' : 'add'} btn btn-outline-secondary") %>
<% end %>

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
blacklight-8.1.0 app/components/blacklight/document/bookmark_component.html.erb
blacklight-8.0.1 app/components/blacklight/document/bookmark_component.html.erb
blacklight-8.0.0 app/components/blacklight/document/bookmark_component.html.erb
blacklight-8.0.0.beta8 app/components/blacklight/document/bookmark_component.html.erb
blacklight-8.0.0.beta7 app/components/blacklight/document/bookmark_component.html.erb
blacklight-8.0.0.beta6 app/components/blacklight/document/bookmark_component.html.erb
blacklight-8.0.0.beta5 app/components/blacklight/document/bookmark_component.html.erb
blacklight-8.0.0.beta4 app/components/blacklight/document/bookmark_component.html.erb
blacklight-8.0.0.beta3 app/components/blacklight/document/bookmark_component.html.erb
blacklight-8.0.0.beta2 app/components/blacklight/document/bookmark_component.html.erb
blacklight-8.0.0.beta1 app/components/blacklight/document/bookmark_component.html.erb