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
- #application_name ⇒ Object
-
#index_field_label(document, field) ⇒ Object
rubocop:disable Metrics/MethodLength.
Instance Method Details
#application_name ⇒ Object
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
rubocop:disable Metrics/MethodLength
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/helpers/hyrax/blacklight_override.rb', line 10 def index_field_label(document, field) field_config = index_fields(document)[field] return resolve_label(field_config) if field_config&.custom_label || field_config&.label&.respond_to?(:call) 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 |