blacklight-spotlight 0.18.0 → 0.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -9
- data/app/assets/javascripts/spotlight/blocks/browse_block.js +1 -0
- data/app/assets/stylesheets/spotlight/_bootstrap_overrides.scss +1 -1
- data/app/assets/stylesheets/spotlight/_multi_up_item_grid.scss +2 -0
- data/app/assets/stylesheets/spotlight/_pages.scss +7 -1
- data/app/controllers/spotlight/contact_forms_controller.rb +1 -5
- data/app/controllers/spotlight/searches_controller.rb +7 -1
- data/app/helpers/spotlight/browse_helper.rb +16 -1
- data/app/helpers/spotlight/searches_helper.rb +8 -0
- data/app/mailers/spotlight/contact_mailer.rb +9 -0
- data/app/models/spotlight/analytics/ga.rb +14 -16
- data/app/models/spotlight/blacklight_configuration.rb +6 -6
- data/app/models/spotlight/contact_form.rb +12 -10
- data/app/services/spotlight/carrierwave_file_resolver.rb +8 -0
- data/app/views/spotlight/browse/show.html.erb +5 -1
- data/app/views/spotlight/contact_mailer/report_problem.html.erb +14 -0
- data/app/views/spotlight/dashboards/analytics.html.erb +1 -3
- data/app/views/spotlight/searches/_form.html.erb +5 -0
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb +4 -3
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb +3 -2
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb +3 -2
- data/config/locales/spotlight.en.yml +1 -0
- data/db/migrate/20160711121314_add_default_view_to_spotlight_searches.rb +5 -0
- data/lib/generators/spotlight/install_generator.rb +6 -0
- data/lib/generators/spotlight/templates/config/initializers/riiif.rb +7 -0
- data/lib/spotlight/version.rb +1 -1
- data/spec/controllers/application_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/about_pages_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/admin_users_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/appearances_controller_spec.rb +0 -1
- data/spec/controllers/spotlight/application_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/attachments_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/browse_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/catalog_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/confirmations_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/contact_forms_controller_spec.rb +5 -2
- data/spec/controllers/spotlight/contacts_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/custom_fields_controller_spec.rb +0 -1
- data/spec/controllers/spotlight/dashboards_controller_spec.rb +0 -1
- data/spec/controllers/spotlight/exhibits_controller_spec.rb +1 -1
- data/spec/controllers/spotlight/feature_pages_controller_spec.rb +0 -1
- data/spec/controllers/spotlight/filters_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/home_pages_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/metadata_configurations_controller_spec.rb +0 -1
- data/spec/controllers/spotlight/resources_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/roles_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/search_configurations_controller_spec.rb +0 -1
- data/spec/controllers/spotlight/searches_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/sites_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/solr_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/tags_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/versions_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/view_configurations_controller_spec.rb +0 -1
- data/spec/features/about_page_spec.rb +0 -2
- data/spec/features/add_contacts_spec.rb +0 -2
- data/spec/features/add_custom_field_metadata_spec.rb +0 -2
- data/spec/features/add_items_spec.rb +0 -2
- data/spec/features/browse_category_admin_spec.rb +13 -2
- data/spec/features/browse_category_spec.rb +27 -2
- data/spec/features/catalog_spec.rb +0 -2
- data/spec/features/confirm_email_spec.rb +0 -2
- data/spec/features/create_exhibit_spec.rb +0 -2
- data/spec/features/create_page_spec.rb +0 -2
- data/spec/features/curator_items.rb +0 -3
- data/spec/features/dashboard_spec.rb +0 -2
- data/spec/features/edit_contact_spec.rb +0 -3
- data/spec/features/edit_search_fields_spec.rb +0 -2
- data/spec/features/exhibit_masthead_spec.rb +0 -2
- data/spec/features/exhibits/add_tags_spec.rb +0 -1
- data/spec/features/exhibits/administration_spec.rb +0 -1
- data/spec/features/exhibits/custom_metadata_fields_spec.rb +0 -1
- data/spec/features/exhibits/edit_metadata_fields_spec.rb +0 -1
- data/spec/features/exhibits_index_spec.rb +0 -2
- data/spec/features/feature_page_spec.rb +0 -2
- data/spec/features/home_page_spec.rb +0 -1
- data/spec/features/import_exhibit_spec.rb +0 -1
- data/spec/features/item_admin_spec.rb +0 -2
- data/spec/features/javascript/about_page_admin_spec.rb +0 -2
- data/spec/features/javascript/block_controls_spec.rb +0 -2
- data/spec/features/javascript/blocks/featured_browse_categories_block_spec.rb +8 -0
- data/spec/features/javascript/edit_in_place_spec.rb +0 -2
- data/spec/features/javascript/feature_page_admin_spec.rb +0 -2
- data/spec/features/javascript/home_page_edit_spec.rb +0 -2
- data/spec/features/javascript/metadata_admin_spec.rb +0 -2
- data/spec/features/javascript/multi_image_select_spec.rb +0 -2
- data/spec/features/javascript/preview_block_spec.rb +0 -2
- data/spec/features/javascript/reindex_monitor_spec.rb +0 -2
- data/spec/features/javascript/roles_admin_spec.rb +0 -2
- data/spec/features/javascript/rule_block_spec.rb +0 -2
- data/spec/features/javascript/search_config_admin_spec.rb +0 -2
- data/spec/features/javascript/search_context_spec.rb +0 -2
- data/spec/features/main_navigation_spec.rb +0 -2
- data/spec/features/metadata_admin_spec.rb +0 -2
- data/spec/features/report_a_problem_spec.rb +0 -2
- data/spec/features/site_admin_management_spec.rb +0 -2
- data/spec/features/site_masthead_spec.rb +0 -6
- data/spec/features/slideshow_spec.rb +0 -2
- data/spec/features/tags_admin_spec.rb +0 -2
- data/spec/features/user_admin_spec.rb +0 -2
- data/spec/helpers/spotlight/application_helper_spec.rb +0 -1
- data/spec/helpers/spotlight/browse_helper_spec.rb +0 -1
- data/spec/helpers/spotlight/crud_link_helpers_spec.rb +0 -1
- data/spec/helpers/spotlight/jcrop_helper_spec.rb +0 -1
- data/spec/helpers/spotlight/main_app_helpers_spec.rb +0 -1
- data/spec/helpers/spotlight/navbar_helper_spec.rb +0 -1
- data/spec/helpers/spotlight/pages_helper_spec.rb +0 -1
- data/spec/helpers/spotlight/roles_helper_spec.rb +0 -1
- data/spec/helpers/spotlight/search_configurations_helper_spec.rb +0 -1
- data/spec/helpers/spotlight/title_helper_spec.rb +0 -1
- data/spec/jobs/spotlight/default_thumbnail_job_spec.rb +0 -1
- data/spec/jobs/spotlight/reindex_job_spec.rb +0 -1
- data/spec/jobs/spotlight/rename_sidecar_field_job_spec.rb +0 -1
- data/spec/lib/spotlight/controller_spec.rb +0 -1
- data/spec/mailers/spotlight/indexing_complete_mailer_spec.rb +0 -1
- data/spec/models/solr_document_spec.rb +0 -2
- data/spec/models/spotlight/ability_spec.rb +0 -1
- data/spec/models/spotlight/about_page_spec.rb +0 -2
- data/spec/models/spotlight/access_controls_enforcement_search_builder_spec.rb +0 -2
- data/spec/models/spotlight/blacklight_configuration_spec.rb +10 -2
- data/spec/models/spotlight/contact_email_spec.rb +0 -8
- data/spec/models/spotlight/contact_form_spec.rb +0 -2
- data/spec/models/spotlight/contact_spec.rb +0 -2
- data/spec/models/spotlight/custom_field_spec.rb +0 -1
- data/spec/models/spotlight/default_thumbnailable_concern_spec.rb +0 -2
- data/spec/models/spotlight/exhibit_spec.rb +0 -2
- data/spec/models/spotlight/feature_page_spec.rb +0 -2
- data/spec/models/spotlight/featured_image_spec.rb +0 -2
- data/spec/models/spotlight/field_metadata_spec.rb +0 -2
- data/spec/models/spotlight/filter_spec.rb +0 -2
- data/spec/models/spotlight/home_page_spec.rb +0 -2
- data/spec/models/spotlight/image_derivatives_spec.rb +0 -2
- data/spec/models/spotlight/main_navigation_spec.rb +0 -2
- data/spec/models/spotlight/masthead_spec.rb +0 -2
- data/spec/models/spotlight/page_spec.rb +0 -2
- data/spec/models/spotlight/reindex_progress_spec.rb +0 -2
- data/spec/models/spotlight/resource_spec.rb +0 -2
- data/spec/models/spotlight/role_spec.rb +0 -2
- data/spec/models/spotlight/search_spec.rb +0 -2
- data/spec/models/spotlight/site_spec.rb +0 -2
- data/spec/models/spotlight/sitemap_spec.rb +0 -1
- data/spec/models/spotlight/solr_document_sidecar_spec.rb +0 -2
- data/spec/models/spotlight/user_spec.rb +0 -2
- data/spec/routing/spotlight/exhibit_catalog_spec.rb +0 -1
- data/spec/routing/spotlight/pages_routing_spec.rb +30 -34
- data/spec/serializers/spotlight/exhibit_export_serializer_spec.rb +0 -2
- data/spec/services/spotlight/carrierwave_file_resolver_spec.rb +14 -0
- data/spec/spec_helper.rb +8 -2
- data/spec/uploaders/spotlight/item_uploader_spec.rb +0 -1
- data/spec/views/_user_util_links.html.erb_spec.rb +70 -74
- data/spec/views/shared/_analytics.html.erb_spec.rb +10 -15
- data/spec/views/shared/_exhibit_navbar.html.erb_spec.rb +0 -2
- data/spec/views/shared/_footer.html.erb_spec.rb +15 -19
- data/spec/views/shared/_header_navbar.html.erb_spec.rb +7 -12
- data/spec/views/shared/_masthead.html.erb_spec.rb +0 -13
- data/spec/views/spotlight/roles/index.html.erb_spec.rb +6 -5
- data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb_spec.rb +1 -1
- metadata +37 -30
- data/app/views/spotlight/contact_forms/show.html.erb +0 -4
@@ -8,6 +8,7 @@
|
|
8
8
|
<div class="col-sm-6">
|
9
9
|
<div class="carousel-inner">
|
10
10
|
<% solr_documents_features_block.each_document.each_with_index do |(block_options, document), index| %>
|
11
|
+
<% doc_presenter = index_presenter(document) %>
|
11
12
|
<div class="item <%= 'active' if index == 0 %>" data-id="<%= document.id %>">
|
12
13
|
<% if block_thumb = block_options[:full_image_url] %>
|
13
14
|
<%= link_to_document(document, image_tag(block_thumb), counter: -1) %>
|
@@ -18,11 +19,11 @@
|
|
18
19
|
|
19
20
|
<% indicators << capture do %>
|
20
21
|
<li data-target="#<%= html_id %>" data-slide-to="<%= index %>" class="list-group-item <%= 'active' if index == 0 %>">
|
21
|
-
<a href="#" title="<%= (caption_text =
|
22
|
+
<a href="#" title="<%= (caption_text = doc_presenter.field_value(solr_documents_features_block.primary_caption? ? solr_documents_features_block.primary_caption_field : document_show_link_field)) %>">
|
22
23
|
<%= truncate(caption_text, length: 95) %>
|
23
24
|
</a>
|
24
25
|
<% if solr_documents_features_block.secondary_caption? %>
|
25
|
-
<p><%=
|
26
|
+
<p><%= doc_presenter.field_value solr_documents_features_block.secondary_caption_field %></p>
|
26
27
|
<% end %>
|
27
28
|
</li>
|
28
29
|
<% end %>
|
@@ -593,6 +593,7 @@ en:
|
|
593
593
|
search_description: "Description"
|
594
594
|
search_masthead: "Masthead"
|
595
595
|
search_thumbnail: "Thumbnail"
|
596
|
+
default_index_view_type: Default view
|
596
597
|
masthead:
|
597
598
|
help: >
|
598
599
|
You can select and crop an image to use as a browse category-specific masthead, instead
|
@@ -21,6 +21,12 @@ module Spotlight
|
|
21
21
|
generate 'friendly_id'
|
22
22
|
end
|
23
23
|
|
24
|
+
def riiif
|
25
|
+
gem 'riiif', '~> 0.4.0'
|
26
|
+
route "mount Riiif::Engine => '/images', as: 'riiif'"
|
27
|
+
copy_file 'config/initializers/riiif.rb'
|
28
|
+
end
|
29
|
+
|
24
30
|
def paper_trail
|
25
31
|
generate 'paper_trail:install'
|
26
32
|
end
|
data/lib/spotlight/version.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
1
|
describe Spotlight::ContactFormsController, type: :controller do
|
4
2
|
routes { Spotlight::Engine.routes }
|
5
3
|
let(:exhibit) { FactoryGirl.create(:exhibit) }
|
@@ -16,6 +14,11 @@ describe Spotlight::ContactFormsController, type: :controller do
|
|
16
14
|
end
|
17
15
|
end
|
18
16
|
describe 'POST create' do
|
17
|
+
it 'sends an email' do
|
18
|
+
expect do
|
19
|
+
post :create, exhibit_id: exhibit.id, contact_form: { name: 'Joe Doe', email: 'jdoe@example.com' }
|
20
|
+
end.to change { ActionMailer::Base.deliveries.count }.by(1)
|
21
|
+
end
|
19
22
|
it 'redirects back' do
|
20
23
|
post :create, exhibit_id: exhibit.id, contact_form: { name: 'Joe Doe', email: 'jdoe@example.com' }
|
21
24
|
expect(response).to redirect_to :back
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
1
|
describe 'Browse Category Administration', type: :feature do
|
4
2
|
let(:exhibit) { FactoryGirl.create(:exhibit) }
|
5
3
|
let(:curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) }
|
@@ -63,6 +61,19 @@ describe 'Browse Category Administration', type: :feature do
|
|
63
61
|
expect(search.thumbnail.image.thumb).not_to be_nil
|
64
62
|
expect(search.thumbnail.image.path).to end_with 'avatar.png'
|
65
63
|
end
|
64
|
+
|
65
|
+
it 'can select a default index view type' do
|
66
|
+
visit spotlight.edit_exhibit_search_path exhibit, search
|
67
|
+
choose 'List'
|
68
|
+
|
69
|
+
click_button 'Save changes'
|
70
|
+
|
71
|
+
expect(page).to have_content('The search was successfully updated.')
|
72
|
+
|
73
|
+
search.reload
|
74
|
+
|
75
|
+
expect(search.default_index_view_type).to eq 'list'
|
76
|
+
end
|
66
77
|
end
|
67
78
|
describe 'destroy' do
|
68
79
|
it 'destroys a tag' do
|
@@ -1,10 +1,15 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
1
|
feature 'Browse pages' do
|
4
2
|
let(:exhibit) { FactoryGirl.create(:exhibit) }
|
5
3
|
|
6
4
|
context 'a browse page' do
|
7
5
|
let!(:search) { FactoryGirl.create(:search, title: 'Some Saved Search', exhibit: exhibit, published: true) }
|
6
|
+
|
7
|
+
let(:mock_response) { Blacklight::Solr::Response.new({ response: { numFound: 10, docs: mock_documents } }, {}) }
|
8
|
+
let(:mock_documents) { [] }
|
9
|
+
before do
|
10
|
+
allow_any_instance_of(Spotlight::BrowseController).to receive(:search_results).and_return([mock_response, mock_documents])
|
11
|
+
end
|
12
|
+
|
8
13
|
context 'with the standard exhibit masthead' do
|
9
14
|
it 'includes the search title and resource count in the body' do
|
10
15
|
visit spotlight.exhibit_browse_path(exhibit, search)
|
@@ -61,5 +66,25 @@ feature 'Browse pages' do
|
|
61
66
|
expect(page).not_to have_selector '.breadcrumbs-container'
|
62
67
|
end
|
63
68
|
end
|
69
|
+
|
70
|
+
context 'without a curator-selected view' do
|
71
|
+
it 'renders the gallery view' do
|
72
|
+
visit spotlight.exhibit_browse_path(exhibit, search)
|
73
|
+
expect(page).to have_selector '.view-type-gallery.active'
|
74
|
+
expect(page).to have_selector '#documents.gallery'
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
context 'with a curator-selected default view' do
|
79
|
+
before do
|
80
|
+
search.update(default_index_view_type: 'list')
|
81
|
+
end
|
82
|
+
|
83
|
+
it 'renders the selected view' do
|
84
|
+
visit spotlight.exhibit_browse_path(exhibit, search)
|
85
|
+
expect(page).to have_selector '.view-type-list.active'
|
86
|
+
expect(page).to have_selector '#documents.documents-list'
|
87
|
+
end
|
88
|
+
end
|
64
89
|
end
|
65
90
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
1
|
describe 'A curator can see the items page', type: :feature do
|
4
2
|
let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator) }
|
5
3
|
let(:exhibit) { FactoryGirl.create(:exhibit) }
|
@@ -7,7 +5,6 @@ describe 'A curator can see the items page', type: :feature do
|
|
7
5
|
it 'works' do
|
8
6
|
login_as exhibit_curator
|
9
7
|
visit spotlight.exhibit_dashboard_path(exhibit)
|
10
|
-
|
11
8
|
expect(page).to have_content 'Items'
|
12
9
|
end
|
13
10
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
1
|
describe 'Add a contact to an exhibit', type: :feature do
|
4
2
|
let(:curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) }
|
5
3
|
let(:exhibit) { FactoryGirl.create(:exhibit) }
|
@@ -14,7 +12,6 @@ describe 'Add a contact to an exhibit', type: :feature do
|
|
14
12
|
end
|
15
13
|
|
16
14
|
click_button 'Save'
|
17
|
-
|
18
15
|
expect(page).to have_content 'The contact was successfully updated.'
|
19
16
|
end
|
20
17
|
end
|