blacklight-spotlight 0.16.0 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +2 -2
- data/app/assets/stylesheets/spotlight/_bootstrap_overrides.scss +7 -1
- data/app/assets/stylesheets/spotlight/_exhibits_index.scss +22 -0
- data/app/assets/stylesheets/spotlight/_header.scss +0 -2
- data/app/assets/stylesheets/spotlight/_variables.scss +1 -1
- data/app/controllers/concerns/spotlight/config.rb +4 -9
- data/app/controllers/concerns/spotlight/controller.rb +3 -8
- data/app/controllers/spotlight/about_pages_controller.rb +1 -1
- data/app/controllers/spotlight/browse_controller.rb +1 -1
- data/app/controllers/spotlight/home_pages_controller.rb +2 -2
- data/app/controllers/spotlight/pages_controller.rb +1 -1
- data/app/controllers/spotlight/roles_controller.rb +6 -2
- data/app/controllers/spotlight/sites_controller.rb +8 -0
- data/app/helpers/spotlight/application_helper.rb +1 -2
- data/app/helpers/spotlight/search_configurations_helper.rb +3 -3
- data/app/models/concerns/spotlight/solr_document.rb +1 -1
- data/app/models/spotlight/field_metadata.rb +1 -1
- data/app/models/spotlight/home_page.rb +6 -4
- data/app/models/spotlight/page.rb +1 -1
- data/app/models/spotlight/resources/upload.rb +5 -5
- data/app/models/spotlight/role.rb +1 -1
- data/app/models/spotlight/search.rb +1 -1
- data/app/views/shared/_site_sidebar.html.erb +4 -4
- data/app/views/spotlight/exhibits/_new_exhibit_form.html.erb +1 -1
- data/app/views/spotlight/exhibits/_tags.html.erb +8 -6
- data/app/views/spotlight/exhibits/new.html.erb +5 -1
- data/app/views/spotlight/sites/edit.html.erb +1 -1
- data/config/locales/spotlight.en.yml +11 -8
- data/config/routes.rb +7 -3
- data/db/migrate/20151217211019_create_spotlight_exhibit_filters.rb +1 -1
- data/lib/generators/spotlight/templates/jetty.rake +1 -1
- data/lib/spotlight/version.rb +1 -1
- data/spec/controllers/spotlight/sites_controller_spec.rb +12 -0
- data/spec/features/create_exhibit_spec.rb +1 -1
- data/spec/features/edit_search_fields_spec.rb +1 -1
- data/spec/features/javascript/roles_admin_spec.rb +12 -0
- data/spec/features/site_admin_management_spec.rb +1 -1
- data/spec/helpers/spotlight/application_helper_spec.rb +1 -1
- data/spec/models/spotlight/blacklight_configuration_spec.rb +3 -3
- data/spec/serializers/spotlight/exhibit_export_serializer_spec.rb +1 -1
- data/spec/spec_helper.rb +5 -5
- data/spec/test_app_templates/catalog_controller.rb +1 -1
- data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb_spec.rb +4 -4
- data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb_spec.rb +4 -4
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a47fab678bff54d54f4d4c3e9f2784b7f3333cf
|
4
|
+
data.tar.gz: 704d71ac8946a3f767ddf3d97347aeac8e72d91f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: baaadb1e9a1abcf1122af09b59443fd47e4673068c1c7870b852d6a65433c8d9f4652d40a49b4521fc71c0e3a861d815ad5f5ed538bb5a4256801428ee4ed070
|
7
|
+
data.tar.gz: 9a7537f66f35fe0b3a60159510a803c081da6e69de8ea63871215db0c469cb9df38636dae65670d1b2048bca25d09de7ad81ce1fc7690d47cbc5decc4649ff96
|
data/Rakefile
CHANGED
@@ -4,7 +4,7 @@ rescue LoadError
|
|
4
4
|
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
5
|
end
|
6
6
|
|
7
|
-
ZIP_URL = 'https://github.com/projectblacklight/blacklight-jetty/archive/v4.10.4.zip'
|
7
|
+
ZIP_URL = 'https://github.com/projectblacklight/blacklight-jetty/archive/v4.10.4.zip'.freeze
|
8
8
|
|
9
9
|
require 'rdoc/task'
|
10
10
|
|
@@ -48,7 +48,7 @@ namespace :spotlight do
|
|
48
48
|
desc 'Copies the default SOLR config for the bundled Testing Server'
|
49
49
|
task :configure_jetty do
|
50
50
|
FileList['solr_conf/conf/*'].each do |f|
|
51
|
-
cp(
|
51
|
+
cp(f, 'jetty/solr/blacklight-core/conf/', verbose: true)
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -102,6 +102,10 @@
|
|
102
102
|
}
|
103
103
|
}
|
104
104
|
|
105
|
+
.nav.tags {
|
106
|
+
display: inline-block;
|
107
|
+
}
|
108
|
+
|
105
109
|
// between the small and medium breakpoints, reduce the size of the image by a little bit
|
106
110
|
@media (min-width: $screen-sm-min) and (max-width: $screen-md-max) {
|
107
111
|
|
@@ -130,3 +134,21 @@
|
|
130
134
|
position: relative;
|
131
135
|
}
|
132
136
|
}
|
137
|
+
|
138
|
+
// For the medium breakpoint, reduce the max width of the .exhibit-card to align right-edge of row correctly
|
139
|
+
@media (min-width: $screen-md-min) and (max-width: $screen-md-max) {
|
140
|
+
.exhibit-card {
|
141
|
+
|
142
|
+
// each card is 3 columns wide
|
143
|
+
max-width: 3 * ($container-md / $grid-columns) - $padding-xs-horizontal;
|
144
|
+
}
|
145
|
+
}
|
146
|
+
|
147
|
+
// For the small breakpoint, reduce the max width of the .exhibit-card to align right-edge of row correctly
|
148
|
+
@media (min-width: $screen-sm-min) and (max-width: $screen-sm-max) {
|
149
|
+
.exhibit-card {
|
150
|
+
|
151
|
+
// each card is 4 columns wide
|
152
|
+
max-width: 4 * ($container-sm / $grid-columns) - $padding-xs-horizontal;
|
153
|
+
}
|
154
|
+
}
|
@@ -52,7 +52,6 @@
|
|
52
52
|
@extend .hidden-xs;
|
53
53
|
|
54
54
|
display: block;
|
55
|
-
margin-top: $padding-base-vertical;
|
56
55
|
padding-bottom: $padding-base-vertical;
|
57
56
|
padding-top: $padding-base-vertical;
|
58
57
|
}
|
@@ -90,7 +89,6 @@
|
|
90
89
|
|
91
90
|
.site-title-container {
|
92
91
|
max-height: $masthead-height - $navbar-height;
|
93
|
-
|
94
92
|
padding-bottom: $padding-large-vertical;
|
95
93
|
padding-top: $padding-large-vertical;
|
96
94
|
}
|
@@ -11,7 +11,7 @@ $exhibit-card-height: 350px !default;
|
|
11
11
|
$exhibit-card-bg: $well-bg !default;
|
12
12
|
$exhibit-card-border: $well-border !default;
|
13
13
|
$exhibit-card-gutter: $padding-large-horizontal !default;
|
14
|
-
$exhibit-card-image-size:
|
14
|
+
$exhibit-card-image-size: 269px !default;
|
15
15
|
$exhibit-card-shadow: inset 2px 2px 5px -2px $exhibit-card-border !default;
|
16
16
|
|
17
17
|
$navbar-transparent-color: $gray !default;
|
@@ -5,15 +5,10 @@ module Spotlight
|
|
5
5
|
extend ActiveSupport::Concern
|
6
6
|
|
7
7
|
def exhibit_specific_blacklight_config
|
8
|
-
@
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
fail "Exhibit id exists (#{params[:exhibit_id]}), but @exhibit hasn't been loaded yet"
|
13
|
-
else
|
14
|
-
# Not in an exhibit context. (So why are we calling a method called exhibit_specific_blacklight_config?)
|
15
|
-
fail 'Exhibit not found'
|
16
|
-
end
|
8
|
+
fail "Exhibit id exists (#{params[:exhibit_id]}), but @exhibit hasn't been loaded yet" if params[:exhibit_id] && current_exhibit.nil?
|
9
|
+
fail 'Exhibit not found' unless current_exhibit
|
10
|
+
|
11
|
+
@exhibit_specific_blacklight_config ||= current_exhibit.blacklight_config
|
17
12
|
end
|
18
13
|
end
|
19
14
|
end
|
@@ -26,8 +26,8 @@ module Spotlight
|
|
26
26
|
nil
|
27
27
|
elsif current_exhibit
|
28
28
|
current_exhibit.masthead if exhibit_masthead?
|
29
|
-
|
30
|
-
current_site.masthead
|
29
|
+
elsif current_site.masthead && current_site.masthead.display?
|
30
|
+
current_site.masthead
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
@@ -82,14 +82,9 @@ module Spotlight
|
|
82
82
|
|
83
83
|
def exhibit_search_facet_url(*args)
|
84
84
|
options = args.extract_options!
|
85
|
-
only_path = options[:only_path]
|
86
85
|
options = params.merge(options).except(:exhibit_id, :only_path)
|
87
86
|
|
88
|
-
|
89
|
-
spotlight.exhibit_catalog_facet_url(current_exhibit, *args, options)
|
90
|
-
else
|
91
|
-
spotlight.exhibit_catalog_facet_url(current_exhibit, *args, options)
|
92
|
-
end
|
87
|
+
spotlight.exhibit_catalog_facet_url(current_exhibit, *args, options)
|
93
88
|
end
|
94
89
|
end
|
95
90
|
end
|
@@ -40,7 +40,7 @@ module Spotlight
|
|
40
40
|
if action_name == 'edit'
|
41
41
|
add_breadcrumb t(:'spotlight.pages.index.about_pages.header'), exhibit_about_pages_path(@exhibit)
|
42
42
|
else
|
43
|
-
add_breadcrumb(
|
43
|
+
add_breadcrumb(@exhibit.main_navigations.about.label_or_default, [@exhibit, @exhibit.main_about_page])
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
@@ -40,7 +40,7 @@ module Spotlight
|
|
40
40
|
|
41
41
|
def attach_breadcrumbs
|
42
42
|
add_breadcrumb t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit
|
43
|
-
add_breadcrumb(
|
43
|
+
add_breadcrumb(@exhibit.main_navigations.browse.label_or_default, exhibit_browse_index_path(@exhibit))
|
44
44
|
end
|
45
45
|
|
46
46
|
def _prefixes
|
@@ -31,8 +31,8 @@ module Spotlight
|
|
31
31
|
|
32
32
|
private
|
33
33
|
|
34
|
-
|
35
|
-
|
34
|
+
alias search_action_url exhibit_search_action_url
|
35
|
+
alias search_facet_url exhibit_search_facet_url
|
36
36
|
|
37
37
|
def allowed_page_params
|
38
38
|
super.concat [:display_title, :display_sidebar]
|
@@ -21,8 +21,6 @@ module Spotlight
|
|
21
21
|
def update_all
|
22
22
|
authorize_nested_attributes! exhibit_params[:roles_attributes], Role
|
23
23
|
|
24
|
-
any_deleted = exhibit_params[:roles_attributes].values.any? { |item| item['_destroy'].present? }
|
25
|
-
|
26
24
|
if @exhibit.update(exhibit_params)
|
27
25
|
notice = any_deleted ? t(:'helpers.submit.role.destroyed') : t(:'helpers.submit.role.updated')
|
28
26
|
redirect_to exhibit_roles_path(@exhibit), notice: notice
|
@@ -38,6 +36,12 @@ module Spotlight
|
|
38
36
|
params.require(:exhibit).permit(roles_attributes: [:id, :user_key, :role, :_destroy])
|
39
37
|
end
|
40
38
|
|
39
|
+
def any_deleted
|
40
|
+
exhibit_params[:roles_attributes].values.any? do |item|
|
41
|
+
item['_destroy'].present? && item['_destroy'] != 'false'
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
41
45
|
# When nested attributes are passed in, ensure we have authorization to update each row.
|
42
46
|
# @param attr [Hash,Array] the nested attributes
|
43
47
|
# @param klass [Class] the class that is getting created
|
@@ -155,8 +155,7 @@ module Spotlight
|
|
155
155
|
private
|
156
156
|
|
157
157
|
def main_app_url_helper?(method)
|
158
|
-
|
159
|
-
main_app.respond_to?(method)
|
158
|
+
method.to_s.end_with?('_path', '_url') && main_app.respond_to?(method)
|
160
159
|
end
|
161
160
|
end
|
162
161
|
end
|
@@ -11,9 +11,9 @@ module Spotlight
|
|
11
11
|
sort_description ||= sort_config[:sort].split(',').map do |sort|
|
12
12
|
sort_field, sort_order = sort.split(' ')
|
13
13
|
safe_join([
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
t(:"spotlight.search_configurations.sort.keys.#{sort_field.strip}", default: sort_field.humanize.downcase),
|
15
|
+
t(:"spotlight.search_configurations.sort.keys.#{sort_order.strip}", default: '')
|
16
|
+
], ' ')
|
17
17
|
end.to_sentence if sort_config[:sort]
|
18
18
|
|
19
19
|
sort_description
|
@@ -8,6 +8,12 @@ module Spotlight
|
|
8
8
|
before_save :publish
|
9
9
|
before_create :default_content
|
10
10
|
|
11
|
+
class << self
|
12
|
+
def default_title_text
|
13
|
+
I18n.t('spotlight.pages.index.home_pages.title')
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
11
17
|
def should_display_title?
|
12
18
|
display_title?
|
13
19
|
end
|
@@ -18,10 +24,6 @@ module Spotlight
|
|
18
24
|
|
19
25
|
private
|
20
26
|
|
21
|
-
def self.default_title_text
|
22
|
-
I18n.t('spotlight.pages.index.home_pages.title')
|
23
|
-
end
|
24
|
-
|
25
27
|
def publish
|
26
28
|
self.published = true
|
27
29
|
end
|
@@ -52,11 +52,11 @@ module Spotlight
|
|
52
52
|
|
53
53
|
def add_file_versions(solr_hash)
|
54
54
|
spotlight_image_derivatives.each do |config|
|
55
|
-
if config[:version]
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
55
|
+
solr_hash[config[:field]] = if config[:version]
|
56
|
+
url.send(config[:version]).url
|
57
|
+
else
|
58
|
+
url.url
|
59
|
+
end
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
@@ -2,7 +2,7 @@ module Spotlight
|
|
2
2
|
##
|
3
3
|
# Exhibit authorization roles
|
4
4
|
class Role < ActiveRecord::Base
|
5
|
-
ROLES = %w(admin curator)
|
5
|
+
ROLES = %w(admin curator).freeze
|
6
6
|
belongs_to :resource, polymorphic: true
|
7
7
|
belongs_to :user, class_name: Spotlight::Engine.config.user_class, autosave: true
|
8
8
|
validates :role, inclusion: { in: ROLES }
|
@@ -4,16 +4,16 @@
|
|
4
4
|
<li><%= link_to t('.documentation'), 'https://github.com/sul-dlss/spotlight/wiki/Configuration-settings' %></li>
|
5
5
|
|
6
6
|
<% if can? :manage, Spotlight::Site.instance %>
|
7
|
-
<li><%= link_to t(:'spotlight.sites.edit.
|
7
|
+
<li><%= link_to t(:'spotlight.sites.edit.page_title'), spotlight.edit_site_path %></li>
|
8
8
|
<% end %>
|
9
9
|
|
10
10
|
<% if can? :manange, Spotlight::Exhibit %>
|
11
|
-
<li><%= link_to t(:'spotlight.sites.edit_exhibits.
|
12
|
-
<li><%= link_to t(:'spotlight.admin_users.index.
|
11
|
+
<li><%= link_to t(:'spotlight.sites.edit_exhibits.page_title'), spotlight.edit_site_exhibits_path %></li>
|
12
|
+
<li><%= link_to t(:'spotlight.admin_users.index.page_title'), spotlight.admin_users_path %></li>
|
13
13
|
<% end %>
|
14
14
|
</ul>
|
15
15
|
|
16
16
|
<ul class="nav sidenav nav-pills nav-stacked">
|
17
|
-
<li><%= link_to t('.
|
17
|
+
<li><%= link_to t(:'spotlight.sites.new.page_title'), new_exhibit_path, class: 'btn btn-default btn-nav', role: 'button' if can? :create, Spotlight::Exhibit %></li>
|
18
18
|
</ul>
|
19
19
|
<% end %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%= bootstrap_form_for @exhibit, url: ((spotlight.exhibit_path(@exhibit) if @exhibit.persisted?) || spotlight.exhibits_path), layout: :horizontal, label_col: 'col-md-2', control_col: 'col-md-10'
|
1
|
+
<%= bootstrap_form_for @exhibit, url: ((spotlight.exhibit_path(@exhibit) if @exhibit.persisted?) || spotlight.exhibits_path), layout: :horizontal, label_col: 'col-md-2', control_col: 'col-md-10' do |f| %>
|
2
2
|
<div class="row col-md-12">
|
3
3
|
<%= f.text_field :title, label: t(:'.fields.title.label'), help: t(:'.fields.title.help_block') %>
|
4
4
|
<%= f.text_field :slug, label: t(:'.fields.slug.label'), help: t(:'.fields.slug.help_block') %>
|
@@ -1,11 +1,13 @@
|
|
1
1
|
<% if tags.any? %>
|
2
2
|
<div class="row">
|
3
|
-
<
|
4
|
-
<
|
3
|
+
<div class="col-md-12 text-center">
|
4
|
+
<ul class="nav nav-pills tags">
|
5
|
+
<li class="<%= 'active' if params[:tag].blank? %>"><%= link_to t('.all'), exhibits_path %></li>
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
<% tags.sort_by(&:name).each do |tag| %>
|
8
|
+
<li class="<%= 'active' if params[:tag] == tag.name %>"><%= link_to tag.name, exhibits_path(tag: tag.name) %></li>
|
9
|
+
<% end %>
|
10
|
+
</ul>
|
11
|
+
</div>
|
10
12
|
</div>
|
11
13
|
<% end %>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<div id="content" class="col-md-9 exhibit-admin">
|
2
2
|
<%= page_title(t('.section'), t('.page_title')) %>
|
3
3
|
<div role="tabpanel">
|
4
|
-
<%= bootstrap_form_for @site, url: spotlight.site_path, layout: :horizontal, label_col: 'col-md-2', control_col: 'col-md-10'
|
4
|
+
<%= bootstrap_form_for @site, url: spotlight.site_path, layout: :horizontal, label_col: 'col-md-2', control_col: 'col-md-10' do |f| %>
|
5
5
|
<ul class="nav nav-tabs" role="tablist">
|
6
6
|
<li role="presentation" class="active">
|
7
7
|
<a href="#basic" aria-controls="basic" role="tab" data-toggle="tab"><%= t(:'.basic_settings.heading') %></a>
|
@@ -125,15 +125,15 @@ en:
|
|
125
125
|
header: "Settings"
|
126
126
|
admin_users:
|
127
127
|
create:
|
128
|
-
success: Added user as
|
128
|
+
success: Added user as an exhibits adminstrator
|
129
129
|
error: There was a problem adding the user as an exhibits adminstrator
|
130
130
|
destroy:
|
131
131
|
success: User removed from site adminstrator role
|
132
132
|
error: There was a problem removing the user from the site adminstrator role
|
133
133
|
index:
|
134
|
-
section: Manage
|
135
|
-
page_title:
|
136
|
-
instructions: Existing
|
134
|
+
section: Manage exhibits
|
135
|
+
page_title: Manage administrators
|
136
|
+
instructions: Existing exhibits administrators
|
137
137
|
add: Add new administrator
|
138
138
|
destroy: Remove from role
|
139
139
|
save: Add role
|
@@ -493,7 +493,7 @@ en:
|
|
493
493
|
header: "Cropped image"
|
494
494
|
help: >
|
495
495
|
Adjust the cropping box to cover the area of the image you want to use
|
496
|
-
as the thumbnail image. Click "Save
|
496
|
+
as the thumbnail image. Click "Save changes" to save the cropped area.
|
497
497
|
upload_form: *featured_images_form
|
498
498
|
|
499
499
|
resources:
|
@@ -543,9 +543,12 @@ en:
|
|
543
543
|
role: "Role"
|
544
544
|
actions: "Actions"
|
545
545
|
sites:
|
546
|
+
new:
|
547
|
+
section: Manage exhibits
|
548
|
+
page_title: Create a new exhibit
|
546
549
|
edit:
|
547
|
-
section:
|
548
|
-
page_title:
|
550
|
+
section: Manage exhibits
|
551
|
+
page_title: Customize appearance
|
549
552
|
basic_settings:
|
550
553
|
heading: Title
|
551
554
|
site_masthead:
|
@@ -558,7 +561,7 @@ en:
|
|
558
561
|
You can crop larger images using the cropping tool below.
|
559
562
|
edit_exhibits:
|
560
563
|
section: Manage exhibits
|
561
|
-
page_title:
|
564
|
+
page_title: Order exhibits
|
562
565
|
instructions: Drag and drop the exhibits below to specify the order in which they are displayed on the exhibits homepage.
|
563
566
|
searches: &search
|
564
567
|
nav_link: "Browse"
|
data/config/routes.rb
CHANGED
@@ -13,9 +13,13 @@ Spotlight::Engine.routes.draw do
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
resource :site, only: [:edit, :update] do
|
17
|
+
collection do
|
18
|
+
get '/tags', to: 'sites#tags'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
get '/exhibits/edit', to: 'sites#edit_exhibits', as: 'edit_site_exhibits'
|
19
23
|
|
20
24
|
resources :admin_users, only: [:index, :create, :destroy], concerns: [:user_existable, :user_invitable]
|
21
25
|
|
@@ -5,7 +5,7 @@ begin
|
|
5
5
|
desc "Copies the application's solr config into jetty"
|
6
6
|
task configure_solr: ['jetty:clean'] do
|
7
7
|
FileList['solr_conf/conf/*'].each do |f|
|
8
|
-
cp(
|
8
|
+
cp(f.to_s, 'jetty/solr/blacklight-core/conf/', verbose: true)
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
data/lib/spotlight/version.rb
CHANGED
@@ -44,5 +44,17 @@ describe Spotlight::SitesController, type: :controller do
|
|
44
44
|
expect(exhibit_a.reload.weight).to eq 5
|
45
45
|
end
|
46
46
|
end
|
47
|
+
|
48
|
+
describe 'GET tags' do
|
49
|
+
let!(:exhibit_a) { FactoryGirl.create(:exhibit, tag_list: 'a') }
|
50
|
+
|
51
|
+
it 'serializes the exhibit-level tags' do
|
52
|
+
get :tags, format: 'json'
|
53
|
+
expect(response).to be_successful
|
54
|
+
data = JSON.parse(response.body)
|
55
|
+
|
56
|
+
expect(data).to include 'a'
|
57
|
+
end
|
58
|
+
end
|
47
59
|
end
|
48
60
|
end
|
@@ -12,7 +12,7 @@ describe 'Create a new exhibit', type: :feature do
|
|
12
12
|
within '.dropdown-menu' do
|
13
13
|
click_link 'Create Exhibit'
|
14
14
|
end
|
15
|
-
expect(page).to have_selector 'h1', text: '
|
15
|
+
expect(page).to have_selector 'h1', text: 'Manage exhibits'
|
16
16
|
expect(page).to have_selector 'h1 small', text: 'Create a new exhibit'
|
17
17
|
end
|
18
18
|
|
@@ -54,7 +54,7 @@ describe 'Search Administration', type: :feature do
|
|
54
54
|
|
55
55
|
# #field_labeled doesn't appear to work for disabled inputs
|
56
56
|
expect(page).to have_css("input[name='blacklight_configuration[sort_fields][relevance][enable]'][disabled='disabled']")
|
57
|
-
expect(page).to have_css('#nested-sort-fields .dd-item:nth-child(5) h3', text: '
|
57
|
+
expect(page).to have_css('#nested-sort-fields .dd-item:nth-child(5) h3', text: 'Date (new to old)')
|
58
58
|
|
59
59
|
uncheck 'blacklight_configuration_sort_fields_title_enabled'
|
60
60
|
uncheck 'blacklight_configuration_sort_fields_identifier_enabled'
|
@@ -22,6 +22,18 @@ describe 'Roles Admin', type: :feature, js: true do
|
|
22
22
|
expect(page).to have_css('input[disabled]')
|
23
23
|
end
|
24
24
|
|
25
|
+
it 'has the appropriate status message when an existing user is added' do
|
26
|
+
second_user = FactoryGirl.create(:site_admin)
|
27
|
+
|
28
|
+
click_link 'Add a new user'
|
29
|
+
fill_in 'User key', with: second_user.email
|
30
|
+
|
31
|
+
click_button 'Save changes'
|
32
|
+
|
33
|
+
expect(page).to have_css('.alert-info', text: 'User has been updated.')
|
34
|
+
expect(page).to have_css('.table.users td', text: second_user.email)
|
35
|
+
end
|
36
|
+
|
25
37
|
it 'persists invited users to the exhibits user list' do
|
26
38
|
expect(page).not_to have_css('.label-warning pending-label', text: 'pending', visible: true)
|
27
39
|
|
@@ -20,7 +20,7 @@ describe 'Site admin management', js: true do
|
|
20
20
|
fill_in 'user_email', with: existing_user.email
|
21
21
|
click_button 'Add role'
|
22
22
|
|
23
|
-
expect(page).to have_content('Added user as
|
23
|
+
expect(page).to have_content('Added user as an exhibits adminstrator')
|
24
24
|
expect(page).to have_css('td', text: existing_user.email)
|
25
25
|
end
|
26
26
|
|
@@ -43,7 +43,7 @@ describe Spotlight::ApplicationHelper, type: :helper do
|
|
43
43
|
it 'is a url for a search with the given tag facet' do
|
44
44
|
allow(SolrDocument).to receive_messages(solr_field_for_tagger: :exhibit_tags)
|
45
45
|
expected = spotlight.exhibit_catalog_index_path(exhibit_id: helper.current_exhibit, f: { exhibit_tags: ['tag_value'] })
|
46
|
-
expect(helper.url_to_tag_facet
|
46
|
+
expect(helper.url_to_tag_facet('tag_value')).to eq expected
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
@@ -452,9 +452,9 @@ describe Spotlight::BlacklightConfiguration, type: :model do
|
|
452
452
|
describe '#custom_index_fields' do
|
453
453
|
it 'converts exhibit-specific fields to Blacklight configurations' do
|
454
454
|
allow(subject.exhibit).to receive_messages(custom_fields: [
|
455
|
-
|
456
|
-
|
457
|
-
|
455
|
+
stub_model(Spotlight::CustomField, field: 'abc', configuration: { a: 1 }, exhibit: subject.exhibit),
|
456
|
+
stub_model(Spotlight::CustomField, field: 'xyz', configuration: { x: 2 }, exhibit: subject.exhibit)
|
457
|
+
])
|
458
458
|
|
459
459
|
expect(subject.custom_index_fields).to include 'abc', 'xyz'
|
460
460
|
expect(subject.custom_index_fields['abc']).to be_a_kind_of Blacklight::Configuration::Field
|
@@ -120,7 +120,7 @@ describe Spotlight::ExhibitExportSerializer do
|
|
120
120
|
end
|
121
121
|
|
122
122
|
it 'has sidecars' do
|
123
|
-
expect(SolrDocument.new(id: 1).public?
|
123
|
+
expect(SolrDocument.new(id: 1).public?(subject)).to be_falsey
|
124
124
|
end
|
125
125
|
|
126
126
|
context 'for an exhibit with contacts' do
|
data/spec/spec_helper.rb
CHANGED
@@ -51,11 +51,11 @@ RSpec.configure do |config|
|
|
51
51
|
config.use_transactional_fixtures = false
|
52
52
|
|
53
53
|
config.before :each do
|
54
|
-
if Capybara.current_driver == :rack_test
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
54
|
+
DatabaseCleaner.strategy = if Capybara.current_driver == :rack_test
|
55
|
+
:transaction
|
56
|
+
else
|
57
|
+
:truncation
|
58
|
+
end
|
59
59
|
DatabaseCleaner.start
|
60
60
|
|
61
61
|
# The first user is automatically granted admin privileges; we don't want that behavior for many of our tests
|
@@ -92,8 +92,8 @@ class CatalogController < ApplicationController
|
|
92
92
|
config.add_sort_field 'relevance', sort: 'score desc, sort_title_ssi asc', label: 'Relevance'
|
93
93
|
config.add_sort_field 'title', sort: 'sort_title_ssi asc', label: 'Title'
|
94
94
|
config.add_sort_field 'type', sort: 'sort_type_ssi asc', label: 'Type'
|
95
|
-
config.add_sort_field 'date', sort: 'sort_date_dtsi asc', label: 'Date (old to new)'
|
96
95
|
config.add_sort_field 'source', sort: 'sort_source_ssi asc', label: 'Source'
|
97
96
|
config.add_sort_field 'identifier', sort: 'id asc', label: 'Identifier'
|
97
|
+
config.add_sort_field 'date', sort: 'sort_date_dtsi desc', label: 'Date (new to old)'
|
98
98
|
end
|
99
99
|
end
|
@@ -8,10 +8,10 @@ describe 'spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb',
|
|
8
8
|
|
9
9
|
before do
|
10
10
|
allow(block).to receive(:each_document).and_return([
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
[{}, SolrDocument.new(id: 1)],
|
12
|
+
[{}, SolrDocument.new(id: 2)],
|
13
|
+
[{}, SolrDocument.new(id: 3)]
|
14
|
+
])
|
15
15
|
allow(block).to receive_messages(documents?: true)
|
16
16
|
allow(view).to receive_messages(solr_documents_carousel_block: block)
|
17
17
|
allow(view).to receive_messages(has_thumbnail?: true, render_thumbnail_tag: 'thumb')
|
@@ -9,10 +9,10 @@ describe 'spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb', type
|
|
9
9
|
|
10
10
|
before do
|
11
11
|
allow(block).to receive(:each_document).and_return([
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
[{}, SolrDocument.new(id: 1)],
|
13
|
+
[{}, SolrDocument.new(id: 2)],
|
14
|
+
[{}, SolrDocument.new(id: 3)]
|
15
|
+
])
|
16
16
|
end
|
17
17
|
|
18
18
|
before do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight-spotlight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Beer
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2016-01-
|
14
|
+
date: 2016-01-28 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|
@@ -407,16 +407,16 @@ dependencies:
|
|
407
407
|
name: google-api-client
|
408
408
|
requirement: !ruby/object:Gem::Requirement
|
409
409
|
requirements:
|
410
|
-
- - "
|
410
|
+
- - "~>"
|
411
411
|
- !ruby/object:Gem::Version
|
412
|
-
version:
|
412
|
+
version: 0.8.0
|
413
413
|
type: :runtime
|
414
414
|
prerelease: false
|
415
415
|
version_requirements: !ruby/object:Gem::Requirement
|
416
416
|
requirements:
|
417
|
-
- - "
|
417
|
+
- - "~>"
|
418
418
|
- !ruby/object:Gem::Version
|
419
|
-
version:
|
419
|
+
version: 0.8.0
|
420
420
|
- !ruby/object:Gem::Dependency
|
421
421
|
name: oauth2
|
422
422
|
requirement: !ruby/object:Gem::Requirement
|
@@ -549,14 +549,14 @@ dependencies:
|
|
549
549
|
requirements:
|
550
550
|
- - "~>"
|
551
551
|
- !ruby/object:Gem::Version
|
552
|
-
version: '0.
|
552
|
+
version: '0.36'
|
553
553
|
type: :development
|
554
554
|
prerelease: false
|
555
555
|
version_requirements: !ruby/object:Gem::Requirement
|
556
556
|
requirements:
|
557
557
|
- - "~>"
|
558
558
|
- !ruby/object:Gem::Version
|
559
|
-
version: '0.
|
559
|
+
version: '0.36'
|
560
560
|
- !ruby/object:Gem::Dependency
|
561
561
|
name: rubocop-rspec
|
562
562
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1375,7 +1375,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1375
1375
|
version: '0'
|
1376
1376
|
requirements: []
|
1377
1377
|
rubyforge_project:
|
1378
|
-
rubygems_version: 2.5.1
|
1378
|
+
rubygems_version: 2.4.5.1
|
1379
1379
|
signing_key:
|
1380
1380
|
specification_version: 4
|
1381
1381
|
summary: Enable librarians, curators, and others who are responsible for digital collections
|