Sha256: 9a4f0d22d6eff88eb7f228357f877b805e9fa1e0f3a79c50dc041a2dee71b2ab

Contents?: true

Size: 773 Bytes

Versions: 24

Compression:

Stored size: 773 Bytes

Contents

module Spotlight
  ##
  # Search configurations helpers
  module SearchConfigurationsHelper
    ##
    # Translate a sort field configuration into
    # a complete description of the sort
    def translate_sort_fields(sort_config)
      sort_description = sort_config[:sort_description] if sort_config[:sort_description]

      sort_description ||= sort_config[:sort].split(',').map do |sort|
        sort_field, sort_order = sort.split(' ')
        safe_join([
          t(:"spotlight.search_configurations.sort.keys.#{sort_field.strip}", default: sort_field.humanize.downcase),
          t(:"spotlight.search_configurations.sort.keys.#{sort_order.strip}", default: '')
        ], ' ')
      end.to_sentence if sort_config[:sort]

      sort_description
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
blacklight-spotlight-0.16.0 app/helpers/spotlight/search_configurations_helper.rb
blacklight-spotlight-0.15.0 app/helpers/spotlight/search_configurations_helper.rb
blacklight-spotlight-0.14.2 app/helpers/spotlight/search_configurations_helper.rb
blacklight-spotlight-0.14.1 app/helpers/spotlight/search_configurations_helper.rb
blacklight-spotlight-0.14.0 app/helpers/spotlight/search_configurations_helper.rb
blacklight-spotlight-0.13.0 app/helpers/spotlight/search_configurations_helper.rb
blacklight-spotlight-0.12.1 app/helpers/spotlight/search_configurations_helper.rb
blacklight-spotlight-0.12.0 app/helpers/spotlight/search_configurations_helper.rb
blacklight-spotlight-0.11.0 app/helpers/spotlight/search_configurations_helper.rb
blacklight-spotlight-0.10.3 app/helpers/spotlight/search_configurations_helper.rb
blacklight-spotlight-0.10.2 app/helpers/spotlight/search_configurations_helper.rb
blacklight-spotlight-0.10.1 app/helpers/spotlight/search_configurations_helper.rb
blacklight-spotlight-0.10.0 app/helpers/spotlight/search_configurations_helper.rb
blacklight-spotlight-0.9.2 app/helpers/spotlight/search_configurations_helper.rb
blacklight-spotlight-0.9.1 app/helpers/spotlight/search_configurations_helper.rb
blacklight-spotlight-0.9.0 app/helpers/spotlight/search_configurations_helper.rb
blacklight-spotlight-0.8.2 app/helpers/spotlight/search_configurations_helper.rb
blacklight-spotlight-0.8.1 app/helpers/spotlight/search_configurations_helper.rb
blacklight-spotlight-0.8.0 app/helpers/spotlight/search_configurations_helper.rb
blacklight-spotlight-0.7.2 app/helpers/spotlight/search_configurations_helper.rb