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 %> <% end %>
Version data entries
20 entries across 20 versions & 1 rubygems