-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP * 🐛 Add check to prevent displaying blank metadata * 🧹 Refactor generate_work_url method and add YARD documentation - Refactored generate_work_url method by breaking it into smaller, modular helper methods for readability and maintainability. - Added YARD documentation to each method in SharedSearchHelper for better code clarity and generating documentation. * Add query parameters to link from thumbnail * Update IiifPrint to branch * Fix search Not all items were being found. * Fix spec * Revert to main branch of iiif_print * Restore markdown --------- Co-authored-by: LaRita Robinson <[email protected]>
- Loading branch information
1 parent
6931967
commit 920da19
Showing
9 changed files
with
146 additions
and
22 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
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
21 changes: 21 additions & 0 deletions
21
app/presenters/blacklight/thumbnail_presenter_decorator.rb
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
# OVERRIDE Blacklight 7.35 to pass the query parameters to the UV via the thumbnail URL | ||
module Blacklight | ||
module ThumbnailPresenterDecorator | ||
## | ||
# Render the thumbnail, if available, for a document and | ||
# link it to the document record. | ||
# | ||
# @param [Hash] image_options to pass to the image tag | ||
# @param [Hash] url_options to pass to #link_to_document | ||
# @return [String] | ||
def thumbnail_tag(image_options = {}, url_options = {}) | ||
value = thumbnail_value(image_options) | ||
return value if value.nil? || url_options[:suppress_link] | ||
view_context.link_to_document document, value, url_options | ||
end | ||
end | ||
end | ||
|
||
Blacklight::ThumbnailPresenter.prepend(Blacklight::ThumbnailPresenterDecorator) |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!-- OVERRIDE Hyrax v5.0 to allow passign options to the thumbnail tag | ||
to allow carrying along the query to the universal viewer --> | ||
<% model = document.hydra_model %> | ||
<% if params['q'].present? && document.any_highlighting_in_all_text_fields? %> | ||
<% additional_options = params.slice('q').merge( { :highlight=>'true' } ) %> | ||
<% elsif params['q'].present? %> | ||
<% additional_options = params.slice('q') %> | ||
<% else %> | ||
<% additional_options = {} %> | ||
<% end %> | ||
|
||
<div class="col-md-3"> | ||
<% if model == Hyrax::PcdmCollection || model < Hyrax::PcdmCollection %> | ||
<%= document_presenter(document)&.thumbnail&.thumbnail_tag({}, suppress_link: true) %> | ||
<% else %> | ||
<div class="list-thumbnail"> | ||
<%= document_presenter(document)&.thumbnail&.thumbnail_tag({}, additional_options ) %> | ||
</div> | ||
<% end %> | ||
</div> |
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