arclight 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/.all-contributorsrc +450 -0
  3. data/.babelrc +3 -0
  4. data/.codeclimate.yml +5 -0
  5. data/.eslintrc +3 -0
  6. data/.rubocop.yml +19 -0
  7. data/.rubocop_todo.yml +15 -135
  8. data/.travis.yml +2 -2
  9. data/CONTRIBUTORS.md +79 -0
  10. data/README.md +21 -24
  11. data/Rakefile +0 -1
  12. data/app/assets/images/blacklight/bookmark.svg +1 -0
  13. data/app/assets/images/blacklight/collection.svg +5 -0
  14. data/app/assets/images/blacklight/compact.svg +1 -25
  15. data/app/assets/images/blacklight/container.svg +5 -0
  16. data/app/assets/images/blacklight/ead.svg +1 -0
  17. data/app/assets/images/blacklight/file.svg +5 -0
  18. data/app/assets/images/blacklight/folder.svg +1 -0
  19. data/app/assets/images/blacklight/list.svg +1 -0
  20. data/app/assets/images/blacklight/minus.svg +1 -0
  21. data/app/assets/images/blacklight/online.svg +5 -0
  22. data/app/assets/images/blacklight/pdf.svg +1 -0
  23. data/app/assets/images/blacklight/plus.svg +1 -0
  24. data/app/assets/images/blacklight/repository.svg +1 -0
  25. data/app/assets/javascripts/arclight/arclight.js +1 -3
  26. data/app/assets/javascripts/arclight/collection_navigation.js +36 -53
  27. data/app/assets/javascripts/arclight/collection_scrollspy.js +1 -1
  28. data/app/assets/javascripts/arclight/context_navigation.js +374 -0
  29. data/app/assets/javascripts/arclight/truncator.js.erb +8 -2
  30. data/app/assets/stylesheets/arclight/application.scss +3 -1
  31. data/app/assets/stylesheets/arclight/bootstrap_overrides.scss +23 -0
  32. data/app/assets/stylesheets/arclight/modules/context_navigation.scss +75 -0
  33. data/app/assets/stylesheets/arclight/modules/hierarchy_and_online_contents.scss +28 -35
  34. data/app/assets/stylesheets/arclight/modules/highlights.scss +2 -1
  35. data/app/assets/stylesheets/arclight/modules/layout.scss +128 -14
  36. data/app/assets/stylesheets/arclight/modules/mastheads.scss +27 -5
  37. data/app/assets/stylesheets/arclight/modules/repositories.scss +1 -5
  38. data/app/assets/stylesheets/arclight/modules/repository_card.scss +6 -7
  39. data/app/assets/stylesheets/arclight/modules/search_results.scss +145 -24
  40. data/app/assets/stylesheets/arclight/modules/show_collection.scss +38 -59
  41. data/app/assets/stylesheets/arclight/responsive.scss +13 -0
  42. data/app/assets/stylesheets/arclight/variables.scss +21 -1
  43. data/app/controllers/concerns/arclight/ead_format_helpers.rb +225 -0
  44. data/app/controllers/concerns/arclight/field_config_helpers.rb +23 -7
  45. data/app/factories/blacklight_field_configuration_factory.rb +1 -0
  46. data/app/helpers/arclight_helper.rb +197 -35
  47. data/app/models/arclight/document_downloads.rb +125 -0
  48. data/app/models/arclight/parent.rb +4 -2
  49. data/app/models/arclight/parents.rb +6 -4
  50. data/app/models/arclight/requests/aeon_external_request.rb +42 -0
  51. data/app/models/arclight/requests/aeon_web_ead.rb +47 -0
  52. data/app/models/arclight/requests/google_form.rb +2 -2
  53. data/app/models/concerns/arclight/catalog.rb +14 -2
  54. data/app/models/concerns/arclight/search_behavior.rb +27 -12
  55. data/app/models/concerns/arclight/solr_document.rb +29 -7
  56. data/app/views/arclight/_requests.html.erb +7 -0
  57. data/app/views/arclight/repositories/_in_person_repository.html.erb +1 -1
  58. data/app/views/arclight/repositories/_repository.html.erb +2 -2
  59. data/app/views/arclight/repositories/_repository_contact.html.erb +9 -0
  60. data/app/views/arclight/repositories/index.html.erb +3 -0
  61. data/app/views/arclight/repositories/show.html.erb +5 -4
  62. data/app/views/arclight/requests/_aeon_external_request_endpoint.html.erb +9 -0
  63. data/app/views/arclight/requests/_aeon_web_ead.html.erb +7 -0
  64. data/app/views/arclight/requests/_google_form.html.erb +2 -1
  65. data/app/views/arclight/viewers/_oembed.html.erb +2 -1
  66. data/app/views/catalog/_access_contents.html.erb +15 -0
  67. data/app/views/catalog/_arclight_abstract_or_scope.html.erb +5 -0
  68. data/app/views/catalog/_arclight_bookmark_control.html.erb +38 -0
  69. data/app/views/catalog/_arclight_document_header_icon.html.erb +1 -0
  70. data/app/views/catalog/_arclight_index_compact_default.html.erb +18 -11
  71. data/app/views/catalog/_arclight_index_default.html.erb +45 -0
  72. data/app/views/catalog/_arclight_index_group_document_compact_default.html.erb +19 -0
  73. data/app/views/catalog/_arclight_index_group_document_default.html.erb +18 -0
  74. data/app/views/catalog/_arclight_online_content_indicator.html.erb +1 -3
  75. data/app/views/catalog/_collection_contents.html.erb +2 -10
  76. data/app/views/catalog/_collection_context.html.erb +15 -0
  77. data/app/views/catalog/_collection_context_nav.html.erb +12 -0
  78. data/app/views/catalog/_collection_online_contents.html.erb +3 -3
  79. data/app/views/catalog/_component_context.html.erb +5 -0
  80. data/app/views/catalog/_containers.html.erb +3 -0
  81. data/app/views/catalog/_context_sidebar.html.erb +2 -2
  82. data/app/views/catalog/_document_downloads.html.erb +14 -0
  83. data/app/views/catalog/_group.html.erb +21 -0
  84. data/app/views/catalog/_group_header_compact_default.html.erb +15 -0
  85. data/app/views/catalog/_group_header_default.html.erb +20 -0
  86. data/app/views/catalog/_group_toggle.html.erb +10 -0
  87. data/app/views/catalog/_home.html.erb +1 -1
  88. data/app/views/catalog/_index_breadcrumb_default.html.erb +5 -2
  89. data/app/views/catalog/_index_collection_context_default.html.erb +53 -0
  90. data/app/views/catalog/_index_header.html.erb +3 -3
  91. data/app/views/catalog/_index_online_contents_default.html.erb +1 -1
  92. data/app/views/catalog/_online_content_label.html.erb +5 -0
  93. data/app/views/catalog/_search_form.html.erb +34 -0
  94. data/app/views/catalog/_search_results.html.erb +1 -4
  95. data/app/views/catalog/_show_actions_box_default.html.erb +27 -0
  96. data/app/views/catalog/_show_breadcrumbs_default.html.erb +5 -20
  97. data/app/views/catalog/_show_collection.html.erb +42 -24
  98. data/app/views/catalog/_show_default.html.erb +63 -35
  99. data/app/views/catalog/_show_upper_metadata_default.html.erb +1 -1
  100. data/app/views/catalog/_sort_and_per_page.html.erb +8 -0
  101. data/app/views/catalog/_within_collection_dropdown.html.erb +26 -0
  102. data/app/views/shared/_breadcrumbs.html.erb +4 -4
  103. data/app/views/shared/_context_sidebar.html.erb +2 -2
  104. data/app/views/shared/_header_navbar.html.erb +13 -17
  105. data/app/views/shared/_show_breadcrumbs.html.erb +27 -0
  106. data/arclight.gemspec +5 -6
  107. data/config/i18n-tasks.yml +2 -1
  108. data/config/locales/arclight.en.yml +54 -21
  109. data/config/repositories.yml +0 -0
  110. data/lib/arclight/engine.rb +22 -12
  111. data/lib/arclight/hash_absolute_xpath.rb +11 -7
  112. data/lib/arclight/level_label.rb +46 -0
  113. data/lib/arclight/normalized_date.rb +2 -2
  114. data/lib/arclight/normalized_id.rb +1 -0
  115. data/lib/arclight/normalized_title.rb +1 -0
  116. data/lib/arclight/repository.rb +58 -5
  117. data/lib/arclight/traject/ead2_config.rb +178 -159
  118. data/lib/arclight/traject/nokogiri_namespaceless_reader.rb +22 -0
  119. data/lib/arclight/version.rb +1 -1
  120. data/lib/arclight/viewers/oembed.rb +1 -0
  121. data/lib/arclight/year_range.rb +9 -1
  122. data/lib/generators/arclight/install_generator.rb +5 -1
  123. data/lib/generators/arclight/templates/catalog_controller.rb +128 -100
  124. data/lib/generators/arclight/templates/config/downloads.yml +12 -0
  125. data/lib/generators/arclight/templates/config/repositories.yml +20 -2
  126. data/lib/generators/arclight/update_generator.rb +1 -1
  127. data/lib/tasks/index.rake +18 -20
  128. data/package.json +8 -1
  129. data/solr/conf/schema.xml +51 -292
  130. data/solr/conf/solrconfig.xml +40 -125
  131. data/tasks/arclight.rake +1 -0
  132. data/vendor/assets/javascripts/responsiveTruncator.js +2 -2
  133. metadata +71 -44
  134. data/app/assets/javascripts/arclight/collection_context.js +0 -18
  135. data/app/assets/javascripts/arclight/component_ancestors.js +0 -56
  136. data/app/assets/javascripts/arclight/search_results.js +0 -15
  137. data/app/assets/stylesheets/arclight/modules/sidebar.scss +0 -21
  138. data/app/views/catalog/_collection_count.html.erb +0 -7
  139. data/app/views/catalog/_collection_downloads.html.erb +0 -15
  140. data/app/views/catalog/_collection_overview.html.erb +0 -7
  141. data/app/views/catalog/_component_contents.html.erb +0 -16
  142. data/app/views/catalog/_component_overview.html.erb +0 -40
  143. data/app/views/catalog/_index_header_hierarchy_default.html.erb +0 -42
  144. data/app/views/catalog/_index_hierarchy_default.html.erb +0 -28
  145. data/app/views/catalog/_results_histogram.html.erb +0 -15
  146. data/app/views/catalog/_show_component_sidebar.html.erb +0 -12
  147. data/app/views/catalog/_show_sidebar.html.erb +0 -22
  148. data/lib/arclight/custom_component.rb +0 -99
  149. data/lib/arclight/custom_document.rb +0 -93
  150. data/lib/arclight/indexer.rb +0 -9
  151. data/lib/arclight/shared_indexing_behavior.rb +0 -97
  152. data/lib/arclight/shared_terminology_behavior.rb +0 -65
  153. 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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Arclight
4
- VERSION = '0.2.0'
4
+ VERSION = '0.3.0'
5
5
  end
@@ -31,6 +31,7 @@ module Arclight
31
31
 
32
32
  def attributes_for(resource)
33
33
  return {} unless embeddable?(resource)
34
+
34
35
  { class: 'al-oembed-viewer', 'data-arclight-oembed': true, 'data-arclight-oembed-url': resource.href }
35
36
  end
36
37
 
@@ -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
- [streak.min, streak.max].map(&:to_s).join('-')
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('../templates', __FILE__)
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 = 'name_search'
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 = 'place_search'
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 = 'subject_search'
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 = 'title_search'
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.insert(0, :arclight_online_content_indicator)
198
- config.index.partials.insert(0, :index_breadcrumb)
199
- config.index.partials.insert(0, :arclight_document_index_header)
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.context_sidebar_items = %i[
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.component_sidebar_items = %i[
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
- # Component Show Page - Metadata Section
227
- config.add_component_field 'containers', label: 'Containers', accessor: 'containers', separator_options: {
228
- words_connector: ', ',
229
- two_words_connector: ', ',
230
- last_word_connector: ', '
231
- }, if: lambda { |_context, _field_config, document|
232
- document.containers.present?
233
- }
234
- config.add_component_field 'abstract_ssm', label: 'Abstract'
235
- config.add_component_field 'extent_ssm', label: 'Extent'
236
- config.add_component_field 'scopecontent_ssm', label: 'Scope and Content'
237
- config.add_component_field 'accessrestrict_ssm', label: 'Restrictions'
238
- config.add_component_field 'userestrict_ssm', label: 'Terms of Access'
239
- config.add_component_field 'access_subjects_ssm', label: 'Subjects', separator_options: {
240
- words_connector: '<br/>',
241
- two_words_connector: '<br/>',
242
- last_word_connector: '<br/>'
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.add_component_indexed_terms_field 'access_subjects_ssim', label: 'Subjects', link_to_facet: true, separator_options: {
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.add_component_indexed_terms_field 'names_ssim', label: 'Names', separator_options: {
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.add_component_indexed_terms_field 'places_ssim', label: 'Places', link_to_facet: true, separator_options: {
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
- # Component Show Page Sidebar - Terms and Condition Section
265
- config.add_component_terms_field 'parent_access_restrict_ssm', label: 'Restrictions'
266
- config.add_component_terms_field 'parent_access_terms_ssm', label: 'Terms of Access'
300
+ # ==========================
301
+ # COMPONENT SHOW PAGE FIELDS
302
+ # ==========================
267
303
 
268
- # Collection Show Page - Summary Section
269
- config.add_summary_field 'creators_ssim', label: 'Creator', link_to_facet: true
270
- config.add_summary_field 'abstract_ssm', label: 'Abstract'
271
- config.add_summary_field 'extent_ssm', label: 'Extent'
272
- config.add_summary_field 'language_ssm', label: 'Language'
273
- config.add_summary_field 'prefercite_ssm', label: 'Preferred citation'
274
-
275
- # Collection Show Page - In Person Section
276
- config.add_in_person_field 'id', if: :before_you_visit_note_present, label: 'Before you visit', helper_method: :context_sidebar_visit_note # Using ID because we know it will always exist
277
- config.add_in_person_field 'containers_ssim', if: :request_config_present, label: 'Request', helper_method: :context_sidebar_containers_request
278
- config.add_in_person_field 'repository_ssm', if: :repository_config_present, label: 'Location of this collection', helper_method: :context_sidebar_repository
279
-
280
- # Collection Show Page - Terms and Condition Section
281
- config.add_terms_field 'accessrestrict_ssm', label: 'Restrictions'
282
- config.add_terms_field 'userestrict_ssm', label: 'Terms of Access'
283
-
284
- # Collection Show Page - How to Cite Section
285
- config.add_cite_field 'prefercite_ssm', label: 'Preferred citation'
286
-
287
- # Collection Show Page - Access Section
288
- config.add_access_field 'accessrestrict_ssm', label: 'Conditions Governing Access', helper_method: :paragraph_separator
289
- config.add_access_field 'userestrict_ssm', label: 'Terms Of Use', helper_method: :paragraph_separator
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.add_indexed_terms_field 'names_coll_ssim', label: 'Names', separator_options: {
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.add_indexed_terms_field 'places_ssim', label: 'Places', link_to_facet: true, separator_options: {
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
- # Collection Show Page - Administrative Information Section
326
- config.add_admin_info_field 'acqinfo_ssm', label: 'Acquisition information'
327
- config.add_admin_info_field 'appraisal_ssm', label: 'Appraisal information'
328
- config.add_admin_info_field 'custodhist_ssm', label: 'Custodial history'
329
- config.add_admin_info_field 'processinfo_ssm', label: 'Processing information'
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
- # Hierarchy Index View
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'