blacklight-spotlight 3.6.0.beta1 → 3.6.0.beta3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/spotlight/application.js +0 -5
- data/app/assets/javascripts/spotlight/spotlight.esm.js +0 -11
- data/app/assets/javascripts/spotlight/spotlight.esm.js.map +1 -1
- data/app/assets/javascripts/spotlight/spotlight.js +0 -11
- data/app/assets/javascripts/spotlight/spotlight.js.map +1 -1
- data/app/assets/stylesheets/spotlight/_browse.scss +1 -1
- data/app/assets/stylesheets/spotlight/_spotlight.scss +36 -38
- data/app/assets/stylesheets/spotlight/_variables.scss +0 -21
- data/app/assets/stylesheets/spotlight/browse_group_categories_block.scss +1 -1
- data/app/controllers/spotlight/browse_controller.rb +5 -1
- data/app/controllers/spotlight/catalog_controller.rb +5 -1
- data/app/controllers/spotlight/dashboards_controller.rb +5 -1
- data/app/javascript/spotlight/user/index.js +1 -3
- data/app/models/spotlight/blacklight_configuration.rb +2 -2
- data/app/views/shared/_analytics.html.erb +10 -9
- data/lib/generators/spotlight/templates/config/initializers/spotlight_initializer.rb +14 -7
- data/lib/spotlight/engine.rb +25 -15
- data/lib/spotlight/version.rb +1 -1
- metadata +2 -17
- data/app/javascript/spotlight/user/analytics.es6 +0 -9
@@ -1,41 +1,39 @@
|
|
1
|
-
@import "
|
2
|
-
@import "
|
3
|
-
@import "
|
4
|
-
|
5
|
-
@import "
|
6
|
-
@import "
|
7
|
-
@import "
|
8
|
-
@import "
|
9
|
-
@import "
|
10
|
-
@import "
|
11
|
-
@import "
|
12
|
-
@import "
|
13
|
-
@import "
|
14
|
-
@import "
|
15
|
-
@import "
|
16
|
-
@import "
|
17
|
-
@import "
|
18
|
-
@import "
|
19
|
-
@import "
|
20
|
-
@import "
|
21
|
-
@import "
|
22
|
-
@import "
|
23
|
-
@import "
|
24
|
-
@import "
|
25
|
-
@import "
|
26
|
-
@import "
|
27
|
-
@import "
|
28
|
-
@import "
|
29
|
-
@import "
|
30
|
-
@import "
|
31
|
-
@import "
|
32
|
-
@import "
|
33
|
-
@import "
|
34
|
-
@import "
|
35
|
-
@import "
|
36
|
-
@import "
|
37
|
-
@import "spotlight/view_larger";
|
38
|
-
@import "spotlight/accessibility";
|
1
|
+
@import "variables";
|
2
|
+
@import "mixins";
|
3
|
+
@import "sir-trevor_overrides";
|
4
|
+
@import "attachments";
|
5
|
+
@import "pages";
|
6
|
+
@import "breadcrumbs";
|
7
|
+
@import "browse";
|
8
|
+
@import "browse_group_categories_block";
|
9
|
+
@import "header";
|
10
|
+
@import "footer";
|
11
|
+
@import "catalog";
|
12
|
+
@import "croppable";
|
13
|
+
@import "curation";
|
14
|
+
@import "exhibit_admin";
|
15
|
+
@import "exhibit_navbar";
|
16
|
+
@import "edit_in_place";
|
17
|
+
@import "featured_browse_categories_block";
|
18
|
+
@import "item_text_block";
|
19
|
+
@import "uploaded_items_block";
|
20
|
+
@import "modals";
|
21
|
+
@import "multi_image_selector";
|
22
|
+
@import "multi_up_item_grid";
|
23
|
+
@import "slideshow_block";
|
24
|
+
@import "upload";
|
25
|
+
@import "nestable";
|
26
|
+
@import "blacklight_configuration";
|
27
|
+
@import "typeahead";
|
28
|
+
@import "bootstrap_overrides";
|
29
|
+
@import "blacklight_overrides";
|
30
|
+
@import "report_a_problem";
|
31
|
+
@import "exhibits_index";
|
32
|
+
@import "collapse_toggle";
|
33
|
+
@import "translations";
|
34
|
+
@import "utilities";
|
35
|
+
@import "view_larger";
|
36
|
+
@import "accessibility";
|
39
37
|
|
40
38
|
|
41
39
|
|
@@ -1,7 +1,5 @@
|
|
1
1
|
$footer-top-margin: 3rem !default;
|
2
2
|
$footer-height: 7.5rem !default;
|
3
|
-
$white: #ffffff !default;
|
4
|
-
$black: #000000 !default;
|
5
3
|
|
6
4
|
$masthead-bg: $card-bg !default;
|
7
5
|
$masthead-height: 11.25rem !default;
|
@@ -14,28 +12,9 @@ $exhibit-card-gutter: 30px !default;
|
|
14
12
|
$exhibit-card-image-size: 269px !default;
|
15
13
|
$exhibit-card-shadow: inset 2px 2px 5px -2px $exhibit-card-border !default;
|
16
14
|
|
17
|
-
$navbar-transparent-color: $gray-400 !default;
|
18
|
-
$navbar-transparent-bg: rgba(0, 0, 0, 0.2) !default;
|
19
15
|
$navbar-transparent-border: $gray-500 !default;
|
20
|
-
$navbar-transparent-link-color: $gray-600 !default;
|
21
|
-
$navbar-transparent-link-hover-color: $gray-600 !default;
|
22
|
-
$navbar-transparent-link-hover-bg: rgba(255, 255, 255, 0.15) !default;
|
23
|
-
$navbar-transparent-link-active-color: $gray-600 !default;
|
24
|
-
$navbar-transparent-link-active-bg: rgba(255, 255, 255, 0.3) !default;
|
25
|
-
$navbar-transparent-link-disabled-color: #ccc !default;
|
26
|
-
$navbar-transparent-link-disabled-bg: transparent !default;
|
27
|
-
|
28
16
|
$navbar-transparent-page-bg: rgba(0, 0, 0, 0.5) !default;
|
29
17
|
|
30
|
-
// Navbar brand label
|
31
|
-
$navbar-transparent-brand-color: $navbar-transparent-link-color !default;
|
32
|
-
$navbar-transparent-brand-hover-color: darken($navbar-transparent-brand-color, 10%) !default;
|
33
|
-
$navbar-transparent-brand-hover-bg: transparent !default;
|
34
|
-
|
35
|
-
// Navbar toggle
|
36
|
-
$navbar-transparent-toggle-icon-bar-bg: $navbar-light-toggler-icon-bg !default;
|
37
|
-
$navbar-transparent-toggle-border-color: $navbar-light-toggler-border-color !default;
|
38
|
-
|
39
18
|
// Translations
|
40
19
|
$translation-available-color: #80bf77;
|
41
20
|
$translation-panel-bg: #f5f5f5;
|
@@ -20,7 +20,11 @@ module Spotlight
|
|
20
20
|
before_action :swap_actions_configuration, only: :show
|
21
21
|
|
22
22
|
before_action do
|
23
|
-
|
23
|
+
if Blacklight::VERSION > '8'
|
24
|
+
blacklight_config.track_search_session.storage = false
|
25
|
+
else
|
26
|
+
blacklight_config.track_search_session = false
|
27
|
+
end
|
24
28
|
blacklight_config.view.gallery.classes = 'row-cols-2 row-cols-md-4' if blacklight_config.view.key? :gallery
|
25
29
|
blacklight_config.action_mapping.default = blacklight_config.index
|
26
30
|
blacklight_config.action_mapping.show = blacklight_config.index
|
@@ -30,7 +30,11 @@ module Spotlight
|
|
30
30
|
before_action only: :admin do
|
31
31
|
blacklight_config.view.select! { |k, _v| k == :admin_table }
|
32
32
|
blacklight_config.view.admin_table(partials: [:index_compact], document_actions: []) unless blacklight_config.view.key? :admin_table
|
33
|
-
|
33
|
+
if Blacklight::VERSION > '8'
|
34
|
+
blacklight_config.track_search_session.storage = false
|
35
|
+
else
|
36
|
+
blacklight_config.track_search_session = false
|
37
|
+
end
|
34
38
|
|
35
39
|
unless blacklight_config.sort_fields.key? :timestamp
|
36
40
|
blacklight_config.add_sort_field :timestamp, default: true,
|
@@ -14,7 +14,11 @@ module Spotlight
|
|
14
14
|
blacklight_config.action_mapping&.delete(:show)
|
15
15
|
blacklight_config.view.clear
|
16
16
|
blacklight_config.view.admin_table(partials: ['index_compact'], document_actions: [])
|
17
|
-
|
17
|
+
if Blacklight::VERSION > '8'
|
18
|
+
blacklight_config.track_search_session.storage = false
|
19
|
+
else
|
20
|
+
blacklight_config.track_search_session = false
|
21
|
+
end
|
18
22
|
blacklight_config.action_mapping.show.top_level_config = :index if blacklight_config.key?(:action_mapping)
|
19
23
|
end
|
20
24
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import Analytics from 'analytics'
|
2
1
|
import BrowseGroupCateogries from 'browse_group_categories'
|
3
2
|
import Carousel from 'carousel'
|
4
3
|
import ClearFormButton from 'clear_form_button'
|
@@ -7,11 +6,10 @@ import ZprLinks from 'zpr_links'
|
|
7
6
|
|
8
7
|
export default class {
|
9
8
|
connect() {
|
10
|
-
new Analytics().connect()
|
11
9
|
new BrowseGroupCateogries().connect()
|
12
10
|
new Carousel().connect()
|
13
11
|
new ClearFormButton().connect()
|
14
12
|
new ReportProblem().connect()
|
15
13
|
new ZprLinks().connect()
|
16
14
|
}
|
17
|
-
}
|
15
|
+
}
|
@@ -46,14 +46,14 @@ module Spotlight
|
|
46
46
|
model.search_fields&.each do |k, v|
|
47
47
|
v[:enabled] &&= value_to_boolean(v[:enabled])
|
48
48
|
v[:enabled] ||= true if v[:enabled].nil?
|
49
|
-
v[:label] = default_blacklight_config.search_fields[k][:label] if default_blacklight_config.search_fields[k] &&
|
49
|
+
v[:label] = default_blacklight_config.search_fields[k][:label] if default_blacklight_config.search_fields[k] && v[:label].blank?
|
50
50
|
v.reject! { |_k, v1| v1.blank? && v1 != false }
|
51
51
|
end
|
52
52
|
|
53
53
|
model.sort_fields&.each do |k, v|
|
54
54
|
v[:enabled] &&= value_to_boolean(v[:enabled])
|
55
55
|
v[:enabled] ||= true if v[:enabled].nil?
|
56
|
-
v[:label] = default_blacklight_config.sort_fields[k][:label] if default_blacklight_config.sort_fields[k] &&
|
56
|
+
v[:label] = default_blacklight_config.sort_fields[k][:label] if default_blacklight_config.sort_fields[k] && v[:label].blank?
|
57
57
|
v.reject! { |_k, v1| v1.blank? && v1 != false }
|
58
58
|
end
|
59
59
|
|
@@ -1,13 +1,14 @@
|
|
1
1
|
<% if Spotlight::Engine.config.ga_web_property_id %>
|
2
|
+
<!-- Google tag (gtag.js) -->
|
3
|
+
<% if Spotlight::Engine.config.ga_debug_mode %>
|
4
|
+
<script>window.analyticsDebug = true;</script>
|
5
|
+
<% end %>
|
6
|
+
<script async src="https://www.googletagmanager.com/gtag/js?id=<%= Spotlight::Engine.config.ga_web_property_id %>"></script>
|
2
7
|
<script>
|
3
|
-
|
4
|
-
(
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
ga('create', '<%= j(Spotlight::Engine.config.ga_web_property_id) %>', 'auto');
|
9
|
-
ga('set', 'anonymizeIp', <%= Spotlight::Engine.config.ga_anonymize_ip %>)
|
10
|
-
ga('send', 'pageview');
|
11
|
-
|
8
|
+
window.dataLayer = window.dataLayer || [];
|
9
|
+
function gtag() { dataLayer.push(arguments); }
|
10
|
+
var opts = window.analyticsDebug ? {'debug_mode': true} : {};
|
11
|
+
gtag("js", new Date());
|
12
|
+
gtag("config", "<%= Spotlight::Engine.config.ga_web_property_id %>", opts);
|
12
13
|
</script>
|
13
14
|
<% end %>
|
@@ -64,13 +64,20 @@
|
|
64
64
|
# Spotlight::Engine.config.featured_image_square_size = [400, 400]
|
65
65
|
|
66
66
|
# ==> Google Analytics integration
|
67
|
-
#
|
68
|
-
#
|
69
|
-
#
|
70
|
-
#
|
71
|
-
#
|
72
|
-
#
|
73
|
-
#
|
67
|
+
# After creating a property for your site on Google Analytics, you need to:
|
68
|
+
# a) register an OAuth service account with access to your analytics property:
|
69
|
+
# (https://github.com/tpitale/legato/wiki/OAuth2-and-Google#registering-for-api-access)
|
70
|
+
# b) download the pkcs12 key and make it accessible to your application
|
71
|
+
# c) set ga_web_property_id below to your site's property id
|
72
|
+
# Rails.application.config.to_prepare do
|
73
|
+
# Spotlight::Engine.config.analytics_provider = Spotlight::Analytics::Ga
|
74
|
+
# Spotlight::Engine.config.ga_pkcs12_key_path = nil
|
75
|
+
# Spotlight::Engine.config.ga_web_property_id = 'G-XXXXXXXXXX'
|
76
|
+
# Spotlight::Engine.config.ga_email = 'test@example.com'
|
77
|
+
# Spotlight::Engine.config.ga_analytics_options = {}
|
78
|
+
# Spotlight::Engine.config.ga_page_analytics_options = Spotlight::Engine.config.ga_analytics_options.merge(limit: 5)
|
79
|
+
# Spotlight::Engine.config.ga_debug_mode = false
|
80
|
+
# end
|
74
81
|
|
75
82
|
# ==> Sir Trevor Widget Configuration
|
76
83
|
# These are set by default by Spotlight's configuration,
|
data/lib/spotlight/engine.rb
CHANGED
@@ -38,7 +38,7 @@ module Spotlight
|
|
38
38
|
end
|
39
39
|
|
40
40
|
require 'carrierwave'
|
41
|
-
require 'redcarpet'
|
41
|
+
require 'redcarpet' # required for markdown support in github/markup https://github.com/github/markup#markups
|
42
42
|
require 'github/markup'
|
43
43
|
require 'openseadragon'
|
44
44
|
require 'handlebars_assets'
|
@@ -181,11 +181,7 @@ module Spotlight
|
|
181
181
|
end
|
182
182
|
end
|
183
183
|
|
184
|
-
#
|
185
|
-
# Adding Google Analytics to your site is left as an excersize for the implementor (you could
|
186
|
-
# consider overriding the layout to inject GA code..)
|
187
|
-
#
|
188
|
-
# After getting your site to report to Google Analytics, you need to:
|
184
|
+
# After creating a property for your site on Google Analytics, you need to:
|
189
185
|
# a) register an OAuth service account with access to your analytics property:
|
190
186
|
# (https://github.com/tpitale/legato/wiki/OAuth2-and-Google#registering-for-api-access)
|
191
187
|
# b) download the pkcs12 key and make it accessible to your application
|
@@ -196,7 +192,8 @@ module Spotlight
|
|
196
192
|
config.ga_email = nil
|
197
193
|
config.ga_analytics_options = {}
|
198
194
|
config.ga_page_analytics_options = config.ga_analytics_options.merge(limit: 5)
|
199
|
-
config.
|
195
|
+
config.ga_debug_mode = false
|
196
|
+
|
200
197
|
config.max_pages = 1000
|
201
198
|
|
202
199
|
Blacklight::Engine.config.inject_blacklight_helpers = false
|
@@ -251,17 +248,30 @@ module Spotlight
|
|
251
248
|
|
252
249
|
config.spambot_honeypot_email_field = :email_address
|
253
250
|
|
254
|
-
|
255
|
-
Blacklight::Configuration.
|
251
|
+
if Blacklight::VERSION > '8'
|
252
|
+
Blacklight::Configuration.default_configuration do
|
253
|
+
# Field containing the last modified date for a Solr document
|
254
|
+
Blacklight::Configuration.default_values[:index].timestamp_field ||= 'timestamp'
|
255
|
+
|
256
|
+
# Default configuration for the browse view
|
257
|
+
Blacklight::Configuration.property :browse, default: Blacklight::OpenStructWithHashAccess.new(document_actions: [])
|
256
258
|
|
257
|
-
|
258
|
-
|
259
|
+
Blacklight::Configuration.default_values[:search_state_fields] ||= []
|
260
|
+
Blacklight::Configuration.default_values[:search_state_fields] += %i[id exhibit_id]
|
261
|
+
end
|
262
|
+
else
|
263
|
+
config.to_prepare do
|
264
|
+
Blacklight::Configuration.try(:initialize_default_configuration) unless Blacklight::Configuration.try(:initialized_default_configuration?)
|
259
265
|
|
260
|
-
|
261
|
-
|
266
|
+
# Field containing the last modified date for a Solr document
|
267
|
+
Blacklight::Configuration.default_values[:index].timestamp_field ||= 'timestamp'
|
262
268
|
|
263
|
-
|
264
|
-
|
269
|
+
# Default configuration for the browse view
|
270
|
+
Blacklight::Configuration.default_values[:browse] ||= Blacklight::OpenStructWithHashAccess.new(document_actions: [])
|
271
|
+
|
272
|
+
Blacklight::Configuration.default_values[:search_state_fields] ||= []
|
273
|
+
Blacklight::Configuration.default_values[:search_state_fields] += %i[id exhibit_id]
|
274
|
+
end
|
265
275
|
end
|
266
276
|
|
267
277
|
# make blacklight configuration play nice with bootstrap_form
|
data/lib/spotlight/version.rb
CHANGED
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: 3.6.0.
|
4
|
+
version: 3.6.0.beta3
|
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: 2023-02
|
14
|
+
date: 2023-03-02 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activejob-status
|
@@ -557,20 +557,6 @@ dependencies:
|
|
557
557
|
- - ">="
|
558
558
|
- !ruby/object:Gem::Version
|
559
559
|
version: '0'
|
560
|
-
- !ruby/object:Gem::Dependency
|
561
|
-
name: sprockets
|
562
|
-
requirement: !ruby/object:Gem::Requirement
|
563
|
-
requirements:
|
564
|
-
- - ">="
|
565
|
-
- !ruby/object:Gem::Version
|
566
|
-
version: '4'
|
567
|
-
type: :runtime
|
568
|
-
prerelease: false
|
569
|
-
version_requirements: !ruby/object:Gem::Requirement
|
570
|
-
requirements:
|
571
|
-
- - ">="
|
572
|
-
- !ruby/object:Gem::Version
|
573
|
-
version: '4'
|
574
560
|
- !ruby/object:Gem::Dependency
|
575
561
|
name: tophat
|
576
562
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1055,7 +1041,6 @@ files:
|
|
1055
1041
|
- app/javascript/spotlight/admin/visibility_toggle.es6
|
1056
1042
|
- app/javascript/spotlight/index.js
|
1057
1043
|
- app/javascript/spotlight/spotlight.js
|
1058
|
-
- app/javascript/spotlight/user/analytics.es6
|
1059
1044
|
- app/javascript/spotlight/user/browse_group_categories.es6
|
1060
1045
|
- app/javascript/spotlight/user/carousel.es6
|
1061
1046
|
- app/javascript/spotlight/user/clear_form_button.es6
|