arclight 0.2.0 → 0.3.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/.all-contributorsrc +450 -0
- data/.babelrc +3 -0
- data/.codeclimate.yml +5 -0
- data/.eslintrc +3 -0
- data/.rubocop.yml +19 -0
- data/.rubocop_todo.yml +15 -135
- data/.travis.yml +2 -2
- data/CONTRIBUTORS.md +79 -0
- data/README.md +21 -24
- data/Rakefile +0 -1
- data/app/assets/images/blacklight/bookmark.svg +1 -0
- data/app/assets/images/blacklight/collection.svg +5 -0
- data/app/assets/images/blacklight/compact.svg +1 -25
- data/app/assets/images/blacklight/container.svg +5 -0
- data/app/assets/images/blacklight/ead.svg +1 -0
- data/app/assets/images/blacklight/file.svg +5 -0
- data/app/assets/images/blacklight/folder.svg +1 -0
- data/app/assets/images/blacklight/list.svg +1 -0
- data/app/assets/images/blacklight/minus.svg +1 -0
- data/app/assets/images/blacklight/online.svg +5 -0
- data/app/assets/images/blacklight/pdf.svg +1 -0
- data/app/assets/images/blacklight/plus.svg +1 -0
- data/app/assets/images/blacklight/repository.svg +1 -0
- data/app/assets/javascripts/arclight/arclight.js +1 -3
- data/app/assets/javascripts/arclight/collection_navigation.js +36 -53
- data/app/assets/javascripts/arclight/collection_scrollspy.js +1 -1
- data/app/assets/javascripts/arclight/context_navigation.js +374 -0
- data/app/assets/javascripts/arclight/truncator.js.erb +8 -2
- data/app/assets/stylesheets/arclight/application.scss +3 -1
- data/app/assets/stylesheets/arclight/bootstrap_overrides.scss +23 -0
- data/app/assets/stylesheets/arclight/modules/context_navigation.scss +75 -0
- data/app/assets/stylesheets/arclight/modules/hierarchy_and_online_contents.scss +28 -35
- data/app/assets/stylesheets/arclight/modules/highlights.scss +2 -1
- data/app/assets/stylesheets/arclight/modules/layout.scss +128 -14
- data/app/assets/stylesheets/arclight/modules/mastheads.scss +27 -5
- data/app/assets/stylesheets/arclight/modules/repositories.scss +1 -5
- data/app/assets/stylesheets/arclight/modules/repository_card.scss +6 -7
- data/app/assets/stylesheets/arclight/modules/search_results.scss +145 -24
- data/app/assets/stylesheets/arclight/modules/show_collection.scss +38 -59
- data/app/assets/stylesheets/arclight/responsive.scss +13 -0
- data/app/assets/stylesheets/arclight/variables.scss +21 -1
- data/app/controllers/concerns/arclight/ead_format_helpers.rb +225 -0
- data/app/controllers/concerns/arclight/field_config_helpers.rb +23 -7
- data/app/factories/blacklight_field_configuration_factory.rb +1 -0
- data/app/helpers/arclight_helper.rb +197 -35
- data/app/models/arclight/document_downloads.rb +125 -0
- data/app/models/arclight/parent.rb +4 -2
- data/app/models/arclight/parents.rb +6 -4
- data/app/models/arclight/requests/aeon_external_request.rb +42 -0
- data/app/models/arclight/requests/aeon_web_ead.rb +47 -0
- data/app/models/arclight/requests/google_form.rb +2 -2
- data/app/models/concerns/arclight/catalog.rb +14 -2
- data/app/models/concerns/arclight/search_behavior.rb +27 -12
- data/app/models/concerns/arclight/solr_document.rb +29 -7
- data/app/views/arclight/_requests.html.erb +7 -0
- data/app/views/arclight/repositories/_in_person_repository.html.erb +1 -1
- data/app/views/arclight/repositories/_repository.html.erb +2 -2
- data/app/views/arclight/repositories/_repository_contact.html.erb +9 -0
- data/app/views/arclight/repositories/index.html.erb +3 -0
- data/app/views/arclight/repositories/show.html.erb +5 -4
- data/app/views/arclight/requests/_aeon_external_request_endpoint.html.erb +9 -0
- data/app/views/arclight/requests/_aeon_web_ead.html.erb +7 -0
- data/app/views/arclight/requests/_google_form.html.erb +2 -1
- data/app/views/arclight/viewers/_oembed.html.erb +2 -1
- data/app/views/catalog/_access_contents.html.erb +15 -0
- data/app/views/catalog/_arclight_abstract_or_scope.html.erb +5 -0
- data/app/views/catalog/_arclight_bookmark_control.html.erb +38 -0
- data/app/views/catalog/_arclight_document_header_icon.html.erb +1 -0
- data/app/views/catalog/_arclight_index_compact_default.html.erb +18 -11
- data/app/views/catalog/_arclight_index_default.html.erb +45 -0
- data/app/views/catalog/_arclight_index_group_document_compact_default.html.erb +19 -0
- data/app/views/catalog/_arclight_index_group_document_default.html.erb +18 -0
- data/app/views/catalog/_arclight_online_content_indicator.html.erb +1 -3
- data/app/views/catalog/_collection_contents.html.erb +2 -10
- data/app/views/catalog/_collection_context.html.erb +15 -0
- data/app/views/catalog/_collection_context_nav.html.erb +12 -0
- data/app/views/catalog/_collection_online_contents.html.erb +3 -3
- data/app/views/catalog/_component_context.html.erb +5 -0
- data/app/views/catalog/_containers.html.erb +3 -0
- data/app/views/catalog/_context_sidebar.html.erb +2 -2
- data/app/views/catalog/_document_downloads.html.erb +14 -0
- data/app/views/catalog/_group.html.erb +21 -0
- data/app/views/catalog/_group_header_compact_default.html.erb +15 -0
- data/app/views/catalog/_group_header_default.html.erb +20 -0
- data/app/views/catalog/_group_toggle.html.erb +10 -0
- data/app/views/catalog/_home.html.erb +1 -1
- data/app/views/catalog/_index_breadcrumb_default.html.erb +5 -2
- data/app/views/catalog/_index_collection_context_default.html.erb +53 -0
- data/app/views/catalog/_index_header.html.erb +3 -3
- data/app/views/catalog/_index_online_contents_default.html.erb +1 -1
- data/app/views/catalog/_online_content_label.html.erb +5 -0
- data/app/views/catalog/_search_form.html.erb +34 -0
- data/app/views/catalog/_search_results.html.erb +1 -4
- data/app/views/catalog/_show_actions_box_default.html.erb +27 -0
- data/app/views/catalog/_show_breadcrumbs_default.html.erb +5 -20
- data/app/views/catalog/_show_collection.html.erb +42 -24
- data/app/views/catalog/_show_default.html.erb +63 -35
- data/app/views/catalog/_show_upper_metadata_default.html.erb +1 -1
- data/app/views/catalog/_sort_and_per_page.html.erb +8 -0
- data/app/views/catalog/_within_collection_dropdown.html.erb +26 -0
- data/app/views/shared/_breadcrumbs.html.erb +4 -4
- data/app/views/shared/_context_sidebar.html.erb +2 -2
- data/app/views/shared/_header_navbar.html.erb +13 -17
- data/app/views/shared/_show_breadcrumbs.html.erb +27 -0
- data/arclight.gemspec +5 -6
- data/config/i18n-tasks.yml +2 -1
- data/config/locales/arclight.en.yml +54 -21
- data/config/repositories.yml +0 -0
- data/lib/arclight/engine.rb +22 -12
- data/lib/arclight/hash_absolute_xpath.rb +11 -7
- data/lib/arclight/level_label.rb +46 -0
- data/lib/arclight/normalized_date.rb +2 -2
- data/lib/arclight/normalized_id.rb +1 -0
- data/lib/arclight/normalized_title.rb +1 -0
- data/lib/arclight/repository.rb +58 -5
- data/lib/arclight/traject/ead2_config.rb +178 -159
- data/lib/arclight/traject/nokogiri_namespaceless_reader.rb +22 -0
- data/lib/arclight/version.rb +1 -1
- data/lib/arclight/viewers/oembed.rb +1 -0
- data/lib/arclight/year_range.rb +9 -1
- data/lib/generators/arclight/install_generator.rb +5 -1
- data/lib/generators/arclight/templates/catalog_controller.rb +128 -100
- data/lib/generators/arclight/templates/config/downloads.yml +12 -0
- data/lib/generators/arclight/templates/config/repositories.yml +20 -2
- data/lib/generators/arclight/update_generator.rb +1 -1
- data/lib/tasks/index.rake +18 -20
- data/package.json +8 -1
- data/solr/conf/schema.xml +51 -292
- data/solr/conf/solrconfig.xml +40 -125
- data/tasks/arclight.rake +1 -0
- data/vendor/assets/javascripts/responsiveTruncator.js +2 -2
- metadata +71 -44
- data/app/assets/javascripts/arclight/collection_context.js +0 -18
- data/app/assets/javascripts/arclight/component_ancestors.js +0 -56
- data/app/assets/javascripts/arclight/search_results.js +0 -15
- data/app/assets/stylesheets/arclight/modules/sidebar.scss +0 -21
- data/app/views/catalog/_collection_count.html.erb +0 -7
- data/app/views/catalog/_collection_downloads.html.erb +0 -15
- data/app/views/catalog/_collection_overview.html.erb +0 -7
- data/app/views/catalog/_component_contents.html.erb +0 -16
- data/app/views/catalog/_component_overview.html.erb +0 -40
- data/app/views/catalog/_index_header_hierarchy_default.html.erb +0 -42
- data/app/views/catalog/_index_hierarchy_default.html.erb +0 -28
- data/app/views/catalog/_results_histogram.html.erb +0 -15
- data/app/views/catalog/_show_component_sidebar.html.erb +0 -12
- data/app/views/catalog/_show_sidebar.html.erb +0 -22
- data/lib/arclight/custom_component.rb +0 -99
- data/lib/arclight/custom_document.rb +0 -93
- data/lib/arclight/indexer.rb +0 -9
- data/lib/arclight/shared_indexing_behavior.rb +0 -97
- data/lib/arclight/shared_terminology_behavior.rb +0 -65
- data/lib/arclight/solr_ead_indexer_ext.rb +0 -155
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Arclight
|
|
4
|
+
module Traject
|
|
5
|
+
# Provides a Traject Reader for XML Documents which removes the namespaces
|
|
6
|
+
class NokogiriNamespacelessReader < ::Traject::NokogiriReader
|
|
7
|
+
# Overrides the #each method (which is used for iterating through each Document)
|
|
8
|
+
# @param args
|
|
9
|
+
# @see ::Traject::NokogiriReader#each
|
|
10
|
+
# @see Enumerable#each
|
|
11
|
+
def each(*args)
|
|
12
|
+
return to_enum(:each, *args) unless block_given?
|
|
13
|
+
|
|
14
|
+
super do |doc|
|
|
15
|
+
new_doc = doc.dup
|
|
16
|
+
new_doc.remove_namespaces!
|
|
17
|
+
yield new_doc
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
data/lib/arclight/version.rb
CHANGED
data/lib/arclight/year_range.rb
CHANGED
|
@@ -25,12 +25,14 @@ module Arclight
|
|
|
25
25
|
def to_s
|
|
26
26
|
return if years.empty?
|
|
27
27
|
return to_s_for_streak(years) unless gaps?
|
|
28
|
+
|
|
28
29
|
to_s_with_gaps
|
|
29
30
|
end
|
|
30
31
|
|
|
31
32
|
# @param [Array<Integer>] `other` the set of years to add
|
|
32
33
|
def <<(other)
|
|
33
34
|
return self if other.blank?
|
|
35
|
+
|
|
34
36
|
@years |= other # will remove duplicates
|
|
35
37
|
@years.sort!
|
|
36
38
|
self
|
|
@@ -40,10 +42,12 @@ module Arclight
|
|
|
40
42
|
# @return [Array<Integer>] the set of years in the given range
|
|
41
43
|
def parse_range(dates)
|
|
42
44
|
return if dates.blank?
|
|
45
|
+
|
|
43
46
|
start_year, end_year = dates.split('/').map { |date| to_year_from_iso8601(date) }
|
|
44
47
|
return [start_year] if end_year.blank?
|
|
45
48
|
raise ArgumentError, "Range is too large: #{dates}" if (end_year - start_year) > 1000
|
|
46
49
|
raise ArgumentError, "Range is inverted: #{dates}" unless start_year <= end_year
|
|
50
|
+
|
|
47
51
|
(start_year..end_year).to_a
|
|
48
52
|
end
|
|
49
53
|
|
|
@@ -57,12 +61,14 @@ module Arclight
|
|
|
57
61
|
# YYYY, YYYY-MM, YYYY-MM-DD, and YYYYMMDD
|
|
58
62
|
def to_year_from_iso8601(date)
|
|
59
63
|
return if date.blank?
|
|
64
|
+
|
|
60
65
|
date.split('-').first[0..3].to_i # Time.parse doesn't work here
|
|
61
66
|
end
|
|
62
67
|
|
|
63
68
|
# @return [Boolean] are there gaps between the years, such as 1999, 2000, 2002?
|
|
64
69
|
def gaps?
|
|
65
70
|
return false if years.blank?
|
|
71
|
+
|
|
66
72
|
(years.min..years.max).to_a != years
|
|
67
73
|
end
|
|
68
74
|
|
|
@@ -73,6 +79,7 @@ module Arclight
|
|
|
73
79
|
# @return [String] 1999-2000, 2002 for 1999, 2000, 2002
|
|
74
80
|
def to_s_with_gaps # rubocop: disable Metrics/AbcSize, Metrics/MethodLength
|
|
75
81
|
raise ArgumentError if years.blank? || years.length < 2
|
|
82
|
+
|
|
76
83
|
results = []
|
|
77
84
|
streak = [years[0]]
|
|
78
85
|
i = streak.first
|
|
@@ -96,7 +103,8 @@ module Arclight
|
|
|
96
103
|
|
|
97
104
|
def to_s_for_streak(streak)
|
|
98
105
|
return streak.min.to_s if streak.min == streak.max
|
|
99
|
-
|
|
106
|
+
|
|
107
|
+
streak.minmax.map(&:to_s).join('-')
|
|
100
108
|
end
|
|
101
109
|
end
|
|
102
110
|
end
|
|
@@ -6,7 +6,7 @@ module Arclight
|
|
|
6
6
|
##
|
|
7
7
|
# Arclight install generator
|
|
8
8
|
class Install < Rails::Generators::Base
|
|
9
|
-
source_root File.expand_path('
|
|
9
|
+
source_root File.expand_path('templates', __dir__)
|
|
10
10
|
|
|
11
11
|
def create_blacklight_catalog
|
|
12
12
|
remove_file 'app/controllers/catalog_controller.rb'
|
|
@@ -69,5 +69,9 @@ module Arclight
|
|
|
69
69
|
def modify_blacklight_yml
|
|
70
70
|
gsub_file 'config/locales/blacklight.en.yml', "application_name: 'Blacklight'", "application_name: 'Arclight'"
|
|
71
71
|
end
|
|
72
|
+
|
|
73
|
+
def run_yarn
|
|
74
|
+
run 'yarn add @babel/core @babel/plugin-external-helpers @babel/plugin-transform-modules-umd @babel/preset-env'
|
|
75
|
+
end
|
|
72
76
|
end
|
|
73
77
|
end
|
|
@@ -108,9 +108,9 @@ class CatalogController < ApplicationController
|
|
|
108
108
|
config.add_index_field 'normalized_date_ssm', label: 'Date'
|
|
109
109
|
config.add_index_field 'creator_ssm', label: 'Creator'
|
|
110
110
|
config.add_index_field 'language_ssm', label: 'Language'
|
|
111
|
-
config.add_index_field 'scopecontent_ssm', label: 'Scope Content'
|
|
111
|
+
config.add_index_field 'scopecontent_ssm', label: 'Scope Content', helper_method: :render_html_tags
|
|
112
112
|
config.add_index_field 'extent_ssm', label: 'Physical Description'
|
|
113
|
-
config.add_index_field 'accessrestrict_ssm', label: 'Conditions Governing Access'
|
|
113
|
+
config.add_index_field 'accessrestrict_ssm', label: 'Conditions Governing Access', helper_method: :render_html_tags
|
|
114
114
|
config.add_index_field 'collection_ssm', label: 'Collection Title'
|
|
115
115
|
config.add_index_field 'geogname_ssm', label: 'Place'
|
|
116
116
|
|
|
@@ -155,16 +155,32 @@ class CatalogController < ApplicationController
|
|
|
155
155
|
field.qt = 'search' # default
|
|
156
156
|
end
|
|
157
157
|
config.add_search_field 'name', label: 'Name' do |field|
|
|
158
|
-
field.qt = '
|
|
158
|
+
field.qt = 'search'
|
|
159
|
+
field.solr_parameters = {
|
|
160
|
+
qf: '${qf_name}',
|
|
161
|
+
pf: '${pf_name}'
|
|
162
|
+
}
|
|
159
163
|
end
|
|
160
164
|
config.add_search_field 'place', label: 'Place' do |field|
|
|
161
|
-
field.qt = '
|
|
165
|
+
field.qt = 'search'
|
|
166
|
+
field.solr_parameters = {
|
|
167
|
+
qf: '${qf_place}',
|
|
168
|
+
pf: '${pf_place}'
|
|
169
|
+
}
|
|
162
170
|
end
|
|
163
171
|
config.add_search_field 'subject', label: 'Subject' do |field|
|
|
164
|
-
field.qt = '
|
|
172
|
+
field.qt = 'search'
|
|
173
|
+
field.solr_parameters = {
|
|
174
|
+
qf: '${qf_subject}',
|
|
175
|
+
pf: '${pf_subject}'
|
|
176
|
+
}
|
|
165
177
|
end
|
|
166
178
|
config.add_search_field 'title', label: 'Title' do |field|
|
|
167
|
-
field.qt = '
|
|
179
|
+
field.qt = 'search'
|
|
180
|
+
field.solr_parameters = {
|
|
181
|
+
qf: '${qf_title}',
|
|
182
|
+
pf: '${pf_title}'
|
|
183
|
+
}
|
|
168
184
|
end
|
|
169
185
|
|
|
170
186
|
# "sort results by" select (pulldown)
|
|
@@ -192,11 +208,17 @@ class CatalogController < ApplicationController
|
|
|
192
208
|
|
|
193
209
|
config.show.document_presenter_class = Arclight::ShowPresenter
|
|
194
210
|
config.index.document_presenter_class = Arclight::IndexPresenter
|
|
211
|
+
|
|
195
212
|
##
|
|
196
213
|
# Configuration for partials
|
|
197
|
-
config.index.partials
|
|
198
|
-
|
|
199
|
-
|
|
214
|
+
config.index.partials = %i[arclight_index_default]
|
|
215
|
+
|
|
216
|
+
##
|
|
217
|
+
# Configuration for index actions
|
|
218
|
+
config.index.document_actions << :containers
|
|
219
|
+
config.index.document_actions << :online_content_label
|
|
220
|
+
config.add_results_document_tool :arclight_bookmark_control, partial: 'arclight_bookmark_control'
|
|
221
|
+
config.index.document_actions.delete(:bookmark)
|
|
200
222
|
|
|
201
223
|
config.show.metadata_partials = %i[
|
|
202
224
|
summary_field
|
|
@@ -206,10 +228,11 @@ class CatalogController < ApplicationController
|
|
|
206
228
|
indexed_terms_field
|
|
207
229
|
]
|
|
208
230
|
|
|
209
|
-
config.show.
|
|
210
|
-
in_person_field
|
|
231
|
+
config.show.context_access_tab_items = %i[
|
|
211
232
|
terms_field
|
|
212
233
|
cite_field
|
|
234
|
+
in_person_field
|
|
235
|
+
contact_field
|
|
213
236
|
]
|
|
214
237
|
|
|
215
238
|
config.show.component_metadata_partials = %i[
|
|
@@ -217,116 +240,129 @@ class CatalogController < ApplicationController
|
|
|
217
240
|
component_indexed_terms_field
|
|
218
241
|
]
|
|
219
242
|
|
|
220
|
-
config.show.
|
|
221
|
-
in_person_field
|
|
243
|
+
config.show.component_access_tab_items = %i[
|
|
222
244
|
component_terms_field
|
|
223
245
|
cite_field
|
|
246
|
+
in_person_field
|
|
247
|
+
contact_field
|
|
224
248
|
]
|
|
225
249
|
|
|
226
|
-
#
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
config.
|
|
235
|
-
config.
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
config.
|
|
239
|
-
config.
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
250
|
+
# ===========================
|
|
251
|
+
# COLLECTION SHOW PAGE FIELDS
|
|
252
|
+
# ===========================
|
|
253
|
+
|
|
254
|
+
# Collection Show Page - Summary Section
|
|
255
|
+
config.add_summary_field 'creators_ssim', label: 'Creator', link_to_facet: true
|
|
256
|
+
config.add_summary_field 'abstract_ssm', label: 'Abstract', helper_method: :render_html_tags
|
|
257
|
+
config.add_summary_field 'extent_ssm', label: 'Extent'
|
|
258
|
+
config.add_summary_field 'language_ssm', label: 'Language'
|
|
259
|
+
config.add_summary_field 'prefercite_ssm', label: 'Preferred citation', helper_method: :render_html_tags
|
|
260
|
+
|
|
261
|
+
# Collection Show Page - Background Section
|
|
262
|
+
config.add_background_field 'scopecontent_ssm', label: 'Scope and Content', helper_method: :render_html_tags
|
|
263
|
+
config.add_background_field 'bioghist_ssm', label: 'Biographical / Historical', helper_method: :render_html_tags
|
|
264
|
+
config.add_background_field 'acqinfo_ssim', label: 'Acquisition information', helper_method: :render_html_tags
|
|
265
|
+
config.add_background_field 'appraisal_ssm', label: 'Appraisal information', helper_method: :render_html_tags
|
|
266
|
+
config.add_background_field 'custodhist_ssm', label: 'Custodial history', helper_method: :render_html_tags
|
|
267
|
+
config.add_background_field 'processinfo_ssm', label: 'Processing information', helper_method: :render_html_tags
|
|
268
|
+
config.add_background_field 'arrangement_ssm', label: 'Arrangement', helper_method: :render_html_tags
|
|
269
|
+
config.add_background_field 'accruals_ssm', label: 'Accruals', helper_method: :render_html_tags
|
|
270
|
+
config.add_background_field 'phystech_ssm', label: 'Physical / technical requirements', helper_method: :render_html_tags
|
|
271
|
+
config.add_background_field 'physloc_ssm', label: 'Physical location', helper_method: :render_html_tags
|
|
272
|
+
config.add_background_field 'descrules_ssm', label: 'Rules or conventions', helper_method: :render_html_tags
|
|
273
|
+
|
|
274
|
+
# Collection Show Page - Related Section
|
|
275
|
+
config.add_related_field 'relatedmaterial_ssm', label: 'Related material', helper_method: :render_html_tags
|
|
276
|
+
config.add_related_field 'separatedmaterial_ssm', label: 'Separated material', helper_method: :render_html_tags
|
|
277
|
+
config.add_related_field 'otherfindaid_ssm', label: 'Other finding aids', helper_method: :render_html_tags
|
|
278
|
+
config.add_related_field 'altformavail_ssm', label: 'Alternative form available', helper_method: :render_html_tags
|
|
279
|
+
config.add_related_field 'originalsloc_ssm', label: 'Location of originals', helper_method: :render_html_tags
|
|
244
280
|
|
|
245
281
|
# Collection Show Page - Indexed Terms Section
|
|
246
|
-
config.
|
|
282
|
+
config.add_indexed_terms_field 'access_subjects_ssim', label: 'Subjects', link_to_facet: true, separator_options: {
|
|
247
283
|
words_connector: '<br/>',
|
|
248
284
|
two_words_connector: '<br/>',
|
|
249
285
|
last_word_connector: '<br/>'
|
|
250
286
|
}
|
|
251
287
|
|
|
252
|
-
config.
|
|
288
|
+
config.add_indexed_terms_field 'names_coll_ssim', label: 'Names', separator_options: {
|
|
253
289
|
words_connector: '<br/>',
|
|
254
290
|
two_words_connector: '<br/>',
|
|
255
291
|
last_word_connector: '<br/>'
|
|
256
292
|
}, helper_method: :link_to_name_facet
|
|
257
293
|
|
|
258
|
-
config.
|
|
294
|
+
config.add_indexed_terms_field 'places_ssim', label: 'Places', link_to_facet: true, separator_options: {
|
|
259
295
|
words_connector: '<br/>',
|
|
260
296
|
two_words_connector: '<br/>',
|
|
261
297
|
last_word_connector: '<br/>'
|
|
262
298
|
}
|
|
263
299
|
|
|
264
|
-
#
|
|
265
|
-
|
|
266
|
-
|
|
300
|
+
# ==========================
|
|
301
|
+
# COMPONENT SHOW PAGE FIELDS
|
|
302
|
+
# ==========================
|
|
267
303
|
|
|
268
|
-
#
|
|
269
|
-
config.
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
config.
|
|
277
|
-
config.
|
|
278
|
-
config.
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
config.
|
|
282
|
-
config.
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
config.
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
config.
|
|
290
|
-
|
|
291
|
-
# Collection Show Page - Background Section
|
|
292
|
-
config.add_background_field 'scopecontent_ssm', label: 'Scope and Content', helper_method: :paragraph_separator
|
|
293
|
-
config.add_background_field 'bioghist_ssm', label: 'Biographical / Historical', helper_method: :paragraph_separator
|
|
294
|
-
config.add_background_field 'acqinfo_ssm', label: 'Acquisition information', helper_method: :paragraph_separator
|
|
295
|
-
config.add_background_field 'appraisal_ssm', label: 'Appraisal information', helper_method: :paragraph_separator
|
|
296
|
-
config.add_background_field 'custodhist_ssm', label: 'Custodial history', helper_method: :paragraph_separator
|
|
297
|
-
config.add_background_field 'processinfo_ssm', label: 'Processing information', helper_method: :paragraph_separator
|
|
298
|
-
|
|
299
|
-
# Collection Show Page - Related Section
|
|
300
|
-
config.add_related_field 'relatedmaterial_ssm', label: 'Related material', helper_method: :paragraph_separator
|
|
301
|
-
config.add_related_field 'separatedmaterial_ssm', label: 'Separated material', helper_method: :paragraph_separator
|
|
302
|
-
config.add_related_field 'otherfindaid_ssm', label: 'Other finding aids', helper_method: :paragraph_separator
|
|
303
|
-
config.add_related_field 'altformavail_ssm', label: 'Alternative form available', helper_method: :paragraph_separator
|
|
304
|
-
config.add_related_field 'originalsloc_ssm', label: 'Location of originals', helper_method: :paragraph_separator
|
|
305
|
-
|
|
306
|
-
# Collection Show Page - Indexed Terms Section
|
|
307
|
-
config.add_indexed_terms_field 'access_subjects_ssim', label: 'Subjects', link_to_facet: true, separator_options: {
|
|
304
|
+
# Component Show Page - Metadata Section
|
|
305
|
+
config.add_component_field 'containers', label: 'Containers', accessor: 'containers', separator_options: {
|
|
306
|
+
words_connector: ', ',
|
|
307
|
+
two_words_connector: ', ',
|
|
308
|
+
last_word_connector: ', '
|
|
309
|
+
}, if: lambda { |_context, _field_config, document|
|
|
310
|
+
document.containers.present?
|
|
311
|
+
}
|
|
312
|
+
config.add_component_field 'abstract_ssm', label: 'Abstract', helper_method: :render_html_tags
|
|
313
|
+
config.add_component_field 'extent_ssm', label: 'Extent'
|
|
314
|
+
config.add_component_field 'scopecontent_ssm', label: 'Scope and Content', helper_method: :render_html_tags
|
|
315
|
+
config.add_component_field 'acqinfo_ssim', label: 'Acquisition information', helper_method: :render_html_tags
|
|
316
|
+
config.add_component_field 'appraisal_ssm', label: 'Appraisal information', helper_method: :render_html_tags
|
|
317
|
+
config.add_component_field 'custodhist_ssm', label: 'Custodial history', helper_method: :render_html_tags
|
|
318
|
+
config.add_component_field 'processinfo_ssm', label: 'Processing information', helper_method: :render_html_tags
|
|
319
|
+
config.add_component_field 'arrangement_ssm', label: 'Arrangement', helper_method: :render_html_tags
|
|
320
|
+
config.add_component_field 'accruals_ssm', label: 'Accruals', helper_method: :render_html_tags
|
|
321
|
+
config.add_component_field 'phystech_ssm', label: 'Physical / technical requirements', helper_method: :render_html_tags
|
|
322
|
+
config.add_component_field 'physloc_ssm', label: 'Physical location', helper_method: :render_html_tags
|
|
323
|
+
|
|
324
|
+
# Component Show Page - Indexed Terms Section
|
|
325
|
+
config.add_component_indexed_terms_field 'access_subjects_ssim', label: 'Subjects', link_to_facet: true, separator_options: {
|
|
308
326
|
words_connector: '<br/>',
|
|
309
327
|
two_words_connector: '<br/>',
|
|
310
328
|
last_word_connector: '<br/>'
|
|
311
329
|
}
|
|
312
330
|
|
|
313
|
-
config.
|
|
331
|
+
config.add_component_indexed_terms_field 'names_ssim', label: 'Names', separator_options: {
|
|
314
332
|
words_connector: '<br/>',
|
|
315
333
|
two_words_connector: '<br/>',
|
|
316
334
|
last_word_connector: '<br/>'
|
|
317
335
|
}, helper_method: :link_to_name_facet
|
|
318
336
|
|
|
319
|
-
config.
|
|
337
|
+
config.add_component_indexed_terms_field 'places_ssim', label: 'Places', link_to_facet: true, separator_options: {
|
|
320
338
|
words_connector: '<br/>',
|
|
321
339
|
two_words_connector: '<br/>',
|
|
322
340
|
last_word_connector: '<br/>'
|
|
323
341
|
}
|
|
324
342
|
|
|
325
|
-
#
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
343
|
+
# =================
|
|
344
|
+
# ACCESS TAB FIELDS
|
|
345
|
+
# =================
|
|
346
|
+
|
|
347
|
+
# Collection Show Page Access Tab - Terms and Conditions Section
|
|
348
|
+
config.add_terms_field 'accessrestrict_ssm', label: 'Restrictions', helper_method: :render_html_tags
|
|
349
|
+
config.add_terms_field 'userestrict_ssm', label: 'Terms of Access', helper_method: :render_html_tags
|
|
350
|
+
|
|
351
|
+
# Component Show Page Access Tab - Terms and Condition Section
|
|
352
|
+
config.add_component_terms_field 'accessrestrict_ssm', label: 'Restrictions', helper_method: :render_html_tags
|
|
353
|
+
config.add_component_terms_field 'userestrict_ssm', label: 'Terms of Access', helper_method: :render_html_tags
|
|
354
|
+
config.add_component_terms_field 'parent_access_restrict_ssm', label: 'Parent Restrictions', helper_method: :render_html_tags
|
|
355
|
+
config.add_component_terms_field 'parent_access_terms_ssm', label: 'Parent Terms of Access', helper_method: :render_html_tags
|
|
356
|
+
|
|
357
|
+
# Collection and Component Show Page Access Tab - In Person Section
|
|
358
|
+
config.add_in_person_field 'repository_ssm', if: :repository_config_present, label: 'Location of this collection', helper_method: :context_access_tab_repository
|
|
359
|
+
config.add_in_person_field 'id', if: :before_you_visit_note_present, label: 'Before you visit', helper_method: :context_access_tab_visit_note # Using ID because we know it will always exist
|
|
360
|
+
|
|
361
|
+
# Collection and Component Show Page Access Tab - How to Cite Section
|
|
362
|
+
config.add_cite_field 'prefercite_ssm', label: 'Preferred citation', helper_method: :render_html_tags
|
|
363
|
+
|
|
364
|
+
# Collection and Component Show Page Access Tab - Contact Section
|
|
365
|
+
config.add_contact_field 'repository_ssm', if: :repository_config_present, label: 'Contact', helper_method: :access_repository_contact
|
|
330
366
|
|
|
331
367
|
# Remove unused show document actions
|
|
332
368
|
%i[citation email sms].each do |action|
|
|
@@ -338,28 +374,20 @@ class CatalogController < ApplicationController
|
|
|
338
374
|
config.show.partials.unshift(:show_breadcrumbs)
|
|
339
375
|
config.show.partials.delete(:show_header)
|
|
340
376
|
|
|
341
|
-
|
|
342
|
-
##
|
|
343
|
-
# Hierarchy Index View
|
|
344
|
-
config.view.hierarchy
|
|
345
|
-
config.view.hierarchy.display_control = false
|
|
346
|
-
config.view.hierarchy.partials = config.index.partials.dup
|
|
347
|
-
config.view.hierarchy.partials.delete(:index_breadcrumb)
|
|
348
|
-
config.view.hierarchy.partials.delete(:arclight_online_content_indicator)
|
|
349
|
-
|
|
350
377
|
##
|
|
351
|
-
#
|
|
378
|
+
# Online Contents Index View
|
|
352
379
|
config.view.online_contents
|
|
353
380
|
config.view.online_contents.display_control = false
|
|
354
|
-
config.view.online_contents.partials = config.view.hierarchy.partials.dup
|
|
355
381
|
|
|
356
|
-
|
|
382
|
+
##
|
|
383
|
+
# Collection Context
|
|
384
|
+
config.view.collection_context
|
|
385
|
+
config.view.collection_context.display_control = false
|
|
386
|
+
config.view.collection_context.partials = %i[index_collection_context]
|
|
387
|
+
|
|
388
|
+
##
|
|
357
389
|
# Compact index view
|
|
358
390
|
config.view.compact
|
|
359
391
|
config.view.compact.partials = %i[arclight_index_compact]
|
|
360
|
-
|
|
361
|
-
##
|
|
362
|
-
# Extra actions
|
|
363
|
-
config.add_results_document_tool :google_form, partial: 'arclight/requests/google_form', if: :item_requestable?
|
|
364
392
|
end
|
|
365
393
|
end
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
# provide the PDF and/or EAD (.xml) links. The
|
|
4
4
|
# size value should be a String (shown as-is) or
|
|
5
5
|
# the number of bytes in the download.
|
|
6
|
+
# - Pass a template key to use a formatted string
|
|
7
|
+
# which interpolates document accessors into the
|
|
8
|
+
# url using the %{accessor} syntax.
|
|
9
|
+
# - Pass a size_accessor key to pull the size of
|
|
10
|
+
# the file from an accessor in the solr document
|
|
6
11
|
#
|
|
7
12
|
sample_unitid:
|
|
8
13
|
pdf:
|
|
@@ -11,3 +16,10 @@ sample_unitid:
|
|
|
11
16
|
ead:
|
|
12
17
|
href: 'http://example.com/sample.xml'
|
|
13
18
|
size: 123456
|
|
19
|
+
# size_accessor: 'level'
|
|
20
|
+
default:
|
|
21
|
+
disabled: true
|
|
22
|
+
pdf:
|
|
23
|
+
template: 'http://example.com/%{unitid}.pdf'
|
|
24
|
+
ead:
|
|
25
|
+
template: 'http://example.com/%{unitid}.xml'
|