blacklight-spotlight 0.18.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -9
- data/app/assets/javascripts/spotlight/blocks/browse_block.js +1 -0
- data/app/assets/stylesheets/spotlight/_bootstrap_overrides.scss +1 -1
- data/app/assets/stylesheets/spotlight/_multi_up_item_grid.scss +2 -0
- data/app/assets/stylesheets/spotlight/_pages.scss +7 -1
- data/app/controllers/spotlight/contact_forms_controller.rb +1 -5
- data/app/controllers/spotlight/searches_controller.rb +7 -1
- data/app/helpers/spotlight/browse_helper.rb +16 -1
- data/app/helpers/spotlight/searches_helper.rb +8 -0
- data/app/mailers/spotlight/contact_mailer.rb +9 -0
- data/app/models/spotlight/analytics/ga.rb +14 -16
- data/app/models/spotlight/blacklight_configuration.rb +6 -6
- data/app/models/spotlight/contact_form.rb +12 -10
- data/app/services/spotlight/carrierwave_file_resolver.rb +8 -0
- data/app/views/spotlight/browse/show.html.erb +5 -1
- data/app/views/spotlight/contact_mailer/report_problem.html.erb +14 -0
- data/app/views/spotlight/dashboards/analytics.html.erb +1 -3
- data/app/views/spotlight/searches/_form.html.erb +5 -0
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb +4 -3
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb +3 -2
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb +3 -2
- data/config/locales/spotlight.en.yml +1 -0
- data/db/migrate/20160711121314_add_default_view_to_spotlight_searches.rb +5 -0
- data/lib/generators/spotlight/install_generator.rb +6 -0
- data/lib/generators/spotlight/templates/config/initializers/riiif.rb +7 -0
- data/lib/spotlight/version.rb +1 -1
- data/spec/controllers/application_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/about_pages_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/admin_users_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/appearances_controller_spec.rb +0 -1
- data/spec/controllers/spotlight/application_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/attachments_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/browse_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/catalog_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/confirmations_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/contact_forms_controller_spec.rb +5 -2
- data/spec/controllers/spotlight/contacts_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/custom_fields_controller_spec.rb +0 -1
- data/spec/controllers/spotlight/dashboards_controller_spec.rb +0 -1
- data/spec/controllers/spotlight/exhibits_controller_spec.rb +1 -1
- data/spec/controllers/spotlight/feature_pages_controller_spec.rb +0 -1
- data/spec/controllers/spotlight/filters_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/home_pages_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/metadata_configurations_controller_spec.rb +0 -1
- data/spec/controllers/spotlight/resources_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/roles_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/search_configurations_controller_spec.rb +0 -1
- data/spec/controllers/spotlight/searches_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/sites_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/solr_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/tags_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/versions_controller_spec.rb +0 -2
- data/spec/controllers/spotlight/view_configurations_controller_spec.rb +0 -1
- data/spec/features/about_page_spec.rb +0 -2
- data/spec/features/add_contacts_spec.rb +0 -2
- data/spec/features/add_custom_field_metadata_spec.rb +0 -2
- data/spec/features/add_items_spec.rb +0 -2
- data/spec/features/browse_category_admin_spec.rb +13 -2
- data/spec/features/browse_category_spec.rb +27 -2
- data/spec/features/catalog_spec.rb +0 -2
- data/spec/features/confirm_email_spec.rb +0 -2
- data/spec/features/create_exhibit_spec.rb +0 -2
- data/spec/features/create_page_spec.rb +0 -2
- data/spec/features/curator_items.rb +0 -3
- data/spec/features/dashboard_spec.rb +0 -2
- data/spec/features/edit_contact_spec.rb +0 -3
- data/spec/features/edit_search_fields_spec.rb +0 -2
- data/spec/features/exhibit_masthead_spec.rb +0 -2
- data/spec/features/exhibits/add_tags_spec.rb +0 -1
- data/spec/features/exhibits/administration_spec.rb +0 -1
- data/spec/features/exhibits/custom_metadata_fields_spec.rb +0 -1
- data/spec/features/exhibits/edit_metadata_fields_spec.rb +0 -1
- data/spec/features/exhibits_index_spec.rb +0 -2
- data/spec/features/feature_page_spec.rb +0 -2
- data/spec/features/home_page_spec.rb +0 -1
- data/spec/features/import_exhibit_spec.rb +0 -1
- data/spec/features/item_admin_spec.rb +0 -2
- data/spec/features/javascript/about_page_admin_spec.rb +0 -2
- data/spec/features/javascript/block_controls_spec.rb +0 -2
- data/spec/features/javascript/blocks/featured_browse_categories_block_spec.rb +8 -0
- data/spec/features/javascript/edit_in_place_spec.rb +0 -2
- data/spec/features/javascript/feature_page_admin_spec.rb +0 -2
- data/spec/features/javascript/home_page_edit_spec.rb +0 -2
- data/spec/features/javascript/metadata_admin_spec.rb +0 -2
- data/spec/features/javascript/multi_image_select_spec.rb +0 -2
- data/spec/features/javascript/preview_block_spec.rb +0 -2
- data/spec/features/javascript/reindex_monitor_spec.rb +0 -2
- data/spec/features/javascript/roles_admin_spec.rb +0 -2
- data/spec/features/javascript/rule_block_spec.rb +0 -2
- data/spec/features/javascript/search_config_admin_spec.rb +0 -2
- data/spec/features/javascript/search_context_spec.rb +0 -2
- data/spec/features/main_navigation_spec.rb +0 -2
- data/spec/features/metadata_admin_spec.rb +0 -2
- data/spec/features/report_a_problem_spec.rb +0 -2
- data/spec/features/site_admin_management_spec.rb +0 -2
- data/spec/features/site_masthead_spec.rb +0 -6
- data/spec/features/slideshow_spec.rb +0 -2
- data/spec/features/tags_admin_spec.rb +0 -2
- data/spec/features/user_admin_spec.rb +0 -2
- data/spec/helpers/spotlight/application_helper_spec.rb +0 -1
- data/spec/helpers/spotlight/browse_helper_spec.rb +0 -1
- data/spec/helpers/spotlight/crud_link_helpers_spec.rb +0 -1
- data/spec/helpers/spotlight/jcrop_helper_spec.rb +0 -1
- data/spec/helpers/spotlight/main_app_helpers_spec.rb +0 -1
- data/spec/helpers/spotlight/navbar_helper_spec.rb +0 -1
- data/spec/helpers/spotlight/pages_helper_spec.rb +0 -1
- data/spec/helpers/spotlight/roles_helper_spec.rb +0 -1
- data/spec/helpers/spotlight/search_configurations_helper_spec.rb +0 -1
- data/spec/helpers/spotlight/title_helper_spec.rb +0 -1
- data/spec/jobs/spotlight/default_thumbnail_job_spec.rb +0 -1
- data/spec/jobs/spotlight/reindex_job_spec.rb +0 -1
- data/spec/jobs/spotlight/rename_sidecar_field_job_spec.rb +0 -1
- data/spec/lib/spotlight/controller_spec.rb +0 -1
- data/spec/mailers/spotlight/indexing_complete_mailer_spec.rb +0 -1
- data/spec/models/solr_document_spec.rb +0 -2
- data/spec/models/spotlight/ability_spec.rb +0 -1
- data/spec/models/spotlight/about_page_spec.rb +0 -2
- data/spec/models/spotlight/access_controls_enforcement_search_builder_spec.rb +0 -2
- data/spec/models/spotlight/blacklight_configuration_spec.rb +10 -2
- data/spec/models/spotlight/contact_email_spec.rb +0 -8
- data/spec/models/spotlight/contact_form_spec.rb +0 -2
- data/spec/models/spotlight/contact_spec.rb +0 -2
- data/spec/models/spotlight/custom_field_spec.rb +0 -1
- data/spec/models/spotlight/default_thumbnailable_concern_spec.rb +0 -2
- data/spec/models/spotlight/exhibit_spec.rb +0 -2
- data/spec/models/spotlight/feature_page_spec.rb +0 -2
- data/spec/models/spotlight/featured_image_spec.rb +0 -2
- data/spec/models/spotlight/field_metadata_spec.rb +0 -2
- data/spec/models/spotlight/filter_spec.rb +0 -2
- data/spec/models/spotlight/home_page_spec.rb +0 -2
- data/spec/models/spotlight/image_derivatives_spec.rb +0 -2
- data/spec/models/spotlight/main_navigation_spec.rb +0 -2
- data/spec/models/spotlight/masthead_spec.rb +0 -2
- data/spec/models/spotlight/page_spec.rb +0 -2
- data/spec/models/spotlight/reindex_progress_spec.rb +0 -2
- data/spec/models/spotlight/resource_spec.rb +0 -2
- data/spec/models/spotlight/role_spec.rb +0 -2
- data/spec/models/spotlight/search_spec.rb +0 -2
- data/spec/models/spotlight/site_spec.rb +0 -2
- data/spec/models/spotlight/sitemap_spec.rb +0 -1
- data/spec/models/spotlight/solr_document_sidecar_spec.rb +0 -2
- data/spec/models/spotlight/user_spec.rb +0 -2
- data/spec/routing/spotlight/exhibit_catalog_spec.rb +0 -1
- data/spec/routing/spotlight/pages_routing_spec.rb +30 -34
- data/spec/serializers/spotlight/exhibit_export_serializer_spec.rb +0 -2
- data/spec/services/spotlight/carrierwave_file_resolver_spec.rb +14 -0
- data/spec/spec_helper.rb +8 -2
- data/spec/uploaders/spotlight/item_uploader_spec.rb +0 -1
- data/spec/views/_user_util_links.html.erb_spec.rb +70 -74
- data/spec/views/shared/_analytics.html.erb_spec.rb +10 -15
- data/spec/views/shared/_exhibit_navbar.html.erb_spec.rb +0 -2
- data/spec/views/shared/_footer.html.erb_spec.rb +15 -19
- data/spec/views/shared/_header_navbar.html.erb_spec.rb +7 -12
- data/spec/views/shared/_masthead.html.erb_spec.rb +0 -13
- data/spec/views/spotlight/roles/index.html.erb_spec.rb +6 -5
- data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb_spec.rb +1 -1
- metadata +37 -30
- data/app/views/spotlight/contact_forms/show.html.erb +0 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 797e808c409dd777422ae85313b3730de6bd0cd3
|
|
4
|
+
data.tar.gz: 95908a121831207677ffe422e1b67cb5a451bca1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2789c3565185605cb60facf97aa1958825d121d4e412d989bb77ba9df20460211236a269812703457624b3d55d152acab312da275a78e601c061cb70aada9d58
|
|
7
|
+
data.tar.gz: ee69b30eb9115c7e96f1cd853cce54949d1f42fe8d9b94cce4eea451308532bbaa2c440570d51fea763e4edb777789bd430bd794058510782f1eaef5a48a9b32
|
data/README.md
CHANGED
|
@@ -42,16 +42,10 @@ Run the database migrations:
|
|
|
42
42
|
$ rake db:migrate
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
Start
|
|
45
|
+
Start Solr and the Rails development server:
|
|
46
46
|
|
|
47
47
|
```
|
|
48
|
-
$ rake
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Start the rails development server:
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
$ rails s
|
|
48
|
+
$ rake spotlight:server
|
|
55
49
|
```
|
|
56
50
|
|
|
57
51
|
Go to http://localhost:3000 in your browser.
|
|
@@ -72,7 +66,7 @@ See the [Spotlight wiki](https://github.com/projectblacklight/spotlight/wiki) fo
|
|
|
72
66
|
Spotlight:
|
|
73
67
|
|
|
74
68
|
* is a Rails engine and needs to be used in the context of a Rails application. We use [engine_cart](https://github.com/cbeer/engine_cart) to create an internal test application at .internal_test_app/
|
|
75
|
-
* uses Solr as part of its integration tests. We use [
|
|
69
|
+
* uses Solr as part of its integration tests. We use [solr_wrapper](https://github.com/cbeer/solr_wrapper) to manage the Solr instance used for development and test.
|
|
76
70
|
|
|
77
71
|
Our `$ rake ci` and `$ rake spotlight:server` tasks utilize Solr and the testing rails app automatically.
|
|
78
72
|
|
|
@@ -12,6 +12,7 @@ SirTrevor.Blocks.Browse = (function(){
|
|
|
12
12
|
|
|
13
13
|
item_options: function() { return [
|
|
14
14
|
'<label>',
|
|
15
|
+
'<input type="hidden" name="display-item-counts" value="false" />',
|
|
15
16
|
'<input type="checkbox" name="display-item-counts" value="true" checked />',
|
|
16
17
|
'<%= i18n.t("blocks:browse:item_counts") %>',
|
|
17
18
|
'</label>'
|
|
@@ -238,12 +238,14 @@
|
|
|
238
238
|
|
|
239
239
|
.box {
|
|
240
240
|
min-width: 150px;
|
|
241
|
+
-webkit-flex: 1 1 150px;
|
|
241
242
|
}
|
|
242
243
|
|
|
243
244
|
/* two items */
|
|
244
245
|
.box:first-child:nth-last-child(2),
|
|
245
246
|
.box:first-child:nth-last-child(2) ~ .box {
|
|
246
|
-
|
|
247
|
+
min-width: 250px;
|
|
248
|
+
-webkit-flex: 1 1 250px;
|
|
247
249
|
}
|
|
248
250
|
|
|
249
251
|
/* only images, no text */
|
|
@@ -257,6 +259,10 @@
|
|
|
257
259
|
height: 175px;
|
|
258
260
|
}
|
|
259
261
|
}
|
|
262
|
+
|
|
263
|
+
@media (max-width: $screen-sm-max) {
|
|
264
|
+
-webkit-flex: 1 1 175px;
|
|
265
|
+
}
|
|
260
266
|
}
|
|
261
267
|
}
|
|
262
268
|
}
|
|
@@ -11,11 +11,7 @@ module Spotlight
|
|
|
11
11
|
|
|
12
12
|
def create
|
|
13
13
|
if @contact_form.valid?
|
|
14
|
-
|
|
15
|
-
@contact_form.deliver_now
|
|
16
|
-
else
|
|
17
|
-
@contact_form.deliver
|
|
18
|
-
end
|
|
14
|
+
ContactMailer.report_problem(@contact_form).deliver_now
|
|
19
15
|
|
|
20
16
|
redirect_to :back, notice: t(:'helpers.submit.contact_form.created')
|
|
21
17
|
else
|
|
@@ -94,7 +94,13 @@ module Spotlight
|
|
|
94
94
|
end
|
|
95
95
|
|
|
96
96
|
def search_params
|
|
97
|
-
params.require(:search).permit(
|
|
97
|
+
params.require(:search).permit(
|
|
98
|
+
:title,
|
|
99
|
+
:long_description,
|
|
100
|
+
:default_index_view_type,
|
|
101
|
+
masthead_attributes: featured_image_attributes,
|
|
102
|
+
thumbnail_attributes: featured_image_attributes
|
|
103
|
+
)
|
|
98
104
|
end
|
|
99
105
|
|
|
100
106
|
def featured_image_attributes
|
|
@@ -3,16 +3,31 @@ module Spotlight
|
|
|
3
3
|
# Helper for browse views
|
|
4
4
|
module BrowseHelper
|
|
5
5
|
include ::BlacklightConfigurationHelper
|
|
6
|
+
def document_index_view_type
|
|
7
|
+
if @search && @search.default_index_view_type.present? && params[:view].blank?
|
|
8
|
+
blacklight_config.view[@search.default_index_view_type].key
|
|
9
|
+
else
|
|
10
|
+
super
|
|
11
|
+
end
|
|
12
|
+
end
|
|
6
13
|
|
|
7
14
|
##
|
|
8
15
|
# Override Blacklight's #default_document_index_view_type helper to
|
|
9
16
|
# use a different default view when presenting browse categories
|
|
10
17
|
def default_document_index_view_type
|
|
11
|
-
|
|
18
|
+
if view_available? default_browse_index_view_type
|
|
19
|
+
default_browse_index_view_type
|
|
20
|
+
else
|
|
21
|
+
super
|
|
22
|
+
end
|
|
12
23
|
end
|
|
13
24
|
|
|
14
25
|
private
|
|
15
26
|
|
|
27
|
+
def view_available?(view)
|
|
28
|
+
blacklight_config.view.key?(view) && blacklight_configuration_context.evaluate_if_unless_configuration(blacklight_config.view)
|
|
29
|
+
end
|
|
30
|
+
|
|
16
31
|
def default_browse_index_view_type
|
|
17
32
|
Spotlight::Engine.config.default_browse_index_view_type
|
|
18
33
|
end
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
require 'signet/oauth_2/client'
|
|
2
|
+
require 'legato'
|
|
3
|
+
|
|
1
4
|
module Spotlight
|
|
2
5
|
module Analytics
|
|
3
6
|
##
|
|
4
7
|
# Google Analytics data provider for the curation dashboard
|
|
5
8
|
class Ga
|
|
6
|
-
require 'legato'
|
|
7
|
-
|
|
8
9
|
extend Legato::Model
|
|
9
10
|
|
|
10
11
|
cattr_writer :user, :site
|
|
@@ -62,7 +63,8 @@ module Spotlight
|
|
|
62
63
|
def self.oauth_token(scope)
|
|
63
64
|
require 'oauth2'
|
|
64
65
|
|
|
65
|
-
|
|
66
|
+
access_token = auth_client(scope).fetch_access_token!
|
|
67
|
+
OAuth2::AccessToken.new(oauth_client, access_token['access_token'], expires_in: access_token['expires_in'])
|
|
66
68
|
end
|
|
67
69
|
|
|
68
70
|
def self.oauth_client
|
|
@@ -70,21 +72,17 @@ module Spotlight
|
|
|
70
72
|
token_url: 'https://accounts.google.com/o/oauth2/token')
|
|
71
73
|
end
|
|
72
74
|
|
|
73
|
-
def self.
|
|
74
|
-
@
|
|
75
|
-
oauth_key = Google::APIClient::PKCS12.load_key(Spotlight::Engine.config.ga_pkcs12_key_path, 'notasecret')
|
|
76
|
-
Google::APIClient::JWTAsserter.new(Spotlight::Engine.config.ga_email, scope, oauth_key)
|
|
77
|
-
end
|
|
75
|
+
def self.signing_key
|
|
76
|
+
@signing_key ||= OpenSSL::PKCS12.new(File.read(Spotlight::Engine.config.ga_pkcs12_key_path), 'notasecret').key
|
|
78
77
|
end
|
|
79
78
|
|
|
80
|
-
def self.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
client
|
|
79
|
+
def self.auth_client(scope)
|
|
80
|
+
Signet::OAuth2::Client.new token_credential_uri: 'https://accounts.google.com/o/oauth2/token',
|
|
81
|
+
audience: 'https://accounts.google.com/o/oauth2/token',
|
|
82
|
+
scope: scope,
|
|
83
|
+
issuer: Spotlight::Engine.config.ga_email,
|
|
84
|
+
signing_key: signing_key,
|
|
85
|
+
sub: Spotlight::Engine.config.ga_email
|
|
88
86
|
end
|
|
89
87
|
end
|
|
90
88
|
end
|
|
@@ -97,7 +97,7 @@ module Spotlight
|
|
|
97
97
|
set_index_field_defaults(v)
|
|
98
98
|
end
|
|
99
99
|
v.upstream_if = v.if unless v.if.nil?
|
|
100
|
-
v.if = :field_enabled?
|
|
100
|
+
v.if = :field_enabled? unless v.if == false
|
|
101
101
|
|
|
102
102
|
v.normalize! config
|
|
103
103
|
v.validate!
|
|
@@ -115,7 +115,7 @@ module Spotlight
|
|
|
115
115
|
end
|
|
116
116
|
|
|
117
117
|
v.upstream_if = v.if unless v.if.nil?
|
|
118
|
-
v.if = :field_enabled?
|
|
118
|
+
v.if = :field_enabled? unless v.if == false
|
|
119
119
|
|
|
120
120
|
v.normalize! config
|
|
121
121
|
v.validate!
|
|
@@ -128,7 +128,7 @@ module Spotlight
|
|
|
128
128
|
|
|
129
129
|
config.search_fields.each do |k, v|
|
|
130
130
|
v.upstream_if = v.if unless v.if.nil?
|
|
131
|
-
v.if = :field_enabled?
|
|
131
|
+
v.if = :field_enabled? unless v.if == false
|
|
132
132
|
next if search_fields[k].blank?
|
|
133
133
|
|
|
134
134
|
v.merge! search_fields[k].symbolize_keys
|
|
@@ -142,7 +142,7 @@ module Spotlight
|
|
|
142
142
|
|
|
143
143
|
config.sort_fields.each do |k, v|
|
|
144
144
|
v.upstream_if = v.if unless v.if.nil?
|
|
145
|
-
v.if = :field_enabled?
|
|
145
|
+
v.if = :field_enabled? unless v.if == false
|
|
146
146
|
next if sort_fields[k].blank?
|
|
147
147
|
|
|
148
148
|
v.merge! sort_fields[k].symbolize_keys
|
|
@@ -161,7 +161,7 @@ module Spotlight
|
|
|
161
161
|
v.merge! facet_fields[k].symbolize_keys
|
|
162
162
|
v.upstream_if = v.if unless v.if.nil?
|
|
163
163
|
v.enabled = v.show
|
|
164
|
-
v.if = :field_enabled?
|
|
164
|
+
v.if = :field_enabled? unless v.if == false
|
|
165
165
|
v.normalize! config
|
|
166
166
|
v.validate!
|
|
167
167
|
end
|
|
@@ -177,7 +177,7 @@ module Spotlight
|
|
|
177
177
|
config.view.each do |k, v|
|
|
178
178
|
v.key = k
|
|
179
179
|
v.upstream_if = v.if unless v.if.nil?
|
|
180
|
-
v.if = :enabled_in_spotlight_view_type_configuration?
|
|
180
|
+
v.if = :enabled_in_spotlight_view_type_configuration? unless v.if == false
|
|
181
181
|
end unless document_index_view_types.blank?
|
|
182
182
|
|
|
183
183
|
if config.search_fields.blank?
|
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
require 'mail_form'
|
|
2
|
-
|
|
3
1
|
module Spotlight
|
|
4
2
|
##
|
|
5
3
|
# Exhibit feedback form
|
|
6
|
-
class ContactForm
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
attribute :message
|
|
11
|
-
attribute :current_url
|
|
4
|
+
class ContactForm
|
|
5
|
+
include ActiveModel::Model
|
|
6
|
+
|
|
7
|
+
attr_accessor :current_exhibit, :name, :email, :message, :current_url, :request
|
|
12
8
|
|
|
13
|
-
|
|
9
|
+
validates :email, format: { with: /\A([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\z/i }
|
|
14
10
|
|
|
15
11
|
def headers
|
|
16
12
|
{
|
|
13
|
+
to: to,
|
|
17
14
|
subject: "#{I18n.t(:'blacklight.application_name')} Contact Form",
|
|
18
|
-
to: Spotlight::Engine.config.default_contact_email || current_exhibit.contact_emails.first.to_s,
|
|
19
15
|
from: %("#{name}" <#{email}>),
|
|
20
16
|
cc: current_exhibit.contact_emails.join(', ')
|
|
21
17
|
}
|
|
22
18
|
end
|
|
19
|
+
|
|
20
|
+
private
|
|
21
|
+
|
|
22
|
+
def to
|
|
23
|
+
Spotlight::Engine.config.default_contact_email || current_exhibit.contact_emails.first.to_s
|
|
24
|
+
end
|
|
23
25
|
end
|
|
24
26
|
end
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
|
|
16
16
|
<div class="col-md-12">
|
|
17
17
|
<%= render 'sort_and_per_page' %>
|
|
18
|
-
|
|
18
|
+
<% if @search.default_index_view_type && params[:view].blank? %>
|
|
19
|
+
<%= render_document_index_with_view(@search.default_index_view_type, @document_list) %>
|
|
20
|
+
<% else %>
|
|
21
|
+
<%= render_document_index(@document_list) %>
|
|
22
|
+
<% end %>
|
|
19
23
|
<%= render 'results_pagination' %>
|
|
20
24
|
</div>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<p><%= @contact_form.name %></p>
|
|
2
|
+
<p>From: <%= %("#{@contact_form.name}" <#{@contact_form.email}>) %></p>
|
|
3
|
+
|
|
4
|
+
<p><%= @contact_form.message %></p>
|
|
5
|
+
|
|
6
|
+
----
|
|
7
|
+
|
|
8
|
+
<dl>
|
|
9
|
+
<dt>REMOTE_IP</dt><dd><%= @contact_form.request.remote_ip %></dd>
|
|
10
|
+
<dt>USER AGENT</dt><dd><%= @contact_form.request.user_agent %></dd>
|
|
11
|
+
<dt>EXHIBIT</dt><dd><%= @contact_form.current_exhibit.title %></dd>
|
|
12
|
+
<dt>CURRENT_URL</dt><dd><%= @contact_form.current_url %></dd>
|
|
13
|
+
<dt>UUID</dt><dd><%= @contact_form.request.uuid %></dd>
|
|
14
|
+
</dl>
|
|
@@ -7,9 +7,7 @@
|
|
|
7
7
|
<%= render 'analytics' %>
|
|
8
8
|
<% else %>
|
|
9
9
|
<div class="empty-page-block">
|
|
10
|
-
|
|
11
|
-
<p>In order to view exhibit analytics, the site administrator must <a href="https://github.com/projectblacklight/spotlight/wiki/Installation">configure an analytics provider.</a></p>
|
|
12
|
-
<% end %>
|
|
10
|
+
<p>In order to view exhibit analytics, the site administrator must <a href="https://github.com/projectblacklight/spotlight/wiki/Installation">configure an analytics provider.</a></p>
|
|
13
11
|
</div>
|
|
14
12
|
<% end %>
|
|
15
13
|
</div>
|
|
@@ -30,6 +30,11 @@
|
|
|
30
30
|
<div role="tabpanel" class="tab-pane active" id="search-description">
|
|
31
31
|
<%= f.text_field :title, control_col: "col-sm-5" %>
|
|
32
32
|
<%= f.text_area :long_description, rows: 5 %>
|
|
33
|
+
<%= f.form_group label: { text: t(:".default_index_view_type") } do %>
|
|
34
|
+
<% available_document_index_views.each do |view| %>
|
|
35
|
+
<%= f.radio_button :default_index_view_type, view, label: view_label(view) %>
|
|
36
|
+
<% end %>
|
|
37
|
+
<% end %>
|
|
33
38
|
<%= f.static_control label: t(:".query_params") do %>
|
|
34
39
|
<div class="well well-sm">
|
|
35
40
|
<%= render_constraints(@search.query_params) %>
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
<div class="items-col spotlight-flexbox pull-<%= solr_documents_block.content_align %> <%= solr_documents_block.text? ? "col-md-6" : "col-md-12" %> ">
|
|
7
7
|
<% solr_documents_block.each_document do |block_options, document| %>
|
|
8
|
+
<% doc_presenter = index_presenter(document) %>
|
|
8
9
|
<div class="box" data-id="<%= document.id %>">
|
|
9
10
|
<div class="contents">
|
|
10
11
|
<% if block_thumb = block_options[:thumbnail_image_url] %>
|
|
@@ -14,12 +15,12 @@
|
|
|
14
15
|
<% end %>
|
|
15
16
|
<% if solr_documents_block.primary_caption? %>
|
|
16
17
|
<div class="caption primary-caption">
|
|
17
|
-
<%=
|
|
18
|
+
<%= doc_presenter.field_value solr_documents_block.primary_caption_field %>
|
|
18
19
|
</div>
|
|
19
20
|
<% end %>
|
|
20
21
|
<% if solr_documents_block.secondary_caption? %>
|
|
21
22
|
<div class="caption secondary-caption">
|
|
22
|
-
<%=
|
|
23
|
+
<%= doc_presenter.field_value solr_documents_block.secondary_caption_field %>
|
|
23
24
|
</div>
|
|
24
25
|
<% end %>
|
|
25
26
|
</div>
|
|
@@ -36,4 +37,4 @@
|
|
|
36
37
|
<%= sir_trevor_markdown solr_documents_block.text %>
|
|
37
38
|
</div>
|
|
38
39
|
<% end %>
|
|
39
|
-
</div>
|
|
40
|
+
</div>
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
<div id="<%= html_id %>" class="carousel slide" data-ride="carousel" data-interval="<%= solr_documents_carousel_block.interval %>">
|
|
7
7
|
<div class="carousel-inner">
|
|
8
8
|
<% solr_documents_carousel_block.each_document.each_with_index do |(block_options, document), index| %>
|
|
9
|
+
<% doc_presenter = index_presenter(document) %>
|
|
9
10
|
<div class="item <%= 'active' if index == 0 %>" data-id="<%= document.id %>">
|
|
10
11
|
<% if block_thumb = block_options[:full_image_url] %>
|
|
11
12
|
<%= link_to_document(document, image_tag(block_thumb), counter: -1) %>
|
|
@@ -15,12 +16,12 @@
|
|
|
15
16
|
<div class="carousel-caption">
|
|
16
17
|
<% if solr_documents_carousel_block.primary_caption? %>
|
|
17
18
|
<h3 class="primary">
|
|
18
|
-
<%=
|
|
19
|
+
<%= doc_presenter.field_value solr_documents_carousel_block.primary_caption_field %>
|
|
19
20
|
</h3>
|
|
20
21
|
<% end %>
|
|
21
22
|
<% if solr_documents_carousel_block.secondary_caption? %>
|
|
22
23
|
<div class="secondary">
|
|
23
|
-
<%=
|
|
24
|
+
<%= doc_presenter.field_value solr_documents_carousel_block.secondary_caption_field %>
|
|
24
25
|
</div>
|
|
25
26
|
<% end %>
|
|
26
27
|
</div>
|