Sha256: 77e42c70ef33778201eefbff9bd6b7ac92a11c94a47ba79fe24b85bf502a4cd5

Contents?: true

Size: 1.13 KB

Versions: 22

Compression:

Stored size: 1.13 KB

Contents

require 'rails/generators'

module BlacklightGallery
  class Install < Rails::Generators::Base

    source_root File.expand_path('../templates', __FILE__)

    def assets
      copy_file "blacklight_gallery.css.scss", "app/assets/stylesheets/blacklight_gallery.css.scss"
      copy_file "blacklight_gallery.js", "app/assets/javascripts/blacklight_gallery.js"
    end

    def configuration
      inject_into_file 'app/controllers/catalog_controller.rb', after: "configure_blacklight do |config|" do
        "\n    config.view.gallery.partials = [:index_header, :index]" \
        "\n    config.view.masonry.partials = [:index]" \
        "\n    config.view.slideshow.partials = [:index]\n\n" \
        "\n    config.show.tile_source_field = :content_metadata_image_iiif_info_ssm" \
        "\n    config.show.partials.insert(1, :openseadragon)"
      end
    end

    def add_model_mixin
      inject_into_file 'app/models/solr_document.rb', after: "include Blacklight::Solr::Document" do
       "\n  include Blacklight::Gallery::OpenseadragonSolrDocument\n"
      end
    end

    def add_openseadragon
      generate 'openseadragon:install'
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
blacklight-gallery-2.0.2 lib/generators/blacklight_gallery/install_generator.rb
blacklight-gallery-2.0.1 lib/generators/blacklight_gallery/install_generator.rb
blacklight-gallery-2.0.0 lib/generators/blacklight_gallery/install_generator.rb
blacklight-gallery-1.7.0 lib/generators/blacklight_gallery/install_generator.rb
blacklight-gallery-1.6.0 lib/generators/blacklight_gallery/install_generator.rb
blacklight-gallery-1.5.0 lib/generators/blacklight_gallery/install_generator.rb
blacklight-gallery-1.4.0 lib/generators/blacklight_gallery/install_generator.rb
blacklight-gallery-1.3.0 lib/generators/blacklight_gallery/install_generator.rb
blacklight-gallery-1.2.1 lib/generators/blacklight_gallery/install_generator.rb
blacklight-gallery-1.2.0 lib/generators/blacklight_gallery/install_generator.rb
blacklight-gallery-1.1.1 lib/generators/blacklight_gallery/install_generator.rb
blacklight-gallery-1.1.0 lib/generators/blacklight_gallery/install_generator.rb
blacklight-gallery-0.12.0 lib/generators/blacklight_gallery/install_generator.rb
blacklight-gallery-1.0.0 lib/generators/blacklight_gallery/install_generator.rb
blacklight-gallery-0.11.0 lib/generators/blacklight_gallery/install_generator.rb
blacklight-gallery-0.10.0 lib/generators/blacklight_gallery/install_generator.rb
blacklight-gallery-0.9.0 lib/generators/blacklight_gallery/install_generator.rb
blacklight-gallery-0.8.0 lib/generators/blacklight_gallery/install_generator.rb
blacklight-gallery-0.7.0 lib/generators/blacklight_gallery/install_generator.rb
blacklight-gallery-0.6.1 lib/generators/blacklight_gallery/install_generator.rb