blacklight-spotlight 3.0.3 → 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/javascripts/spotlight/admin/blocks/block.js +4 -0
- 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 +2 -6
- data/app/controllers/spotlight/searches_controller.rb +6 -1
- data/app/helpers/spotlight/application_helper.rb +1 -1
- data/app/helpers/spotlight/job_trackers_helper.rb +1 -1
- data/app/helpers/spotlight/main_app_helpers.rb +1 -1
- data/app/jobs/spotlight/reindex_exhibit_job.rb +9 -1
- data/app/mailers/spotlight/confirmation_mailer.rb +2 -1
- data/app/models/sir_trevor_rails/blocks/featured_pages_block.rb +2 -2
- data/app/models/spotlight/contact_email.rb +1 -1
- data/app/models/spotlight/page.rb +8 -0
- data/app/models/spotlight/page_configurations.rb +1 -1
- data/app/services/spotlight/exhibit_import_export_service.rb +1 -1
- data/app/views/layouts/spotlight/base.html.erb +5 -2
- data/app/views/shared/_body_preamble.html.erb +0 -0
- data/app/views/shared/_footer.html.erb +0 -1
- data/app/views/shared/_masthead.html.erb +1 -1
- data/app/views/shared/_user_util_links.html.erb +8 -2
- 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/sir_trevor/blocks/_iframe_block.html.erb +1 -1
- data/app/views/spotlight/sir_trevor/blocks/_search_results_block.html.erb +1 -0
- 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 +13 -4
- data/lib/generators/spotlight/install_generator.rb +16 -7
- 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 +21 -3
- data/spec/examples.txt +1508 -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/features/report_a_problem_spec.rb +1 -0
- data/spec/fixtures/iiif_responses.rb +81 -81
- data/spec/helpers/spotlight/pages_helper_spec.rb +1 -1
- data/spec/models/sir_trevor_rails/blocks/featured_pages_block_spec.rb +19 -1
- data/spec/models/solr_document_spec.rb +3 -3
- data/spec/models/spotlight/page_configurations_spec.rb +2 -2
- 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 -4
- data/spec/views/spotlight/pages/show.html.erb_spec.rb +17 -6
- 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 +14 -9
- data/spec/views/shared/_footer.html.erb_spec.rb +0 -15
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
|
@@ -3,9 +3,6 @@
|
|
3
3
|
module Spotlight
|
4
4
|
##
|
5
5
|
# Base CRUD controller for pages
|
6
|
-
# rubocop:disable Metrics/ClassLength
|
7
|
-
# Disableing class length because this is a base
|
8
|
-
# controller that gives other controllers their behavior
|
9
6
|
class PagesController < Spotlight::ApplicationController
|
10
7
|
before_action :authenticate_user!, except: [:show]
|
11
8
|
before_action :load_locale_specific_page, only: %i[destroy edit show update]
|
@@ -32,7 +29,7 @@ module Spotlight
|
|
32
29
|
|
33
30
|
respond_to do |format|
|
34
31
|
format.html
|
35
|
-
format.json { render json: @pages.
|
32
|
+
format.json { render json: @pages.for_default_locale.published.to_json(methods: [:thumbnail_image_url]) }
|
36
33
|
end
|
37
34
|
end
|
38
35
|
|
@@ -192,7 +189,7 @@ module Spotlight
|
|
192
189
|
add_breadcrumb t(key, title: current_exhibit.title), spotlight.exhibit_root_path(current_exhibit)
|
193
190
|
end
|
194
191
|
|
195
|
-
# Only allow
|
192
|
+
# Only allow trusted parameters through.
|
196
193
|
def page_params
|
197
194
|
params.require(controller_name.singularize).permit(allowed_page_params)
|
198
195
|
end
|
@@ -208,5 +205,4 @@ module Spotlight
|
|
208
205
|
end
|
209
206
|
end
|
210
207
|
end
|
211
|
-
# rubocop:enable Metrics/ClassLength
|
212
208
|
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
|
@@ -4,7 +4,7 @@ module Spotlight
|
|
4
4
|
# HTML <meta> tag helpers
|
5
5
|
module JobTrackersHelper
|
6
6
|
def job_status_icon(job_tracker)
|
7
|
-
content_tag :span, title: t(job_tracker.status || 'missing', scope: 'spotlight.job_trackers.status') do
|
7
|
+
content_tag :span, title: t(job_tracker.status || 'missing', scope: 'spotlight.job_trackers.status') do
|
8
8
|
if job_tracker.enqueued? || job_tracker.in_progress?
|
9
9
|
'⏱'
|
10
10
|
elsif job_tracker.completed?
|
@@ -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
|
@@ -14,7 +14,7 @@ module Spotlight
|
|
14
14
|
|
15
15
|
# Use the provided batch size, or calculate a reasonable default
|
16
16
|
batch_count = (count.to_f / batch_size).ceil if batch_size
|
17
|
-
batch_count ||=
|
17
|
+
batch_count ||= batch_count_based_on_number_of_resources(count)
|
18
18
|
|
19
19
|
return Spotlight::ReindexJob.perform_now(exhibit, reports_on: job_tracker) if batch_count == 1
|
20
20
|
|
@@ -26,6 +26,8 @@ module Spotlight
|
|
26
26
|
job_tracker.update(status: 'pending')
|
27
27
|
end
|
28
28
|
|
29
|
+
private
|
30
|
+
|
29
31
|
def perform_later_in_batches(exhibit, of:)
|
30
32
|
last = 0
|
31
33
|
exhibit.resources.select(:id).in_batches(of: of) do |batch|
|
@@ -35,5 +37,11 @@ module Spotlight
|
|
35
37
|
|
36
38
|
Spotlight::ReindexJob.perform_later(exhibit, reports_on: job_tracker, start: last)
|
37
39
|
end
|
40
|
+
|
41
|
+
def batch_count_based_on_number_of_resources(count)
|
42
|
+
return 1 if count.zero?
|
43
|
+
|
44
|
+
1 + Math.log(count).round # e.g. 10 => 3, 100 => 6, 1000 => 8
|
45
|
+
end
|
38
46
|
end
|
39
47
|
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
|
@@ -12,7 +12,7 @@ module SirTrevorRails
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def pages
|
15
|
-
@pages ||= parent.exhibit.pages.published.where(slug: item_ids).sort do |a, b|
|
15
|
+
@pages ||= parent.exhibit.pages.for_default_locale.published.where(slug: item_ids).sort do |a, b|
|
16
16
|
ordered_items.index(a.slug) <=> ordered_items.index(b.slug)
|
17
17
|
end
|
18
18
|
end
|
@@ -28,7 +28,7 @@ module SirTrevorRails
|
|
28
28
|
|
29
29
|
result[:data][:item].transform_values! do |v|
|
30
30
|
begin
|
31
|
-
v['thumbnail_image_url'] = parent.exhibit.pages.find(v['id']).thumbnail_image_url
|
31
|
+
v['thumbnail_image_url'] = parent.exhibit.pages.for_default_locale.find(v['id']).thumbnail_image_url
|
32
32
|
rescue ActiveRecord::RecordNotFound
|
33
33
|
v = nil
|
34
34
|
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
|
@@ -46,6 +46,12 @@ module Spotlight
|
|
46
46
|
|
47
47
|
after_update :update_translated_pages_weights_and_parent_page
|
48
48
|
|
49
|
+
def title
|
50
|
+
return super if I18n.locale == I18n.default_locale
|
51
|
+
|
52
|
+
translated_page_for(I18n.locale)&.title || super
|
53
|
+
end
|
54
|
+
|
49
55
|
def content_changed!
|
50
56
|
@content = nil
|
51
57
|
end
|
@@ -133,6 +139,8 @@ module Spotlight
|
|
133
139
|
end
|
134
140
|
|
135
141
|
def translated_page_for(locale)
|
142
|
+
return self if locale == self.locale
|
143
|
+
|
136
144
|
translated_pages.for_locale(locale).first
|
137
145
|
end
|
138
146
|
|
@@ -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])
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<meta charset="utf-8">
|
5
5
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
7
|
-
|
7
|
+
<%= render partial: 'shared/analytics' %>
|
8
8
|
<title><%= h(@page_title || application_name.to_s) %></title>
|
9
9
|
<link href="<%= current_exhibit ? spotlight.opensearch_exhibit_catalog_url(current_exhibit, format: 'xml') : main_app.opensearch_catalog_url(format: 'xml') %>" title="<%= h(@page_title || application_name.to_str) %>" type="application/opensearchdescription+xml" rel="search"/>
|
10
10
|
<%= favicon_link_tag 'favicon.ico' %>
|
@@ -22,8 +22,11 @@
|
|
22
22
|
<%= javascript_tag '$.fx.off = true;' if Rails.env.test? %>
|
23
23
|
</head>
|
24
24
|
<body class="<%= render_body_class %>">
|
25
|
+
<%= render partial: 'shared/body_preamble' %>
|
25
26
|
<div id="skip-link">
|
26
|
-
|
27
|
+
<% if should_render_spotlight_search_bar? %>
|
28
|
+
<%= link_to t('blacklight.skip_links.search_field'), '#search_field', class: 'element-invisible element-focusable rounded-bottom py-2 px-3', data: { turbolinks: 'false' } %>
|
29
|
+
<% end %>
|
27
30
|
<%= link_to t('blacklight.skip_links.main_content'), '#main-container', class: 'element-invisible element-focusable rounded-bottom py-2 px-3', data: { turbolinks: 'false' } %>
|
28
31
|
<%= content_for(:skip_links) %>
|
29
32
|
</div>
|
File without changes
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= render 'shared/analytics' %>
|
@@ -1,8 +1,14 @@
|
|
1
|
-
|
1
|
+
<% nav_actions = capture do %>
|
2
2
|
<%= render_nav_actions do |config, action|%>
|
3
3
|
<li class="nav-item"><%= action %></li>
|
4
4
|
<% end %>
|
5
|
-
|
5
|
+
<% end %>
|
6
|
+
|
7
|
+
<% if nav_actions.present? %>
|
8
|
+
<ul class="navbar-nav mr-auto">
|
9
|
+
<%= nav_actions %>
|
10
|
+
</ul>
|
11
|
+
<% end %>
|
6
12
|
|
7
13
|
<ul class="navbar-nav">
|
8
14
|
<%= render '/spotlight/shared/locale_picker' %>
|
@@ -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? %>
|
@@ -1 +1 @@
|
|
1
|
-
<%= sanitize iframe_block.code, tags: %w(iframe), attributes: %w(id width height marginwidth marginheight src frameborder allowfullscreen sandbox seamless srcdoc scrolling) %>
|
1
|
+
<%= sanitize iframe_block.code, tags: %w(iframe), attributes: %w(id aria-label title width height marginwidth marginheight src frameborder allowfullscreen sandbox seamless srcdoc scrolling) %>
|
@@ -17,6 +17,7 @@
|
|
17
17
|
</div>
|
18
18
|
<% end %>
|
19
19
|
|
20
|
+
<h2 class="sr-only visually-hidden"><%= t('blacklight.search.search_results') %></h2>
|
20
21
|
<%= render_document_index_with_view(block_document_index_view_type(search_results_block), document_list) %>
|
21
22
|
<%= render 'results_pagination' %>
|
22
23
|
<%- end %>
|
@@ -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:
|
@@ -50,7 +54,7 @@ en:
|
|
50
54
|
destroy: Delete group
|
51
55
|
spotlight/role:
|
52
56
|
create: Add a new user
|
53
|
-
destroy: Remove from
|
57
|
+
destroy: Remove from exhibit
|
54
58
|
spotlight/search:
|
55
59
|
destroy: Delete
|
56
60
|
edit_long: Edit this saved search
|
@@ -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:
|