Skip to content

Commit

Permalink
blacklight-gallery: add slideshow_method to render large images
Browse files Browse the repository at this point in the history
  • Loading branch information
dunn committed Aug 15, 2017
1 parent fb8265d commit 5edae28
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ gem "therubyracer", "~> 0.12.3", platforms: :ruby

gem "active-fedora", "~> 11.0.0"
gem "active-triples", "~> 0.11.0"
gem "blacklight-gallery", "~> 0.5.0"
gem "blacklight-gallery", "~> 0.8.0"
gem "blacklight_range_limit", "~> 6.1.2"
gem "curation_concerns", "~> 1.7.7"
gem "ezid-client", "~> 1.2"
Expand Down
13 changes: 7 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ GEM
american_date (1.1.1)
arel (7.1.4)
ast (2.3.0)
autoprefixer-rails (7.1.2.3)
autoprefixer-rails (7.1.2.6)
execjs
awesome_nested_set (3.1.3)
activerecord (>= 4.0.0, < 5.2)
Expand All @@ -116,10 +116,11 @@ GEM
execjs (~> 2.0)
bcp47 (0.3.3)
i18n
blacklight (6.10.1)
blacklight (6.11.0)
bootstrap-sass (~> 3.2)
deprecation
globalid
jbuilder
kaminari (>= 0.15)
nokogiri (~> 1.6)
rails (>= 4.2, < 6)
Expand All @@ -129,8 +130,8 @@ GEM
blacklight (~> 6.0)
cancancan (~> 1.8)
deprecation (~> 1.0)
blacklight-gallery (0.5.0)
blacklight (> 6.0.0.pre, < 7)
blacklight-gallery (0.8.0)
blacklight (~> 6.3)
bootstrap-sass (~> 3.0)
openseadragon (>= 0.2.0)
rails
Expand Down Expand Up @@ -484,7 +485,7 @@ GEM
activesupport
nokogiri (>= 1.4.2)
solrizer (~> 3.3)
openseadragon (0.3.3)
openseadragon (0.4.0)
rails (> 3.2.0)
os (0.9.6)
parallel (1.12.0)
Expand Down Expand Up @@ -800,7 +801,7 @@ DEPENDENCIES
active-triples (~> 0.11.0)
american_date (~> 1.1.0)
awesome_print
blacklight-gallery (~> 0.5.0)
blacklight-gallery (~> 0.8.0)
blacklight_range_limit (~> 6.1.2)
byebug
capistrano (~> 3.8.0)
Expand Down
1 change: 1 addition & 0 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def enforce_show_permissions(_opts = {})
config.search_builder_class = SearchBuilder
config.view.gallery.partials = [:index_header, :index]
config.view.slideshow.partials = [:index]
config.view.slideshow.slideshow_method = :choose_image

# config.show.tile_source_field = :content_metadata_image_iiif_info_ssm
# config.show.partials.insert(1, :openseadragon)
Expand Down
20 changes: 20 additions & 0 deletions config/initializers/slideshow_method.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module Blacklight::GalleryHelper
WITH_LARGE_IMAGES = %w[
Image
ComponentMap
IndexMap
ScannedMap
].freeze

def choose_image(document, options)
if WITH_LARGE_IMAGES.include? document["has_model_ssim"].first
image_tag(document["image_url_ssm"].first, options)
else
render_thumbnail_tag(
document,
options,
url_options.reverse_merge(suppress_link: true)
)
end
end
end

0 comments on commit 5edae28

Please sign in to comment.