blacklight-spotlight 3.5.0.4 → 3.6.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +20 -0
- data/Rakefile +6 -7
- data/app/assets/config/spotlight/manifest.js +1 -0
- data/app/assets/javascripts/spotlight/application.js +14 -14
- data/app/assets/javascripts/spotlight/spotlight.esm.js +7148 -0
- data/app/assets/javascripts/spotlight/spotlight.esm.js.map +1 -0
- data/app/assets/javascripts/spotlight/spotlight.js +7148 -15
- data/app/assets/javascripts/spotlight/spotlight.js.map +1 -0
- data/app/assets/stylesheets/spotlight/_catalog.scss +16 -0
- data/app/controllers/concerns/spotlight/base.rb +2 -1
- data/app/controllers/concerns/spotlight/controller.rb +10 -0
- data/app/controllers/spotlight/admin_users_controller.rb +4 -4
- data/app/controllers/spotlight/appearances_controller.rb +6 -6
- data/app/controllers/spotlight/browse_controller.rb +1 -1
- data/app/controllers/spotlight/catalog_controller.rb +20 -15
- data/app/controllers/spotlight/concerns/application_controller.rb +1 -0
- data/app/controllers/spotlight/concerns/catalog_search_context.rb +2 -2
- data/app/controllers/spotlight/contacts_controller.rb +6 -6
- data/app/controllers/spotlight/dashboards_controller.rb +2 -2
- data/app/controllers/spotlight/exhibits_controller.rb +19 -19
- data/app/controllers/spotlight/featured_images_controller.rb +1 -1
- data/app/controllers/spotlight/home_pages_controller.rb +7 -7
- data/app/controllers/spotlight/lock_controller.rb +1 -1
- data/app/controllers/spotlight/metadata_configurations_controller.rb +2 -2
- data/app/controllers/spotlight/pages_controller.rb +4 -3
- data/app/controllers/spotlight/search_configurations_controller.rb +6 -6
- data/app/controllers/spotlight/searches_controller.rb +22 -22
- data/app/controllers/spotlight/solr_controller.rb +1 -1
- data/app/controllers/spotlight/translations_controller.rb +8 -10
- data/app/controllers/spotlight/versions_controller.rb +2 -1
- data/app/helpers/spotlight/application_helper.rb +33 -17
- data/app/helpers/spotlight/crud_link_helpers.rb +12 -2
- data/app/helpers/spotlight/pages_helper.rb +1 -1
- data/app/helpers/spotlight/roles_helper.rb +2 -2
- data/app/helpers/spotlight/title_helper.rb +1 -1
- data/app/helpers/spotlight/translations_helper.rb +1 -3
- data/app/javascript/spotlight/admin/add_another.es6 +24 -0
- data/app/javascript/spotlight/admin/add_image_selector.es6 +38 -0
- data/app/javascript/spotlight/admin/add_new_button.es6 +77 -0
- data/app/javascript/spotlight/admin/appearance.es6 +22 -0
- data/app/javascript/spotlight/admin/blacklight_configuration.es6 +65 -0
- data/app/{assets/javascripts → javascript}/spotlight/admin/block_mixins/autocompleteable.js +8 -8
- data/app/{assets/javascripts → javascript}/spotlight/admin/block_mixins/formable.js +1 -1
- data/app/javascript/spotlight/admin/block_mixins/plustextable.js +58 -0
- data/app/{assets/javascripts → javascript}/spotlight/admin/blocks/block.js +2 -1
- data/app/javascript/spotlight/admin/blocks/browse_block.js +86 -0
- data/app/javascript/spotlight/admin/blocks/browse_group_categories_block.js +88 -0
- data/app/{assets/javascripts → javascript}/spotlight/admin/blocks/iframe_block.js +7 -11
- data/app/{assets/javascripts → javascript}/spotlight/admin/blocks/link_to_search_block.js +0 -2
- data/app/javascript/spotlight/admin/blocks/oembed_block.js +41 -0
- data/app/{assets/javascripts → javascript}/spotlight/admin/blocks/pages_block.js +1 -1
- data/app/{assets/javascripts → javascript}/spotlight/admin/blocks/resources_block.js +45 -42
- data/app/{assets/javascripts → javascript}/spotlight/admin/blocks/rule_block.js +2 -4
- data/app/{assets/javascripts → javascript}/spotlight/admin/blocks/search_result_block.js +7 -9
- data/app/{assets/javascripts → javascript}/spotlight/admin/blocks/solr_documents_base_block.js +22 -22
- data/app/{assets/javascripts → javascript}/spotlight/admin/blocks/solr_documents_block.js +7 -7
- data/app/{assets/javascripts → javascript}/spotlight/admin/blocks/solr_documents_carousel_block.js +14 -15
- data/app/javascript/spotlight/admin/blocks/uploaded_items_block.js +147 -0
- data/app/javascript/spotlight/admin/checkbox_submit.es6 +75 -0
- data/app/javascript/spotlight/admin/copy_email_addresses.es6 +5 -0
- data/app/{assets/javascripts/spotlight/admin/crop.es6 → javascript/spotlight/admin/crop.js} +5 -4
- data/app/javascript/spotlight/admin/croppable.es6 +10 -0
- data/app/{assets/javascripts/spotlight/admin/edit_in_place.js → javascript/spotlight/admin/edit_in_place.es6} +6 -13
- data/app/javascript/spotlight/admin/exhibit_tag_autocomplete.es6 +39 -0
- data/app/javascript/spotlight/admin/exhibits.es6 +59 -0
- data/app/{assets/javascripts/spotlight/admin/form_observer.js → javascript/spotlight/admin/form_observer.es6} +23 -21
- data/app/javascript/spotlight/admin/index.js +85 -0
- data/app/javascript/spotlight/admin/locks.es6 +12 -0
- data/app/{assets/javascripts → javascript}/spotlight/admin/multi_image_selector.js +2 -1
- data/app/javascript/spotlight/admin/pages.es6 +42 -0
- data/app/{assets/javascripts/spotlight/admin/progress_monitor.js → javascript/spotlight/admin/progress_monitor.es6} +5 -9
- data/app/javascript/spotlight/admin/readonly_checkbox.es6 +8 -0
- data/app/{assets/javascripts → javascript}/spotlight/admin/search_typeahead.js +3 -46
- data/app/{assets/javascripts/spotlight/admin/select_related_input.js → javascript/spotlight/admin/select_related_input.es6} +6 -3
- data/app/{assets/javascripts → javascript}/spotlight/admin/sir-trevor/block_controls.js +6 -4
- data/app/{assets/javascripts → javascript}/spotlight/admin/sir-trevor/block_limits.js +2 -0
- data/app/{assets/javascripts → javascript}/spotlight/admin/spotlight_nestable.js +4 -8
- data/app/javascript/spotlight/admin/tabs.es6 +8 -0
- data/app/{assets/javascripts/spotlight/admin/translation_progress.js → javascript/spotlight/admin/translation_progress.es6} +6 -13
- data/app/{assets/javascripts/spotlight/admin/users.js → javascript/spotlight/admin/users.es6} +7 -17
- data/app/javascript/spotlight/admin/visibility_toggle.es6 +23 -0
- data/app/javascript/spotlight/index.js +10 -0
- data/app/javascript/spotlight/spotlight.js +32 -0
- data/app/{assets/javascripts/spotlight/user/analytics.js → javascript/spotlight/user/analytics.es6} +4 -4
- data/app/{assets/javascripts/spotlight/user/browse_group_categories.js → javascript/spotlight/user/browse_group_categories.es6} +4 -13
- data/app/javascript/spotlight/user/carousel.es6 +5 -0
- data/app/{assets/javascripts/spotlight/user/clear_form_button.js → javascript/spotlight/user/clear_form_button.es6} +5 -9
- data/app/javascript/spotlight/user/index.js +17 -0
- data/app/{assets/javascripts/spotlight/user/report_a_problem.js → javascript/spotlight/user/report_a_problem.es6} +6 -15
- data/app/javascript/spotlight/user/zpr_links.es6 +44 -0
- data/app/jobs/spotlight/add_uploads_from_csv.rb +1 -2
- data/app/models/concerns/spotlight/browse_category_search_builder.rb +1 -10
- data/app/models/concerns/spotlight/exhibit_defaults.rb +1 -1
- data/app/models/concerns/spotlight/exhibit_documents.rb +2 -2
- data/app/models/concerns/spotlight/resources/web.rb +1 -1
- data/app/models/concerns/spotlight/solr_document/atomic_updates.rb +1 -1
- data/app/models/concerns/spotlight/solr_document/finder.rb +2 -2
- data/app/models/concerns/spotlight/solr_document.rb +2 -2
- data/app/models/concerns/spotlight/translatables.rb +1 -1
- data/app/models/sir_trevor_rails/blocks/displayable.rb +2 -2
- data/app/models/sir_trevor_rails/blocks/solr_documents_block.rb +17 -6
- data/app/models/spotlight/analytics/ga.rb +5 -5
- data/app/models/spotlight/blacklight_configuration.rb +12 -12
- data/app/models/spotlight/bulk_update.rb +1 -0
- data/app/models/spotlight/contact_email.rb +1 -1
- data/app/models/spotlight/contact_form.rb +1 -1
- data/app/models/spotlight/exhibit.rb +1 -1
- data/app/models/spotlight/featured_image.rb +1 -2
- data/app/models/spotlight/lock.rb +1 -1
- data/app/models/spotlight/main_navigation.rb +1 -5
- data/app/models/spotlight/page.rb +1 -1
- data/app/models/spotlight/resources/iiif_manifest.rb +4 -4
- data/app/models/spotlight/resources/iiif_service.rb +1 -1
- data/app/models/spotlight/resources/upload.rb +3 -6
- data/app/models/spotlight/search.rb +2 -2
- data/app/models/translation.rb +2 -0
- data/app/presenters/spotlight/iiif_manifest_presenter.rb +2 -1
- data/app/services/spotlight/etl/solr_loader.rb +1 -1
- data/app/services/spotlight/iiif_resource_resolver.rb +10 -10
- data/app/uploaders/spotlight/bulk_updates_uploader.rb +1 -0
- data/app/views/layouts/spotlight/base.html.erb +1 -0
- data/app/views/shared/_exhibit_navbar.html.erb +6 -1
- data/app/views/spotlight/admin_users/index.html.erb +9 -3
- data/app/views/spotlight/browse/show.html.erb +2 -2
- data/app/views/spotlight/catalog/_admin_header.html.erb +3 -1
- data/app/views/spotlight/catalog/_document_visibility_control.html.erb +21 -2
- data/app/views/spotlight/catalog/_index_compact_default.html.erb +1 -1
- data/app/views/spotlight/exhibits/_confirmation_status.html.erb +3 -1
- data/app/views/spotlight/exhibits/_contact.html.erb +5 -1
- data/app/views/spotlight/shared/_exhibit_sidebar.html.erb +2 -0
- data/app/views/spotlight/shared/_report_a_problem.html.erb +1 -1
- data/app/views/spotlight/sir_trevor/blocks/_search_results_block.html.erb +2 -2
- data/app/views/spotlight/translations/_page.html.erb +6 -1
- data/config/locales/spotlight.en.yml +4 -9
- data/lib/generators/spotlight/install_generator.rb +15 -23
- data/lib/generators/spotlight/scaffold_resource_generator.rb +12 -12
- data/lib/generators/spotlight/templates/config/initializers/spotlight_initializer.rb +3 -0
- data/lib/generators/spotlight/templates/solr/conf/_rest_managed.json +3 -0
- data/lib/generators/spotlight/templates/solr/conf/admin-extra.html +31 -0
- data/lib/generators/spotlight/templates/solr/conf/elevate.xml +36 -0
- data/lib/generators/spotlight/templates/solr/conf/mapping-ISOLatin1Accent.txt +246 -0
- data/lib/generators/spotlight/templates/solr/conf/protwords.txt +21 -0
- data/lib/generators/spotlight/templates/solr/{config → conf}/schema.xml +17 -0
- data/lib/generators/spotlight/templates/solr/conf/scripts.conf +24 -0
- data/lib/generators/spotlight/templates/solr/{config → conf}/solrconfig.xml +55 -24
- data/lib/generators/spotlight/templates/solr/conf/spellings.txt +2 -0
- data/lib/generators/spotlight/templates/solr/conf/stopwords.txt +58 -0
- data/lib/generators/spotlight/templates/solr/conf/stopwords_en.txt +58 -0
- data/lib/generators/spotlight/templates/solr/conf/synonyms.txt +31 -0
- data/lib/generators/spotlight/templates/solr/conf/xslt/example.xsl +132 -0
- data/lib/generators/spotlight/templates/solr/conf/xslt/example_atom.xsl +67 -0
- data/lib/generators/spotlight/templates/solr/conf/xslt/example_rss.xsl +66 -0
- data/lib/generators/spotlight/templates/solr/conf/xslt/luke.xsl +337 -0
- data/lib/generators/spotlight/templates/spotlight.js +1 -1
- data/lib/migration/iiif.rb +3 -7
- data/lib/spotlight/engine.rb +18 -16
- data/lib/spotlight/riiif_service.rb +31 -0
- data/lib/spotlight/search_state.rb +19 -0
- data/lib/spotlight/upload_field_config.rb +1 -1
- data/lib/spotlight/version.rb +1 -1
- data/lib/tasks/spotlight_tasks.rake +1 -1
- data/spec/factories/searches.rb +0 -12
- data/spec/fixtures/iiif_responses.rb +64 -64
- data/vendor/assets/javascripts/nestable.js +1 -1
- data/vendor/assets/javascripts/parameterize.js +2 -2
- data/vendor/assets/javascripts/sir-trevor.js +22460 -20591
- data/vendor/assets/stylesheets/sir-trevor/_icons.scss +0 -0
- data/vendor/assets/stylesheets/sir-trevor/_variables.scss +16 -18
- data/vendor/assets/stylesheets/sir-trevor/base.scss +11 -0
- data/vendor/assets/stylesheets/sir-trevor/block-addition-top.scss +4 -1
- data/vendor/assets/stylesheets/sir-trevor/block-addition.scss +3 -2
- data/vendor/assets/stylesheets/sir-trevor/block-controls.scss +4 -0
- data/vendor/assets/stylesheets/sir-trevor/block-positioner.scss +0 -0
- data/vendor/assets/stylesheets/sir-trevor/block-replacer.scss +0 -0
- data/vendor/assets/stylesheets/sir-trevor/block-ui.scss +10 -0
- data/vendor/assets/stylesheets/sir-trevor/block.scss +19 -5
- data/vendor/assets/stylesheets/sir-trevor/errors.scss +0 -0
- data/vendor/assets/stylesheets/sir-trevor/format-bar.scss +0 -0
- data/vendor/assets/stylesheets/sir-trevor/inputs.scss +0 -0
- data/vendor/assets/stylesheets/sir-trevor/main.scss +0 -0
- data/vendor/assets/stylesheets/sir-trevor/patterns/ui-popup.scss +0 -0
- data/vendor/assets/stylesheets/sir-trevor/utils.scss +0 -0
- metadata +118 -131
- data/app/assets/javascripts/spotlight/admin/add_another.js +0 -22
- data/app/assets/javascripts/spotlight/admin/add_new_button.js +0 -81
- data/app/assets/javascripts/spotlight/admin/appearance.js +0 -24
- data/app/assets/javascripts/spotlight/admin/attachments.js +0 -2
- data/app/assets/javascripts/spotlight/admin/blacklight_configuration.js +0 -63
- data/app/assets/javascripts/spotlight/admin/block_mixins/plustextable.js +0 -57
- data/app/assets/javascripts/spotlight/admin/blocks/browse_block.js +0 -87
- data/app/assets/javascripts/spotlight/admin/blocks/browse_group_categories_block.js +0 -88
- data/app/assets/javascripts/spotlight/admin/blocks/oembed_block.js +0 -40
- data/app/assets/javascripts/spotlight/admin/blocks/uploaded_items_block.js +0 -145
- data/app/assets/javascripts/spotlight/admin/catalog_edit.js +0 -16
- data/app/assets/javascripts/spotlight/admin/copy_email_addresses.js +0 -9
- data/app/assets/javascripts/spotlight/admin/croppable.js +0 -25
- data/app/assets/javascripts/spotlight/admin/exhibit_tag_autocomplete.js +0 -37
- data/app/assets/javascripts/spotlight/admin/exhibits.js +0 -58
- data/app/assets/javascripts/spotlight/admin/index.js +0 -16
- data/app/assets/javascripts/spotlight/admin/locks.js +0 -12
- data/app/assets/javascripts/spotlight/admin/pages.js.erb +0 -40
- data/app/assets/javascripts/spotlight/admin/readonly_checkbox.js +0 -6
- data/app/assets/javascripts/spotlight/admin/tabs.js +0 -6
- data/app/assets/javascripts/spotlight/user/carousel.js +0 -3
- data/app/assets/javascripts/spotlight/user/index.js +0 -8
- data/app/assets/javascripts/spotlight/user/zpr_links.js.erb +0 -45
- data/vendor/assets/javascripts/MutationObserver.js +0 -625
- data/vendor/assets/javascripts/eventable.js +0 -205
- data/vendor/assets/javascripts/polyfill.min.js +0 -4
- /data/app/{assets/javascripts → javascript}/spotlight/admin/blocks/solr_documents_embed_block.js +0 -0
- /data/app/{assets/javascripts → javascript}/spotlight/admin/blocks/solr_documents_features_block.js +0 -0
- /data/app/{assets/javascripts → javascript}/spotlight/admin/blocks/solr_documents_grid_block.js +0 -0
- /data/app/{assets/javascripts/spotlight/admin/iiif.es6 → javascript/spotlight/admin/iiif.js} +0 -0
- /data/app/{assets/javascripts → javascript}/spotlight/admin/sir-trevor/locales.js +0 -0
@@ -7,7 +7,7 @@ module Spotlight
|
|
7
7
|
MAX_PAGES = Spotlight::Engine.config.max_pages
|
8
8
|
|
9
9
|
extend FriendlyId
|
10
|
-
#
|
10
|
+
# NOTE: This configuration also needs to be duplicated on the
|
11
11
|
# STI models ({Spotlight::AboutPage}, {Spotlight::FeaturePage}, {Spotlight::HomePage})
|
12
12
|
friendly_id :title, use: %i[slugged scoped finders history], scope: %i[exhibit locale], treat_reserved_as_conflict: true do |config|
|
13
13
|
config.reserved_words&.concat(%w[update_all contacts])
|
@@ -115,8 +115,8 @@ module Spotlight
|
|
115
115
|
end
|
116
116
|
|
117
117
|
def exhibit_custom_fields
|
118
|
-
@exhibit_custom_fields ||= exhibit.custom_fields.
|
119
|
-
|
118
|
+
@exhibit_custom_fields ||= exhibit.custom_fields.index_by do |value|
|
119
|
+
value.label
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
@@ -243,14 +243,14 @@ module Spotlight
|
|
243
243
|
# If any of the values have a language associated with them, the client must display all of the values associated with the language that best
|
244
244
|
# matches the language preference.
|
245
245
|
elsif value.any? { |v| v.is_a?(Hash) && v['@language'] == default_json_ld_language }
|
246
|
-
value.select { |v| v.is_a?(Hash) && v['@language'] == default_json_ld_language }.
|
246
|
+
value.select { |v| v.is_a?(Hash) && v['@language'] == default_json_ld_language }.pluck('@value')
|
247
247
|
# If all of the values have a language associated with them, and none match the language preference, the client must select a language
|
248
248
|
# and display all of the values associated with that language.
|
249
249
|
elsif value.all? { |v| v.is_a?(Hash) && v.key?('@language') }
|
250
250
|
selected_json_ld_language = value.find { |v| v.is_a?(Hash) && v.key?('@language') }
|
251
251
|
|
252
252
|
value.select { |v| v.is_a?(Hash) && v['@language'] == selected_json_ld_language['@language'] }
|
253
|
-
.
|
253
|
+
.pluck('@value')
|
254
254
|
# If some of the values have a language associated with them, but none match the language preference, the client must display all of the values
|
255
255
|
# that do not have a language associated with them.
|
256
256
|
else
|
@@ -43,16 +43,13 @@ module Spotlight
|
|
43
43
|
def to_solr
|
44
44
|
return {} unless upload&.file_present?
|
45
45
|
|
46
|
-
|
47
|
-
riiif = Riiif::Engine.routes.url_helpers
|
48
|
-
|
49
|
-
dimensions = Riiif::Image.new(upload_id).info
|
46
|
+
dimensions = Spotlight::Engine.config.iiif_service.info(id)
|
50
47
|
|
51
48
|
{
|
52
49
|
spotlight_full_image_width_ssm: dimensions.width,
|
53
50
|
spotlight_full_image_height_ssm: dimensions.height,
|
54
|
-
Spotlight::Engine.config.thumbnail_field =>
|
55
|
-
Spotlight::Engine.config.iiif_manifest_field =>
|
51
|
+
Spotlight::Engine.config.thumbnail_field => Spotlight::Engine.config.iiif_service.thumbnail_url(upload),
|
52
|
+
Spotlight::Engine.config.iiif_manifest_field => Spotlight::Engine.config.iiif_service.manifest_url(exhibit, upload)
|
56
53
|
}
|
57
54
|
end
|
58
55
|
|
@@ -45,14 +45,14 @@ module Spotlight
|
|
45
45
|
thumbnail.iiif_url
|
46
46
|
end
|
47
47
|
|
48
|
-
def documents
|
48
|
+
def documents(&block)
|
49
49
|
start = 0
|
50
50
|
response = repository.search(search_params.start(start))
|
51
51
|
|
52
52
|
return to_enum(:documents) { response['response']['numFound'] } unless block_given?
|
53
53
|
|
54
54
|
while response.documents.present?
|
55
|
-
response.documents.each
|
55
|
+
response.documents.each(&block)
|
56
56
|
start += response.documents.length
|
57
57
|
response = repository.search(search_params.start(start))
|
58
58
|
end
|
data/app/models/translation.rb
CHANGED
@@ -79,7 +79,8 @@ module Spotlight
|
|
79
79
|
|
80
80
|
def iiif_url
|
81
81
|
# yes this is hacky, and we are appropriately ashamed.
|
82
|
-
|
82
|
+
Spotlight::Engine.config.iiif_service.info_url(uploaded_resource.upload)
|
83
|
+
.sub(%r{/info\.json\Z}, '')
|
83
84
|
end
|
84
85
|
end
|
85
86
|
end
|
@@ -57,20 +57,20 @@ module Spotlight
|
|
57
57
|
|
58
58
|
def response
|
59
59
|
@response ||= begin
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
60
|
+
Spotlight::Resources::IiifService.http_client.get(iiif_manifest_url).body
|
61
|
+
rescue Faraday::Error => e
|
62
|
+
Rails.logger.warn("#{self.class.name} failed to fetch #{iiif_manifest_url} with: #{e}")
|
63
|
+
'{}'
|
64
|
+
end
|
65
65
|
end
|
66
66
|
|
67
67
|
def manifest
|
68
68
|
@manifest ||= begin
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
69
|
+
JSON.parse(response)
|
70
|
+
rescue JSON::ParserError => e
|
71
|
+
Rails.logger.warn("#{self.class.name} failed to parse #{iiif_manifest_url} with: #{e}")
|
72
|
+
{}
|
73
|
+
end
|
74
74
|
end
|
75
75
|
|
76
76
|
class ManifestError < RuntimeError; end
|
@@ -19,6 +19,7 @@
|
|
19
19
|
<%= description %>
|
20
20
|
<%= twitter_card %>
|
21
21
|
<%= opengraph %>
|
22
|
+
<%= javascript_tag "Spotlight.sirTrevorIcon = '#{asset_path('spotlight/blocks/sir-trevor-icons.svg')}'" %>
|
22
23
|
<%= javascript_tag '$.fx.off = true;' if Rails.env.test? %>
|
23
24
|
</head>
|
24
25
|
<body class="<%= render_body_class %>">
|
@@ -12,7 +12,12 @@
|
|
12
12
|
</ul>
|
13
13
|
<% if should_render_spotlight_search_bar? %>
|
14
14
|
<div class="navbar-right navbar-nav exhibit-search-form mt-3 mt-md-0">
|
15
|
-
<%=
|
15
|
+
<%= render Blacklight::SearchBarComponent.new(
|
16
|
+
url: search_action_url,
|
17
|
+
advanced_search_url: search_action_url(action: 'advanced_search'),
|
18
|
+
params: search_state.params_for_search.except(:qt),
|
19
|
+
autocomplete_path: suggest_index_catalog_path
|
20
|
+
) %>
|
16
21
|
</div>
|
17
22
|
<% end %>
|
18
23
|
</div>
|
@@ -16,7 +16,9 @@
|
|
16
16
|
<span class='badge badge-warning pending-label'><%= t('.pending') %></span>
|
17
17
|
</td>
|
18
18
|
<td>
|
19
|
-
<%= link_to(t('.destroy'), admin_user_path(user),
|
19
|
+
<%= link_to(t('.destroy'), admin_user_path(user),
|
20
|
+
data: { method: :delete, turbo_method: :delete },
|
21
|
+
class: 'btn btn-sm btn-danger float-right') unless user == current_user %>
|
20
22
|
</td>
|
21
23
|
</tr>
|
22
24
|
<% end %>
|
@@ -81,9 +83,13 @@
|
|
81
83
|
</td>
|
82
84
|
<td class="text-right">
|
83
85
|
<% if user.superadmin? %>
|
84
|
-
<%= link_to(t('.destroy'), admin_user_path(user),
|
86
|
+
<%= link_to(t('.destroy'), admin_user_path(user),
|
87
|
+
data: { method: :delete, turbo_method: :delete },
|
88
|
+
class: 'btn btn-sm btn-danger') unless user == current_user %>
|
85
89
|
<% else %>
|
86
|
-
<%= link_to(t('.update'), admin_user_path(user),
|
90
|
+
<%= link_to(t('.update'), admin_user_path(user),
|
91
|
+
data: { method: :patch, turbo_method: :patch },
|
92
|
+
class: 'btn btn-sm btn-secondary') %>
|
87
93
|
<% end %>
|
88
94
|
</td>
|
89
95
|
</tr>
|
@@ -20,8 +20,8 @@
|
|
20
20
|
<%= render partial: 'search_box', locals: {search: @search} %>
|
21
21
|
<% end %>
|
22
22
|
<% if @search.default_index_view_type && params[:view].blank? %>
|
23
|
-
<%= render_document_index_with_view(@search.default_index_view_type, @
|
23
|
+
<%= render_document_index_with_view(@search.default_index_view_type, @response.documents) %>
|
24
24
|
<% else %>
|
25
|
-
<%= render_document_index(@
|
25
|
+
<%= render_document_index(@response.documents) %>
|
26
26
|
<% end %>
|
27
27
|
<%= render 'results_pagination' %>
|
@@ -4,7 +4,9 @@
|
|
4
4
|
</div>
|
5
5
|
<div class="add-items-nav clearfix">
|
6
6
|
<div class="float-right">
|
7
|
-
<%= link_to t('.reindex'), reindex_all_exhibit_resources_path(current_exhibit),
|
7
|
+
<%= link_to t('.reindex'), reindex_all_exhibit_resources_path(current_exhibit),
|
8
|
+
data: { method: :post, turbo_method: :post },
|
9
|
+
class: 'btn btn-secondary' %>
|
8
10
|
<% if Spotlight::Engine.config.resource_partials.any? %>
|
9
11
|
<%= link_to t('.new_resource'), new_exhibit_resource_path(current_exhibit), class: 'btn btn-primary' %>
|
10
12
|
<% end %>
|
@@ -1,5 +1,24 @@
|
|
1
1
|
<% action = document.private?(current_exhibit) ? :make_public : :make_private %>
|
2
2
|
|
3
|
-
<%= form_tag(
|
4
|
-
|
3
|
+
<%= form_tag([:visibility, current_exhibit, document],
|
4
|
+
method: document.private?(current_exhibit) ? :put : :delete,
|
5
|
+
class: 'visibility-toggle',
|
6
|
+
data: {
|
7
|
+
'doc-id': document.id,
|
8
|
+
present: t('.make_private'),
|
9
|
+
absent: t('.make_public'),
|
10
|
+
inprogress: t('.inprogress'),
|
11
|
+
}) do %>
|
12
|
+
|
13
|
+
<div class="checkbox toggle-visibility">
|
14
|
+
<label class="toggle-visibility" data-checkboxsubmit-target="label">
|
15
|
+
<input type="checkbox" class="toggle-visibility" data-checkboxsubmit-target="checkbox" <%= 'checked="checked"' if document.public?(current_exhibit) %>>
|
16
|
+
<span data-checkboxsubmit-target="span" class="sr-only">
|
17
|
+
<%= document.private?(current_exhibit) ? t('.make_public') : t('.make_private') %>
|
18
|
+
</span>
|
19
|
+
</label>
|
20
|
+
</div>
|
21
|
+
|
22
|
+
<%= submit_tag(t(".#{action}"), id: "visibility_toggle_#{document.id.to_s.parameterize}", class: "visibility-#{action}") %>
|
23
|
+
|
5
24
|
<% end %>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<%= render_document_partial document, 'admin_index_header', document_counter: document_counter %>
|
7
7
|
|
8
8
|
<div class="page-links">
|
9
|
-
<%= view_link document, url_for_document(document) %> ·
|
9
|
+
<%= view_link document, search_state.url_for_document(document) %> ·
|
10
10
|
<%= exhibit_edit_link document, [:edit, current_exhibit, document] %>
|
11
11
|
</div>
|
12
12
|
</td>
|
@@ -4,6 +4,8 @@
|
|
4
4
|
<% elsif contact_email.recently_sent? %>
|
5
5
|
<span class="confirmed"><%= blacklight_icon('check_circle') %> <%= t('.confirmation_sent') %></span>
|
6
6
|
<% else %>
|
7
|
-
<span class="unconfirmed"><%= blacklight_icon('error') %> <%= t('.not_validated') %></span>
|
7
|
+
<span class="unconfirmed"><%= blacklight_icon('error') %> <%= t('.not_validated') %></span>
|
8
|
+
<%= link_to t('.resend'), contact_email_confirmation_path(contact_email: {email: contact_email.email}),
|
9
|
+
data: { method: :post, turbo_method: :post } %>
|
8
10
|
<% end %>
|
9
11
|
</div>
|
@@ -12,7 +12,11 @@
|
|
12
12
|
<div class="col-md-4">
|
13
13
|
<% if contact.object.id %>
|
14
14
|
<span class="contact-email-delete-wrapper">
|
15
|
-
<%= link_to exhibit_contact_email_path(exhibit_id: exhibit.id, id: contact.object.id), class: 'contact-email-delete btn btn-sm btn-danger',
|
15
|
+
<%= link_to exhibit_contact_email_path(exhibit_id: exhibit.id, id: contact.object.id), class: 'contact-email-delete btn btn-sm btn-danger',
|
16
|
+
data: { method: :delete, turbo_method: :delete,
|
17
|
+
confirm: t('.email_delete_confirmation'),
|
18
|
+
turbo_confirm: t('.email_delete_confirmation'),
|
19
|
+
remote: true } do %>
|
16
20
|
<%= t('.email_delete_button') %>
|
17
21
|
<% end %>
|
18
22
|
</span>
|
@@ -1,7 +1,9 @@
|
|
1
1
|
<h2 class="sr-only"><%= t(:'.header') %></h2>
|
2
2
|
<ul class="nav sidenav top-level flex-column">
|
3
3
|
<%= nav_link t(:'spotlight.curation.sidebar.dashboard'), spotlight.exhibit_dashboard_path(current_exhibit) %>
|
4
|
+
<% if current_exhibit.analytics_provider&.enabled? %>
|
4
5
|
<%= nav_link t(:'spotlight.curation.sidebar.analytics'), spotlight.analytics_exhibit_dashboard_path(current_exhibit) %>
|
6
|
+
<% end %>
|
5
7
|
</ul>
|
6
8
|
<%= render 'spotlight/shared/configuration_sidebar' if can? :update, current_exhibit %>
|
7
9
|
<%= render 'spotlight/shared/curation_sidebar' %>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<% contact_form ||= Spotlight::ContactForm.new current_url: request.original_url %>
|
4
4
|
<%= bootstrap_form_for contact_form, url: spotlight.exhibit_contact_form_path(current_exhibit, contact_form), layout: :horizontal, label_col: 'col-sm-3', control_col: 'col-sm-9', html: { class: 'col-md-offset-2 col-md-8 my-3 '} do |f| %>
|
5
5
|
<h2><%= t(:'.title') %></h2>
|
6
|
-
<div class="alert alert-
|
6
|
+
<div class="alert alert-info"><%= t('.reporting_from', url: contact_form.current_url) %></div>
|
7
7
|
<%= f.text_area :message, rows: 4 %>
|
8
8
|
<%= f.text_field :name %>
|
9
9
|
<%= render '/spotlight/shared/honeypot_field', f: f %>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<% if search_results_block.searches? %>
|
2
2
|
<div class="content-block documents">
|
3
3
|
<% response, document_list = get_search_widget_search_results(search_results_block) %>
|
4
|
-
<%- unless
|
4
|
+
<%- unless response.documents.present? %>
|
5
5
|
<div class="alert alert-warning">
|
6
6
|
<strong>No items to display.</strong> There are currently no items in this exhibit that match the curator's search criteria.
|
7
7
|
</div>
|
@@ -18,7 +18,7 @@
|
|
18
18
|
<% end %>
|
19
19
|
|
20
20
|
<h2 class="sr-only visually-hidden"><%= t('blacklight.search.search_results') %></h2>
|
21
|
-
<%= render_document_index_with_view(block_document_index_view_type(search_results_block),
|
21
|
+
<%= render_document_index_with_view(block_document_index_view_type(search_results_block), response.documents) %>
|
22
22
|
<%= render 'results_pagination' %>
|
23
23
|
<%- end %>
|
24
24
|
</div>
|
@@ -40,7 +40,12 @@
|
|
40
40
|
<%= link_to(t('.recreate'), polymorphic_path([:clone, current_exhibit, page], language: @language), data: { confirm: t('.recreate_are_you_sure') }) %>
|
41
41
|
<% if page.feature_page? || page.about_page? %>
|
42
42
|
·
|
43
|
-
<%= link_to(t('.destroy'), polymorphic_path([current_exhibit, translated_page], locale: @language),
|
43
|
+
<%= link_to(t('.destroy'), polymorphic_path([current_exhibit, translated_page], locale: @language),
|
44
|
+
data: {
|
45
|
+
method: :delete,
|
46
|
+
turbo_method: :delete,
|
47
|
+
confirm: t('.destroy_are_you_sure'),
|
48
|
+
turbo_confirm: t('.destroy_are_you_sure') }) %>
|
44
49
|
<% end %>
|
45
50
|
<% end %>
|
46
51
|
</td>
|
@@ -373,14 +373,9 @@ en:
|
|
373
373
|
breadcrumb:
|
374
374
|
index: Search results
|
375
375
|
document_visibility_control:
|
376
|
-
inprogress:
|
377
|
-
|
378
|
-
|
379
|
-
button: Make private
|
380
|
-
label: ''
|
381
|
-
make_public:
|
382
|
-
button: Make public
|
383
|
-
label: ''
|
376
|
+
inprogress: In progress
|
377
|
+
make_private: Make private
|
378
|
+
make_public: Make public
|
384
379
|
edit_default:
|
385
380
|
url-field:
|
386
381
|
help: 'Valid file types: %{extensions}'
|
@@ -801,7 +796,7 @@ en:
|
|
801
796
|
note_provenance_tesim: Provenance
|
802
797
|
note_references_tesim: References
|
803
798
|
note_source_tesim: Source
|
804
|
-
|
799
|
+
personal_name_ssm: Personal names
|
805
800
|
search:
|
806
801
|
all_fields: Everything
|
807
802
|
author: Author
|
@@ -10,29 +10,17 @@ module Spotlight
|
|
10
10
|
class_option :solr_update_class, type: :string, default: 'Spotlight::SolrDocument::AtomicUpdates'
|
11
11
|
class_option :mailer_default_url_host, type: :string, default: '' # e.g. localhost:3000
|
12
12
|
|
13
|
-
# we're not
|
13
|
+
# we're not using webpacker, so we need to re-add sprockets functionality
|
14
14
|
def add_js_rails6
|
15
15
|
return unless Rails.version.to_i == 6
|
16
16
|
|
17
|
-
|
18
|
-
gem 'uglifier', '>= 1.3.0'
|
19
|
-
|
20
|
-
append_to_file 'app/assets/config/manifest.js', "\n//= link_directory ../javascripts .js\n"
|
21
|
-
append_to_file 'app/assets/javascripts/application.js', "\n//= require_tree .\n"
|
17
|
+
# By default rails generates javascript_pack_tag, we'll change this to javascript_include_tag
|
22
18
|
gsub_file 'app/views/layouts/application.html.erb', /pack/, 'include'
|
23
|
-
inject_into_file 'config/environments/production.rb', after: ' # config.assets.css_compressor = :sass' do
|
24
|
-
"\n config.assets.js_compressor = :uglifier"
|
25
|
-
end
|
26
|
-
|
27
|
-
# but since webpacker exists in the gemfile, we still need to run the
|
28
|
-
# install before rails will start
|
29
|
-
run 'bundle exec rails webpacker:install'
|
30
19
|
end
|
31
20
|
|
32
|
-
def
|
33
|
-
return unless Rails.version.to_i == 7
|
34
|
-
|
21
|
+
def add_manifest
|
35
22
|
append_to_file 'app/assets/javascripts/application.js', "\n//= require_tree .\n"
|
23
|
+
append_to_file 'app/assets/config/manifest.js', "\n//= link spotlight/manifest.js"
|
36
24
|
end
|
37
25
|
|
38
26
|
def inject_spotlight_routes
|
@@ -67,9 +55,9 @@ module Spotlight
|
|
67
55
|
|
68
56
|
copy_file 'config/sitemap.rb', 'config/sitemap.rb'
|
69
57
|
|
70
|
-
say
|
71
|
-
|
72
|
-
|
58
|
+
say <<~EOS, :red
|
59
|
+
Added a default sitemap_generator configuration in config/sitemap.rb; please
|
60
|
+
update the default host to match your environment
|
73
61
|
EOS
|
74
62
|
end
|
75
63
|
|
@@ -132,14 +120,18 @@ module Spotlight
|
|
132
120
|
end
|
133
121
|
|
134
122
|
def add_osd_viewer
|
135
|
-
|
136
|
-
|
123
|
+
unless Bundler.locked_gems.dependencies.key? 'blacklight-gallery'
|
124
|
+
gem 'blacklight-gallery', '~> 4.0'
|
125
|
+
bundle_install
|
126
|
+
end
|
137
127
|
generate 'blacklight_gallery:install'
|
138
128
|
end
|
139
129
|
|
140
130
|
def add_oembed
|
141
|
-
|
142
|
-
|
131
|
+
unless Bundler.locked_gems.dependencies.key? 'blacklight-oembed'
|
132
|
+
gem 'blacklight-oembed', '~> 1.0'
|
133
|
+
bundle_install
|
134
|
+
end
|
143
135
|
generate 'blacklight_oembed:install'
|
144
136
|
copy_file 'config/initializers/oembed.rb'
|
145
137
|
end
|
@@ -9,7 +9,7 @@ module Spotlight
|
|
9
9
|
source_root File.expand_path('templates', __dir__)
|
10
10
|
|
11
11
|
def create_model
|
12
|
-
create_file "app/models/#{file_name}_resource.rb",
|
12
|
+
create_file "app/models/#{file_name}_resource.rb", <<~FILE
|
13
13
|
class #{class_name}Resource < Spotlight::Resource
|
14
14
|
def self.indexing_pipeline
|
15
15
|
@indexing_pipeline ||= super.dup.tap do |pipeline|
|
@@ -21,7 +21,7 @@ module Spotlight
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def create_controller
|
24
|
-
create_file "app/controllers/#{file_name}_resources_controller.rb",
|
24
|
+
create_file "app/controllers/#{file_name}_resources_controller.rb", <<~FILE
|
25
25
|
class #{class_name}ResourcesController < Spotlight::ResourcesController
|
26
26
|
private
|
27
27
|
|
@@ -33,16 +33,16 @@ module Spotlight
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def create_form
|
36
|
-
create_file "app/views/#{file_name}_resources/_form.html.erb",
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
36
|
+
create_file "app/views/#{file_name}_resources/_form.html.erb", <<~FILE
|
37
|
+
<%= bootstrap_form_for([current_exhibit, @resource.becomes(#{class_name}Resource)], as: :resource) do |f| %>
|
38
|
+
<%= f.text_field :url %>
|
39
|
+
<div class="form-actions">
|
40
|
+
<div class="primary-actions">
|
41
|
+
<%= cancel_link @resource, :back, class: 'btn btn-secondary' %>
|
42
|
+
<%= f.submit t('.add_item'), class: 'btn btn-primary' %>
|
43
|
+
</div>
|
43
44
|
</div>
|
44
|
-
|
45
|
-
<% end if can? :manage, @resource %>
|
45
|
+
<% end if can? :manage, @resource %>
|
46
46
|
FILE
|
47
47
|
end
|
48
48
|
end
|
@@ -54,7 +54,7 @@ module Spotlight
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def create_routes
|
57
|
-
route
|
57
|
+
route <<~FILE
|
58
58
|
resources :exhibits, only: [] do
|
59
59
|
resources :#{file_name}_resources, only: [:create, :update] do
|
60
60
|
end
|
@@ -21,6 +21,9 @@
|
|
21
21
|
# Spotlight::Engine.config.default_browse_index_view_type = :gallery
|
22
22
|
# Spotlight::Engine.config.default_contact_email = nil
|
23
23
|
|
24
|
+
# ==> IIIF configuration
|
25
|
+
# Spotlight::Engine.config.iiif_service = Spotlight::RIIIFService
|
26
|
+
|
24
27
|
# ==> Solr configuration
|
25
28
|
# Spotlight::Engine.config.writable_index = true
|
26
29
|
# Spotlight::Engine.config.solr_batch_size = 20
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<!--
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one or more
|
3
|
+
contributor license agreements. See the NOTICE file distributed with
|
4
|
+
this work for additional information regarding copyright ownership.
|
5
|
+
The ASF licenses this file to You under the Apache License, Version 2.0
|
6
|
+
(the "License"); you may not use this file except in compliance with
|
7
|
+
the License. You may obtain a copy of the License at
|
8
|
+
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
See the License for the specific language governing permissions and
|
15
|
+
limitations under the License.
|
16
|
+
-->
|
17
|
+
|
18
|
+
<!-- The content of this page will be statically included into the top
|
19
|
+
of the admin page. Uncomment this as an example to see there the content
|
20
|
+
will show up.
|
21
|
+
|
22
|
+
<hr>
|
23
|
+
<i>This line will appear before the first table</i>
|
24
|
+
<tr>
|
25
|
+
<td colspan="2">
|
26
|
+
This row will be appended to the end of the first table
|
27
|
+
</td>
|
28
|
+
</tr>
|
29
|
+
<hr>
|
30
|
+
|
31
|
+
-->
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
2
|
+
<!--
|
3
|
+
Licensed to the Apache Software Foundation (ASF) under one or more
|
4
|
+
contributor license agreements. See the NOTICE file distributed with
|
5
|
+
this work for additional information regarding copyright ownership.
|
6
|
+
The ASF licenses this file to You under the Apache License, Version 2.0
|
7
|
+
(the "License"); you may not use this file except in compliance with
|
8
|
+
the License. You may obtain a copy of the License at
|
9
|
+
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
|
12
|
+
Unless required by applicable law or agreed to in writing, software
|
13
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
See the License for the specific language governing permissions and
|
16
|
+
limitations under the License.
|
17
|
+
-->
|
18
|
+
|
19
|
+
<!-- If this file is found in the config directory, it will only be
|
20
|
+
loaded once at startup. If it is found in Solr's data
|
21
|
+
directory, it will be re-loaded every commit.
|
22
|
+
-->
|
23
|
+
|
24
|
+
<elevate>
|
25
|
+
<query text="foo bar">
|
26
|
+
<doc id="1" />
|
27
|
+
<doc id="2" />
|
28
|
+
<doc id="3" />
|
29
|
+
</query>
|
30
|
+
|
31
|
+
<query text="ipod">
|
32
|
+
<doc id="MA147LL/A" /> <!-- put the actual ipod at the top -->
|
33
|
+
<doc id="IW-02" exclude="true" /> <!-- exclude this cable -->
|
34
|
+
</query>
|
35
|
+
|
36
|
+
</elevate>
|