arclight 0.1.4 → 0.3.3
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 +5 -5
- data/.all-contributorsrc +450 -0
- data/.babelrc +3 -0
- data/.codeclimate.yml +5 -0
- data/.eslintrc +3 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +20 -42
- data/.rubocop_todo.yml +139 -0
- data/.travis.yml +24 -20
- data/CONTRIBUTORS.md +79 -0
- data/README.md +34 -23
- 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 -2
- data/app/assets/javascripts/arclight/collection_navigation.js +36 -50
- data/app/assets/javascripts/arclight/collection_scrollspy.js +1 -1
- data/app/assets/javascripts/arclight/context_navigation.js +386 -0
- data/app/assets/javascripts/arclight/oembed_viewer.js +11 -4
- data/app/assets/javascripts/arclight/truncator.js.erb +8 -2
- data/app/assets/stylesheets/arclight/application.scss +4 -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 +34 -38
- data/app/assets/stylesheets/arclight/modules/highlights.scss +2 -1
- data/app/assets/stylesheets/arclight/modules/icons.scss +4 -0
- data/app/assets/stylesheets/arclight/modules/layout.scss +149 -11
- data/app/assets/stylesheets/arclight/modules/mastheads.scss +60 -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 +198 -36
- 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 +2 -2
- 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_card.html.erb +1 -1
- data/app/views/catalog/_context_sidebar.html.erb +2 -2
- data/app/views/catalog/_custom_metadata.html.erb +1 -1
- 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_default.html.erb +1 -1
- 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 -6
- data/app/views/catalog/_show_collection.html.erb +42 -24
- data/app/views/catalog/_show_default.html.erb +64 -26
- data/app/views/catalog/_show_upper_metadata_collection.html.erb +1 -0
- data/app/views/catalog/_show_upper_metadata_default.html.erb +14 -0
- 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 +51 -43
- data/app/views/shared/_main_menu_links.html.erb +1 -1
- data/app/views/shared/_show_breadcrumbs.html.erb +27 -0
- data/arclight.gemspec +15 -12
- data/config/i18n-tasks.yml +133 -0
- data/config/locales/arclight.en.yml +89 -55
- data/config/repositories.yml +0 -0
- data/lib/arclight/engine.rb +23 -12
- data/lib/arclight/hash_absolute_xpath.rb +61 -0
- data/lib/arclight/level_label.rb +46 -0
- data/lib/arclight/missing_id_strategy.rb +21 -0
- data/lib/arclight/normalized_date.rb +21 -12
- data/lib/arclight/normalized_id.rb +1 -0
- data/lib/arclight/normalized_title.rb +1 -0
- data/lib/arclight/repository.rb +61 -25
- data/lib/arclight/traject/ead2_config.rb +495 -0
- 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 +34 -3
- data/lib/generators/arclight/templates/catalog_controller.rb +162 -131
- 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 +19 -19
- data/package.json +8 -1
- data/solr/conf/schema.xml +56 -292
- data/solr/conf/solrconfig.xml +40 -125
- data/tasks/arclight.rake +6 -1
- data/template.rb +1 -1
- data/vendor/assets/javascripts/responsiveTruncator.js +2 -2
- metadata +159 -60
- data/app/assets/javascripts/arclight/collection_context.js +0 -18
- data/app/assets/javascripts/arclight/component_ancestors.js +0 -56
- data/app/assets/stylesheets/arclight/modules/sidebar.scss +0 -21
- data/app/views/catalog/_arclight_document_show_header.html.erb +0 -15
- data/app/views/catalog/_arclight_document_show_header_collection.html.erb +0 -12
- 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_overview.html.erb +0 -46
- 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 -10
- data/app/views/catalog/_search_within_form.html.erb +0 -16
- data/app/views/catalog/_show_component_sidebar.html.erb +0 -12
- data/app/views/catalog/_show_header.html.erb +0 -5
- data/app/views/catalog/_show_sidebar.html.erb +0 -30
- 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 -159
- data/lib/generators/arclight/templates/arclight.js +0 -2
|
@@ -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'
|
|
@@ -19,6 +19,20 @@ module Arclight
|
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
+
def install_blacklight_locale_picker
|
|
23
|
+
gem 'blacklight-locale_picker'
|
|
24
|
+
|
|
25
|
+
Bundler.with_clean_env do
|
|
26
|
+
run 'bundle install'
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
generate 'blacklight:locale_picker:install'
|
|
30
|
+
|
|
31
|
+
inject_into_file 'app/helpers/application_helper.rb', after: 'include Blacklight::LocalePicker::LocaleHelper' do
|
|
32
|
+
"\n\n def additional_locale_routing_scopes\n [blacklight, arclight_engine]\n end"
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
22
36
|
def install_blacklight_range_limit
|
|
23
37
|
generate 'blacklight_range_limit:install'
|
|
24
38
|
end
|
|
@@ -29,9 +43,22 @@ module Arclight
|
|
|
29
43
|
end
|
|
30
44
|
end
|
|
31
45
|
|
|
32
|
-
def
|
|
46
|
+
def copy_styles
|
|
33
47
|
copy_file 'arclight.scss', 'app/assets/stylesheets/arclight.scss'
|
|
34
|
-
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def inject_js
|
|
51
|
+
inject_into_file 'app/assets/javascripts/application.js', after: '//= require blacklight/blacklight' do
|
|
52
|
+
"\n// Required by Arclight" \
|
|
53
|
+
"\n//= require arclight/arclight" \
|
|
54
|
+
"\n//= require stickyfill"
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def install_webpacker
|
|
59
|
+
return unless Rails.version.to_i == 6
|
|
60
|
+
|
|
61
|
+
rake 'webpacker:install'
|
|
35
62
|
end
|
|
36
63
|
|
|
37
64
|
def add_arclight_search_behavior
|
|
@@ -55,5 +82,9 @@ module Arclight
|
|
|
55
82
|
def modify_blacklight_yml
|
|
56
83
|
gsub_file 'config/locales/blacklight.en.yml', "application_name: 'Blacklight'", "application_name: 'Arclight'"
|
|
57
84
|
end
|
|
85
|
+
|
|
86
|
+
def run_yarn
|
|
87
|
+
run 'yarn add @babel/core @babel/plugin-external-helpers @babel/plugin-transform-modules-umd @babel/preset-env'
|
|
88
|
+
end
|
|
58
89
|
end
|
|
59
90
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
class CatalogController < ApplicationController
|
|
3
2
|
|
|
3
|
+
class CatalogController < ApplicationController
|
|
4
4
|
include Blacklight::Catalog
|
|
5
5
|
include Arclight::Catalog
|
|
6
6
|
include Arclight::FieldConfigHelpers
|
|
@@ -21,31 +21,31 @@ class CatalogController < ApplicationController
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
# solr path which will be added to solr base url before the other solr params.
|
|
24
|
-
#config.solr_path = 'select'
|
|
24
|
+
# config.solr_path = 'select'
|
|
25
25
|
|
|
26
26
|
# items to show per page, each number in the array represent another option to choose from.
|
|
27
|
-
#config.per_page = [10,20,50,100]
|
|
27
|
+
# config.per_page = [10,20,50,100]
|
|
28
28
|
|
|
29
|
-
## Default parameters to send on single-document requests to Solr. These settings are the
|
|
29
|
+
## Default parameters to send on single-document requests to Solr. These settings are the Blacklight defaults (see SearchHelper#solr_doc_params) or
|
|
30
30
|
## parameters included in the Blacklight-jetty document requestHandler.
|
|
31
31
|
#
|
|
32
|
-
#config.default_document_solr_params = {
|
|
32
|
+
# config.default_document_solr_params = {
|
|
33
33
|
# qt: 'document',
|
|
34
34
|
# ## These are hard-coded in the blacklight 'document' requestHandler
|
|
35
35
|
# # fl: '*',
|
|
36
36
|
# # rows: 1,
|
|
37
37
|
# # q: '{!term f=id v=$id}'
|
|
38
|
-
#}
|
|
38
|
+
# }
|
|
39
39
|
|
|
40
40
|
# solr field configuration for search results/index views
|
|
41
41
|
config.index.title_field = 'normalized_title_ssm'
|
|
42
42
|
config.index.display_type_field = 'level_ssm'
|
|
43
|
-
#config.index.thumbnail_field = 'thumbnail_path_ss'
|
|
43
|
+
# config.index.thumbnail_field = 'thumbnail_path_ss'
|
|
44
44
|
|
|
45
45
|
# solr field configuration for document/show views
|
|
46
|
-
#config.show.title_field = 'title_display'
|
|
47
|
-
|
|
48
|
-
#config.show.thumbnail_field = 'thumbnail_path_ss'
|
|
46
|
+
# config.show.title_field = 'title_display'
|
|
47
|
+
config.show.display_type_field = 'level_ssm'
|
|
48
|
+
# config.show.thumbnail_field = 'thumbnail_path_ss'
|
|
49
49
|
|
|
50
50
|
config.add_results_document_tool(:bookmark, partial: 'bookmark_control', if: :render_bookmarks_control?)
|
|
51
51
|
|
|
@@ -85,16 +85,16 @@ class CatalogController < ApplicationController
|
|
|
85
85
|
# (useful when user clicks "more" on a large facet and wants to navigate alphabetically across a large set of results)
|
|
86
86
|
# :index_range can be an array or range of prefixes that will be used to create the navigation (note: It is case sensitive when searching values)
|
|
87
87
|
|
|
88
|
-
config.add_facet_field 'collection_sim', label: 'Collection'
|
|
89
|
-
config.add_facet_field 'creator_ssim', label: 'Creator'
|
|
88
|
+
config.add_facet_field 'collection_sim', label: 'Collection', limit: 10
|
|
89
|
+
config.add_facet_field 'creator_ssim', label: 'Creator', limit: 10
|
|
90
90
|
config.add_facet_field 'creators_ssim', label: 'Creator', show: false
|
|
91
91
|
config.add_facet_field 'date_range_sim', label: 'Date range', range: true
|
|
92
|
-
config.add_facet_field 'level_sim', label: 'Level'
|
|
93
|
-
config.add_facet_field 'names_ssim', label: 'Names'
|
|
94
|
-
config.add_facet_field 'repository_sim', label: 'Repository'
|
|
95
|
-
config.add_facet_field 'geogname_sim', label: 'Place'
|
|
96
|
-
config.add_facet_field 'places_ssim', label: 'Places', show:false
|
|
97
|
-
config.add_facet_field 'access_subjects_ssim', label: 'Subject'
|
|
92
|
+
config.add_facet_field 'level_sim', label: 'Level', limit: 10
|
|
93
|
+
config.add_facet_field 'names_ssim', label: 'Names', limit: 10
|
|
94
|
+
config.add_facet_field 'repository_sim', label: 'Repository', limit: 10
|
|
95
|
+
config.add_facet_field 'geogname_sim', label: 'Place', limit: 10
|
|
96
|
+
config.add_facet_field 'places_ssim', label: 'Places', show: false
|
|
97
|
+
config.add_facet_field 'access_subjects_ssim', label: 'Subject', limit: 10
|
|
98
98
|
|
|
99
99
|
# Have BL send all facet field names to Solr, which has been the default
|
|
100
100
|
# previously. Simply remove these lines if you'd rather use Solr request
|
|
@@ -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,141 +208,161 @@ 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
|
-
|
|
200
|
-
|
|
201
|
-
config.
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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)
|
|
222
|
+
|
|
223
|
+
config.show.metadata_partials = %i[
|
|
224
|
+
summary_field
|
|
225
|
+
access_field
|
|
226
|
+
background_field
|
|
227
|
+
related_field
|
|
228
|
+
indexed_terms_field
|
|
207
229
|
]
|
|
208
230
|
|
|
209
|
-
config.show.
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
231
|
+
config.show.context_access_tab_items = %i[
|
|
232
|
+
terms_field
|
|
233
|
+
cite_field
|
|
234
|
+
in_person_field
|
|
235
|
+
contact_field
|
|
213
236
|
]
|
|
214
237
|
|
|
215
|
-
config.show.component_metadata_partials = [
|
|
216
|
-
|
|
217
|
-
|
|
238
|
+
config.show.component_metadata_partials = %i[
|
|
239
|
+
component_field
|
|
240
|
+
component_indexed_terms_field
|
|
218
241
|
]
|
|
219
242
|
|
|
220
|
-
config.show.
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
243
|
+
config.show.component_access_tab_items = %i[
|
|
244
|
+
component_terms_field
|
|
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|
|
|
@@ -334,29 +370,24 @@ class CatalogController < ApplicationController
|
|
|
334
370
|
end
|
|
335
371
|
|
|
336
372
|
# Insert the breadcrumbs at the beginning
|
|
373
|
+
config.show.partials.unshift(:show_upper_metadata)
|
|
337
374
|
config.show.partials.unshift(:show_breadcrumbs)
|
|
375
|
+
config.show.partials.delete(:show_header)
|
|
338
376
|
|
|
339
377
|
##
|
|
340
|
-
#
|
|
341
|
-
config.view.hierarchy
|
|
342
|
-
config.view.hierarchy.display_control = false
|
|
343
|
-
config.view.hierarchy.partials = config.index.partials.dup
|
|
344
|
-
config.view.hierarchy.partials.delete(:index_breadcrumb)
|
|
345
|
-
config.view.hierarchy.partials.delete(:arclight_online_content_indicator)
|
|
346
|
-
|
|
347
|
-
##
|
|
348
|
-
# Hierarchy Index View
|
|
378
|
+
# Online Contents Index View
|
|
349
379
|
config.view.online_contents
|
|
350
380
|
config.view.online_contents.display_control = false
|
|
351
|
-
config.view.online_contents.partials = config.view.hierarchy.partials.dup
|
|
352
381
|
|
|
353
|
-
|
|
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
|
+
##
|
|
354
389
|
# Compact index view
|
|
355
390
|
config.view.compact
|
|
356
391
|
config.view.compact.partials = %i[arclight_index_compact]
|
|
357
|
-
|
|
358
|
-
##
|
|
359
|
-
# Extra actions
|
|
360
|
-
config.add_results_document_tool :google_form, partial: 'arclight/requests/google_form', if: :item_requestable?
|
|
361
392
|
end
|
|
362
393
|
end
|