diff --git a/Gemfile b/Gemfile index ce3041f87..ac5baa387 100644 --- a/Gemfile +++ b/Gemfile @@ -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" diff --git a/Gemfile.lock b/Gemfile.lock index 102ced960..9e8bb3498 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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) @@ -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) @@ -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 @@ -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) @@ -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) diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index cfbfb10c2..13d82ec27 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -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) diff --git a/config/initializers/slideshow_method.rb b/config/initializers/slideshow_method.rb new file mode 100644 index 000000000..9664eb5d3 --- /dev/null +++ b/config/initializers/slideshow_method.rb @@ -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