arclight 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.eslintrc +12 -0
- data/.gitignore +5 -0
- data/.rubocop.yml +66 -0
- data/.solr_wrapper +5 -0
- data/.travis.yml +30 -2
- data/CONTRIBUTING.md +43 -0
- data/Gemfile +36 -0
- data/LICENSE.txt +1 -0
- data/README.md +85 -12
- data/Rakefile +14 -3
- data/app/assets/images/blacklight/compact.svg +25 -0
- data/app/assets/images/blacklight/logo.png +0 -0
- data/app/assets/javascripts/arclight/arclight.js +9 -0
- data/app/assets/javascripts/arclight/collection_context.js +18 -0
- data/app/assets/javascripts/arclight/collection_navigation.js +114 -0
- data/app/assets/javascripts/arclight/collection_scrollspy.js +6 -0
- data/app/assets/javascripts/arclight/component_ancestors.js +56 -0
- data/app/assets/javascripts/arclight/oembed_viewer.js +39 -0
- data/app/assets/javascripts/arclight/truncator.js.erb +23 -0
- data/app/assets/stylesheets/arclight/application.scss +13 -0
- data/app/assets/stylesheets/arclight/bootstrap_overrides.scss +3 -0
- data/app/assets/stylesheets/arclight/modules/collection_search.scss +3 -0
- data/app/assets/stylesheets/arclight/modules/hierarchy_and_online_contents.scss +174 -0
- data/app/assets/stylesheets/arclight/modules/highlights.scss +10 -0
- data/app/assets/stylesheets/arclight/modules/layout.scss +33 -0
- data/app/assets/stylesheets/arclight/modules/mastheads.scss +60 -0
- data/app/assets/stylesheets/arclight/modules/repositories.scss +29 -0
- data/app/assets/stylesheets/arclight/modules/repository_card.scss +54 -0
- data/app/assets/stylesheets/arclight/modules/search_results.scss +75 -0
- data/app/assets/stylesheets/arclight/modules/show_collection.scss +78 -0
- data/app/assets/stylesheets/arclight/modules/sidebar.scss +16 -0
- data/app/assets/stylesheets/arclight/variables.scss +2 -0
- data/app/controllers/arclight/repositories_controller.rb +40 -0
- data/app/controllers/concerns/arclight/field_config_helpers.rb +86 -0
- data/app/factories/blacklight_field_configuration_factory.rb +29 -0
- data/app/helpers/arclight_helper.rb +173 -0
- data/app/models/arclight/parent.rb +24 -0
- data/app/models/arclight/parents.rb +34 -0
- data/app/models/arclight/requests/google_form.rb +44 -0
- data/app/models/concerns/arclight/catalog.rb +22 -0
- data/app/models/concerns/arclight/search_behavior.rb +46 -0
- data/app/models/concerns/arclight/solr_document.rb +131 -0
- data/app/presenters/arclight/index_presenter.rb +10 -0
- data/app/presenters/arclight/show_presenter.rb +27 -0
- data/app/views/arclight/.keep +0 -0
- data/app/views/arclight/repositories/_in_person_repository.html.erb +19 -0
- data/app/views/arclight/repositories/_repository.html.erb +62 -0
- data/app/views/arclight/repositories/index.html.erb +4 -0
- data/app/views/arclight/repositories/show.html.erb +38 -0
- data/app/views/arclight/requests/_google_form.html.erb +11 -0
- data/app/views/arclight/viewers/_oembed.html.erb +7 -0
- data/app/views/catalog/_arclight_document_index_header.html.erb +13 -0
- data/app/views/catalog/_arclight_document_index_header_hierarchy_default.html.erb +0 -0
- data/app/views/catalog/_arclight_document_index_header_online_contents_default.html.erb +0 -0
- data/app/views/catalog/_arclight_document_show_header.html.erb +15 -0
- data/app/views/catalog/_arclight_document_show_header_collection.html.erb +12 -0
- data/app/views/catalog/_arclight_index_compact_default.html.erb +15 -0
- data/app/views/catalog/_arclight_online_content_indicator.html.erb +5 -0
- data/app/views/catalog/_arclight_rangelimit.html.erb +24 -0
- data/app/views/catalog/_arclight_viewer_default.html.erb +1 -0
- data/app/views/catalog/_collection_contents.html.erb +12 -0
- data/app/views/catalog/_collection_count.html.erb +7 -0
- data/app/views/catalog/_collection_downloads.html.erb +17 -0
- data/app/views/catalog/_collection_online_contents.html.erb +17 -0
- data/app/views/catalog/_collection_overview.html.erb +7 -0
- data/app/views/catalog/_component_overview.html.erb +46 -0
- data/app/views/catalog/_context_card.html.erb +27 -0
- data/app/views/catalog/_context_sidebar.html.erb +8 -0
- data/app/views/catalog/_custom_metadata.html.erb +16 -0
- data/app/views/catalog/_home.html.erb +1 -0
- data/app/views/catalog/_index_breadcrumb_default.html.erb +3 -0
- data/app/views/catalog/_index_default.html.erb +17 -0
- data/app/views/catalog/_index_header.html.erb +7 -0
- data/app/views/catalog/_index_header_hierarchy_default.html.erb +42 -0
- data/app/views/catalog/_index_header_online_contents_default.html.erb +1 -0
- data/app/views/catalog/_index_hierarchy_default.html.erb +28 -0
- data/app/views/catalog/_index_online_contents_default.html.erb +6 -0
- data/app/views/catalog/_results_histogram.html.erb +10 -0
- data/app/views/catalog/_search_results.html.erb +31 -0
- data/app/views/catalog/_search_results_repository.html.erb +6 -0
- data/app/views/catalog/_search_within_form.html.erb +16 -0
- data/app/views/catalog/_show_breadcrumbs_default.html.erb +7 -0
- data/app/views/catalog/_show_collection.html.erb +40 -0
- data/app/views/catalog/_show_component_sidebar.html.erb +12 -0
- data/app/views/catalog/_show_default.html.erb +32 -0
- data/app/views/catalog/_show_header.html.erb +5 -0
- data/app/views/catalog/_show_sidebar.html.erb +30 -0
- data/app/views/catalog/index.html.erb +8 -0
- data/app/views/layouts/catalog_result.html.erb +7 -0
- data/app/views/shared/_breadcrumbs.html.erb +15 -0
- data/app/views/shared/_context_sidebar.html.erb +8 -0
- data/app/views/shared/_header_navbar.html.erb +54 -0
- data/app/views/shared/_main_menu_links.html.erb +6 -0
- data/arclight.gemspec +17 -4
- data/bin/rails +13 -0
- data/config/locales/arclight.en.yml +65 -0
- data/config/routes.rb +6 -0
- data/lib/arclight.rb +5 -0
- data/lib/arclight/custom_component.rb +98 -0
- data/lib/arclight/custom_document.rb +93 -0
- data/lib/arclight/digital_object.rb +26 -0
- data/lib/arclight/engine.rb +55 -0
- data/lib/arclight/exceptions.rb +18 -0
- data/lib/arclight/indexer.rb +9 -0
- data/lib/arclight/normalized_date.rb +45 -0
- data/lib/arclight/normalized_id.rb +25 -0
- data/lib/arclight/normalized_title.rb +30 -0
- data/lib/arclight/repository.rb +91 -0
- data/lib/arclight/shared_indexing_behavior.rb +97 -0
- data/lib/arclight/shared_terminology_behavior.rb +65 -0
- data/lib/arclight/solr_ead_indexer_ext.rb +159 -0
- data/lib/arclight/version.rb +3 -1
- data/lib/arclight/viewer.rb +45 -0
- data/lib/arclight/viewers/oembed.rb +56 -0
- data/lib/arclight/year_range.rb +102 -0
- data/lib/generators/arclight/install_generator.rb +63 -0
- data/lib/generators/arclight/templates/arclight.js +2 -0
- data/lib/generators/arclight/templates/arclight.scss +3 -0
- data/lib/generators/arclight/templates/catalog_controller.rb +347 -0
- data/lib/generators/arclight/templates/config/downloads.yml +13 -0
- data/lib/generators/arclight/templates/config/repositories.yml +42 -0
- data/lib/generators/arclight/update_generator.rb +22 -0
- data/lib/tasks/index.rake +87 -0
- data/package.json +24 -0
- data/solr/conf/_rest_managed.json +3 -0
- data/solr/conf/admin-extra.html +31 -0
- data/solr/conf/elevate.xml +36 -0
- data/solr/conf/mapping-ISOLatin1Accent.txt +246 -0
- data/solr/conf/protwords.txt +21 -0
- data/solr/conf/schema.xml +631 -0
- data/solr/conf/scripts.conf +24 -0
- data/solr/conf/solrconfig.xml +393 -0
- data/solr/conf/spellings.txt +2 -0
- data/solr/conf/stopwords.txt +58 -0
- data/solr/conf/stopwords_en.txt +58 -0
- data/solr/conf/synonyms.txt +31 -0
- data/solr/conf/xslt/example.xsl +132 -0
- data/solr/conf/xslt/example_atom.xsl +67 -0
- data/solr/conf/xslt/example_rss.xsl +66 -0
- data/solr/conf/xslt/luke.xsl +337 -0
- data/tasks/arclight.rake +68 -0
- data/template.rb +15 -0
- data/vendor/assets/javascripts/responsiveTruncator.js +69 -0
- data/vendor/assets/javascripts/stickyfill.js +480 -0
- metadata +301 -6
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Arclight
|
4
|
+
# Custom presentation methods for show partial
|
5
|
+
class ShowPresenter < Blacklight::ShowPresenter
|
6
|
+
def heading
|
7
|
+
document.normalized_title
|
8
|
+
end
|
9
|
+
|
10
|
+
def with_field_group(group)
|
11
|
+
self.field_group = group
|
12
|
+
self
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def field_group
|
18
|
+
@field_group || 'show_field'
|
19
|
+
end
|
20
|
+
|
21
|
+
attr_writer :field_group
|
22
|
+
|
23
|
+
def field_config(field)
|
24
|
+
BlacklightFieldConfigurationFactory.for(config: configuration, field: field, field_group: field_group)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
File without changes
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<div class='al-in-person-repository-name'>
|
2
|
+
<% if repository.thumbnail_url %>
|
3
|
+
<%= image_tag repository.thumbnail_url, alt: repository.name, class: 'img-fluid float-left' %>
|
4
|
+
<% end %>
|
5
|
+
<div>
|
6
|
+
<%= link_to(repository.name, arclight_engine.repository_path(repository.slug)) %>
|
7
|
+
</div>
|
8
|
+
</div>
|
9
|
+
<div class='al-in-person-repository-location'>
|
10
|
+
<address>
|
11
|
+
<% %i[building address1 address2 city_state_zip_country phone contact_info].each do |f| %>
|
12
|
+
<% if repository.send(f).present? %>
|
13
|
+
<div class='al-repository-contact-<%= f %>'>
|
14
|
+
<%= repository.send(f) %>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
17
|
+
<% end %>
|
18
|
+
</address>
|
19
|
+
</div>
|
@@ -0,0 +1,62 @@
|
|
1
|
+
<div class="al-repository">
|
2
|
+
<div class="container">
|
3
|
+
<div class='row'>
|
4
|
+
<div class='col-2 align-self-center al-repository-thumbnail hidden-md-down'>
|
5
|
+
<%= image_tag repository.thumbnail_url, alt: repository.name, class: 'img-fluid' %>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<div class="col-sm-12 col-lg-10 al-repository-information">
|
9
|
+
<h2>
|
10
|
+
<%= link_to_unless(params[:id] == repository.slug, repository.name, arclight_engine.repository_path(repository.slug)) %>
|
11
|
+
</h2>
|
12
|
+
<div class='row no-gutters justify-content-md-center'>
|
13
|
+
<div class='col-4 col-md-3 al-repository-contact'>
|
14
|
+
<address>
|
15
|
+
<div class="al-repository-street-address">
|
16
|
+
<% %i[building address1 address2 city_state_zip_country].each do |f| %>
|
17
|
+
<% if repository.send(f).present? %>
|
18
|
+
<div class='al-repository-street-address-<%= f %>'>
|
19
|
+
<%= repository.send(f) %>
|
20
|
+
</div>
|
21
|
+
<% end %>
|
22
|
+
<% end %>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<div class="al-repository-contact-info">
|
26
|
+
<% if repository.phone.present? %>
|
27
|
+
<div class='al-repository-contact-info-phone'>
|
28
|
+
<%= repository.phone %>
|
29
|
+
</div>
|
30
|
+
<% end %>
|
31
|
+
<% if repository.contact_info.present? %>
|
32
|
+
<div class='al-repository-contact-info-contact_info'>
|
33
|
+
<% if repository.contact_info.include?('@') %>
|
34
|
+
<%= mail_to repository.contact_info %>
|
35
|
+
<% else %>
|
36
|
+
<%= repository.contact_info %>
|
37
|
+
<% end %>
|
38
|
+
</div>
|
39
|
+
<% end %>
|
40
|
+
</div>
|
41
|
+
</address>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<div class='col al-repository-description'>
|
45
|
+
<%= repository.description %>
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<% if on_repositories_index? %>
|
49
|
+
<div class='col col-lg-2 al-repository-extra align-self-center hidden-md-down'>
|
50
|
+
<div class='al-repository-extra-collection-count'>
|
51
|
+
<span class="al-repository-collection-count">
|
52
|
+
<%= t(:'arclight.views.repositories.number_of_collections', count: repository.collection_count) %>
|
53
|
+
</span>
|
54
|
+
</div>
|
55
|
+
<%= link_to(t(:'arclight.views.repositories.view_more'), arclight_engine.repository_path(repository.slug), class: 'btn btn-secondary btn-sm') %>
|
56
|
+
</div>
|
57
|
+
<% end %>
|
58
|
+
</div>
|
59
|
+
</div>
|
60
|
+
</div>
|
61
|
+
</div>
|
62
|
+
</div>
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<%= render 'shared/breadcrumbs' %>
|
2
|
+
<%= render @repository %>
|
3
|
+
<div class="row al-repository-show-header">
|
4
|
+
<div class="col col-md-8 col-lg-9">
|
5
|
+
<h3>
|
6
|
+
<%= t('arclight.views.show.our_collections') %>
|
7
|
+
</h3>
|
8
|
+
</div>
|
9
|
+
<div class="col text-right">
|
10
|
+
<span class="al-repository-collections">
|
11
|
+
<%= link_to(t(:'arclight.views.repositories.view_all_collections'), repository_collections_path(@repository)) %>
|
12
|
+
</span>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<div class="row">
|
17
|
+
<% @collections.each do |document| %>
|
18
|
+
<div class="col-md-12">
|
19
|
+
<div class='al-document-title-bar'>
|
20
|
+
<div class='row'>
|
21
|
+
<div class='col-md-10 col-lg-9'>
|
22
|
+
<h5><%= link_to document.normalized_title, solr_document_path(document.id) %></h5>
|
23
|
+
<%= content_tag('div', class: 'al-document-abstract-or-scope', title: document.abstract_or_scope) do %>
|
24
|
+
<%= content_tag('div', 'data-arclight-truncate' => true) do %>
|
25
|
+
<%= document.abstract_or_scope %>
|
26
|
+
<% end %>
|
27
|
+
<% end if document.abstract_or_scope %>
|
28
|
+
</div>
|
29
|
+
<% if document.unitid %>
|
30
|
+
<div class='col text-right al-collection-id'>
|
31
|
+
<%= t(:'arclight.views.show.collection_id', id: document.unitid) %>
|
32
|
+
</div>
|
33
|
+
<% end %>
|
34
|
+
</div>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
<% end %>
|
38
|
+
</div>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<% document ||= @document %>
|
2
|
+
<% google_form ||= Arclight::Requests::GoogleForm.new(document, show_presenter(document), solr_document_path(document)) %>
|
3
|
+
|
4
|
+
<%= form_tag google_form.url, method: :get, class: 'al-request-form' do |f| %>
|
5
|
+
<% google_form.form_mapping.each do |key, value| %>
|
6
|
+
<%= hidden_field_tag value, google_form.send(key) %>
|
7
|
+
<% end %>
|
8
|
+
<button type='submit' class='btn btn-sm btn-primary'>
|
9
|
+
<%= t('arclight.request.container') %>
|
10
|
+
</button>
|
11
|
+
<% end %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<% document_actions = capture do %>
|
2
|
+
<% # bookmark functions for items/docs -%>
|
3
|
+
<%= render_index_doc_actions document, wrapping_class: "col-5 col-sm-3 text-right" %>
|
4
|
+
<% end %>
|
5
|
+
|
6
|
+
<div class='al-document-title-bar'>
|
7
|
+
<div class='row'>
|
8
|
+
<div class='col-7 col-sm-9'>
|
9
|
+
<%= document.repository_and_unitid %>
|
10
|
+
</div>
|
11
|
+
<%= document_actions %>
|
12
|
+
</div>
|
13
|
+
</div>
|
File without changes
|
File without changes
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<% document_actions = capture do %>
|
2
|
+
<% # bookmark functions for items/docs -%>
|
3
|
+
<%= render_show_doc_actions document %>
|
4
|
+
<% end %>
|
5
|
+
|
6
|
+
<div class='al-document-title-bar'>
|
7
|
+
<div class='row'>
|
8
|
+
<div class='col-7 col-sm-9'>
|
9
|
+
<%= document.repository_and_unitid %>
|
10
|
+
</div>
|
11
|
+
<div class='col-5 col-sm-3 text-right'>
|
12
|
+
<%= document_actions %>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
</div>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<div class='al-document-title-bar'>
|
2
|
+
<div class='row'>
|
3
|
+
<div class='col-8'>
|
4
|
+
<%= document.repository %>
|
5
|
+
</div>
|
6
|
+
<% if document.unitid %>
|
7
|
+
<div class='col-4 text-right'>
|
8
|
+
<%= t(:'arclight.views.show.collection_id', id: document.unitid) %>
|
9
|
+
</div>
|
10
|
+
<% end %>
|
11
|
+
</div>
|
12
|
+
</div>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<div class="row">
|
2
|
+
<div class="col-5">
|
3
|
+
<% counter = document_counter_with_offset(document_counter) %>
|
4
|
+
<%= link_to_document document, document_show_link_field(document), counter: counter %>
|
5
|
+
</div>
|
6
|
+
<div class="col-5">
|
7
|
+
<%= render_document_partial(document, :index_breadcrumb) %>
|
8
|
+
<div class='al-repository-footer'>
|
9
|
+
<%= document.repository %>
|
10
|
+
</div>
|
11
|
+
</div>
|
12
|
+
<div class="col-2">
|
13
|
+
<%= render_document_partial(document, :arclight_online_content_indicator) %>
|
14
|
+
</div>
|
15
|
+
</div>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<% # Arclight Customized version of https://github.com/projectblacklight/blacklight_range_limit/blob/master/app/views/blacklight_range_limit/_range_limit_panel.html.erb %>
|
2
|
+
|
3
|
+
<% # requires solr_config local passed in
|
4
|
+
field_config = range_config(solr_field)
|
5
|
+
%>
|
6
|
+
|
7
|
+
<div class='limit_content range_limit'>
|
8
|
+
<% unless params['range'] && params['range'][solr_field] && params['range'][solr_field]['missing'] %>
|
9
|
+
<div class='profile'>
|
10
|
+
<% if (min = range_results_endpoint(solr_field, :min)) &&
|
11
|
+
(max = range_results_endpoint(solr_field, :max)) %>
|
12
|
+
<% if field_config[:segments] != false %>
|
13
|
+
<div class="distribution subsection <%= 'chart_js' unless field_config[:chart_js] == false %>">
|
14
|
+
<% if solr_range_queries_to_a(solr_field).length > 0 %>
|
15
|
+
<%= render(partial: 'blacklight_range_limit/range_segments', locals: {solr_field: solr_field}) %>
|
16
|
+
<% else %>
|
17
|
+
<%= link_to('View distribution', search_state.to_h.merge(action: 'range_limit', range_field: solr_field, range_start: min, range_end: max), :class => 'load_distribution') %>
|
18
|
+
<% end %>
|
19
|
+
</div>
|
20
|
+
<% end %>
|
21
|
+
<% end %>
|
22
|
+
</div>
|
23
|
+
<% end %>
|
24
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= @document.digital_object_viewer %>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<% document ||= @document %>
|
2
|
+
|
3
|
+
<h2 class="sr-only">Collection inventory</h2>
|
4
|
+
<%= content_tag(
|
5
|
+
:div, '',
|
6
|
+
class: 'al-contents',
|
7
|
+
data: {
|
8
|
+
arclight: {
|
9
|
+
hierarchy: true, level: 1, path: search_catalog_path, name: document.collection_name
|
10
|
+
}
|
11
|
+
}
|
12
|
+
) %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<% if downloads.present? && (downloads[:pdf].present? || downloads[:ead].present?) %>
|
2
|
+
<li>
|
3
|
+
<div class='dropdown'>
|
4
|
+
<button class='btn btn-secondary dropdown-toggle' type="button" id="download-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
5
|
+
<%= t 'arclight.views.show.download.default' %>
|
6
|
+
</button>
|
7
|
+
<div class="dropdown-menu" aria-labelledby="download-dropdown">
|
8
|
+
<% if downloads[:pdf].present? %>
|
9
|
+
<a class="dropdown-item" href="<%= downloads[:pdf][:href] %>"><%= t('arclight.views.show.download.pdf', size: downloads[:pdf][:size]) %></a>
|
10
|
+
<% end %>
|
11
|
+
<% if downloads[:ead].present? %>
|
12
|
+
<a class="dropdown-item" href="<%= downloads[:ead][:href] %>"><%= t('arclight.views.show.download.ead', size: downloads[:ead][:size]) %></a>
|
13
|
+
<% end %>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
</li>
|
17
|
+
<% end %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<% if document.digital_objects.present? %>
|
2
|
+
<%= render_document_partial(document, 'arclight_viewer') %>
|
3
|
+
<% elsif document.online_content? %>
|
4
|
+
<%= content_tag(
|
5
|
+
:div, '',
|
6
|
+
class: 'al-contents',
|
7
|
+
data: {
|
8
|
+
arclight: {
|
9
|
+
path: search_catalog_path,
|
10
|
+
name: document.collection_name,
|
11
|
+
access: 'online',
|
12
|
+
view: 'online_contents',
|
13
|
+
search_field: 'within_collection'
|
14
|
+
}
|
15
|
+
}
|
16
|
+
) %>
|
17
|
+
<% end %>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<h2 class="sr-only">Collection description</h2>
|
2
|
+
<% unless blacklight_config.show.metadata_partials.nil? %>
|
3
|
+
<% blacklight_config.show.metadata_partials.each do |metadata| %>
|
4
|
+
<% next unless fields_have_content?(@document, metadata) %>
|
5
|
+
<%= render partial: 'custom_metadata', locals: { document: @document, field_accessor: metadata } %>
|
6
|
+
<% end %>
|
7
|
+
<% end %>
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<h2 class="sr-only">Component description</h2>
|
2
|
+
<% unless blacklight_config.show.component_metadata_partials.nil? %>
|
3
|
+
<% blacklight_config.show.component_metadata_partials.each do |metadata| %>
|
4
|
+
<% next unless fields_have_content?(@document, metadata) %>
|
5
|
+
<%= render partial: 'custom_metadata', locals: { document: @document, field_accessor: metadata } %>
|
6
|
+
<% end %>
|
7
|
+
<% end %>
|
8
|
+
<!-- Section below will be moved into its own partial later -->
|
9
|
+
<%= content_tag(:div, id: t("arclight.views.show.sections.collection_context_field").parameterize) do %>
|
10
|
+
<h3 class='al-show-sub-heading'>
|
11
|
+
<%= t("arclight.views.show.sections.collection_context_field") %>
|
12
|
+
</h3>
|
13
|
+
<%= content_tag(
|
14
|
+
:div, '',
|
15
|
+
class: 'al-context',
|
16
|
+
data: {
|
17
|
+
arclight_collection_context: true,
|
18
|
+
arclight_collection_context_url: solr_document_path(
|
19
|
+
normalize_id(@document.eadid)
|
20
|
+
)
|
21
|
+
}
|
22
|
+
) %>
|
23
|
+
<%= content_tag(
|
24
|
+
:div, '',
|
25
|
+
class: 'al-ancestors',
|
26
|
+
data: {
|
27
|
+
arclight_ancestors: @document.parent_ids,
|
28
|
+
arclight_path: search_catalog_path(hierarchy_context: 'component')
|
29
|
+
}
|
30
|
+
) %>
|
31
|
+
<%= content_tag(
|
32
|
+
:div, '',
|
33
|
+
class: "al-contents al-hierarchy-level-#{@document.component_level} extra-indent documents-hierarchy",
|
34
|
+
data: {
|
35
|
+
arclight: {
|
36
|
+
hierarchy: true,
|
37
|
+
level: @document.component_level,
|
38
|
+
path: search_catalog_path(hierarchy_context: 'component'),
|
39
|
+
name: @document.collection_name,
|
40
|
+
parent: @document.parent_ids.last,
|
41
|
+
highlightId: @document.id
|
42
|
+
}
|
43
|
+
}
|
44
|
+
) %>
|
45
|
+
|
46
|
+
<% end %>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<% doc_presenter = show_presenter(document).with_field_group(field_accessor) %>
|
2
|
+
<div class="card">
|
3
|
+
<div class="card-header" role="tab" id="heading<%= card_index %>">
|
4
|
+
<h3 class="mb-0">
|
5
|
+
<a data-toggle="collapse" data-parent="#accordion" href="#collapse<%= card_index %>" aria-expanded="<%= card_index.zero? %>" aria-controls="collapse<%= card_index %>">
|
6
|
+
<%= t("arclight.views.show.context_sidebar.#{field_accessor}") %>
|
7
|
+
</a>
|
8
|
+
</h3>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<div id="collapse<%= card_index %>" class="collapse <%= 'show' if card_index.zero? %>" role="tabpanel" aria-labelledby="heading<%= card_index %>">
|
12
|
+
<div class="card-block">
|
13
|
+
<dl>
|
14
|
+
<% generic_document_fields(field_accessor).each do |field_name, field| %>
|
15
|
+
<% if generic_should_render_field?(field_accessor, document, field) %>
|
16
|
+
<dt class="blacklight-<%= field_name.parameterize %>">
|
17
|
+
<%= generic_render_document_field_label(field_accessor, document, field: field_name) %>
|
18
|
+
</dt>
|
19
|
+
<dd class="blacklight-<%= field_name.parameterize %>">
|
20
|
+
<%= doc_presenter.field_value field_name %>
|
21
|
+
</dd>
|
22
|
+
<% end %>
|
23
|
+
<% end %>
|
24
|
+
</dl>
|
25
|
+
</div>
|
26
|
+
</div>
|
27
|
+
</div>
|