Sha256: 238af60b1730d20eb68a8318ab8592b610b190cf8ece7d4ca353d9918a718e0e

Contents?: true

Size: 1.31 KB

Versions: 20

Compression:

Stored size: 1.31 KB

Contents

<% if has_user_authentication_provider? and current_user %>
  <%- existing_bookmark = current_user.existing_bookmark_for(document.id) -%>
  <%-
  # Note these two forms are pretty similar but for different :methods, classes, and labels.
  # but it was simpler to leave them separate 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 existing_bookmark %>

      <%= form_tag( bookmark_path( document ), :method => :put, :class => "bookmark_toggle", "data-doc-id" => document.id, :title=> document[document_show_link_field] ) do %>
        <%= hidden_field(:bookmark, :title, :value => document[document_show_link_field] ) %>
        <%= submit_tag("Bookmark", :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, :title=> document[document_show_link_field]) do %>
        <%= hidden_field(:bookmark, :title, :value => document[document_show_link_field] ) %>
        <%= submit_tag("Remove bookmark", :id => "bookmark_toggle_#{document.id.to_s.parameterize}", :class => "bookmark_remove") %>
      <% end %>

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

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
curate-0.6.6 app/views/catalog/_bookmark_control.html.erb
curate-0.6.5 app/views/catalog/_bookmark_control.html.erb
curate-0.6.4 app/views/catalog/_bookmark_control.html.erb
curate-0.6.3 app/views/catalog/_bookmark_control.html.erb
curate-0.6.1 app/views/catalog/_bookmark_control.html.erb
curate-0.6.0 app/views/catalog/_bookmark_control.html.erb
curate-0.5.6 app/views/catalog/_bookmark_control.html.erb
curate-0.5.5 app/views/catalog/_bookmark_control.html.erb
curate-0.5.4 app/views/catalog/_bookmark_control.html.erb
curate-0.5.2 app/views/catalog/_bookmark_control.html.erb
curate-0.5.1 app/views/catalog/_bookmark_control.html.erb
curate-0.5.0 app/views/catalog/_bookmark_control.html.erb
curate-0.4.2 app/views/catalog/_bookmark_control.html.erb
curate-0.3.2 app/views/catalog/_bookmark_control.html.erb
curate-0.3.1 app/views/catalog/_bookmark_control.html.erb
curate-0.2.0 app/views/catalog/_bookmark_control.html.erb
curate-0.1.3 app/views/catalog/_bookmark_control.html.erb
curate-0.1.2 app/views/catalog/_bookmark_control.html.erb
curate-0.1.1 app/views/catalog/_bookmark_control.html.erb
curate-0.1.0 app/views/catalog/_bookmark_control.html.erb