blacklight-spotlight 3.2.0 → 3.3.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 +2 -2
- data/app/assets/stylesheets/spotlight/_breadcrumbs.scss +2 -4
- data/app/builders/spotlight/bootstrap_breadcrumbs_builder.rb +2 -2
- data/app/controllers/concerns/spotlight/controller.rb +13 -12
- data/app/controllers/spotlight/attachments_controller.rb +1 -1
- data/app/controllers/spotlight/custom_search_fields_controller.rb +1 -1
- data/app/controllers/spotlight/pages_controller.rb +1 -1
- data/app/controllers/spotlight/searches_controller.rb +6 -1
- data/app/helpers/spotlight/application_helper.rb +1 -1
- data/app/helpers/spotlight/main_app_helpers.rb +1 -1
- data/app/mailers/spotlight/confirmation_mailer.rb +2 -1
- data/app/models/spotlight/contact_email.rb +1 -1
- data/app/models/spotlight/page_configurations.rb +1 -1
- data/app/services/spotlight/exhibit_import_export_service.rb +1 -1
- data/app/views/spotlight/catalog/admin.html.erb +1 -1
- data/app/views/spotlight/confirmation_mailer/confirmation_instructions.html.erb +3 -3
- data/app/views/spotlight/exhibits/_import.html.erb +1 -1
- data/app/views/spotlight/exhibits/_languages.html.erb +2 -2
- data/app/views/spotlight/filters/_form.html.erb +1 -1
- data/app/views/spotlight/resources/upload/_form.html.erb +1 -1
- data/app/views/spotlight/search_configurations/_document_index_view_types.html.erb +1 -1
- data/app/views/spotlight/search_configurations/_facet_metadata.html.erb +4 -2
- data/app/views/spotlight/search_configurations/_facets.html.erb +1 -1
- data/app/views/spotlight/searches/_form.html.erb +1 -1
- data/app/views/spotlight/translations/_browse_categories.html.erb +1 -1
- data/app/views/spotlight/translations/_groups.html.erb +1 -1
- data/app/views/spotlight/translations/_import.html.erb +1 -1
- data/app/views/spotlight/translations/_metadata.html.erb +1 -1
- data/app/views/spotlight/translations/_search_fields.html.erb +1 -1
- data/config/i18n-tasks.yml +1 -1
- data/config/locales/spotlight.en.yml +12 -3
- data/lib/generators/spotlight/templates/config/initializers/translation.rb +13 -11
- data/lib/spotlight/engine.rb +3 -1
- data/lib/spotlight/version.rb +1 -1
- data/lib/tasks/spotlight_tasks.rake +20 -5
- data/spec/examples.txt +1505 -1496
- data/spec/features/edit_search_fields_spec.rb +1 -1
- data/spec/features/javascript/blocks/solr_documents_block_spec.rb +2 -0
- data/spec/helpers/spotlight/pages_helper_spec.rb +1 -1
- data/spec/models/solr_document_spec.rb +3 -3
- data/spec/models/spotlight/page_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/spec/test_app_templates/catalog_controller.rb +3 -3
- data/spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb +27 -1
- data/spec/views/spotlight/tags/index.html.erb_spec.rb +0 -1
- metadata +13 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6d38a0f303034a89f2a514617e5bc17b31ad2bb60a2dd865245a1822d5ef27c
|
4
|
+
data.tar.gz: 3a1e9f34a1f5bb1486843486dfc9bbb991b0c8504ae69898dbd852828fbb82f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9e96166b8445ac6333e6a5fb2647b1688b2007dcdc5907fb81099c5476f6dc49f053a060dbea12c531fb91934ef5f2c3aa6051ae408c1f654155fc6cd7e9816
|
7
|
+
data.tar.gz: b72e0ccf54ad7969d11167df4aa8139533d4afd0acab8bfe05cd26f54170ca8b52bfe92575224e216dd1af32c537a0a2c2785f2b691567a0c7b176dc2b73e3ba
|
data/README.md
CHANGED
@@ -9,8 +9,8 @@ Read more about what Spotlight is, our motivations for creating it, and how to i
|
|
9
9
|
|
10
10
|
## Requirements
|
11
11
|
|
12
|
-
1. Ruby (2.
|
13
|
-
2. Rails (5.
|
12
|
+
1. Ruby (2.7 or greater)
|
13
|
+
2. Rails (5.2 or greater)
|
14
14
|
3. Java (7 or greater) *for Solr*
|
15
15
|
4. ImageMagick (http://www.imagemagick.org/script/index.php) due to [carrierwave](https://github.com/carrierwaveuploader/carrierwave#adding-versions)
|
16
16
|
|
@@ -25,7 +25,7 @@ module Spotlight
|
|
25
25
|
|
26
26
|
html_class = 'active' if current
|
27
27
|
|
28
|
-
@context.content_tag(:li, class: "breadcrumb-item #{html_class}") do
|
28
|
+
@context.content_tag(:li, class: "breadcrumb-item truncated-value #{html_class}") do
|
29
29
|
@context.link_to_unless(current, element_label(element), compute_path(element), element.options&.except(:current))
|
30
30
|
end
|
31
31
|
end
|
@@ -33,7 +33,7 @@ module Spotlight
|
|
33
33
|
private
|
34
34
|
|
35
35
|
def element_label(element)
|
36
|
-
@context.content_tag(:span
|
36
|
+
@context.content_tag(:span) { compute_name(element) }
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
@@ -67,38 +67,39 @@ module Spotlight
|
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
|
-
def search_action_url(*args)
|
70
|
+
def search_action_url(*args, **kwargs)
|
71
71
|
if current_exhibit
|
72
|
-
exhibit_search_action_url(*args)
|
72
|
+
exhibit_search_action_url(*args, **kwargs)
|
73
73
|
else
|
74
|
-
main_app.search_catalog_url(*args)
|
74
|
+
main_app.search_catalog_url(*args, **kwargs)
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
78
|
-
def search_facet_path(*args)
|
78
|
+
def search_facet_path(*args, **kwargs)
|
79
79
|
if current_exhibit
|
80
|
-
exhibit_search_facet_path(*args)
|
80
|
+
exhibit_search_facet_path(*args, **kwargs)
|
81
81
|
else
|
82
|
-
main_app.catalog_facet_url(*args)
|
82
|
+
main_app.catalog_facet_url(*args, **kwargs)
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
86
|
-
def exhibit_search_action_url(*args)
|
86
|
+
def exhibit_search_action_url(*args, **kwargs)
|
87
87
|
options = args.extract_options!
|
88
|
+
options = options.merge(kwargs)
|
88
89
|
only_path = options[:only_path]
|
89
90
|
options.except! :exhibit_id, :only_path
|
90
91
|
|
91
92
|
if only_path
|
92
|
-
spotlight.search_exhibit_catalog_path(current_exhibit, *args, options)
|
93
|
+
spotlight.search_exhibit_catalog_path(current_exhibit, *args, **options)
|
93
94
|
else
|
94
|
-
spotlight.search_exhibit_catalog_url(current_exhibit, *args, options)
|
95
|
+
spotlight.search_exhibit_catalog_url(current_exhibit, *args, **options)
|
95
96
|
end
|
96
97
|
end
|
97
98
|
|
98
|
-
def exhibit_search_facet_path(*args)
|
99
|
+
def exhibit_search_facet_path(*args, **kwargs)
|
99
100
|
options = args.extract_options!
|
100
|
-
options = Blacklight::Parameters.sanitize(params.to_unsafe_h.with_indifferent_access).merge(options).except(:exhibit_id, :only_path)
|
101
|
-
spotlight.facet_exhibit_catalog_url(current_exhibit, *args, options)
|
101
|
+
options = Blacklight::Parameters.sanitize(params.to_unsafe_h.with_indifferent_access).merge(options).merge(kwargs).except(:exhibit_id, :only_path)
|
102
|
+
spotlight.facet_exhibit_catalog_url(current_exhibit, *args, **options&.symbolize_keys)
|
102
103
|
end
|
103
104
|
end
|
104
105
|
end
|
@@ -57,7 +57,7 @@ module Spotlight
|
|
57
57
|
add_breadcrumb t(:'spotlight.configuration.sidebar.search_configuration'), edit_exhibit_search_configuration_path(@exhibit)
|
58
58
|
end
|
59
59
|
|
60
|
-
# Only allow
|
60
|
+
# Only allow trusted parameters through.
|
61
61
|
def custom_search_field_params
|
62
62
|
params.require(:custom_search_field).permit(:slug, :field, :label)
|
63
63
|
end
|
@@ -189,7 +189,7 @@ module Spotlight
|
|
189
189
|
add_breadcrumb t(key, title: current_exhibit.title), spotlight.exhibit_root_path(current_exhibit)
|
190
190
|
end
|
191
191
|
|
192
|
-
# Only allow
|
192
|
+
# Only allow trusted parameters through.
|
193
193
|
def page_params
|
194
194
|
params.require(controller_name.singularize).permit(allowed_page_params)
|
195
195
|
end
|
@@ -117,9 +117,14 @@ module Spotlight
|
|
117
117
|
end
|
118
118
|
|
119
119
|
def query_params
|
120
|
-
params.to_unsafe_h.with_indifferent_access.except(:exhibit_id, :search, *
|
120
|
+
params.to_unsafe_h.with_indifferent_access.except(:exhibit_id, :search, *excluded_search_session_params).reject { |_k, v| v.blank? }
|
121
121
|
end
|
122
122
|
|
123
|
+
def excluded_search_session_params
|
124
|
+
blacklisted_search_session_params
|
125
|
+
end
|
126
|
+
|
127
|
+
# @deprecated
|
123
128
|
def blacklisted_search_session_params
|
124
129
|
%i[id commit counter total search_id page per_page authenticity_token utf8 action controller]
|
125
130
|
end
|
@@ -162,7 +162,7 @@ module Spotlight
|
|
162
162
|
if current_exhibit_theme && current_exhibit.theme != 'default'
|
163
163
|
stylesheet_link_tag "#{tag}_#{current_exhibit_theme}"
|
164
164
|
else
|
165
|
-
Rails.logger.warn "Exhibit theme '#{current_exhibit_theme}' not in
|
165
|
+
Rails.logger.warn "Exhibit theme '#{current_exhibit_theme}' not in the list of available themes: #{current_exhibit.themes}"
|
166
166
|
stylesheet_link_tag(tag)
|
167
167
|
end
|
168
168
|
end
|
@@ -40,7 +40,7 @@ module Spotlight
|
|
40
40
|
if current_exhibit_theme && current_exhibit&.theme != 'default'
|
41
41
|
stylesheet_link_tag "#{tag}_#{current_exhibit_theme}"
|
42
42
|
else
|
43
|
-
Rails.logger.warn "Exhibit theme '#{current_exhibit_theme}' not in
|
43
|
+
Rails.logger.warn "Exhibit theme '#{current_exhibit_theme}' not in the list of available themes: #{current_exhibit&.themes}"
|
44
44
|
stylesheet_link_tag(tag)
|
45
45
|
end
|
46
46
|
end
|
@@ -6,8 +6,9 @@ module Spotlight
|
|
6
6
|
class ConfirmationMailer < ActionMailer::Base
|
7
7
|
include Devise::Mailers::Helpers
|
8
8
|
|
9
|
-
def confirmation_instructions(record, token, opts)
|
9
|
+
def confirmation_instructions(record, token, opts, exhibit: nil)
|
10
10
|
@token = token
|
11
|
+
@exhibit = exhibit
|
11
12
|
initialize_from_record(record)
|
12
13
|
mail headers_for(:confirmation_instructions, opts)
|
13
14
|
end
|
@@ -33,7 +33,7 @@ module Spotlight
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def send_devise_notification(notification, *args)
|
36
|
-
notice = notification_mailer.send(notification, self, *args)
|
36
|
+
notice = notification_mailer.send(notification, self, *args, exhibit: exhibit)
|
37
37
|
if notice.respond_to? :deliver_now
|
38
38
|
notice.deliver_now
|
39
39
|
else
|
@@ -49,7 +49,7 @@ module Spotlight
|
|
49
49
|
deserialize_featured_image(exhibit, :masthead, hash[:masthead]) if hash[:masthead]
|
50
50
|
deserialize_featured_image(exhibit, :thumbnail, hash[:thumbnail]) if hash[:thumbnail]
|
51
51
|
|
52
|
-
exhibit.blacklight_configuration.update hash[:blacklight_configuration].
|
52
|
+
exhibit.blacklight_configuration.update hash[:blacklight_configuration].with_indifferent_access if hash[:blacklight_configuration]
|
53
53
|
|
54
54
|
hash[:main_navigations].each do |attr|
|
55
55
|
ar = exhibit.main_navigations.find_or_initialize_by(nav_type: attr[:nav_type])
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<p><%= t(:'.welcome', email: @email) %></p>
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
<br /><br />
|
3
|
+
<%= simple_format t(:'.instructions', exhibit_title: @exhibit&.title) %>
|
4
|
+
<br /><br />
|
5
5
|
<p><%= link_to t(:'.confirm'), spotlight.contact_email_confirmation_url(:confirmation_token => @token) %></p>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<p class="instructions"><%= t :'.instructions' %></p>
|
5
5
|
<div class="form-group">
|
6
6
|
<%= file_field_tag :file, class: 'form-control' %>
|
7
|
-
<%= hidden_field_tag :tab, 'import' %>
|
7
|
+
<%= hidden_field_tag :tab, 'import', id: nil %>
|
8
8
|
</div>
|
9
9
|
<div class="form-actions">
|
10
10
|
<div class="primary-actions">
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<%= bootstrap_form_for [current_exhibit, Spotlight::Language.new], layout: :horizontal, html: { class: 'row' }, label_col: "col-sm-3", control_col: "col-sm-9" do |f| %>
|
5
5
|
<div class='col-sm-6'>
|
6
6
|
<%= f.select('locale', add_exhibit_language_dropdown_options, prompt: t('.selection_prompt')) %>
|
7
|
-
<%= hidden_field_tag :tab, 'language' %>
|
7
|
+
<%= hidden_field_tag :tab, 'language', id: nil %>
|
8
8
|
</div>
|
9
9
|
<div class='col-sm-6'>
|
10
10
|
<%= f.submit nil, class: 'btn btn-primary' %>
|
@@ -48,7 +48,7 @@
|
|
48
48
|
</div>
|
49
49
|
<div class="form-actions">
|
50
50
|
<div class="primary-actions">
|
51
|
-
<%= hidden_field_tag :tab, 'language' %>
|
51
|
+
<%= hidden_field_tag :tab, 'language', id: nil %>
|
52
52
|
<%= f.submit nil, class: 'btn btn-primary' %>
|
53
53
|
</div>
|
54
54
|
</div>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<% end %>
|
12
12
|
<div class="form-actions">
|
13
13
|
<div class="primary-actions">
|
14
|
-
<%= hidden_field_tag :tab, 'upload' %>
|
14
|
+
<%= hidden_field_tag :tab, 'upload', id: nil %>
|
15
15
|
<%= cancel_link @resource, :back, class: 'btn-sizing' %>
|
16
16
|
<%= f.submit t('.add_item_and_continue'), name: 'add-and-continue', class: 'btn btn-secondary' %>
|
17
17
|
<%= f.submit t('.add_item'), class: 'btn btn-primary' %>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%= f.form_group :document_index_view_types, label: {text: t(:'.label'), class: 'pt-0'} do %>
|
2
2
|
<%= f.fields_for :document_index_view_types, @blacklight_configuration.document_index_view_types_selected_hash do |vt| %>
|
3
3
|
<% @blacklight_configuration.default_blacklight_config.view.select { |_k, v| v.if != false }.each do |key, view| %>
|
4
|
-
<%= vt.check_box key, label: view.display_label
|
4
|
+
<%= vt.check_box key, label: view.display_label %>
|
5
5
|
<% end %>
|
6
6
|
<% end %>
|
7
7
|
<% end %>
|
@@ -1,8 +1,10 @@
|
|
1
1
|
<%= content_tag :span, t(:'.document_count', count: metadata[:document_count]) %>
|
2
2
|
<% if metadata[:document_count] > 0 %>
|
3
3
|
•
|
4
|
-
<%
|
5
|
-
|
4
|
+
<% limit = field_config&.limit || Spotlight::FieldMetadata::FACET_LIMIT %>
|
5
|
+
<% limit = blacklight_config.default_facet_limit if limit == true %>
|
6
|
+
<% if metadata[:value_count] >= limit %>
|
7
|
+
<%= content_tag :span, t(:'.too_many_values_count', count: limit) %>
|
6
8
|
<% else %>
|
7
9
|
<%= content_tag :span, t(:'.value_count', count: metadata[:value_count]) %>
|
8
10
|
<% end %>
|
@@ -16,7 +16,7 @@
|
|
16
16
|
</div>
|
17
17
|
<% when :additional_options %>
|
18
18
|
<div class="facet-metadata mr-3">
|
19
|
-
<%= render partial: 'facet_metadata', locals: { metadata: metadata } %>
|
19
|
+
<%= render partial: 'facet_metadata', locals: { blacklight_config: @blacklight_configuration.blacklight_config, field_config: config, metadata: metadata } %>
|
20
20
|
</div>
|
21
21
|
<% else %>
|
22
22
|
<% end %>
|
@@ -40,7 +40,7 @@
|
|
40
40
|
<% end %>
|
41
41
|
<%= f.form_group label: { text: t(:".default_index_view_type"), class: 'pt-0' } do %>
|
42
42
|
<% available_document_index_views.each do |key, view| %>
|
43
|
-
<%= f.radio_button :default_index_view_type, key, label: view.display_label
|
43
|
+
<%= f.radio_button :default_index_view_type, key, label: view.display_label %>
|
44
44
|
<% end %>
|
45
45
|
<% end %>
|
46
46
|
<% unless @search.query_params.blank? %>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<%= bootstrap_form_for current_exhibit, url: spotlight.exhibit_translations_path(current_exhibit), layout: :horizontal do |f| %>
|
3
3
|
<% # Add hidden fields for the language and tab so the redirect knows how to come back here %>
|
4
4
|
<%= hidden_field_tag :language, @language %>
|
5
|
-
<%= hidden_field_tag :tab, 'browse' %>
|
5
|
+
<%= hidden_field_tag :tab, 'browse', id: nil %>
|
6
6
|
<div class="row">
|
7
7
|
<div class="col-4 text-right">
|
8
8
|
<span class="browse-translations-header">
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<%= bootstrap_form_for current_exhibit, url: spotlight.exhibit_translations_path(current_exhibit), layout: :horizontal do |f| %>
|
3
3
|
<% # Add hidden fields for the language and tab so the redirect knows how to come back here %>
|
4
4
|
<%= hidden_field_tag :language, @language %>
|
5
|
-
<%= hidden_field_tag :tab, 'groups' %>
|
5
|
+
<%= hidden_field_tag :tab, 'groups', id: nil %>
|
6
6
|
|
7
7
|
<% current_exhibit.groups.each do |group| %>
|
8
8
|
<% title_translation = Translation.find_or_initialize_by(exhibit: current_exhibit, key: "#{group.slug}.title", locale: @language) %>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
<div class="input-group col px-0">
|
10
10
|
<%= file_field_tag :file, class: 'form-control' %>
|
11
|
-
<%= hidden_field_tag :tab, 'import' %>
|
11
|
+
<%= hidden_field_tag :tab, 'import', id: nil %>
|
12
12
|
<div class="input-group-append">
|
13
13
|
<%= f.submit t(:'.import_submit'), class: 'btn btn-primary' %>
|
14
14
|
</div>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<%= bootstrap_form_for current_exhibit, url: spotlight.exhibit_translations_path(current_exhibit), layout: :horizontal do |f| %>
|
3
3
|
<% # Add a hidden field for the language so the redirect knows how to come back here %>
|
4
4
|
<%= hidden_field_tag :language, @language %>
|
5
|
-
<%= hidden_field_tag :tab, 'metadata' %>
|
5
|
+
<%= hidden_field_tag :tab, 'metadata', id: nil %>
|
6
6
|
|
7
7
|
<% non_custom_metadata_fields.each do |key, field_config| %>
|
8
8
|
<% translation = Translation.find_or_initialize_by(exhibit: current_exhibit, key: "blacklight.search.fields.#{key}", locale: @language) %>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<%= bootstrap_form_for current_exhibit, url: spotlight.exhibit_translations_path(current_exhibit), layout: :horizontal do |f| %>
|
3
3
|
<% # Add hidden fields for the language and tab so the redirect knows how to come back here %>
|
4
4
|
<%= hidden_field_tag :language, @language %>
|
5
|
-
<%= hidden_field_tag :tab, 'search_fields' %>
|
5
|
+
<%= hidden_field_tag :tab, 'search_fields', id: nil %>
|
6
6
|
|
7
7
|
<div class='translation-field-based-search-fields'>
|
8
8
|
<h2 class='translation-subheading'>
|
data/config/i18n-tasks.yml
CHANGED
@@ -77,7 +77,7 @@ ignore_unused:
|
|
77
77
|
# TODO Look into these as its unclear
|
78
78
|
- activerecord.models.spotlight.page
|
79
79
|
#- # perhaps removed here? https://github.com/projectblacklight/spotlight/commit/d4fdf04565ab3d648f0cb2a1238d84f262509fcd
|
80
|
-
- devise.mailer
|
80
|
+
- devise.mailer.*.* # Does this even work? https://github.com/projectblacklight/spotlight/blob/master/app/mailers/spotlight/invitation_mailer.rb#L16
|
81
81
|
- helpers.submit.solr_document.{batch_error,batch_updated,create,created,destroyed,submit,update,updated} # Do we need this?
|
82
82
|
- helpers.submit.user.{batch_error,batch_updated,create,created,destroyed,submit,update,updated} # Do we need this?
|
83
83
|
- helpers.action.destroy # no idea here
|
@@ -27,6 +27,10 @@ en:
|
|
27
27
|
spotlight/group: Browse group
|
28
28
|
spotlight/search: Browse category
|
29
29
|
cancel: Cancel
|
30
|
+
devise:
|
31
|
+
mailer:
|
32
|
+
confirmation_instructions:
|
33
|
+
contact_email_subject: Exhibit feedback confirmation
|
30
34
|
drag: Drag
|
31
35
|
helpers:
|
32
36
|
action:
|
@@ -408,9 +412,14 @@ en:
|
|
408
412
|
users: Users
|
409
413
|
confirmation_mailer:
|
410
414
|
confirmation_instructions:
|
411
|
-
confirm:
|
412
|
-
instructions:
|
413
|
-
|
415
|
+
confirm: Yes, add me to the list of feedback form recipients
|
416
|
+
instructions: |
|
417
|
+
An administrator of the %{exhibit_title} exhibit has added your email address to the list of feedback form recipients.
|
418
|
+
This will enable you to receive any feedback submitted through the feedback form by visitors to the %{exhibit_title} exhibit.
|
419
|
+
|
420
|
+
To receive feedback from this exhibit, confirm your decision through the link below. If you do not want to
|
421
|
+
receive feedback form submissions from this exhibit, you can ignore this email.
|
422
|
+
welcome: Hello %{email},
|
414
423
|
contact_form:
|
415
424
|
subject: "%{application_name} exhibit feedback"
|
416
425
|
contacts:
|
@@ -5,17 +5,19 @@ require 'i18n/backend/fallbacks'
|
|
5
5
|
|
6
6
|
Translation = I18n::Backend::ActiveRecord::Translation
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
ActiveSupport::Reloader.to_prepare do
|
9
|
+
if Translation.table_exists?
|
10
|
+
##
|
11
|
+
# Sets up the new Spotlight Translation backend, backed by ActiveRecord. To
|
12
|
+
# turn on the ActiveRecord backend, uncomment the following lines.
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
I18n.backend = I18n::Backend::ActiveRecord.new
|
15
|
+
I18n::Backend::ActiveRecord.include I18n::Backend::Memoize
|
16
|
+
Translation.include Spotlight::CustomTranslationExtension
|
17
|
+
I18n::Backend::Simple.include I18n::Backend::Memoize
|
18
|
+
I18n::Backend::Simple.include I18n::Backend::Pluralization
|
19
|
+
I18n::Backend::Simple.include I18n::Backend::Fallbacks
|
19
20
|
|
20
|
-
|
21
|
+
I18n.backend = I18n::Backend::Chain.new(I18n.backend, I18n::Backend::Simple.new)
|
22
|
+
end
|
21
23
|
end
|
data/lib/spotlight/engine.rb
CHANGED
@@ -179,7 +179,9 @@ module Spotlight
|
|
179
179
|
config.analytics_provider = nil
|
180
180
|
|
181
181
|
initializer 'analytics.initialize' do
|
182
|
-
|
182
|
+
ActiveSupport::Reloader.to_prepare do
|
183
|
+
Spotlight::Engine.config.analytics_provider = Spotlight::Analytics::Ga
|
184
|
+
end
|
183
185
|
end
|
184
186
|
|
185
187
|
# If you use Google Analytics, you need to wire your site to report to a Google Analytics property.
|
data/lib/spotlight/version.rb
CHANGED
@@ -18,11 +18,8 @@ namespace :spotlight do
|
|
18
18
|
|
19
19
|
desc 'Create a new exhibit'
|
20
20
|
task exhibit: :environment do
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
print 'Exhibit URL slug: '
|
25
|
-
slug = @stdin.gets.chomp
|
21
|
+
title = prompt_for_title
|
22
|
+
slug = prompt_for_slug
|
26
23
|
|
27
24
|
exhibit = Spotlight::Exhibit.create!({ title: title, slug: slug })
|
28
25
|
|
@@ -91,11 +88,15 @@ namespace :spotlight do
|
|
91
88
|
end
|
92
89
|
|
93
90
|
def prompt_for_email
|
91
|
+
return ENV['SPOTLIGHT_USER_EMAIL'] if ENV['SPOTLIGHT_USER_EMAIL']
|
92
|
+
|
94
93
|
print 'Email: '
|
95
94
|
$stdin.gets.chomp
|
96
95
|
end
|
97
96
|
|
98
97
|
def prompt_for_password
|
98
|
+
return ENV['SPOTLIGHT_USER_PASSWORD'] if ENV['SPOTLIGHT_USER_PASSWORD']
|
99
|
+
|
99
100
|
begin
|
100
101
|
system 'stty -echo'
|
101
102
|
print 'Password (must be 8+ characters): '
|
@@ -107,6 +108,20 @@ namespace :spotlight do
|
|
107
108
|
password
|
108
109
|
end
|
109
110
|
|
111
|
+
def prompt_for_title
|
112
|
+
return ENV['SPOTLIGHT_EXHIBIT_TITLE'] if ENV['SPOTLIGHT_EXHIBIT_TITLE']
|
113
|
+
|
114
|
+
print 'Exhibit title: '
|
115
|
+
$stdin.gets.chomp
|
116
|
+
end
|
117
|
+
|
118
|
+
def prompt_for_slug
|
119
|
+
return ENV['SPOTLIGHT_EXHIBIT_SLUG'] if ENV['SPOTLIGHT_EXHIBIT_SLUG']
|
120
|
+
|
121
|
+
print 'Exhibit URL slug: '
|
122
|
+
$stdin.gets.chomp
|
123
|
+
end
|
124
|
+
|
110
125
|
namespace :check do
|
111
126
|
desc 'Check the Solr connection and controller configuration'
|
112
127
|
task :solr, [:model_name] => ['blacklight:check:solr', :environment] do |_, _args|
|