Module: Hyrax::BlacklightOverride

Included in:
HyraxHelper
Defined in:
app/helpers/hyrax/blacklight_override.rb

Overview

Overrides of methods defined by the Blacklight gem.

Instance Method Summary collapse

Instance Method Details

#application_nameObject



5
6
7
# File 'app/helpers/hyrax/blacklight_override.rb', line 5

def application_name
  t('hyrax.product_name', default: super)
end

#index_field_label(document, field) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/helpers/hyrax/blacklight_override.rb', line 9

def index_field_label(document, field)
  field_config = index_fields(document)[field]
  return field_config.label if field_config&.custom_label
  translate = I18n.t(field_config.label, default: field_config.label) if field_config&.label&.match(/\./)
  if translate && translate != field_config.label
    field_label(translate, field_config.label, field.to_s.humanize)
  else
    field_label(
      :"blacklight.search.fields.index.#{field}",
      :"blacklight.search.fields.show.#{field}",
      :"blacklight.search.fields.#{field}",
      (field_config.label if field_config),
        field.to_s.humanize
    )
  end
end