blacklight-gallery 2.0.2 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +45 -0
- data/README.md +1 -1
- data/app/assets/javascripts/blacklight_gallery/default.js +0 -1
- data/app/assets/javascripts/blacklight_gallery/masonry.js +1 -1
- data/app/assets/javascripts/blacklight_gallery/osd_viewer.js +1 -1
- data/app/assets/javascripts/blacklight_gallery/slideshow.js +1 -2
- data/app/assets/stylesheets/blacklight_gallery/_gallery.scss +8 -18
- data/app/assets/stylesheets/blacklight_gallery/_masonry.scss +60 -22
- data/app/assets/stylesheets/blacklight_gallery/_slideshow.scss +5 -3
- data/app/components/blacklight/gallery/document_component.html.erb +21 -0
- data/app/components/blacklight/gallery/document_component.rb +11 -0
- data/app/components/blacklight/gallery/slideshow_component.html.erb +12 -0
- data/app/components/blacklight/gallery/slideshow_component.rb +40 -0
- data/app/components/blacklight/gallery/slideshow_preview_component.html.erb +5 -0
- data/app/components/blacklight/gallery/slideshow_preview_component.rb +28 -0
- data/app/helpers/blacklight/gallery_helper.rb +0 -38
- data/app/models/concerns/blacklight/gallery/openseadragon_solr_document.rb +1 -1
- data/app/views/catalog/_document_gallery.html.erb +4 -3
- data/app/views/catalog/_document_masonry.html.erb +2 -3
- data/app/views/catalog/_document_slideshow.html.erb +26 -5
- data/app/views/catalog/_slideshow_modal.html.erb +2 -3
- data/blacklight-gallery.gemspec +4 -4
- data/lib/blacklight/gallery/engine.rb +0 -1
- data/lib/blacklight/gallery/version.rb +1 -1
- data/lib/generators/blacklight_gallery/install_generator.rb +10 -3
- data/lib/generators/blacklight_gallery/templates/blacklight_gallery.js +2 -1
- data/spec/components/blacklight/gallery/document_component_spec.rb +46 -0
- data/spec/components/blacklight/gallery/slideshow_component_spec.rb +67 -0
- data/spec/features/gallery_spec.rb +3 -4
- data/spec/features/masonry_spec.rb +2 -3
- data/spec/features/slideshow_spec.rb +0 -2
- data/spec/fixtures/sample_solr_documents.yml +2495 -0
- data/spec/models/concerns/openseadragon_solr_document_spec.rb +1 -1
- data/spec/spec_helper.rb +4 -11
- data/spec/views/catalog/_document_slideshow.html.erb_spec.rb +15 -5
- metadata +45 -39
- data/.travis.yml +0 -21
- data/app/views/catalog/_grid_slideshow.html.erb +0 -11
- data/app/views/catalog/_index_gallery.html.erb +0 -14
- data/app/views/catalog/_index_masonry.html.erb +0 -8
- data/app/views/catalog/_index_masonry_default.html.erb +0 -1
- data/app/views/catalog/_index_slideshow.html.erb +0 -11
- data/app/views/catalog/_slideshow.html.erb +0 -23
- data/spec/helpers/blacklight/gallery_helper_spec.rb +0 -110
- data/spec/views/catalog/_index_gallery.html.erb_spec.rb +0 -22
- data/spec/views/catalog/_index_masonry.html.erb_spec.rb +0 -34
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "catalog/_index_gallery.html.erb", :type => :view do
|
4
|
-
let(:blacklight_config) { Blacklight::Configuration.new }
|
5
|
-
|
6
|
-
let(:document) { stub_model(::SolrDocument) }
|
7
|
-
|
8
|
-
before do
|
9
|
-
blacklight_config.view.gallery.partials = ['a', 'b']
|
10
|
-
allow(view).to receive_messages(blacklight_config: blacklight_config)
|
11
|
-
allow(view).to receive_messages(document: document)
|
12
|
-
allow(view).to receive_messages(document_counter: 3, document_counter_with_offset: 3)
|
13
|
-
end
|
14
|
-
|
15
|
-
it "should have thumbnail and caption" do
|
16
|
-
expect(view).to receive(:render_thumbnail_tag).with(document, { class: 'img-thumbnail', alt: '' }, hash_including(:counter)).and_return('Thumbnail')
|
17
|
-
expect(view).to receive(:render_document_partials).with(document, ['a', 'b'], document_counter: 3).and_return('Z')
|
18
|
-
render
|
19
|
-
expect(rendered).to have_selector '.thumbnail', text: 'Thumbnail'
|
20
|
-
expect(rendered).to have_selector '.caption', text: 'Z'
|
21
|
-
end
|
22
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "catalog/_document_masonry.html.erb", :type => :view do
|
4
|
-
let(:blacklight_config) { Blacklight::Configuration.new }
|
5
|
-
let(:documents) { [stub_model(::SolrDocument), stub_model(::SolrDocument)] }
|
6
|
-
let(:presenter) { instance_double(Blacklight::IndexPresenter, heading: 'xyz')}
|
7
|
-
before do
|
8
|
-
allow(view).to receive_messages(blacklight_config: blacklight_config)
|
9
|
-
allow(view).to receive_messages(index_presenter: presenter)
|
10
|
-
allow(view).to receive_messages(documents: documents)
|
11
|
-
allow(view).to receive_messages(document_counter: 1)
|
12
|
-
allow(view).to receive_messages(document_counter_with_offset: 1)
|
13
|
-
allow(view).to receive_messages(render_document_partials: "Caption")
|
14
|
-
allow(view).to receive_messages(render_thumbnail_tag: "Thumbnail")
|
15
|
-
render
|
16
|
-
end
|
17
|
-
|
18
|
-
it 'should render a container div with a data attribute to initiate the masonry plugin' do
|
19
|
-
expect(rendered).to have_css('#documents[data-behavior="masonry-gallery"]')
|
20
|
-
end
|
21
|
-
|
22
|
-
it 'should render a .masonry.document div for each document' do
|
23
|
-
expect(rendered).to have_css('.masonry.document', count: 2)
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'should render the thumbnail' do
|
27
|
-
expect(rendered).to have_css('.thumbnail', text: 'Thumbnail')
|
28
|
-
expect(view).to have_received(:render_thumbnail_tag).with(documents.first, { class: 'img-thumbnail', alt: 'xyz' }, counter: 1)
|
29
|
-
end
|
30
|
-
|
31
|
-
it 'should render the caption' do
|
32
|
-
expect(rendered).to have_css('.caption', text: 'Caption')
|
33
|
-
end
|
34
|
-
end
|