blacklight 7.5.0 → 7.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/.docker/app/Dockerfile +26 -0
  3. data/.docker/app/entrypoint.sh +6 -0
  4. data/.env +5 -0
  5. data/.gitignore +0 -1
  6. data/.rubocop_todo.yml +26 -37
  7. data/.travis.yml +16 -24
  8. data/Gemfile +4 -1
  9. data/README.md +4 -0
  10. data/VERSION +1 -1
  11. data/app/assets/stylesheets/blacklight/_pagination.scss +4 -0
  12. data/app/components/blacklight/constraint_layout_component.html.erb +23 -0
  13. data/app/components/blacklight/constraint_layout_component.rb +16 -0
  14. data/app/components/blacklight/facet_field_component.html.erb +25 -0
  15. data/app/components/blacklight/facet_field_component.rb +11 -0
  16. data/app/components/blacklight/facet_field_list_component.html.erb +18 -0
  17. data/app/components/blacklight/facet_field_list_component.rb +22 -0
  18. data/app/components/blacklight/facet_field_no_layout_component.rb +13 -0
  19. data/app/components/blacklight/facet_item_component.rb +120 -0
  20. data/app/controllers/concerns/blacklight/catalog.rb +4 -1
  21. data/app/helpers/blacklight/blacklight_helper_behavior.rb +4 -2
  22. data/app/helpers/blacklight/catalog_helper_behavior.rb +2 -4
  23. data/app/helpers/blacklight/configuration_helper_behavior.rb +3 -2
  24. data/app/helpers/blacklight/facets_helper_behavior.rb +84 -48
  25. data/app/helpers/blacklight/render_constraints_helper_behavior.rb +64 -33
  26. data/app/javascript/blacklight/modal.js +1 -1
  27. data/app/models/blacklight/icon.rb +11 -5
  28. data/app/models/concerns/blacklight/document/extensions.rb +3 -0
  29. data/app/models/concerns/blacklight/document/semantic_fields.rb +0 -4
  30. data/app/presenters/blacklight/document_presenter.rb +27 -36
  31. data/app/presenters/blacklight/facet_field_presenter.rb +57 -0
  32. data/app/presenters/blacklight/facet_item_presenter.rb +81 -0
  33. data/app/presenters/blacklight/field_presenter.rb +31 -6
  34. data/app/presenters/blacklight/index_presenter.rb +2 -2
  35. data/app/presenters/blacklight/show_presenter.rb +3 -3
  36. data/app/views/catalog/_citation.html.erb +1 -1
  37. data/app/views/catalog/_constraints.html.erb +2 -2
  38. data/app/views/catalog/_constraints_element.html.erb +5 -24
  39. data/app/views/catalog/_email_form.html.erb +1 -1
  40. data/app/views/catalog/_facet_layout.html.erb +8 -17
  41. data/app/views/catalog/_facet_limit.html.erb +3 -12
  42. data/app/views/catalog/_facet_pagination.html.erb +2 -2
  43. data/app/views/catalog/_facet_pivot.html.erb +4 -4
  44. data/app/views/catalog/_field.json.jbuilder +2 -2
  45. data/app/views/catalog/_index.html.erb +3 -3
  46. data/app/views/catalog/_previous_next_doc.html.erb +5 -5
  47. data/app/views/catalog/_search_form.html.erb +1 -1
  48. data/app/views/catalog/_show.html.erb +3 -3
  49. data/app/views/catalog/_sms_form.html.erb +1 -1
  50. data/app/views/catalog/_sort_and_per_page.html.erb +1 -1
  51. data/app/views/catalog/_start_over.html.erb +1 -0
  52. data/app/views/catalog/_thumbnail.html.erb +1 -1
  53. data/app/views/catalog/index.json.jbuilder +2 -1
  54. data/app/views/catalog/show.html.erb +1 -1
  55. data/app/views/catalog/show.json.jbuilder +2 -1
  56. data/app/views/layouts/blacklight/base.html.erb +2 -2
  57. data/blacklight.gemspec +1 -0
  58. data/config/locales/blacklight.ar.yml +30 -24
  59. data/config/locales/blacklight.de.yml +2 -0
  60. data/config/locales/blacklight.en.yml +2 -0
  61. data/config/locales/blacklight.es.yml +2 -0
  62. data/config/locales/blacklight.fr.yml +2 -0
  63. data/config/locales/blacklight.hu.yml +2 -0
  64. data/config/locales/blacklight.it.yml +2 -0
  65. data/config/locales/blacklight.nl.yml +2 -0
  66. data/config/locales/blacklight.pt-BR.yml +2 -0
  67. data/config/locales/blacklight.sq.yml +2 -0
  68. data/config/locales/blacklight.zh.yml +2 -0
  69. data/docker-compose.yml +35 -0
  70. data/lib/blacklight/configuration/field.rb +5 -4
  71. data/lib/blacklight/engine.rb +2 -6
  72. data/lib/blacklight/nested_open_struct_with_hash_access.rb +1 -1
  73. data/lib/blacklight/search_state.rb +52 -0
  74. data/lib/blacklight/solr/response/facets.rb +2 -0
  75. data/lib/generators/blacklight/assets_generator.rb +10 -0
  76. data/package.json +1 -1
  77. data/spec/{views/catalog/_constraints_element.html.erb_spec.rb → components/blacklight/constraint_layout_component_spec.rb} +22 -12
  78. data/spec/components/blacklight/facet_field_list_component_spec.rb +108 -0
  79. data/spec/components/blacklight/facet_item_component_spec.rb +50 -0
  80. data/spec/controllers/catalog_controller_spec.rb +13 -1
  81. data/spec/features/facets_spec.rb +1 -1
  82. data/spec/helpers/blacklight/configuration_helper_behavior_spec.rb +3 -0
  83. data/spec/helpers/blacklight/facets_helper_behavior_spec.rb +24 -12
  84. data/spec/helpers/blacklight/render_constraints_helper_behavior_spec.rb +4 -23
  85. data/spec/helpers/blacklight_helper_spec.rb +17 -0
  86. data/spec/helpers/catalog_helper_spec.rb +0 -7
  87. data/spec/lib/blacklight/search_state_spec.rb +50 -0
  88. data/spec/models/blacklight/icon_spec.rb +15 -6
  89. data/spec/models/blacklight/solr/response/facets_spec.rb +30 -1
  90. data/spec/presenters/blacklight/document_presenter_spec.rb +22 -62
  91. data/spec/presenters/blacklight/facet_field_presenter_spec.rb +109 -0
  92. data/spec/presenters/blacklight/facet_item_presenter_spec.rb +92 -0
  93. data/spec/presenters/blacklight/field_presenter_spec.rb +268 -0
  94. data/spec/presenters/blacklight/index_presenter_spec.rb +0 -142
  95. data/spec/presenters/blacklight/show_presenter_spec.rb +0 -177
  96. data/spec/spec_helper.rb +2 -0
  97. data/spec/support/presenter_test_helpers.rb +11 -0
  98. data/spec/views/catalog/_facet_group.html.erb_spec.rb +1 -0
  99. data/spec/views/catalog/_previous_next_doc.html.erb_spec.rb +18 -0
  100. data/tasks/blacklight.rake +30 -23
  101. metadata +48 -7
  102. data/Vagrantfile +0 -79
  103. data/provision.sh +0 -30
@@ -3,7 +3,7 @@
3
3
  module Blacklight
4
4
  # Renders a field and handles link_to_facet or helper_method if supplied
5
5
  class FieldPresenter
6
- # @param controller [Object] the context in which to execute helper methods
6
+ # @param view_context [Object] the context in which to execute helper methods
7
7
  # @param document [SolrDocument] the document
8
8
  # @param field_config [Blacklight::Configuration::Field] the field's configuration
9
9
  # @param options [Hash]
@@ -11,8 +11,8 @@ module Blacklight
11
11
  # @option options [Array] :except_operations
12
12
  # @option options [Object] :value
13
13
  # @option options [Array] :steps
14
- def initialize(controller, document, field_config, options = {})
15
- @controller = controller
14
+ def initialize(view_context, document, field_config, options = {})
15
+ @view_context = view_context
16
16
  @document = document
17
17
  @field_config = field_config
18
18
  @options = options
@@ -28,10 +28,35 @@ module Blacklight
28
28
  @except_operations += [Rendering::HelperMethod] if options.key? :value
29
29
  end
30
30
 
31
- attr_reader :controller, :document, :field_config, :values, :except_operations, :options
31
+ attr_reader :view_context, :document, :field_config, :except_operations, :options
32
32
 
33
33
  def render
34
- Rendering::Pipeline.new(values || retrieve_values, field_config, document, controller, pipeline_steps, options).render
34
+ Rendering::Pipeline.new(values, field_config, document, view_context, pipeline_steps, options).render
35
+ end
36
+
37
+ def values
38
+ @values ||= retrieve_values
39
+ end
40
+
41
+ def label(context = 'index', **options)
42
+ field_config.display_label(context, count: retrieve_values.count, **options)
43
+ end
44
+
45
+ ##
46
+ # Check to see if the given field should be rendered in this context
47
+ # @param [Blacklight::Configuration::Field] field_config
48
+ # @return [Boolean]
49
+ def render_field?
50
+ view_context.should_render_field?(field_config, document)
51
+ end
52
+
53
+ ##
54
+ # Check if a document has (or, might have, in the case of accessor methods) a value for
55
+ # the given solr field
56
+ # @param [Blacklight::Configuration::Field] field_config
57
+ # @return [Boolean]
58
+ def any?
59
+ values.present?
35
60
  end
36
61
 
37
62
  private
@@ -40,7 +65,7 @@ module Blacklight
40
65
  (options[:steps] || Rendering::Pipeline.operations) - except_operations
41
66
  end
42
67
 
43
- def retrieve_values(field_config)
68
+ def retrieve_values
44
69
  FieldRetriever.new(document, field_config).fetch
45
70
  end
46
71
  end
@@ -12,7 +12,7 @@ module Blacklight
12
12
  value = case field_or_string_or_proc
13
13
  when Symbol
14
14
  config = field_config(field_or_string_or_proc)
15
- retrieve_values(config)
15
+ field_presenter(config).values
16
16
  when Proc
17
17
  Deprecation.warn(self, "calling IndexPresenter.label with a Proc is deprecated. " \
18
18
  "First argument must be a symbol. This will be removed in Blacklight 8")
@@ -24,7 +24,7 @@ module Blacklight
24
24
  end
25
25
 
26
26
  value = document.id if value.blank?
27
- field_values(config, values: Array.wrap(value), except_operations: [Rendering::HelperMethod])
27
+ field_value(config, values: Array.wrap(value), except_operations: [Rendering::HelperMethod])
28
28
  end
29
29
 
30
30
  deprecation_deprecate label: 'Use #heading'
@@ -20,12 +20,12 @@ module Blacklight
20
20
  # @see #document_heading
21
21
  # @return [String]
22
22
  def html_title
23
- return field_values(view_config.html_title_field) if view_config.html_title_field.is_a? Blacklight::Configuration::Field
23
+ return field_value(view_config.html_title_field) if view_config.html_title_field.is_a? Blacklight::Configuration::Field
24
24
 
25
25
  if view_config.html_title_field
26
26
  fields = Array.wrap(view_config.html_title_field) + [configuration.document_model.unique_key]
27
- f = fields.lazy.map { |field| field_config(field) }.detect { |field_config| retrieve_values(field_config).any? }
28
- field_values(f)
27
+ f = fields.lazy.map { |field| field_config(field) }.detect { |field_config| field_presenter(field_config).any? }
28
+ field_value(f)
29
29
  else
30
30
  heading
31
31
  end
@@ -5,7 +5,7 @@
5
5
  </button>
6
6
  </div>
7
7
  <div class="modal-body">
8
- <% @documents.each do |document| %>
8
+ <% @documents&.each do |document| %>
9
9
  <h1 class="modal-title"><%= document_heading(document) %></h1>
10
10
 
11
11
  <% if document.respond_to?(:export_as_mla_citation_txt) %>
@@ -2,8 +2,8 @@
2
2
  <div id="appliedParams" class="clearfix constraints-container">
3
3
  <h2 class="sr-only"><%= t('blacklight.search.search_constraints_header') %></h2>
4
4
 
5
- <%=link_to t('blacklight.search.start_over'), start_over_path, class: "catalog_startOverLink btn btn-primary" %>
5
+ <%= render 'start_over' %>
6
6
  <span class="constraints-label sr-only"><%= t('blacklight.search.filters.title') %></span>
7
- <%= render_constraints(params) %>
7
+ <%= render_constraints(controller.params != params ? params : search_state) %>
8
8
  </div>
9
9
  <% end %>
@@ -7,27 +7,8 @@
7
7
  options ||= {}
8
8
  %>
9
9
 
10
- <span class="btn-group applied-filter constraint <%= options[:classes].join(" ") if options[:classes] %>">
11
- <span class="constraint-value btn btn-outline-secondary btn-disabled">
12
- <% unless label.blank? %>
13
- <span class="filter-name"><%= label %></span>
14
- <% end %>
15
- <% unless value.blank? %>
16
- <%= content_tag :span, value, class: 'filter-value', title: strip_tags(value) %>
17
- <% end %>
18
- </span>
19
- <% unless options[:remove].blank? %>
20
- <% accessible_remove_label = content_tag :span, class: 'sr-only' do
21
- if label.blank?
22
- t('blacklight.search.filters.remove.value', value: value)
23
- else
24
- t('blacklight.search.filters.remove.label_value', label: label, value: value)
25
- end
26
- end
27
- %>
28
-
29
- <%= link_to(content_tag(:span, '✖', class: 'remove-icon') + accessible_remove_label,
30
- options[:remove], class: 'btn btn-outline-secondary remove'
31
- ) %>
32
- <%- end -%>
33
- </span>
10
+ <%= render(Blacklight::ConstraintLayoutComponent.new(
11
+ classes: options[:classes],
12
+ label: label,
13
+ value: value,
14
+ remove_path: options[:remove])) %>
@@ -24,7 +24,7 @@
24
24
  </div>
25
25
  </div>
26
26
 
27
- <% @documents.each do |doc| %>
27
+ <% @documents&.each do |doc| %>
28
28
  <%=hidden_field_tag "id[]", doc.id %>
29
29
  <% end %>
30
30
  <%- if params[:sort] -%>
@@ -1,17 +1,8 @@
1
- <div class="card facet-limit blacklight-<%= facet_field.key.parameterize %> <%= 'facet-limit-active' if facet_field_in_params?(facet_field.key) %>">
2
- <h3 class="card-header p-0 facet-field-heading" id="<%= facet_field_id(facet_field) %>-header">
3
- <button
4
- class="btn btn-block p-2 text-left collapse-toggle <%= "collapsed" if should_collapse_facet?(facet_field) %>"
5
- data-toggle="collapse"
6
- data-target="#<%= facet_field_id(facet_field) %>"
7
- aria-expanded="<%= should_collapse_facet?(facet_field) ? 'false' : 'true' %>"
8
- >
9
- <%= facet_field_label(facet_field.key) %>
10
- </button>
11
- </h3>
12
- <div id="<%= facet_field_id(facet_field) %>" aria-labelledby="<%= facet_field_id(facet_field) %>-header" class="panel-collapse facet-content collapse <%= "show" unless should_collapse_facet?(facet_field) %>">
13
- <div class="card-body">
14
- <%= yield %>
15
- </div>
16
- </div>
17
- </div>
1
+ <%= render(Blacklight::FacetFieldComponent.new(facet_field: facet_field_presenter(facet_field, nil))) do |component| %>
2
+ <% component.with(:label) do %>
3
+ <%= facet_field_label(facet_field.key) %>
4
+ <% end %>
5
+ <% component.with(:body) do %>
6
+ <%= yield %>
7
+ <% end %>
8
+ <% end %>
@@ -1,12 +1,3 @@
1
- <ul class="facet-values list-unstyled">
2
- <% paginator = facet_paginator(facet_field, display_facet) %>
3
- <%= render_facet_limit_list paginator, facet_field.key %>
4
-
5
- <% unless paginator.last_page? || params[:action] == "facet" %>
6
- <li class="more_facets">
7
- <%= link_to t("more_#{field_name}_html", scope: 'blacklight.search.facets', default: :more_html, field_name: facet_field_label(facet_field.key)),
8
- search_facet_path(id: facet_field.key),
9
- data: { blacklight_modal: 'trigger' } %>
10
- </li>
11
- <% end %>
12
- </ul>
1
+ <%= render(Blacklight::FacetFieldListComponent.new(
2
+ facet_field: facet_field_presenter(facet_field, display_facet),
3
+ layout: false)) %>
@@ -1,10 +1,10 @@
1
1
  <div class="prev_next_links btn-group">
2
2
  <%= link_to_previous_page @pagination, raw(t('views.pagination.previous')), params: search_state.to_h, param_name: blacklight_config.facet_paginator_class.request_keys[:page], class: 'btn btn-link', data: { blacklight_modal: "preserve" } do %>
3
- <span class="disabled btn btn-disabled"><%= raw(t('views.pagination.previous')) %></span>
3
+ <%= content_tag :span, raw(t('views.pagination.previous')), class: 'disabled btn' %>
4
4
  <% end %>
5
5
 
6
6
  <%= link_to_next_page @pagination, raw(t('views.pagination.next')), params: search_state.to_h, param_name: blacklight_config.facet_paginator_class.request_keys[:page], class: 'btn btn-link', data: { blacklight_modal: "preserve" } do %>
7
- <span class="disabled btn btn-disabled"><%= raw(t('views.pagination.next')) %></span>
7
+ <%= content_tag :span, raw(t('views.pagination.next')), class: 'disabled btn' %>
8
8
  <% end %>
9
9
  </div>
10
10
 
@@ -2,10 +2,10 @@
2
2
  <% display_facet.items.each do |item| -%>
3
3
  <li>
4
4
  <span class="facet-values">
5
- <% if facet_in_params?(field_name, item) %>
6
- <%= render_selected_facet_value(field_name, item) %>
7
- <% else %>
8
- <%= render_facet_value(field_name, item) %>
5
+ <% if facet_in_params?(field_name, item) %>
6
+ <%= render_selected_facet_value(field_name, item) %>
7
+ <% else %>
8
+ <%= render_facet_value(field_name, item) %>
9
9
  <% end -%>
10
10
  </span>
11
11
 
@@ -4,7 +4,7 @@ json.set!(field_name) do
4
4
  json.id "#{document_url}##{field_name}"
5
5
  json.type 'document_value'
6
6
  json.attributes do
7
- json.value doc_presenter.field_value(field)
8
- json.label field.display_label(view_type)
7
+ json.value field_presenter.render
8
+ json.label field_presenter.label(view_type)
9
9
  end
10
10
  end
@@ -2,9 +2,9 @@
2
2
  <%# default partial to display solr document fields in catalog index view -%>
3
3
  <dl class="document-metadata dl-invert row">
4
4
 
5
- <% doc_presenter.fields_to_render.each do |field_name, field| -%>
6
- <dt class="blacklight-<%= field_name.parameterize %> col-md-3"><%= render_index_field_label document, field: field_name %></dt>
7
- <dd class="blacklight-<%= field_name.parameterize %> col-md-9"><%= doc_presenter.field_value field %></dd>
5
+ <% doc_presenter.fields_to_render.each do |field_name, field, field_presenter| -%>
6
+ <dt class="blacklight-<%= field_name.parameterize %> col-md-3"><%= render_index_field_label document, label: field_presenter.label, field: field_name %></dt>
7
+ <dd class="blacklight-<%= field_name.parameterize %> col-md-9"><%= field_presenter.render %></dd>
8
8
  <% end -%>
9
9
 
10
10
  </dl>
@@ -1,6 +1,6 @@
1
- <% # Using the Bootstrap Pagination class -%>
2
- <div class='pagination-search-widgets'>
3
- <% if @search_context[:prev] || @search_context[:next] %>
1
+ <% if @search_context[:prev] || @search_context[:next] %>
2
+ <div class='pagination-search-widgets'>
3
+
4
4
  <div class="page-links">
5
5
  <%= link_to_previous_document @search_context[:prev] %> |
6
6
 
@@ -8,5 +8,5 @@
8
8
 
9
9
  <%= link_to_next_document @search_context[:next] %>
10
10
  </div>
11
- <% end %>
12
- </div>
11
+ </div>
12
+ <% end %>
@@ -1,4 +1,4 @@
1
- <%= form_tag search_action_url, method: :get, class: 'search-query-form', role: 'search' do %>
1
+ <%= form_tag search_action_url, method: :get, class: 'search-query-form', role: 'search', 'aria-label' => t('blacklight.search.form.submit') do %>
2
2
  <%= render_hash_as_hidden_fields(search_state.params_for_search.except(:q, :search_field, :qt, :page, :utf8)) %>
3
3
  <% if search_fields.length > 1 %>
4
4
  <label for="search_field" class="sr-only"><%= t('blacklight.search.form.search_field.label') %></label>
@@ -1,8 +1,8 @@
1
1
  <% doc_presenter = show_presenter(document) %>
2
2
  <%# default partial to display solr document fields in catalog show view -%>
3
3
  <dl class="row dl-invert document-metadata">
4
- <% doc_presenter.fields_to_render.each do |field_name, field| -%>
5
- <dt class="blacklight-<%= field_name.parameterize %> col-md-3"><%= render_document_show_field_label document, field: field_name %></dt>
6
- <dd class="blacklight-<%= field_name.parameterize %> col-md-9"><%= doc_presenter.field_value field %></dd>
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
7
  <% end -%>
8
8
  </dl>
@@ -22,7 +22,7 @@
22
22
  </div>
23
23
 
24
24
  </div>
25
- <% @documents.each do |doc| %>
25
+ <% @documents&.each do |doc| %>
26
26
  <%=hidden_field_tag "id[]", doc.id %>
27
27
  <% end %>
28
28
  </div>
@@ -1,4 +1,4 @@
1
- <div id="sortAndPerPage" class="sort-pagination d-md-flex justify-content-between">
1
+ <div id="sortAndPerPage" class="sort-pagination d-md-flex justify-content-between" role="navigation" aria-label="<%= t('blacklight.search.per_page.aria_label')%>">
2
2
  <%= render partial: "paginate_compact", object: @response if show_pagination? %>
3
3
  <%= render_results_collection_tools wrapping_class: "search-widgets" %>
4
4
  </div>
@@ -0,0 +1 @@
1
+ <%= link_to t('blacklight.search.start_over'), start_over_path, class: "catalog_startOverLink btn btn-primary" %>
@@ -1,4 +1,4 @@
1
- <% if presenter(document).thumbnail.exists? && tn = presenter(document).thumbnail.thumbnail_tag({}, counter: document_counter_with_offset(document_counter)) %>
1
+ <% if presenter(document).thumbnail.exists? && tn = presenter(document).thumbnail.thumbnail_tag({ alt: '' }, 'aria-hidden': true, tabindex: -1, counter: document_counter_with_offset(document_counter)) %>
2
2
  <div class="document-thumbnail">
3
3
  <%= tn %>
4
4
  </div>
@@ -17,11 +17,12 @@ json.data do
17
17
  json.id document.id
18
18
  json.type doc_presenter.display_type.first
19
19
  json.attributes do
20
- doc_presenter.fields_to_render.each do |field_name, field|
20
+ doc_presenter.fields_to_render.each do |field_name, field, field_presenter|
21
21
  json.partial! 'field', field: field,
22
22
  field_name: field_name,
23
23
  document_url: document_url,
24
24
  doc_presenter: doc_presenter,
25
+ field_presenter: field_presenter,
25
26
  view_type: 'index'
26
27
  end
27
28
  end
@@ -1,6 +1,6 @@
1
1
  <% if current_search_session %>
2
2
  <div id="appliedParams" class="clearfix constraints-container">
3
- <%= link_to t('blacklight.search.start_over'), start_over_path, class: "catalog_startOverLink btn btn-primary" %>
3
+ <%= render 'start_over' %>
4
4
  <%= link_back_to_catalog class: 'btn btn-outline-secondary' %>
5
5
  </div>
6
6
  <% end %>
@@ -11,11 +11,12 @@ json.data do
11
11
  json.id @document.id
12
12
  json.type doc_presenter.display_type.first
13
13
  json.attributes do
14
- doc_presenter.fields_to_render.each do |field_name, field|
14
+ doc_presenter.fields_to_render.each do |field_name, field, field_presenter|
15
15
  json.partial! 'field', field: field,
16
16
  field_name: field_name,
17
17
  document_url: document_url,
18
18
  doc_presenter: doc_presenter,
19
+ field_presenter: field_presenter,
19
20
  view_type: 'show'
20
21
  end
21
22
  end
@@ -17,11 +17,11 @@
17
17
  <%= content_for(:head) %>
18
18
  </head>
19
19
  <body class="<%= render_body_class %>">
20
- <div id="skip-link">
20
+ <nav id="skip-link" role="navigation" aria-label="<%= t('blacklight.skip_links.label') %>">
21
21
  <%= link_to t('blacklight.skip_links.search_field'), '#search_field', class: 'element-invisible element-focusable rounded-bottom py-2 px-3', data: { turbolinks: 'false' } %>
22
22
  <%= link_to t('blacklight.skip_links.main_content'), '#main-container', class: 'element-invisible element-focusable rounded-bottom py-2 px-3', data: { turbolinks: 'false' } %>
23
23
  <%= content_for(:skip_links) %>
24
- </div>
24
+ </nav>
25
25
  <%= render partial: 'shared/header_navbar' %>
26
26
 
27
27
  <main id="main-container" class="<%= container_classes %>" role="main" aria-label="<%= t('blacklight.main.aria.main_container') %>">
@@ -30,6 +30,7 @@ Gem::Specification.new do |s|
30
30
  s.add_dependency "jbuilder", '~> 2.7'
31
31
  s.add_dependency "kaminari", ">= 0.15" # the pagination (page 1,2,3, etc..) of our search results
32
32
  s.add_dependency "deprecation"
33
+ s.add_dependency "view_component"
33
34
 
34
35
  s.add_development_dependency "rsolr", ">= 1.0.6", "< 3" # Library for interacting with rSolr.
35
36
  s.add_development_dependency "rspec-rails", "~> 4.0.0.beta2"
@@ -3,8 +3,8 @@ ar:
3
3
  pagination:
4
4
  first: 'الأولى &laquo;'
5
5
  last: 'الأخيرة &raquo;'
6
- previous: '&laquo; السابقة'
7
- next: 'التالية &raquo;'
6
+ previous: '&laquo; السابق'
7
+ next: 'التالي &raquo;'
8
8
  truncate: '…'
9
9
  aria:
10
10
  container_label: 'روابط الصفحات'
@@ -22,6 +22,7 @@ ar:
22
22
  blacklight:
23
23
  application_name: 'Blacklight'
24
24
  skip_links:
25
+ label: 'تخطي الروابط'
25
26
  main_content: 'انتقل إلى المحتوى الرئيسي'
26
27
  search_field: 'انتقل إلى البحث'
27
28
  first_result: 'انتقل إلى النتيجة الأولى'
@@ -51,7 +52,8 @@ ar:
51
52
  few: 'أضيفت الصفحات المفضلة بنجاح.'
52
53
  many: 'أضيفت الصفحات المفضلة بنجاح.'
53
54
  other: 'أضيفت الصفحات المفضلة بنجاح.'
54
- failure: 'معذرة! حدثت مشكلة في حفظ الصفحات المفضلة.'
55
+
56
+ failure: 'معذرة! حدثت مشكلة في حفظ الصفحات المفضلة.'
55
57
  remove:
56
58
  button: 'إزالة الصفحة المفضلة'
57
59
  success: 'أزيلت الصفحة المفضلة بنجاح.'
@@ -60,7 +62,7 @@ ar:
60
62
  clear:
61
63
  action_title: 'مسح الصفحات المفضلة'
62
64
  action_confirm: 'هل ترغب في مسح الصفحات المفضلة؟'
63
- success: 'ُمسِحَت صفحاتك المفضلة.'
65
+ success: 'تم مسح صفحاتك المفضلة.'
64
66
  failure: 'معذرة! حدثت مشكلة في مسح صفحاتك المفضلة.'
65
67
  need_login: 'يُرجى تسجيل الدخول لتنظيم صفحاتك المفضلة وعرضها.'
66
68
  list_title: 'صفحاتك المفضلة'
@@ -68,14 +70,14 @@ ar:
68
70
 
69
71
  search_history:
70
72
  clear:
71
- action_title: 'مسح سجل البحث السابق'
73
+ action_title: 'امسح سجل البحث السابق'
72
74
  action_confirm: 'هل ترغب في مسح سجل البحث السابق؟'
73
- success: 'ُمسِحَ سجل بحثك السابق.'
75
+ success: 'تم مسح سجل بحثك السابق.'
74
76
  failure: 'حدثت مشكلة في مسح سجل بحثك السابق.'
75
77
  title: 'سجل البحث'
76
78
  page_title: 'سجل البحث - %{application_name}'
77
- no_history: 'ليس لديك سجل بحث'
78
- recent: 'استعلامات البحث الأخيرة'
79
+ no_history: 'لا يوجد لديك سجل بحث'
80
+ recent: 'سجل ابحاثك السابقة'
79
81
  forget: 'تراجع'
80
82
  save: 'حفظ'
81
83
 
@@ -83,7 +85,7 @@ ar:
83
85
  title: 'أدوات'
84
86
  citation: 'استشهاد مرجعي'
85
87
  email: 'بريد إلكتروني'
86
- sms: 'إرسال كرسالة نصية قصيرة'
88
+ sms: 'إرسله كرسالة نصية قصيرة'
87
89
  clear: 'مسح'
88
90
 
89
91
  citation:
@@ -93,12 +95,12 @@ ar:
93
95
 
94
96
  email:
95
97
  form:
96
- title: 'إرسال بالبريد الإلكتروني'
98
+ title: 'إرسله عبرالبريد الإلكتروني'
97
99
  to: 'بريد إلكتروني:'
98
100
  message: 'الرسالة:'
99
101
  submit: 'إرسال'
100
102
  text:
101
- default_title: 'لا ينطبق'
103
+ default_title: 'لا يوجد'
102
104
  title: 'العنوان: %{value}'
103
105
  author: 'المؤلف: %{value}'
104
106
  format: 'الصيغة: %{value}'
@@ -110,30 +112,31 @@ ar:
110
112
  few: 'سجلات المادة'
111
113
  many: 'سجلات المادة'
112
114
  other: 'سجلات المادة'
115
+
113
116
  url: 'الرابط: %{url}'
114
117
  message: 'الرسالة: %{message}'
115
118
 
116
- success: 'تم إرسال البريد الإلكتروني'
119
+ success: "تم إرسال البريد الإلكتروني"
120
+
117
121
  errors:
118
122
  to:
119
123
  invalid: 'يجب إدخال عنوان بريد إلكتروني صحيح'
120
124
  blank: 'يجب إدخال مُستلم من أجل إرسال هذه الرسالة'
121
-
122
125
  sms:
123
126
  form:
124
- title: 'إرسال كرسالة نصية قصيرة'
127
+ title: 'إرسله كرسالة نصية قصيرة'
125
128
  to: 'رقم الهاتف:'
126
129
  carrier: 'شركة الاتصالات'
127
130
  carrier_prompt: 'يرجى تحديد شركة الاتصالات'
128
131
  submit: 'إرسال'
129
132
  text:
130
133
  title: '%{value}'
131
- author: ' حسب %{value}'
134
+ author: ' بواسطة %{value}'
132
135
  url: 'الرابط: %{url}'
133
- success: 'تم الإرسال كرسالة نصية قصيرة'
136
+ success: "تم الإرسال كرسالة نصية قصيرة"
134
137
  errors:
135
138
  to:
136
- invalid: 'يجب إدخال رقم هاتف صحيح من 10 أعداد'
139
+ invalid: 'يجب إدخال رقم هاتف صحيح من 10 أرقام'
137
140
  blank: "يجب إدخال رقم هاتف المستلم لإرسال هذه الرسالة"
138
141
  carrier:
139
142
  blank: 'يجب تحديد شركة الاتصالات'
@@ -147,11 +150,11 @@ ar:
147
150
  title: '%{constraints} - %{application_name} نتائج البحث'
148
151
  constraint: '%{label}: %{value}'
149
152
  many_constraint_values: 'تم تحديد %{values}'
150
- header: 'البحث'
153
+ header: 'ابحث'
151
154
  search_constraints_header: 'قيود البحث'
152
155
  search_results: 'نتائج البحث'
153
156
  errors:
154
- request_error: "معذرة، لا أفهم ما تبحث عنه."
157
+ request_error: "معذرة، لم أفهم ما تبحث عنه."
155
158
  invalid_solr_id: "معذرة! لقد طلبت سجلًا غير موجود."
156
159
  per_page:
157
160
  label: '%{count}<span class="sr-only"> لكل صفحة</span>'
@@ -159,17 +162,18 @@ ar:
159
162
  button_label_html: '%{count}<span class="d-none d-sm-inline"> لكل صفحة</span>'
160
163
  title: 'عدد النتائج المعروضة في الصفحة'
161
164
  submit: 'تحديث'
165
+ aria_label: 'تصفح النتائج'
162
166
  sort:
163
167
  label: 'ترتيب حسب %{field}' # TODO: Remove during major release
164
168
  label_html: 'ترتيب <span class="d-none d-sm-inline"> حسب %{field}</span>'
165
169
  submit: 'نتائج الترتيب'
166
170
  form:
167
171
  search_field:
168
- label: 'بحث في'
172
+ label: 'ابحث في'
169
173
  title: 'خيارات البحث المستهدفة'
170
174
  post_label: 'عن'
171
175
  search:
172
- label: 'بحث عن'
176
+ label: 'ابحث عن'
173
177
  placeholder: 'بحث...'
174
178
  submit: 'بحث'
175
179
  pagination:
@@ -184,6 +188,7 @@ ar:
184
188
  few: '<strong>%{start_num}</strong> - <strong>%{end_num}</strong> من <strong>%{total_num}</strong>'
185
189
  many: '<strong>%{start_num}</strong> - <strong>%{end_num}</strong> من <strong>%{total_num}</strong>'
186
190
  other: '<strong>%{start_num}</strong> - <strong>%{end_num}</strong> من <strong>%{total_num}</strong>'
191
+
187
192
  entry_pagination_info:
188
193
  zero: '<strong>%{current}</strong> من <strong>%{total}</strong>'
189
194
  one: '<strong>%{current}</strong> من <strong>%{total}</strong>'
@@ -191,10 +196,11 @@ ar:
191
196
  few: '<strong>%{current}</strong> من <strong>%{total}</strong>'
192
197
  many: '<strong>%{current}</strong> من <strong>%{total}</strong>'
193
198
  other: '<strong>%{current}</strong> من <strong>%{total}</strong>'
199
+
194
200
  documents:
195
201
  aria:
196
202
  search_results: 'نتائج البحث'
197
- limit_search: 'تحديد نطاق البحث'
203
+ limit_search: '...ابحث عن العناصر حسب'
198
204
  counter: '%{counter}. '
199
205
  facets:
200
206
  title: 'تحديد نطاق البحث'
@@ -231,9 +237,9 @@ ar:
231
237
  zero_results:
232
238
  title: "لا توجد نتائج للبحث"
233
239
  modify_search: "حاول تعديل معايير البحث"
234
- use_fewer_keywords: "استخدم كلمات مفتاحية أقل في البداية، ثم أعد تنقيح البحث باستخدام الروابط على اليسار."
240
+ use_fewer_keywords: "استخدم كلمات أساسية أقل أولاً، ثم أعد تحديد البحث باستخدام الروابط على اليسار."
235
241
  search_fields: "لقد بحثت باستخدام %{search_fields}"
236
- search_everything: "أعد البحث عن كل شيء"
242
+ search_everything: "حاول البحث عن كل شيء"
237
243
  view_title: "عرض النتائج ك: "
238
244
  view:
239
245
  list: "قائمة"