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,20 @@
1
+ <div class='al-grouped-title-bar'>
2
+ <div class='row'>
3
+ <div class='col-md-12'>
4
+ <% if document.repository_config.present? %>
5
+ <div class='al-grouped-repository breadcrumb-links'>
6
+ <%= link_to(document.repository_config.name, arclight_engine.repository_path(document.repository_config.slug)) %>
7
+ </div>
8
+ <% end %>
9
+ <h3><%= link_to_document document, document_show_link_field(document) %></h3>
10
+ <%= content_tag('span', class: 'al-document-extent badge') do %>
11
+ <%= document.extent %>
12
+ <% end if document.extent %>
13
+ <%= content_tag('div', class: 'al-document-abstract-or-scope') do %>
14
+ <%= content_tag('div', 'data-arclight-truncate' => true) do %>
15
+ <%= document.abstract_or_scope %>
16
+ <% end %>
17
+ <% end if document.abstract_or_scope %>
18
+ </div>
19
+ </div>
20
+ </div>
@@ -0,0 +1,10 @@
1
+ <div class="result-type-group mb-2 mb-lg-0 btn-group float-lg-left float-md-right" role="group" aria-label="<%= t('arclight.views.index.group_results') %>">
2
+ <%= link_to t('arclight.views.index.all_results'),
3
+ search_catalog_path(search_without_group),
4
+ class: "btn btn-outline-secondary #{'active' unless grouped?}"
5
+ %>
6
+ <%= link_to t('arclight.views.index.group_by_collection'),
7
+ search_catalog_path(search_with_group),
8
+ class: "btn btn-outline-secondary #{'active' if grouped?}"
9
+ %>
10
+ </div>
@@ -1 +1 @@
1
-
1
+ <% @page_title = t('arclight.views.home.title') %>
@@ -1,3 +1,6 @@
1
- <div class='breadcrumb-links'>
2
- <%= parents_to_links(document) %>
1
+ <div class="row">
2
+ <div class='breadcrumb-links media'>
3
+ <span class="media-body ml-3" aria-hidden="true"><%= blacklight_icon :repository, classes: 'al-repository-content-icon' %></span>
4
+ <span class="col ml-2 pl-0" ><%= parents_to_links(document) %></span>
5
+ </div>
3
6
  </div>
@@ -0,0 +1,53 @@
1
+ <li id="<%= document.id %>" class="al-collection-context row d-flex align-items-start">
2
+ <div class="documentHeader row" data-document-id="<%= document.id %>">
3
+ <% requestable = item_requestable?('', { document: document }) %>
4
+ <% if document.children? %>
5
+ <div class="al-toggle-children-container">
6
+ <%= link_to(
7
+ blacklight_icon(:plus),
8
+ "##{document.id}-collapsible-hierarchy",
9
+ class: "al-toggle-view-children #{!show_expanded?(document) ? 'collapsed' : ''}",
10
+ 'aria-label': t('arclight.hierarchy.view_all'),
11
+ data: {
12
+ toggle: 'collapse'
13
+ }
14
+ )
15
+ %>
16
+ </div>
17
+ <% end %>
18
+ <div class="col-auto">
19
+ <%= render partial: 'arclight_document_header_icon', locals: { document: document } %>
20
+ </div>
21
+ <div class="col col-no-left-padding d-flex flex-wrap">
22
+ <div class="index_title document-title-heading my-w-75 w-md-100 order-0">
23
+ <% counter = document_counter_with_offset(document_counter) %>
24
+ <%= link_to_document document, document_show_link_field(document), counter: counter %>
25
+ <% if document.children? %>
26
+ <span class="badge badge-pill badge-secondary al-number-of-children-badge"><%= document.number_of_children %><span class="sr-only"><%= t(:'arclight.views.index.number_of_components', count: document.number_of_children) %></span></span>
27
+ <% end %>
28
+ </div>
29
+
30
+ <div class="my-w-25 w-md-100 order-12 order-md-1">
31
+ <%= render_index_doc_actions document, wrapping_class: 'd-flex justify-content-end' %>
32
+ </div>
33
+
34
+ <div class="order-2">
35
+ <div class="row">
36
+ <%= content_tag('div', class: 'al-document-abstract-or-scope mb-0') do %>
37
+ <%= content_tag('div', data: { 'arclight-truncate': true, 'truncate-more': I18n.t('arclight.truncation.view_more'), 'truncate-less': I18n.t('arclight.truncation.view_less') } ) do %>
38
+ <%= document.abstract_or_scope %>
39
+ <% end %>
40
+ <% end if document.abstract_or_scope %>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ </div>
45
+ <% if document.number_of_children > 0 %>
46
+ <%= content_tag(:div, id: "#{document.id}-collapsible-hierarchy",
47
+ class: "collapse al-collection-context-collapsible al-hierarchy-level-#{document.component_level} #{'show' if show_expanded?(document)}",
48
+ data: { resolved: false }
49
+ ) do %>
50
+ <%= generic_context_navigation(document, component_level: document.component_level + 1, original_parents: params[:original_parents]) %>
51
+ <% end %>
52
+ <% end %>
53
+ </li>
@@ -1,7 +1,7 @@
1
1
  <%# header bar for doc items in index view -%>
2
- <div class="documentHeader row" data-document-id="<%= document.id %>">
3
- <h3 class="index_title document-title-heading col-md-12">
2
+ <div class="documentHeader col" data-document-id="<%= document.id %>">
3
+ <h3 class="index_title document-title-heading">
4
4
  <% counter = document_counter_with_offset(document_counter) %>
5
5
  <%= link_to_document document, document_show_link_field(document), counter: counter %>
6
6
  </h3>
7
- </div>
7
+ </div>
@@ -1,4 +1,4 @@
1
- <%= content_tag('div', class: 'al-document-abstract-or-scope', title: document.abstract_or_scope) do %>
1
+ <%= content_tag('div', class: 'al-document-abstract-or-scope') do %>
2
2
  <%= content_tag(:h4, I18n.t('arclight.hierarchy.scope_and_contents'), class: 'al-hierarchy-sub-heading') %>
3
3
  <%= content_tag('div', 'data-arclight-truncate' => true) do %>
4
4
  <%= document.abstract_or_scope %>
@@ -0,0 +1,5 @@
1
+ <% if document.online_content? %>
2
+ <div>
3
+ <%= blacklight_icon :online, classes: 'al-online-content-icon' %>
4
+ </div>
5
+ <% end %>
@@ -0,0 +1,34 @@
1
+ <%
2
+ # Overridden from Blacklight to add a drop down that allows the user to choose to search w/i the collection or all collections
3
+ %>
4
+ <%= form_tag search_action_url, method: :get, class: 'search-query-form pr-0', role: 'search' do %>
5
+ <%= render_hash_as_hidden_fields(search_state.params_for_search.except(:q, :search_field, :qt, :page, :utf8).merge(f: (search_state.params_for_search[:f] || {}).except(:collection_sim))) %>
6
+ <div class="d-md-flex">
7
+ <%= render 'catalog/within_collection_dropdown' %>
8
+
9
+ <% if search_fields.length > 1 %>
10
+ <label for="search_field" class="sr-only"><%= t('blacklight.search.form.search_field.label') %></label>
11
+ <% end %>
12
+ <div class="input-group flex-nowrap">
13
+ <% if search_fields.length > 1 %>
14
+ <%= select_tag(:search_field,
15
+ options_for_select(search_fields, h(params[:search_field])),
16
+ title: t('blacklight.search.form.search_field.title'),
17
+ id: "search_field",
18
+ class: "custom-select search-field") %>
19
+ <% elsif search_fields.length == 1 %>
20
+ <%= hidden_field_tag :search_field, search_fields.first.last %>
21
+ <% end %>
22
+
23
+ <label for="q" class="sr-only"><%= t('blacklight.search.form.search.label') %></label>
24
+ <%= text_field_tag :q, params[:q], placeholder: t('blacklight.search.form.search.placeholder'), class: "search-q q rounded-0 form-control", id: "q", autofocus: presenter.autofocus?, data: { autocomplete_enabled: presenter.autocomplete_enabled?, autocomplete_path: search_action_path(action: :suggest) } %>
25
+
26
+ <span class="input-group-append">
27
+ <button type="submit" class="btn btn-primary search-btn" id="search">
28
+ <span class="submit-search-text d-none d-lg-inline"><%= t('blacklight.search.form.submit') %></span>
29
+ <%= blacklight_icon :search, aria_hidden: true %>
30
+ </button>
31
+ </span>
32
+ </div>
33
+ </div>
34
+ <% end %>
@@ -1,5 +1,3 @@
1
- <h2 class="sr-only top-content-title"><%= t('blacklight.search.search_results_header') %></h2>
2
-
3
1
  <% @page_title = t('blacklight.search.page_title.title', :constraints => render_search_to_page_title(params), :application_name => application_name) %>
4
2
 
5
3
  <% content_for(:head) do %>
@@ -9,10 +7,9 @@
9
7
  <% end %>
10
8
 
11
9
  <% content_for(:container_header) do %>
10
+ <h1 class="sr-only top-content-title"><%= search_results_header_text %></h1>
12
11
  <%= render 'shared/breadcrumbs' %>
13
12
  <%= render 'search_results_repository' %>
14
- <%= render 'collection_count' %>
15
- <%= render 'results_histogram' %>
16
13
  <%= render 'constraints' %>
17
14
  <% end %>
18
15
 
@@ -0,0 +1,27 @@
1
+ <div class='al-show-actions-box'>
2
+ <div class="al-actions-box-container">
3
+ <% if document.unitid || document.containers.present? %>
4
+ <div class='al-collection-id'>
5
+ <% if document.unitid %>
6
+ <%= t(:'arclight.views.show.collection_id', id: document.unitid) %>
7
+ <% end %>
8
+
9
+ <% if document.unitid && document.containers.present? %>
10
+ <span> | </span>
11
+ <% end %>
12
+
13
+ <% if document.containers.present? %>
14
+ <span><%= document.containers.join(', ') %></span>
15
+ <% end %>
16
+ </div>
17
+ <% end %>
18
+ <div class='al-show-actions-box-options d-flex'>
19
+ <%= render partial: 'arclight/requests', locals: { document: document } %>
20
+ <div class='al-show-actions-box-bookmarks flex-md-fill'>
21
+ <%= render partial: 'catalog/bookmark_control', locals: { document: document } %>
22
+ </div>
23
+ </div>
24
+ </div>
25
+
26
+ <%= render document.downloads %>
27
+ </div>
@@ -1,21 +1,6 @@
1
- <% parents = Arclight::Parents.from_solr_document(document).as_parents %>
2
- <div class='al-show-breadcrumb'>
3
- <nav aria-label="breadcrumb">
4
- <ol class="breadcrumb">
5
- <li class="breadcrumb-item breadcrumb-item-1">
6
- <%= link_to t('arclight.routes.home'), root_path %>
7
- </li>
8
- <li class="breadcrumb-item breadcrumb-item-2 al-bc-item">
9
- <%= link_to t('arclight.routes.collections'), arclight_engine.collections_path %>
10
- </li>
11
- <% parents.each_with_index.map do |parent, index| %>
12
- <%= content_tag :li, class: "breadcrumb-item breadcrumb-item-#{index + 3} al-bc-item" do %>
13
- <%= link_to parent.label, solr_document_path(parent.global_id) %>
14
- <% end %>
15
- <% end %>
16
- </ol>
17
- <h1 class="breadcrumb-item breadcrumb-item-<%= parents.length + 3 %> al-bc-item">
18
- <%= document.normalized_title %>
19
- </h1>
20
- </nav>
1
+ <div class='d-md-flex justify-content-between al-show'>
2
+ <div class='al-show-breadcrumb'>
3
+ <%= render partial: 'shared/show_breadcrumbs', locals: {document: document} %>
4
+ </div>
5
+ <%= render_document_partial(document, :show_actions_box) %>
21
6
  </div>
@@ -1,48 +1,66 @@
1
+ <% parents = Arclight::Parents.from_solr_document(document).as_parents %>
1
2
  <div class='row'>
2
- <div class='col-md-3'>
3
- <%= render partial: 'show_sidebar' %>
4
- </div>
5
- <div class='col-md-9'>
3
+ <div class='col-md-12'>
4
+ <% if document.digital_objects.present? %>
5
+ <%= content_tag :p, class: "media breadcrumb-item breadcrumb-item-#{parents.length + 3}" do %>
6
+ <span class="media-body al-online-content-icon" aria-hidden="true"><%= blacklight_icon :online %></span>
7
+ <span class="col text-muted">
8
+ <%= t('arclight.views.show.online_content_upper') %>
9
+ </span>
10
+ <%= render_document_partial(document, 'arclight_viewer') %>
11
+ <% end %>
12
+ <% end %>
6
13
  <div class='row'>
7
- <div class='col-lg-9'>
8
- <ul class='nav nav-pills' role='tablist'>
9
- <li class='nav-item'>
10
- <a class='nav-link active' data-toggle='pill' href='#overview' role='tab'>
14
+ <div class='col-lg-12'>
15
+ <ul class='nav nav-tabs nav-fill' role='tablist' aria-label='<%= t('arclight.views.show.tablist_nav') %>'>
16
+ <li class='nav-item flex-fill'>
17
+ <a class='nav-link p-1 p-sm-2 active' data-toggle='tab' href='#context' role='tab'>
11
18
  <%= t 'arclight.views.show.overview' %>
12
19
  </a>
13
20
  </li>
14
- <li class='nav-item'>
15
- <a class='nav-link disabled' data-toggle='pill' href='#contents' role='tab' data-hierarchy-enable-me='true'>
21
+ <li class='nav-item flex-fill'>
22
+ <a class='nav-link p-1 p-sm-2 disabled' data-toggle='tab' href='#contents' role='tab' data-hierarchy-enable-me='true'>
16
23
  <%= t 'arclight.views.show.no_contents' %>
17
24
  </a>
18
25
  </li>
19
- <li class='nav-item'>
20
- <a class='nav-link <%= 'disabled' unless document.digital_objects.present? || document.online_content? %>' data-toggle='pill' href='#online-content' role='tab' data-arclight-online-content-tab='true'>
21
- <% if document.digital_objects.present? || document.online_content? %>
26
+ <% if document.online_content? %>
27
+ <li class='nav-item flex-fill'>
28
+ <a class='nav-link p-1 p-sm-2' data-toggle='tab' href='#online-content' role='tab' data-arclight-online-content-tab='true'>
22
29
  <%= t 'arclight.views.show.online_content' %>
23
- <% else %>
24
- <%= t 'arclight.views.show.no_online_content' %>
25
- <% end %>
30
+ </a>
31
+ </li>
32
+ <% end %>
33
+ <li class='nav-item flex-fill'>
34
+ <a class='nav-link p-1 p-sm-2' data-toggle='tab' href='#access' role='tab'>
35
+ <%= t 'arclight.views.show.access' %>
26
36
  </a>
27
37
  </li>
28
38
  </ul>
29
39
  </div>
30
-
31
- <div class='col'>
32
- <%= render partial: 'collection_downloads', locals: { downloads: collection_downloads(document) } %>
33
- </div>
34
40
  </div>
35
41
 
36
42
  <div class='tab-content'>
37
- <div class='tab-pane active' id='overview' role='tabpanel'>
38
- <%= render 'collection_overview' %>
43
+ <div class='tab-pane active' id='context' role='tabpanel'>
44
+ <%= render 'collection_context' %>
39
45
  </div>
40
46
  <div class='tab-pane' id='contents' role='tabpanel'>
41
47
  <%= render 'collection_contents' %>
42
48
  </div>
43
- <div class='tab-pane' id='online-content' role='tabpanel'>
44
- <%= render partial: 'collection_online_contents', locals: { document: document } %>
49
+ <% if document.online_content? %>
50
+ <div class='tab-pane' id='online-content' role='tabpanel'>
51
+ <%= render partial: 'collection_online_contents', locals: { document: document } %>
52
+ </div>
53
+ <% end %>
54
+ <div class='tab-pane' id='access' role='tabpanel'>
55
+ <h2 class="sr-only"><%= t 'arclight.views.show.access' %></h2>
56
+ <% unless blacklight_config.show.context_access_tab_items.nil? %>
57
+ <% items = blacklight_config.show.context_access_tab_items.select { |i| fields_have_content?(@document, i) } %>
58
+ <% items.each_with_index do |item, index| %>
59
+ <%= render partial: 'access_contents', locals: { document: @document, field_accessor: item, card_index: index} %>
60
+ <% end %>
61
+ <% end %>
45
62
  </div>
46
63
  </div>
47
64
  </div>
65
+
48
66
  </div>
@@ -1,42 +1,70 @@
1
+ <% parents = Arclight::Parents.from_solr_document(document).as_parents %>
1
2
  <div class='row'>
2
- <div class='col-md-3'>
3
- <%= render partial: 'show_component_sidebar' %>
4
- </div>
5
- <div class='col-md-9'>
6
- <ul class='nav nav-pills' role='tablist'>
7
- <li class='nav-item'>
8
- <a class='nav-link active' data-toggle='pill' href='#overview' role='tab'>
9
- <%= t 'arclight.views.show.overview' %>
10
- </a>
11
- </li>
12
- <% if document.children? %>
13
- <li class='nav-item'>
14
- <a class='nav-link disabled' data-toggle='pill' href='#contents' role='tab' data-hierarchy-enable-me='true'>
15
- <%= t 'arclight.views.show.no_contents' %>
16
- </a>
17
- </li>
3
+ <div class='col-md-12'>
4
+ <% if document.digital_objects.present? %>
5
+ <%= content_tag :p, class: "media breadcrumb-item breadcrumb-item-#{parents.length + 3}" do %>
6
+ <span class="media-body al-online-content-icon" aria-hidden="true"><%= blacklight_icon :online %></span>
7
+ <span class="col text-muted">
8
+ <%= t('arclight.views.show.online_content_upper') %>
9
+ </span>
10
+ <%= render_document_partial(document, 'arclight_viewer') %>
18
11
  <% end %>
19
- <li class='nav-item'>
20
- <a class='nav-link <%= 'disabled' unless document.online_content? %>' data-toggle='pill' href='#online-content' role='tab' data-arclight-online-content-tab='true'>
21
- <% if document.online_content? %>
22
- <%= t 'arclight.views.show.online_content' %>
23
- <% else %>
24
- <%= t 'arclight.views.show.no_online_content' %>
12
+ <% end %>
13
+ <div class='row'>
14
+ <div class='col-md-12'>
15
+ <ul class='nav nav-tabs nav-fill' role='tablist' aria-label='<%= t('arclight.views.show.tablist_nav') %>'>
16
+ <li class='nav-item flex-fill'>
17
+ <a class='nav-link p-1 p-sm-2 active' data-toggle='tab' href='#context' role='tab'>
18
+ <%= t 'arclight.views.show.context' %>
19
+ </a>
20
+ </li>
21
+ <% if document.online_content? && document.children? %>
22
+ <li class='nav-item flex-fill'>
23
+ <a class='nav-link p-1 p-sm-2' data-toggle='tab' href='#online-content' role='tab' data-arclight-online-content-tab='true'>
24
+ <%= t 'arclight.views.show.online_content' %>
25
+ <span data-arclight-online-content-tab-count/>
26
+ </a>
27
+ </li>
25
28
  <% end %>
26
- </a>
27
- </li>
28
- </ul>
29
- <div class='tab-content'>
30
- <div class='tab-pane active' id='overview' role='tabpanel'>
31
- <%= render 'component_overview' %>
32
- </div>
33
- <div class='tab-pane' id='contents' role='tabpanel'>
34
- <%= render 'component_contents' %>
35
- </div>
36
- <div class='tab-pane' id='online-content' role='tabpanel'>
37
- <%= render_document_partial(document, 'arclight_viewer') %>
29
+ <li class='nav-item flex-fill'>
30
+ <a class='nav-link p-1 p-sm-2' data-toggle='tab' href='#access' role='tab'>
31
+ <%= t 'arclight.views.show.access' %>
32
+ </a>
33
+ </li>
34
+ </ul>
35
+ <div class='tab-content'>
36
+ <div class='tab-pane active' id='context' role='tabpanel'>
37
+ <%= render 'component_context' %>
38
+ </div>
39
+ <% if document.online_content? && document.children? %>
40
+ <div class='tab-pane' id='online-content' role='tabpanel'>
41
+ <%= content_tag(
42
+ :div, '',
43
+ class: 'al-contents',
44
+ data: {
45
+ arclight: {
46
+ path: search_catalog_path,
47
+ name: document.collection_name,
48
+ access: 'online',
49
+ view: 'online_contents',
50
+ parent: document.reference,
51
+ search_field: 'within_collection'
52
+ }
53
+ }
54
+ ) %>
55
+ </div>
56
+ <% end %>
57
+ <div class='tab-pane' id='access' role='tabpanel'>
58
+ <h2 class="sr-only"><%= t 'arclight.views.show.access' %></h2>
59
+ <% unless blacklight_config.show.component_access_tab_items.nil? %>
60
+ <% items = blacklight_config.show.component_access_tab_items.select { |i| fields_have_content?(@document, i) } %>
61
+ <% items.each_with_index do |item, index| %>
62
+ <%= render partial: 'access_contents', locals: { document: @document, field_accessor: item, card_index: index} %>
63
+ <% end %>
64
+ <% end %>
65
+ </div>
66
+ </div>
38
67
  </div>
39
68
  </div>
40
69
  </div>
41
-
42
70
  </div>
@@ -1,6 +1,6 @@
1
1
  <% if blacklight_config.show.component_metadata_partials.present? %>
2
2
  <% parents = Arclight::Parents.from_solr_document(document).as_parents %>
3
- <dl class="breadcrumb-item breadcrumb-item-<%= parents.length + 3 %>">
3
+ <dl class="al-metadata-section breadcrumb-item breadcrumb-item-<%= parents.length + 3 %>">
4
4
  <% blacklight_config.show.component_metadata_partials.each do |metadata| %>
5
5
  <% doc_presenter = show_presenter(document).with_field_group(metadata) %>
6
6
  <% generic_document_fields(metadata).each do |field_name, field| %>