blacklight 7.10.0 → 7.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +56 -7
  3. data/.rubocop_todo.yml +113 -98
  4. data/.travis.yml +0 -2
  5. data/Gemfile +0 -7
  6. data/README.md +1 -0
  7. data/VERSION +1 -1
  8. data/app/assets/javascripts/blacklight/blacklight.js +1 -2
  9. data/app/components/blacklight/document/bookmark_component.html.erb +16 -0
  10. data/app/components/blacklight/document/bookmark_component.rb +19 -0
  11. data/app/components/blacklight/document/citation_component.html.erb +9 -0
  12. data/app/components/blacklight/document/citation_component.rb +24 -0
  13. data/app/components/blacklight/document/more_like_this_component.html.erb +12 -0
  14. data/app/components/blacklight/document/more_like_this_component.rb +21 -0
  15. data/app/components/blacklight/document_component.html.erb +29 -0
  16. data/app/components/blacklight/document_component.rb +121 -0
  17. data/app/components/blacklight/document_metadata_component.html.erb +5 -0
  18. data/app/components/blacklight/document_metadata_component.rb +21 -0
  19. data/app/components/blacklight/facet_item_component.rb +6 -6
  20. data/app/components/blacklight/metadata_field_component.html.erb +8 -0
  21. data/app/components/blacklight/metadata_field_component.rb +31 -0
  22. data/app/components/blacklight/metadata_field_layout_component.html.erb +2 -0
  23. data/app/components/blacklight/metadata_field_layout_component.rb +16 -0
  24. data/app/components/blacklight/response/facet_group_component.html.erb +25 -0
  25. data/app/components/blacklight/response/facet_group_component.rb +19 -0
  26. data/app/components/blacklight/response/pagination_component.html.erb +3 -0
  27. data/app/components/blacklight/response/pagination_component.rb +17 -0
  28. data/app/components/blacklight/response/sort_component.html.erb +6 -0
  29. data/app/components/blacklight/response/sort_component.rb +16 -0
  30. data/app/components/blacklight/response/spellcheck_component.html.erb +7 -0
  31. data/app/components/blacklight/response/spellcheck_component.rb +20 -0
  32. data/app/components/blacklight/search_bar_component.html.erb +29 -0
  33. data/app/components/blacklight/search_bar_component.rb +45 -0
  34. data/app/components/blacklight/search_context_component.html.erb +10 -0
  35. data/app/components/blacklight/search_context_component.rb +30 -0
  36. data/app/components/blacklight/system/dropdown_component.html.erb +12 -0
  37. data/app/components/blacklight/system/dropdown_component.rb +42 -0
  38. data/app/components/blacklight/system/modal_component.html.erb +25 -0
  39. data/app/components/blacklight/system/modal_component.rb +9 -0
  40. data/app/controllers/concerns/blacklight/catalog.rb +5 -4
  41. data/app/controllers/concerns/blacklight/default_component_configuration.rb +2 -2
  42. data/app/controllers/concerns/blacklight/searchable.rb +11 -0
  43. data/app/helpers/blacklight/blacklight_helper_behavior.rb +14 -3
  44. data/app/helpers/blacklight/catalog_helper_behavior.rb +1 -0
  45. data/app/helpers/blacklight/component_helper_behavior.rb +2 -2
  46. data/app/helpers/blacklight/configuration_helper_behavior.rb +6 -0
  47. data/app/helpers/blacklight/facets_helper_behavior.rb +1 -1
  48. data/app/helpers/blacklight/icon_helper_behavior.rb +2 -2
  49. data/app/helpers/blacklight/search_history_constraints_helper_behavior.rb +7 -10
  50. data/app/helpers/blacklight/url_helper_behavior.rb +3 -3
  51. data/app/javascript/blacklight/search_context.js +0 -1
  52. data/app/models/blacklight/icon.rb +1 -0
  53. data/app/models/concerns/blacklight/document.rb +1 -0
  54. data/app/models/record_mailer.rb +1 -1
  55. data/app/presenters/blacklight/document_presenter.rb +7 -1
  56. data/app/presenters/blacklight/field_presenter.rb +1 -0
  57. data/app/presenters/blacklight/rendering/microdata.rb +1 -1
  58. data/app/services/blacklight/field_retriever.rb +1 -0
  59. data/app/services/blacklight/search_service.rb +1 -0
  60. data/app/views/catalog/_bookmark_control.html.erb +1 -36
  61. data/app/views/catalog/_citation.html.erb +4 -25
  62. data/app/views/catalog/_did_you_mean.html.erb +1 -5
  63. data/app/views/catalog/_document.atom.builder +3 -3
  64. data/app/views/catalog/_document.html.erb +5 -5
  65. data/app/views/catalog/_facet_group.html.erb +5 -19
  66. data/app/views/catalog/_index.html.erb +1 -10
  67. data/app/views/catalog/_paginate_compact.html.erb +6 -6
  68. data/app/views/catalog/_per_page_widget.html.erb +9 -12
  69. data/app/views/catalog/_previous_next_doc.html.erb +1 -12
  70. data/app/views/catalog/_results_pagination.html.erb +1 -3
  71. data/app/views/catalog/_search_form.html.erb +6 -27
  72. data/app/views/catalog/_show.html.erb +6 -8
  73. data/app/views/catalog/_show_main_content.html.erb +19 -13
  74. data/app/views/catalog/_show_sidebar.html.erb +1 -11
  75. data/app/views/catalog/_sort_widget.html.erb +5 -12
  76. data/app/views/catalog/email.html.erb +7 -7
  77. data/app/views/catalog/email_success.html.erb +5 -12
  78. data/app/views/catalog/facet.html.erb +14 -17
  79. data/app/views/catalog/index.atom.builder +0 -1
  80. data/app/views/catalog/sms.html.erb +7 -7
  81. data/app/views/catalog/sms_success.html.erb +5 -12
  82. data/blacklight.gemspec +3 -2
  83. data/config/i18n-tasks.yml +3 -0
  84. data/config/locales/blacklight.ar.yml +2 -0
  85. data/config/locales/blacklight.de.yml +2 -0
  86. data/config/locales/blacklight.en.yml +2 -0
  87. data/config/locales/blacklight.es.yml +4 -2
  88. data/config/locales/blacklight.fr.yml +2 -0
  89. data/config/locales/blacklight.hu.yml +2 -0
  90. data/config/locales/blacklight.it.yml +2 -0
  91. data/config/locales/blacklight.nl.yml +2 -0
  92. data/config/locales/blacklight.pt-BR.yml +2 -0
  93. data/config/locales/blacklight.sq.yml +2 -0
  94. data/config/locales/blacklight.zh.yml +2 -0
  95. data/lib/blacklight.rb +10 -0
  96. data/lib/blacklight/configuration.rb +8 -3
  97. data/lib/blacklight/configuration/fields.rb +5 -7
  98. data/lib/blacklight/engine.rb +1 -1
  99. data/lib/blacklight/nested_open_struct_with_hash_access.rb +1 -0
  100. data/lib/blacklight/search_state.rb +21 -7
  101. data/lib/blacklight/solr/response.rb +1 -0
  102. data/lib/blacklight/solr/response/facets.rb +9 -8
  103. data/lib/generators/blacklight/models_generator.rb +2 -0
  104. data/lib/generators/blacklight/templates/config/blacklight.yml +1 -0
  105. data/lib/railties/blacklight.rake +18 -13
  106. data/package.json +1 -1
  107. data/spec/components/blacklight/constraint_layout_component_spec.rb +1 -0
  108. data/spec/components/blacklight/document_component_spec.rb +129 -0
  109. data/spec/components/blacklight/document_metadata_component_spec.rb +0 -0
  110. data/spec/components/blacklight/metadata_field_component_spec.rb +41 -0
  111. data/spec/controllers/blacklight/search_fields_spec.rb +2 -2
  112. data/spec/controllers/catalog_controller_spec.rb +20 -0
  113. data/spec/features/search_context_spec.rb +12 -2
  114. data/spec/features/search_filters_spec.rb +4 -0
  115. data/spec/features/search_results_spec.rb +1 -0
  116. data/spec/features/sitelinks_search_box.rb +1 -0
  117. data/spec/helpers/blacklight/configuration_helper_behavior_spec.rb +3 -0
  118. data/spec/helpers/blacklight/render_partials_helper_behavior_spec.rb +1 -0
  119. data/spec/helpers/blacklight/search_history_constraints_helper_behavior_spec.rb +2 -0
  120. data/spec/helpers/blacklight/url_helper_behavior_spec.rb +1 -1
  121. data/spec/helpers/blacklight_helper_spec.rb +14 -1
  122. data/spec/helpers/catalog_helper_spec.rb +1 -4
  123. data/spec/lib/blacklight/search_state_spec.rb +32 -0
  124. data/spec/models/blacklight/configuration_spec.rb +5 -0
  125. data/spec/models/blacklight/document/cache_key_spec.rb +1 -0
  126. data/spec/models/blacklight/document/email_spec.rb +2 -0
  127. data/spec/models/blacklight/document/sms_spec.rb +2 -0
  128. data/spec/models/blacklight/facet_paginator_spec.rb +3 -0
  129. data/spec/models/blacklight/icon_spec.rb +6 -0
  130. data/spec/models/blacklight/solr/document_spec.rb +10 -0
  131. data/spec/models/blacklight/solr/response/facets_spec.rb +1 -1
  132. data/spec/models/blacklight/solr/response/group_response_spec.rb +2 -0
  133. data/spec/models/blacklight/solr/search_builder_spec.rb +10 -0
  134. data/spec/models/record_mailer_spec.rb +9 -0
  135. data/spec/models/search_spec.rb +1 -0
  136. data/spec/presenters/blacklight/show_presenter_spec.rb +8 -0
  137. data/spec/routing/catalog_routing_spec.rb +4 -0
  138. data/spec/services/blacklight/search_service_spec.rb +7 -0
  139. data/spec/spec_helper.rb +1 -1
  140. data/spec/views/catalog/_document.html.erb_spec.rb +13 -11
  141. data/spec/views/catalog/_facet_group.html.erb_spec.rb +1 -0
  142. data/spec/views/catalog/_facet_index_navigation.html.erb_spec.rb +1 -0
  143. data/spec/views/catalog/_previous_next_doc.html.erb_spec.rb +4 -0
  144. data/spec/views/catalog/index.atom.builder_spec.rb +40 -3
  145. data/spec/views/catalog/show.html.erb_spec.rb +14 -0
  146. data/tasks/blacklight.rake +7 -7
  147. metadata +56 -6
@@ -1,8 +1,6 @@
1
- <% doc_presenter = show_presenter(document) %>
2
- <%# default partial to display solr document fields in catalog show view -%>
3
- <dl class="row dl-invert document-metadata">
4
- <% doc_presenter.fields_to_render.each do |field_name, field, field_presenter| -%>
5
- <dt class="blacklight-<%= field_name.parameterize %> col-md-3"><%= render_document_show_field_label document, label: field_presenter.label, field: field_name %></dt>
6
- <dd class="blacklight-<%= field_name.parameterize %> col-md-9"><%= field_presenter.render %></dd>
7
- <% end -%>
8
- </dl>
1
+ <%= render(
2
+ Blacklight::DocumentMetadataComponent.new(
3
+ fields: show_presenter(document).field_presenters,
4
+ show: true
5
+ )
6
+ ) %>
@@ -1,19 +1,25 @@
1
- <%= render 'previous_next_doc' if @search_context %>
1
+ <%= render 'previous_next_doc' if @search_context && search_session['document_id'] == @document.id %>
2
2
 
3
3
  <% @page_title = t('blacklight.search.show.title', :document_title => document_show_html_title, :application_name => application_name).html_safe %>
4
4
  <% content_for(:head) { render_link_rel_alternates } %>
5
5
 
6
- <div id="document" class="document <%= render_document_class %>" itemscope itemtype="<%= @document.itemtype %>">
7
- <div id="doc_<%= @document.id.to_s.parameterize %>">
8
- <%= render_document_partials @document, blacklight_config.view_config(:show).partials %>
9
- </div>
10
- </div>
6
+ <%= render (blacklight_config.show.document_component || Blacklight::DocumentComponent).new(document: @document, component: :div, title_component: :h1, show: true) do |component| %>
7
+ <% component.with(:footer) do %>
8
+ <% if @document.respond_to?(:export_as_openurl_ctx_kev) %>
9
+ <!--
10
+ // COinS, for Zotero among others.
11
+ // This document_partial_name(@document) business is not quite right,
12
+ // but has been there for a while.
13
+ -->
14
+ <span class="Z3988" title="<%= @document.export_as_openurl_ctx_kev(document_partial_name(@document)) %>"></span>
15
+ <% end %>
16
+ <% end %>
11
17
 
12
- <% if @document.respond_to?(:export_as_openurl_ctx_kev) %>
13
- <!--
14
- // COinS, for Zotero among others.
15
- // This document_partial_name(@document) business is not quite right,
16
- // but has been there for a while.
17
- -->
18
- <span class="Z3988" title="<%= @document.export_as_openurl_ctx_kev(document_partial_name(@document)) %>"></span>
18
+ <%# Use :body for complete backwards compatibility (overriding the component body markup),
19
+ but if the app explicitly opted-in to components, make the partials data available as :partials to ease migrations pain %>
20
+ <% component.with(blacklight_config.show.document_component.blank? && blacklight_config.view_config(:show).partials.any? ? :body : :partials) do %>
21
+ <div id="doc_<%= @document.id.to_s.parameterize %>">
22
+ <%= render_document_partials @document, blacklight_config.view_config(:show).partials, component: component %>
23
+ </div>
24
+ <% end %>
19
25
  <% end %>
@@ -1,12 +1,2 @@
1
1
  <%= render 'show_tools' %>
2
-
3
- <% unless document.more_like_this.empty? %>
4
- <div class="card">
5
- <div class="card-header">More Like This</div>
6
- <div class="card-body">
7
- <%= render collection: document.more_like_this,
8
- partial: 'show_more_like_this',
9
- as: :document %>
10
- </div>
11
- </div>
12
- <% end %>
2
+ <%= render(Blacklight::Document::MoreLikeThisComponent.new(document: document)) %>
@@ -1,13 +1,6 @@
1
- <% if show_sort_and_per_page? and active_sort_fields.many? %>
2
- <div id="sort-dropdown" class="sort-dropdown btn-group">
3
- <button type="button" class="btn btn-outline-secondary dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
4
- <%= t('blacklight.search.sort.label_html', :field =>sort_field_label(current_sort_field.key)) %> <span class="caret"></span>
5
- </button>
6
-
7
- <div class="dropdown-menu" role="menu">
8
- <%- active_sort_fields.each do |sort_key, field_config| %>
9
- <%= link_to(sort_field_label(sort_key), url_for(search_state.params_for_search(sort: sort_key)), class: 'dropdown-item', role: 'menuitem') %>
10
- <%- end -%>
11
- </div>
12
- </div>
1
+ <% if show_sort_and_per_page? %>
2
+ <%= render(Blacklight::Response::SortComponent.new(
3
+ choices: active_sort_fields.map { |key, config| [sort_field_label(config.key), key] },
4
+ search_state: search_state,
5
+ selected: current_sort_field&.key)) %>
13
6
  <% end %>
@@ -1,7 +1,7 @@
1
- <div class="modal-header">
2
- <h1 class="modal-title"><%= t('blacklight.email.form.title') %></h1>
3
- <button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>">
4
- <span aria-hidden="true">&times;</span>
5
- </button>
6
- </div>
7
- <%= render :partial => 'email_form' %>
1
+ <%= render Blacklight::System::ModalComponent.new do |component| %>
2
+ <% component.with(:title, t('blacklight.email.form.title')) %>
3
+
4
+ <% component.with(:body) do %>
5
+ <%= render 'email_form' %>
6
+ <% end %>
7
+ <% end %>
@@ -1,13 +1,6 @@
1
- <div data-blacklight-modal="container">
2
- <div class="modal-header">
3
- <h1><%= t('blacklight.email.form.title') %></h1>
4
- <button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>">
5
- <span aria-hidden="true">&times;</span>
6
- </button>
7
- </div>
1
+ <%= render Blacklight::System::ModalComponent.new do |component| %>
2
+ <% component.with(:title, t('blacklight.email.form.title')) %>
8
3
 
9
- <div class="modal-body">
10
- <%= render partial: '/shared/flash_msg' %>
11
- <span data-blacklight-modal="close"></span>
12
- </div>
13
- </div>
4
+ <%= render partial: '/shared/flash_msg' %>
5
+ <span data-blacklight-modal="close"></span>
6
+ <% end %>
@@ -1,24 +1,21 @@
1
- <div class="facet-pagination top row justify-content-between">
2
- <%= render :partial=>'facet_pagination' %>
3
- </div>
1
+ <%= render Blacklight::System::ModalComponent.new do |component| %>
2
+ <% component.with(:prefix) do %>
3
+ <div class="facet-pagination top row justify-content-between">
4
+ <%= render :partial=>'facet_pagination' %>
5
+ </div>
6
+ <% end %>
4
7
 
5
- <div class="modal-header">
6
- <h1 class="modal-title"><%= facet_field_label(@facet.key) %></h1>
7
- <button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>">
8
- <span aria-hidden="true">&times;</span>
9
- </button>
10
- </div>
8
+ <% component.with(:title, facet_field_label(@facet.key)) %>
11
9
 
12
- <div class="modal-body">
13
10
  <%= render partial: 'facet_index_navigation' if @facet.index_range && @display_facet.index? %>
14
11
 
15
12
  <div class="facet-extended-list">
16
- <%= render_facet_limit(@display_facet, layout: false) %>
13
+ <%= render_facet_limit(@display_facet, layout: false) %>
17
14
  </div>
18
- </div>
19
15
 
20
- <div class="modal-footer">
21
- <div class="facet-pagination bottom row justify-content-between">
22
- <%= render :partial=>'facet_pagination' %>
23
- </div>
24
- </div>
16
+ <% component.with(:footer) do %>
17
+ <div class="facet-pagination bottom row justify-content-between">
18
+ <%= render :partial=>'facet_pagination' %>
19
+ </div>
20
+ <% end %>
21
+ <% end %>
@@ -6,7 +6,6 @@ xml.instruct!(:xml, encoding: "UTF-8")
6
6
 
7
7
  xml.feed("xmlns" => "http://www.w3.org/2005/Atom",
8
8
  "xmlns:opensearch" => "http://a9.com/-/spec/opensearch/1.1/") do
9
-
10
9
  xml.title t('blacklight.search.page_title.title', constraints: render_search_to_page_title(params), application_name: application_name)
11
10
  # an author is required, so we'll just use the app name
12
11
  xml.author { xml.name application_name }
@@ -1,7 +1,7 @@
1
- <div class="modal-header">
2
- <h1 class="modal-title"><%= t('blacklight.sms.form.title') %></h1>
3
- <button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>">
4
- <span aria-hidden="true">&times;</span>
5
- </button>
6
- </div>
7
- <%= render :partial => 'sms_form' %>
1
+ <%= render Blacklight::System::ModalComponent.new do |component| %>
2
+ <% component.with(:title, t('blacklight.sms.form.title')) %>
3
+
4
+ <% component.with(:body) do %>
5
+ <%= render 'sms_form' %>
6
+ <% end %>
7
+ <% end %>
@@ -1,13 +1,6 @@
1
- <div data-blacklight-modal="container">
2
- <div class="modal-header">
3
- <h1 class="modal-title"><%= t('blacklight.sms.form.title') %></h1>
4
- <button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>">
5
- <span aria-hidden="true">&times;</span>
6
- </button>
7
- </div>
1
+ <%= render Blacklight::System::ModalComponent.new do |component| %>
2
+ <% component.with(:title, t('blacklight.sms.form.title')) %>
8
3
 
9
- <div class="modal-body">
10
- <%= render partial: '/shared/flash_msg' %>
11
- <span data-blacklight-modal="close"></span>
12
- </div>
13
- </div>
4
+ <%= render partial: '/shared/flash_msg' %>
5
+ <span data-blacklight-modal="close"></span>
6
+ <% end %>
@@ -42,7 +42,8 @@ Gem::Specification.new do |s|
42
42
  s.add_development_dependency 'engine_cart', '~> 2.1'
43
43
  s.add_development_dependency "equivalent-xml"
44
44
  s.add_development_dependency "simplecov"
45
- s.add_development_dependency "rubocop", '~> 0.63.0'
46
- s.add_development_dependency "rubocop-rspec", '~> 1.8'
45
+ s.add_development_dependency "rubocop", '~> 0.85'
46
+ s.add_development_dependency "rubocop-rails", '~> 2.6'
47
+ s.add_development_dependency "rubocop-rspec", '~> 1.43'
47
48
  s.add_development_dependency "i18n-tasks"
48
49
  end
@@ -15,3 +15,6 @@ search:
15
15
  exclude:
16
16
  - app/assets/images
17
17
  - app/assets/fonts
18
+
19
+ ignore_missing:
20
+ - 'button_label_html'
@@ -217,6 +217,8 @@ ar:
217
217
  pivot:
218
218
  show: فتح
219
219
  hide: "إغلاق"
220
+ group:
221
+ toggle: 'المزيد »'
220
222
  group:
221
223
  more: 'المزيد »'
222
224
  filters:
@@ -197,6 +197,8 @@ de:
197
197
  pivot:
198
198
  show: Öffnen
199
199
  hide: Schließen
200
+ group:
201
+ toggle: 'mehr »'
200
202
  group:
201
203
  more: 'mehr »'
202
204
  filters:
@@ -197,6 +197,8 @@ en:
197
197
  pivot:
198
198
  show: Show
199
199
  hide: Hide
200
+ group:
201
+ toggle: Toggle facets
200
202
  group:
201
203
  more: 'more »'
202
204
  filters:
@@ -169,8 +169,8 @@ es:
169
169
  pagination:
170
170
  title: 'Resultados de navegación'
171
171
  pagination_info:
172
- no_items_found: 'No %{entry_name} encontrado'
173
- single_item_found: '<strong>1</strong> %{entry_name} encontrado'
172
+ no_items_found: 'No %{entry_name} encontrada'
173
+ single_item_found: '<strong>1</strong> %{entry_name} encontrada'
174
174
  pages:
175
175
  one: '<strong>%{start_num}</strong> - <strong>%{end_num}</strong> de <strong>%{total_num}</strong>'
176
176
  other: '<strong>%{start_num}</strong> - <strong>%{end_num}</strong> de <strong>%{total_num}</strong>'
@@ -197,6 +197,8 @@ es:
197
197
  pivot:
198
198
  show: Abierto
199
199
  hide: Cerrar
200
+ group:
201
+ toggle: 'más »'
200
202
  group:
201
203
  more: 'más »'
202
204
  filters:
@@ -200,6 +200,8 @@ fr:
200
200
  pivot:
201
201
  show: Ouvrir
202
202
  hide: Fermer
203
+ group:
204
+ toggle: 'plus »'
203
205
  group:
204
206
  more: 'plus »'
205
207
  filters:
@@ -197,6 +197,8 @@ hu:
197
197
  pivot:
198
198
  show: Megnyitás
199
199
  hide: Bezárás
200
+ group:
201
+ toggle: 'több »'
200
202
  group:
201
203
  more: 'több »'
202
204
  filters:
@@ -197,6 +197,8 @@ it:
197
197
  pivot:
198
198
  show: Apri
199
199
  hide: Chiudi
200
+ group:
201
+ toggle: 'altri »'
200
202
  group:
201
203
  more: 'altri »'
202
204
  filters:
@@ -197,6 +197,8 @@ nl:
197
197
  pivot:
198
198
  show: Openen
199
199
  hide: Sluiten
200
+ group:
201
+ toggle: 'meer »'
200
202
  group:
201
203
  more: 'meer »'
202
204
  filters:
@@ -198,6 +198,8 @@ pt-BR:
198
198
  pivot:
199
199
  show: Abrir
200
200
  hide: Fechar
201
+ group:
202
+ toggle: 'mais »'
201
203
  group:
202
204
  more: 'mais »'
203
205
  filters:
@@ -197,6 +197,8 @@ sq:
197
197
  pivot:
198
198
  show: Hape
199
199
  hide: "Mbylle"
200
+ group:
201
+ toggle: 'më shumë »'
200
202
  group:
201
203
  more: 'më shumë »'
202
204
  filters:
@@ -197,6 +197,8 @@ zh:
197
197
  pivot:
198
198
  show: 打开
199
199
  hide: 关
200
+ group:
201
+ toggle: '更多 »'
200
202
  group:
201
203
  more: '更多 »'
202
204
  filters:
@@ -70,6 +70,16 @@ module Blacklight
70
70
  Blacklight::RuntimeRegistry.connection_config = value
71
71
  end
72
72
 
73
+ def defaults_version
74
+ @defaults_version ||= blacklight_yml['load_defaults'] ||
75
+ # this config parameter was introduced in Blacklight 7.11, so to be safe,
76
+ # we pin any 7.x app to the 7.10 behavior
77
+ (Blacklight::VERSION.starts_with?('7') && '7.10.0') ||
78
+ Blacklight::VERSION
79
+
80
+ @defaults_version == 'latest' ? Blacklight::VERSION : @defaults_version
81
+ end
82
+
73
83
  def self.blacklight_yml
74
84
  require 'erb'
75
85
  require 'yaml'
@@ -65,6 +65,9 @@ module Blacklight
65
65
  index: ViewConfig::Index.new(
66
66
  # document presenter class used by helpers and views
67
67
  document_presenter_class: nil,
68
+ # component class used to render a document; defaults to Blacklight::DocumentComponent,
69
+ # but can be set explicitly to avoid any legacy behavior
70
+ document_component: nil,
68
71
  # solr field to use to render a document title
69
72
  title_field: nil,
70
73
  # solr field to use to render format-specific partials
@@ -82,6 +85,7 @@ module Blacklight
82
85
  show: ViewConfig::Show.new(
83
86
  # document presenter class used by helpers and views
84
87
  document_presenter_class: nil,
88
+ document_component: nil,
85
89
  display_type_field: 'format',
86
90
  # Default route parameters for 'show' requests.
87
91
  # Set this to a hash with additional arguments to merge into the route,
@@ -96,7 +100,8 @@ module Blacklight
96
100
  list: {},
97
101
  atom: {
98
102
  if: false, # by default, atom should not show up as an alternative view
99
- partials: [:document]
103
+ partials: [:document],
104
+ summary_partials: [:index]
100
105
  },
101
106
  rss: {
102
107
  if: false, # by default, rss should not show up as an alternative view
@@ -306,7 +311,7 @@ module Blacklight
306
311
  end
307
312
 
308
313
  # YARD will include inline disabling as docs, cannot do multiline inside @!macro. AND this must be separate from doc block.
309
- # rubocop:disable Metrics/LineLength
314
+ # rubocop:disable Layout/LineLength
310
315
 
311
316
  # Add a partial to the tools when rendering a document.
312
317
  # @!macro partial_if_unless
@@ -319,7 +324,7 @@ module Blacklight
319
324
  add_action(show.document_actions, name, opts)
320
325
  klass && ActionBuilder.new(klass, name, opts).build
321
326
  end
322
- # rubocop:enable Metrics/LineLength
327
+ # rubocop:enable Layout/LineLength
323
328
 
324
329
  # Add a tool for the search result list itself
325
330
  # @!macro partial_if_unless
@@ -148,13 +148,11 @@ module Blacklight
148
148
  end
149
149
 
150
150
  @table[:reflected_fields] ||= Rails.cache.fetch("blacklight_configuration/admin/reflected_fields", expires_in: 1.hour) do
151
- begin
152
- repository = repository_class.new(self)
153
- repository.reflect_fields
154
- rescue => e
155
- Blacklight.logger.warn "Error retrieving field metadata: #{e}"
156
- false
157
- end
151
+ repository = repository_class.new(self)
152
+ repository.reflect_fields
153
+ rescue => e
154
+ Blacklight.logger.warn "Error retrieving field metadata: #{e}"
155
+ false
158
156
  end
159
157
 
160
158
  @table[:reflected_fields] || {}
@@ -8,7 +8,7 @@ module Blacklight
8
8
  # BlacklightHelper is needed by all helpers, so we inject it
9
9
  # into action view base here.
10
10
  initializer 'blacklight.helpers' do
11
- ActionView::Base.send :include, BlacklightHelper
11
+ ActionView::Base.include BlacklightHelper
12
12
  end
13
13
 
14
14
  # This makes our rake tasks visible.
@@ -6,6 +6,7 @@ module Blacklight
6
6
  # additional instances of NestedOpenStructWithHashAccess
7
7
  class NestedOpenStructWithHashAccess < OpenStructWithHashAccess
8
8
  attr_reader :nested_class
9
+
9
10
  delegate :default_proc=, to: :to_h
10
11
 
11
12
  def initialize(klass, hash = {})