-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enables Bootstrap/Blacklight JS Replaces our form override with the new ViewComponent, passes the path rather than overriding. Closes #999
- Loading branch information
1 parent
335b316
commit 34694f6
Showing
4 changed files
with
8 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,7 @@ | ||
<% 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. | ||
# | ||
<%- | ||
# Local override to use the actual document id for the form path as opposed to | ||
# the noid id. This simple change makes all the existing bookmark | ||
# functionality work rather than overriding functionality in several other | ||
# places to stay consistent with the noid. | ||
-%> | ||
<% unless bookmarked? document %> | ||
<%= form_tag( bookmarks_id_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( bookmarks_id_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 %> | ||
| ||
<% end %> | ||
-%> | ||
<%= render Blacklight::Document::BookmarkComponent.new(document: document, bookmark_path: bookmarks_id_path(document)) if current_or_guest_user %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters