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.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +2 -2
  3. data/app/assets/stylesheets/spotlight/_bootstrap_overrides.scss +7 -1
  4. data/app/assets/stylesheets/spotlight/_exhibits_index.scss +22 -0
  5. data/app/assets/stylesheets/spotlight/_header.scss +0 -2
  6. data/app/assets/stylesheets/spotlight/_variables.scss +1 -1
  7. data/app/controllers/concerns/spotlight/config.rb +4 -9
  8. data/app/controllers/concerns/spotlight/controller.rb +3 -8
  9. data/app/controllers/spotlight/about_pages_controller.rb +1 -1
  10. data/app/controllers/spotlight/browse_controller.rb +1 -1
  11. data/app/controllers/spotlight/home_pages_controller.rb +2 -2
  12. data/app/controllers/spotlight/pages_controller.rb +1 -1
  13. data/app/controllers/spotlight/roles_controller.rb +6 -2
  14. data/app/controllers/spotlight/sites_controller.rb +8 -0
  15. data/app/helpers/spotlight/application_helper.rb +1 -2
  16. data/app/helpers/spotlight/search_configurations_helper.rb +3 -3
  17. data/app/models/concerns/spotlight/solr_document.rb +1 -1
  18. data/app/models/spotlight/field_metadata.rb +1 -1
  19. data/app/models/spotlight/home_page.rb +6 -4
  20. data/app/models/spotlight/page.rb +1 -1
  21. data/app/models/spotlight/resources/upload.rb +5 -5
  22. data/app/models/spotlight/role.rb +1 -1
  23. data/app/models/spotlight/search.rb +1 -1
  24. data/app/views/shared/_site_sidebar.html.erb +4 -4
  25. data/app/views/spotlight/exhibits/_new_exhibit_form.html.erb +1 -1
  26. data/app/views/spotlight/exhibits/_tags.html.erb +8 -6
  27. data/app/views/spotlight/exhibits/new.html.erb +5 -1
  28. data/app/views/spotlight/sites/edit.html.erb +1 -1
  29. data/config/locales/spotlight.en.yml +11 -8
  30. data/config/routes.rb +7 -3
  31. data/db/migrate/20151217211019_create_spotlight_exhibit_filters.rb +1 -1
  32. data/lib/generators/spotlight/templates/jetty.rake +1 -1
  33. data/lib/spotlight/version.rb +1 -1
  34. data/spec/controllers/spotlight/sites_controller_spec.rb +12 -0
  35. data/spec/features/create_exhibit_spec.rb +1 -1
  36. data/spec/features/edit_search_fields_spec.rb +1 -1
  37. data/spec/features/javascript/roles_admin_spec.rb +12 -0
  38. data/spec/features/site_admin_management_spec.rb +1 -1
  39. data/spec/helpers/spotlight/application_helper_spec.rb +1 -1
  40. data/spec/models/spotlight/blacklight_configuration_spec.rb +3 -3
  41. data/spec/serializers/spotlight/exhibit_export_serializer_spec.rb +1 -1
  42. data/spec/spec_helper.rb +5 -5
  43. data/spec/test_app_templates/catalog_controller.rb +1 -1
  44. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb_spec.rb +4 -4
  45. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb_spec.rb +4 -4
  46. metadata +9 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8cddcc5a9f2a5d68c50a7092eec103a1fd4e4ff2
4
- data.tar.gz: a368d7becced90f589111c22c2dbf2b5311d1aa8
3
+ metadata.gz: 6a47fab678bff54d54f4d4c3e9f2784b7f3333cf
4
+ data.tar.gz: 704d71ac8946a3f767ddf3d97347aeac8e72d91f
5
5
  SHA512:
6
- metadata.gz: b39192c1b349d0b10f7f9968ee2683e6c62aadb203069e28eb41cf9165a6dbf527bf2870a06639298ba52cbacd29a0e6b042e43be5a7136a956ebeaf6ef3a818
7
- data.tar.gz: 113f4f169e3a1ea853e39417e5a96c49e2b3492c311f3f161d35187b917d759a5b999886f44df3cce2abfe36b1b07a597bebea6e85dcdfe4f4ba432425c68724
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("#{f}", 'jetty/solr/blacklight-core/conf/', verbose: true)
51
+ cp(f, 'jetty/solr/blacklight-core/conf/', verbose: true)
52
52
  end
53
53
  end
54
54
 
@@ -88,4 +88,10 @@ label.radio {
88
88
  div.radio + div input, div.radio + input[type="file"] {
89
89
  margin-top: $padding-large-vertical;
90
90
  }
91
- }
91
+ }
92
+
93
+ @media (max-width: $screen-sm-max) {
94
+ aside.col-md-3 {
95
+ padding-left: 0;
96
+ }
97
+ }
@@ -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: 273px !default;
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
- @exhibit_specific_blacklight_config ||=
9
- if current_exhibit
10
- current_exhibit.blacklight_config
11
- elsif params[:exhibit_id]
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
- else
30
- current_site.masthead if current_site.masthead && current_site.masthead.display?
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
- if only_path
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((@exhibit.main_navigations.about.label_or_default), [@exhibit, @exhibit.main_about_page])
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((@exhibit.main_navigations.browse.label_or_default), exhibit_browse_index_path(@exhibit))
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
- alias_method :search_action_url, :exhibit_search_action_url
35
- alias_method :search_facet_url, :exhibit_search_facet_url
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]
@@ -126,7 +126,7 @@ module Spotlight
126
126
  @human_name ||= page_collection_name.humanize
127
127
  end
128
128
 
129
- alias_method :page_collection_name, :controller_name
129
+ alias page_collection_name controller_name
130
130
 
131
131
  def attach_breadcrumbs
132
132
  if view_context.current_page? '/'
@@ -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
@@ -21,6 +21,14 @@ module Spotlight
21
21
  end
22
22
  end
23
23
 
24
+ def tags
25
+ authorize! :tag, @site
26
+
27
+ respond_to do |format|
28
+ format.json { render json: Spotlight::Exhibit.all_tags.map(&:name) }
29
+ end
30
+ end
31
+
24
32
  private
25
33
 
26
34
  def load_site
@@ -155,8 +155,7 @@ module Spotlight
155
155
  private
156
156
 
157
157
  def main_app_url_helper?(method)
158
- (method.to_s.end_with?('_path') || method.to_s.end_with?('_url')) &&
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
- 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
- ], ' ')
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
@@ -93,7 +93,7 @@ module Spotlight
93
93
  end
94
94
 
95
95
  def private?(exhibit)
96
- !(public?(exhibit))
96
+ !public?(exhibit)
97
97
  end
98
98
 
99
99
  def public?(exhibit)
@@ -61,6 +61,6 @@ module Spotlight
61
61
  blacklight_config.facet_fields.reject { |_k, v| v.pivot || v.query }
62
62
  end
63
63
 
64
- alias_method :current_exhibit, :exhibit
64
+ alias current_exhibit exhibit
65
65
  end
66
66
  end
@@ -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
@@ -43,7 +43,7 @@ module Spotlight
43
43
  def content?
44
44
  self[:content].present? && content.present?
45
45
  end
46
- alias_method :has_content?, :content?
46
+ alias has_content? content?
47
47
 
48
48
  def display_sidebar?
49
49
  true
@@ -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
- solr_hash[config[:field]] = url.send(config[:version]).url
57
- else
58
- solr_hash[config[:field]] = url.url
59
- end
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 }
@@ -101,6 +101,6 @@ module Spotlight
101
101
  super || (title_changed? && persisted?)
102
102
  end
103
103
 
104
- alias_method :current_exhibit, :exhibit
104
+ alias current_exhibit exhibit
105
105
  end
106
106
  end
@@ -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.section'), spotlight.edit_site_path %></li>
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.section'), spotlight.edit_site_exhibits_path %></li>
12
- <li><%= link_to t(:'spotlight.admin_users.index.section'), spotlight.admin_users_path %></li>
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('.create_exhibit'), new_exhibit_path, class: 'btn btn-default btn-nav', role: 'button' if can? :create, Spotlight::Exhibit %></li>
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', html: {class: "row"} do |f| %>
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
- <ul class="nav nav-pills col-md-10 col-md-offset-1 tags">
4
- <li class="<%= 'active' if params[:tag].blank? %>"><%= link_to t('.all'), exhibits_path %></li>
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
- <% tags.sort_by(&:name).each do |tag| %>
7
- <li class="<%= 'active' if params[:tag] == tag.name %>"><%= link_to tag.name, exhibits_path(tag: tag.name) %></li>
8
- <% end %>
9
- </ul>
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,4 +1,8 @@
1
1
  <div id="content" class="col-md-9 exhibit-admin">
2
- <%= configuration_page_title %>
2
+ <%= page_title t(:'spotlight.sites.new.section') %>
3
3
  <%= render 'new_exhibit_form' %>
4
4
  </div>
5
+
6
+ <aside class="col-md-3">
7
+ <%= render "shared/site_sidebar" %>
8
+ </aside>
@@ -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', html: {class: "row"} do |f| %>
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 exhibts adminstrator
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 users
135
- page_title: Exhibits administrators
136
- instructions: Existing exhibit administrators
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 Changes" to save the cropped area.
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: Customize appearance
548
- page_title: Exhibits landing page
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: Existing exhibits
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"
@@ -13,9 +13,13 @@ Spotlight::Engine.routes.draw do
13
13
  end
14
14
  end
15
15
 
16
- get '/edit' => 'sites#edit', as: :edit_site
17
- get '/exhibits/edit' => 'sites#edit_exhibits', as: :edit_site_exhibits
18
- patch '/edit' => 'sites#update', as: :site
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
 
@@ -3,7 +3,7 @@ class CreateSpotlightExhibitFilters < ActiveRecord::Migration
3
3
  create_table :spotlight_filters do |t|
4
4
  t.string :field
5
5
  t.string :value
6
- t.references :exhibit, index: true, foreign_key: true
6
+ t.references :exhibit, index: true
7
7
 
8
8
  t.timestamps null: false
9
9
  end
@@ -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("#{f}", 'jetty/solr/blacklight-core/conf/', verbose: true)
8
+ cp(f.to_s, 'jetty/solr/blacklight-core/conf/', verbose: true)
9
9
  end
10
10
  end
11
11
  end
@@ -1,4 +1,4 @@
1
1
  #
2
2
  module Spotlight
3
- VERSION = '0.16.0'
3
+ VERSION = '0.17.0'.freeze
4
4
  end
@@ -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: 'Configuration'
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: 'Identifier')
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 exhibts adminstrator')
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 'tag_value').to eq expected
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
- 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
- ])
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? subject).to be_falsey
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
@@ -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
- DatabaseCleaner.strategy = :transaction
56
- else
57
- DatabaseCleaner.strategy = :truncation
58
- end
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
- [{}, SolrDocument.new(id: 1)],
12
- [{}, SolrDocument.new(id: 2)],
13
- [{}, SolrDocument.new(id: 3)]
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
- [{}, SolrDocument.new(id: 1)],
13
- [{}, SolrDocument.new(id: 2)],
14
- [{}, SolrDocument.new(id: 3)]
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.16.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-13 00:00:00.000000000 Z
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: '0'
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: '0'
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.35'
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.35'
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