blacklight-spotlight 0.23.0 → 0.24.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/spotlight/_nestable.scss +10 -23
- data/app/controllers/concerns/spotlight/controller.rb +12 -0
- data/app/controllers/spotlight/browse_controller.rb +7 -1
- data/app/controllers/spotlight/catalog_controller.rb +2 -2
- data/app/controllers/spotlight/concerns/user_invitable.rb +10 -2
- data/app/controllers/spotlight/contact_forms_controller.rb +1 -1
- data/app/controllers/spotlight/lock_controller.rb +1 -1
- data/app/controllers/spotlight/pages_controller.rb +1 -1
- data/app/controllers/spotlight/resources/csv_upload_controller.rb +2 -2
- data/app/controllers/spotlight/roles_controller.rb +1 -1
- data/app/controllers/spotlight/searches_controller.rb +8 -3
- data/app/controllers/spotlight/solr_controller.rb +26 -7
- data/app/controllers/spotlight/versions_controller.rb +1 -1
- data/app/helpers/spotlight/application_helper.rb +0 -4
- data/app/helpers/spotlight/pages_helper.rb +9 -1
- data/app/models/concerns/spotlight/resources/open_graph.rb +11 -1
- data/app/models/concerns/spotlight/user.rb +1 -1
- data/app/models/spotlight/resources/json_upload.rb +8 -0
- data/app/views/spotlight/featured_images/_form.html.erb +5 -1
- data/app/views/spotlight/featured_images/_upload_form.html.erb +5 -1
- data/app/views/spotlight/resources/json_upload/_form.html.erb +15 -0
- data/config/locales/spotlight.en.yml +5 -0
- data/lib/generators/spotlight/install_generator.rb +2 -0
- data/lib/generators/spotlight/templates/config/initializers/spotlight_initializer.rb +58 -0
- data/lib/spotlight/engine.rb +6 -1
- data/lib/spotlight/version.rb +1 -1
- data/spec/controllers/spotlight/about_pages_controller_spec.rb +33 -22
- data/spec/controllers/spotlight/admin_users_controller_spec.rb +9 -9
- data/spec/controllers/spotlight/appearances_controller_spec.rb +11 -8
- data/spec/controllers/spotlight/attachments_controller_spec.rb +2 -2
- data/spec/controllers/spotlight/browse_controller_spec.rb +5 -5
- data/spec/controllers/spotlight/catalog_controller_spec.rb +31 -31
- data/spec/controllers/spotlight/confirmations_controller_spec.rb +1 -1
- data/spec/controllers/spotlight/contact_forms_controller_spec.rb +4 -4
- data/spec/controllers/spotlight/contacts_controller_spec.rb +8 -8
- data/spec/controllers/spotlight/custom_fields_controller_spec.rb +5 -5
- data/spec/controllers/spotlight/dashboards_controller_spec.rb +5 -5
- data/spec/controllers/spotlight/exhibits_controller_spec.rb +26 -20
- data/spec/controllers/spotlight/feature_pages_controller_spec.rb +18 -18
- data/spec/controllers/spotlight/filters_controller_spec.rb +6 -6
- data/spec/controllers/spotlight/home_pages_controller_spec.rb +9 -9
- data/spec/controllers/spotlight/metadata_configurations_controller_spec.rb +15 -12
- data/spec/controllers/spotlight/resources/csv_upload_controller_spec.rb +5 -5
- data/spec/controllers/spotlight/resources/upload_controller_spec.rb +4 -4
- data/spec/controllers/spotlight/resources_controller_spec.rb +8 -8
- data/spec/controllers/spotlight/roles_controller_spec.rb +47 -29
- data/spec/controllers/spotlight/search_configurations_controller_spec.rb +35 -23
- data/spec/controllers/spotlight/searches_controller_spec.rb +33 -22
- data/spec/controllers/spotlight/sites_controller_spec.rb +2 -2
- data/spec/controllers/spotlight/solr_controller_spec.rb +29 -17
- data/spec/controllers/spotlight/tags_controller_spec.rb +4 -4
- data/spec/controllers/spotlight/versions_controller_spec.rb +3 -3
- data/spec/controllers/spotlight/view_configurations_controller_spec.rb +2 -2
- data/spec/features/add_items_spec.rb +23 -2
- data/spec/fixtures/json-upload-fixture.json +3 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/support/backport_test_helpers.rb +45 -0
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7de23e07b1ce71e1f7d3d18807940b6f9e46c14
|
4
|
+
data.tar.gz: d3dc8288bdff435529fb727f6d0353adae56f178
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 794b994391e7ea143e90cb42230bbf1e4cb759831ac5e397c198cdde892585c2abdc2ca09b3f8cfcc319cdadebbaf73434aecf3a7e92039f6374a4ea6f8198aa
|
7
|
+
data.tar.gz: aeef5f4b1f8622303a270752e8ce3e92c9c836c1eb9856ce99b2406d860b4e90644fc974d524dcf1493e3e392cb60654128c1d1c87d88bef51dda44d902e7de6
|
@@ -36,12 +36,9 @@ tr.dd-item {
|
|
36
36
|
|
37
37
|
.dd-handle { display: block; height: 100%; margin: 5px 0; padding: 5px 10px; color: #333; text-decoration: none; font-weight: bold; border: 1px solid #ccc;
|
38
38
|
background: #fafafa;
|
39
|
-
background:
|
40
|
-
|
41
|
-
|
42
|
-
-webkit-border-radius: 3px;
|
43
|
-
border-radius: 3px;
|
44
|
-
box-sizing: border-box; -moz-box-sizing: border-box;
|
39
|
+
background: linear-gradient(to bottom, #fafafa 0%, #eee 100%);
|
40
|
+
border-radius: 3px;
|
41
|
+
box-sizing: border-box;
|
45
42
|
}
|
46
43
|
.dd-handle:hover { color: #2ea8e5; background: #fff; }
|
47
44
|
|
@@ -50,14 +47,10 @@ tr.dd-item {
|
|
50
47
|
.dd-item > button[data-action="collapse"]:before { content: '-'; }
|
51
48
|
|
52
49
|
.dd-placeholder,
|
53
|
-
.dd-empty { margin: 5px 0; padding: 0; min-height: 30px; border: 1px dashed #b6bcbf; box-sizing: border-box;
|
54
|
-
.dd-empty { border: 1px dashed #bbb; min-height: 100px;
|
55
|
-
background-image:
|
56
|
-
|
57
|
-
background-image: -moz-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff),
|
58
|
-
-moz-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff);
|
59
|
-
background-image: linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff),
|
60
|
-
linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff);
|
50
|
+
.dd-empty { margin: 5px 0; padding: 0; min-height: 30px; border: 1px dashed #b6bcbf; box-sizing: border-box; }
|
51
|
+
.dd-empty { border: 1px dashed #bbb; min-height: 100px;
|
52
|
+
background-image: linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff),
|
53
|
+
linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff);
|
61
54
|
background-size: 60px 60px;
|
62
55
|
background-position: 0 0, 30px 30px;
|
63
56
|
}
|
@@ -65,7 +58,6 @@ tr.dd-item {
|
|
65
58
|
.dd-dragel { position: absolute; pointer-events: none; z-index: 9999; }
|
66
59
|
.dd-dragel > .dd-item .dd-handle { margin-top: 0; }
|
67
60
|
.dd-dragel .dd-handle {
|
68
|
-
-webkit-box-shadow: 2px 4px 6px 0 rgba(0,0,0,.1);
|
69
61
|
box-shadow: 2px 4px 6px 0 rgba(0,0,0,.1);
|
70
62
|
}
|
71
63
|
|
@@ -84,12 +76,9 @@ tr.dd-item {
|
|
84
76
|
|
85
77
|
.dd3-content { display: block; margin: 5px 0; padding: 0 0 0 30px;
|
86
78
|
background: #fafafa;
|
87
|
-
background: -webkit-linear-gradient(to bottom, #fafafa 0%, #eee 100%);
|
88
|
-
background: -moz-linear-gradient(to bottom, #fafafa 0%, #eee 100%);
|
89
79
|
background: linear-gradient(to bottom, #fafafa 0%, #eee 100%);
|
90
|
-
|
91
|
-
|
92
|
-
box-sizing: border-box; -moz-box-sizing: border-box;
|
80
|
+
border-radius: 3px;
|
81
|
+
box-sizing: border-box;
|
93
82
|
}
|
94
83
|
.dd3-content.page-admin {
|
95
84
|
position: relative;
|
@@ -105,9 +94,7 @@ tr.dd-item {
|
|
105
94
|
white-space: nowrap; overflow: hidden;
|
106
95
|
border: 1px solid #aaa;
|
107
96
|
background: #ddd;
|
108
|
-
background:
|
109
|
-
background: -moz-linear-gradient(to bottom, #ddd 0%, #bbb 100%);
|
110
|
-
background: linear-gradient(to bottom, #ddd 0%, #bbb 100%);
|
97
|
+
background: linear-gradient(to bottom, #ddd 0%, #bbb 100%);
|
111
98
|
border-top-right-radius: 0;
|
112
99
|
border-bottom-right-radius: 0;
|
113
100
|
}
|
@@ -8,6 +8,7 @@ module Spotlight
|
|
8
8
|
|
9
9
|
included do
|
10
10
|
helper_method :current_site, :current_exhibit, :current_masthead, :exhibit_masthead?, :resource_masthead?
|
11
|
+
helper_method :redirect_back # helper method backported from Rails 5
|
11
12
|
end
|
12
13
|
|
13
14
|
def current_site
|
@@ -85,5 +86,16 @@ module Spotlight
|
|
85
86
|
options = Blacklight::Parameters.sanitize(params.to_unsafe_h.with_indifferent_access).merge(options).except(:exhibit_id, :only_path)
|
86
87
|
spotlight.facet_exhibit_catalog_url(current_exhibit, *args, options)
|
87
88
|
end
|
89
|
+
|
90
|
+
# Backport from Rails 5
|
91
|
+
def redirect_back(fallback_location:, **args)
|
92
|
+
if defined?(super)
|
93
|
+
super
|
94
|
+
elsif request.headers['Referer']
|
95
|
+
redirect_to request.headers['Referer'], **args
|
96
|
+
else
|
97
|
+
redirect_to fallback_location, **args
|
98
|
+
end
|
99
|
+
end
|
88
100
|
end
|
89
101
|
end
|
@@ -20,11 +20,17 @@ module Spotlight
|
|
20
20
|
blacklight_config.index.document_actions = blacklight_config.browse.document_actions
|
21
21
|
|
22
22
|
add_breadcrumb @search.title, exhibit_browse_path(@exhibit, @search)
|
23
|
-
(@response, @document_list) = search_results(
|
23
|
+
(@response, @document_list) = search_results(search_query)
|
24
24
|
end
|
25
25
|
|
26
26
|
protected
|
27
27
|
|
28
|
+
def search_query
|
29
|
+
base_query = Blacklight::SearchState.new(@search.query_params, blacklight_config)
|
30
|
+
user_query = Blacklight::SearchState.new(params, blacklight_config).to_h
|
31
|
+
base_query.params_for_search(user_query)
|
32
|
+
end
|
33
|
+
|
28
34
|
##
|
29
35
|
# Browsing an exhibit should start a new search session
|
30
36
|
def start_new_search_session?
|
@@ -92,7 +92,7 @@ module Spotlight
|
|
92
92
|
@document.save
|
93
93
|
|
94
94
|
respond_to do |format|
|
95
|
-
format.html {
|
95
|
+
format.html { redirect_back(fallback_location: [spotlight, current_exhibit, @document]) }
|
96
96
|
format.json { render json: true }
|
97
97
|
end
|
98
98
|
end
|
@@ -103,7 +103,7 @@ module Spotlight
|
|
103
103
|
@document.save
|
104
104
|
|
105
105
|
respond_to do |format|
|
106
|
-
format.html {
|
106
|
+
format.html { redirect_back(fallback_location: [spotlight, current_exhibit, @document]) }
|
107
107
|
format.json { render json: true }
|
108
108
|
end
|
109
109
|
end
|
@@ -10,9 +10,9 @@ module Spotlight
|
|
10
10
|
role = Spotlight::Role.create(resource: exhibit_or_site, user: user, role: invite_params[:role])
|
11
11
|
if role.save
|
12
12
|
user.deliver_invitation # now deliver it when we have saved the role
|
13
|
-
|
13
|
+
redirect_back fallback_location: fallback_location, notice: t(:'helpers.submit.invite.invited')
|
14
14
|
else
|
15
|
-
|
15
|
+
redirect_back fallback_location: fallback_location, alert: t(:'helpers.submit.role.batch_error', count: 1)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
@@ -25,6 +25,14 @@ module Spotlight
|
|
25
25
|
def exhibit_or_site
|
26
26
|
current_exhibit || @site
|
27
27
|
end
|
28
|
+
|
29
|
+
def fallback_location
|
30
|
+
if current_exhibit
|
31
|
+
spotlight.exhibit_roles_path(current_exhibit)
|
32
|
+
else
|
33
|
+
spotlight.admin_users_path
|
34
|
+
end
|
35
|
+
end
|
28
36
|
end
|
29
37
|
end
|
30
38
|
end
|
@@ -13,7 +13,7 @@ module Spotlight
|
|
13
13
|
if @contact_form.valid?
|
14
14
|
ContactMailer.report_problem(@contact_form).deliver_now
|
15
15
|
|
16
|
-
|
16
|
+
redirect_back fallback_location: spotlight.new_exhibit_contact_form_path(current_exhibit), notice: t(:'helpers.submit.contact_form.created')
|
17
17
|
else
|
18
18
|
render 'new'
|
19
19
|
end
|
@@ -17,11 +17,11 @@ module Spotlight
|
|
17
17
|
csv = CSV.parse(file.read, headers: true, return_headers: false, encoding: 'utf-8').map(&:to_hash)
|
18
18
|
Spotlight::AddUploadsFromCSV.perform_later(csv, current_exhibit, current_user)
|
19
19
|
flash[:notice] = t('spotlight.resources.upload.csv.success', file_name: file.original_filename)
|
20
|
-
|
20
|
+
redirect_back(fallback_location: spotlight.exhibit_resources_path(current_exhibit))
|
21
21
|
end
|
22
22
|
|
23
23
|
def template
|
24
|
-
render
|
24
|
+
render plain: CSV.generate { |csv| csv << data_param_keys.unshift(:url) }, content_type: 'text/csv'
|
25
25
|
end
|
26
26
|
|
27
27
|
private
|
@@ -25,7 +25,7 @@ module Spotlight
|
|
25
25
|
notice = any_deleted ? t(:'helpers.submit.role.destroyed') : t(:'helpers.submit.role.updated')
|
26
26
|
redirect_to exhibit_roles_path(@exhibit), notice: notice
|
27
27
|
else
|
28
|
-
flash[:alert] = t(:'helpers.submit.role.batch_error', count: exhibit_params[:roles_attributes].size)
|
28
|
+
flash[:alert] = t(:'helpers.submit.role.batch_error', count: exhibit_params[:roles_attributes].to_unsafe_h.size)
|
29
29
|
render action: 'index'
|
30
30
|
end
|
31
31
|
end
|
@@ -16,9 +16,10 @@ module Spotlight
|
|
16
16
|
@search.query_params = query_params
|
17
17
|
|
18
18
|
if @search.save
|
19
|
-
|
19
|
+
redirect_back fallback_location: fallback_url,
|
20
|
+
notice: t(:'helpers.submit.search.created', model: @search.class.model_name.human.downcase)
|
20
21
|
else
|
21
|
-
|
22
|
+
redirect_back fallback_location: fallback_url, alert: @search.errors.full_messages.join('<br>'.html_safe)
|
22
23
|
end
|
23
24
|
end
|
24
25
|
|
@@ -64,7 +65,7 @@ module Spotlight
|
|
64
65
|
else
|
65
66
|
t(:'helpers.submit.search.batch_error', model: Spotlight::Search.model_name.human.pluralize.downcase)
|
66
67
|
end
|
67
|
-
|
68
|
+
redirect_back fallback_location: fallback_url, notice: notice
|
68
69
|
end
|
69
70
|
|
70
71
|
def show
|
@@ -118,5 +119,9 @@ module Spotlight
|
|
118
119
|
def blacklisted_search_session_params
|
119
120
|
[:commit, :counter, :total, :search_id, :page, :per_page, :authenticity_token, :utf8, :action, :controller]
|
120
121
|
end
|
122
|
+
|
123
|
+
def fallback_url
|
124
|
+
spotlight.exhibit_searches_path(current_exhibit)
|
125
|
+
end
|
121
126
|
end
|
122
127
|
end
|
@@ -6,31 +6,50 @@ module Spotlight
|
|
6
6
|
# This is an example of how you could integrate external indexing
|
7
7
|
# workflows with exhibit-specific content
|
8
8
|
class SolrController < Spotlight::ApplicationController
|
9
|
+
include Blacklight::SearchHelper
|
10
|
+
|
9
11
|
before_action :authenticate_user!
|
10
12
|
before_action :validate_writable_index!
|
11
13
|
|
12
14
|
load_and_authorize_resource :exhibit, class: Spotlight::Exhibit
|
15
|
+
delegate :blacklight_config, to: :current_exhibit
|
13
16
|
|
14
17
|
def update
|
15
18
|
authorize! :update_solr, @exhibit
|
16
19
|
|
17
|
-
|
20
|
+
data = solr_documents
|
18
21
|
|
19
|
-
|
20
|
-
|
22
|
+
repository.connection.update params: { commitWithin: 500 }, data: data.to_json, headers: { 'Content-Type' => 'application/json' } unless data.empty?
|
23
|
+
|
24
|
+
if respond_to? :head
|
25
|
+
head :ok
|
26
|
+
else
|
27
|
+
render nothing: true
|
21
28
|
end
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
22
32
|
|
23
|
-
|
33
|
+
def solr_documents
|
34
|
+
req = ActiveSupport::JSON.decode(json_content)
|
24
35
|
|
25
|
-
|
36
|
+
Array.wrap(req).map do |r|
|
37
|
+
blacklight_config.document_model.new(r).to_solr.merge(@exhibit.solr_data).merge(r)
|
38
|
+
end
|
26
39
|
end
|
27
40
|
|
28
|
-
|
41
|
+
def json_content
|
42
|
+
if params[:resources_json_upload]
|
43
|
+
params[:resources_json_upload][:json].read
|
44
|
+
else
|
45
|
+
request.body.read
|
46
|
+
end
|
47
|
+
end
|
29
48
|
|
30
49
|
def validate_writable_index!
|
31
50
|
return if Spotlight::Engine.config.writable_index
|
32
51
|
|
33
|
-
render
|
52
|
+
render plain: 'Spotlight is unable to write to solr', status: 409
|
34
53
|
end
|
35
54
|
end
|
36
55
|
end
|
@@ -15,7 +15,7 @@ module Spotlight
|
|
15
15
|
redirect_to [obj.exhibit, obj], flash: { html_safe: true }, notice: view_context.t(:'spotlight.versions.undo_error')
|
16
16
|
end
|
17
17
|
else
|
18
|
-
|
18
|
+
redirect_back fallback_location: main_app.root_url, flash: { html_safe: true }, notice: view_context.t(:'spotlight.versions.undo_error')
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
@@ -140,10 +140,6 @@ module Spotlight
|
|
140
140
|
config.label || blacklight_config.index_fields[solr_field].try(:label) || t(".#{solr_field}")
|
141
141
|
end
|
142
142
|
|
143
|
-
def view_label(view)
|
144
|
-
t(:"blacklight.search.view.#{view}", default: blacklight_config.view[view].title || view.to_s)
|
145
|
-
end
|
146
|
-
|
147
143
|
def available_view_fields
|
148
144
|
current_exhibit.blacklight_configuration.default_blacklight_config.view.to_h.reject { |_k, v| v.if == false }
|
149
145
|
end
|
@@ -22,7 +22,7 @@ module Spotlight
|
|
22
22
|
|
23
23
|
def get_search_widget_search_results(block)
|
24
24
|
if block.searches?
|
25
|
-
search_results(block
|
25
|
+
search_results(search_widget_search_query(block))
|
26
26
|
else
|
27
27
|
[]
|
28
28
|
end
|
@@ -50,5 +50,13 @@ module Spotlight
|
|
50
50
|
def render_contact_email_address(address)
|
51
51
|
mail_to address, address
|
52
52
|
end
|
53
|
+
|
54
|
+
private
|
55
|
+
|
56
|
+
def search_widget_search_query(block)
|
57
|
+
base_query = Blacklight::SearchState.new(block.query_params, blacklight_config)
|
58
|
+
user_query = Blacklight::SearchState.new(params, blacklight_config).to_h
|
59
|
+
base_query.params_for_search(user_query)
|
60
|
+
end
|
53
61
|
end
|
54
62
|
end
|
@@ -20,9 +20,19 @@ module Spotlight
|
|
20
20
|
|
21
21
|
def opengraph_properties
|
22
22
|
Hash[opengraph.map do |k, v|
|
23
|
-
["#{k
|
23
|
+
["#{opengraph_solr_field_name(k)}_tesim", v]
|
24
24
|
end]
|
25
25
|
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def opengraph_solr_field_name(field)
|
30
|
+
if Rails::VERSION::MAJOR >= 5
|
31
|
+
field.parameterize(separator: '_')
|
32
|
+
else
|
33
|
+
field.parameterize('_')
|
34
|
+
end
|
35
|
+
end
|
26
36
|
end
|
27
37
|
end
|
28
38
|
end
|
@@ -7,7 +7,7 @@ module Spotlight
|
|
7
7
|
has_many :roles, class_name: 'Spotlight::Role', dependent: :destroy
|
8
8
|
has_many :exhibits, class_name: 'Spotlight::Exhibit', through: :roles, source: 'resource', source_type: 'Spotlight::Exhibit'
|
9
9
|
|
10
|
-
scope :with_roles, -> { where(id: Spotlight::Role.
|
10
|
+
scope :with_roles, -> { where(id: Spotlight::Role.distinct.pluck(:user_id)) }
|
11
11
|
|
12
12
|
before_create :add_default_roles
|
13
13
|
end
|
@@ -1,4 +1,8 @@
|
|
1
|
-
<%
|
1
|
+
<% if Rails::VERSION::MAJOR >= 5 %>
|
2
|
+
<% form_prefix = f.object_name.parameterize(separator: '_') %>
|
3
|
+
<% else %>
|
4
|
+
<% form_prefix = f.object_name.parameterize('_') %>
|
5
|
+
<% end %>
|
2
6
|
<%= field_set_tag do %>
|
3
7
|
<%= f.check_box(:display) %>
|
4
8
|
<% end if f.object.is_a? Spotlight::Masthead %>
|
@@ -1,4 +1,8 @@
|
|
1
|
-
<%
|
1
|
+
<% if Rails::VERSION::MAJOR >= 5 %>
|
2
|
+
<% form_prefix = f.object_name.parameterize(separator: '_') %>
|
3
|
+
<% else %>
|
4
|
+
<% form_prefix = f.object_name.parameterize('_') %>
|
5
|
+
<% end %>
|
2
6
|
<%= field_set_tag do %>
|
3
7
|
<%= f.check_box(:display) %>
|
4
8
|
<% end if f.object.is_a? Spotlight::Masthead %>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<% if can? :update_solr, current_exhibit %>
|
2
|
+
<%= bootstrap_form_for([current_exhibit, @resource.becomes(Spotlight::Resources::JsonUpload)], url: spotlight.exhibit_solr_update_path(current_exhibit), layout: :horizontal, label_col: 'col-md-2', control_col: 'col-sm-6 col-md-6', html: { class: 'item-upload-form', multipart: true } ) do |f| %>
|
3
|
+
<%= f.url_field :json, type: "file", label: t('.file_label') %>
|
4
|
+
<div class="form-actions">
|
5
|
+
<div class="primary-actions">
|
6
|
+
<%= cancel_link @resource, :back, class: 'btn btn-default' %>
|
7
|
+
<%= f.submit t('.add_item'), class: 'btn btn-primary' %>
|
8
|
+
</div>
|
9
|
+
</div>
|
10
|
+
<% end %>
|
11
|
+
<% else %>
|
12
|
+
<div class="alert alert-info">
|
13
|
+
Uploading raw documents is restricted to site administrators.
|
14
|
+
</div>
|
15
|
+
<% end %>
|