lib/generators/blacklight_gallery/install_generator.rb in blacklight-gallery-0.1.0 vs lib/generators/blacklight_gallery/install_generator.rb in blacklight-gallery-0.1.1

- old
+ new

@@ -7,7 +7,31 @@ 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 + <<-EOF + config.view.gallery.partials = [:index_header, :index] + config.view.slideshow.partials = [:index] + + config.show.tile_source_field = :content_metadata_image_iiif_info_ssm + config.show.partials.insert(1, :openseadragon) + EOF + 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_controller_helpers + inject_into_class 'app/controllers/catalog_controller.rb', CatalogController do + "\n helper Openseadragon::OpenseadragonHelper\n" + end + end end end