Sha256: a5fe3e94beab1e86d4d5ebbfa5723dcfd4e1641be701349507057b0f2939c610

Contents?: true

Size: 792 Bytes

Versions: 17

Compression:

Stored size: 792 Bytes

Contents

# frozen_string_literal: true

module Blacklight
  module Hierarchy
    class QfacetValueComponent < ::ViewComponent::Base
      def initialize(field_name:, item:, id: nil, suppress_link: false)
        @field_name = field_name
        @item = item
        @id = id
        @suppress_link = suppress_link
      end

      attr_reader :field_name, :item, :id, :suppress_link

      def path_for_facet
        facet_config = helpers.facet_configuration_for_field(field_name)
        Blacklight::FacetItemPresenter.new(item.qvalue, facet_config, helpers, field_name).href
      end

      def render_facet_count
        classes = "facet-count"
        content_tag("span", t('blacklight.search.facets.count', number: number_with_delimiter(item.hits)), class: classes)
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
blacklight-hierarchy-6.2.2 app/components/blacklight/hierarchy/qfacet_value_component.rb
blacklight-hierarchy-6.2.1 app/components/blacklight/hierarchy/qfacet_value_component.rb
blacklight-hierarchy-6.2.0 app/components/blacklight/hierarchy/qfacet_value_component.rb
blacklight-hierarchy-6.1.2 app/components/blacklight/hierarchy/qfacet_value_component.rb
blacklight-hierarchy-6.1.1 app/components/blacklight/hierarchy/qfacet_value_component.rb
blacklight-hierarchy-6.1.0 app/components/blacklight/hierarchy/qfacet_value_component.rb
blacklight-hierarchy-6.0.2 app/components/blacklight/hierarchy/qfacet_value_component.rb
blacklight-hierarchy-6.0.1 app/components/blacklight/hierarchy/qfacet_value_component.rb
blacklight-hierarchy-6.0.0 app/components/blacklight/hierarchy/qfacet_value_component.rb
blacklight-hierarchy-5.4.0 app/components/blacklight/hierarchy/qfacet_value_component.rb
blacklight-hierarchy-5.3.0 app/components/blacklight/hierarchy/qfacet_value_component.rb
blacklight-hierarchy-5.2.0 app/components/blacklight/hierarchy/qfacet_value_component.rb
blacklight-hierarchy-5.1.0 app/components/blacklight/hierarchy/qfacet_value_component.rb
blacklight-hierarchy-5.0.0 app/components/blacklight/hierarchy/qfacet_value_component.rb
blacklight-hierarchy-4.3.0 app/components/blacklight/hierarchy/qfacet_value_component.rb
blacklight-hierarchy-4.2.1 app/components/blacklight/hierarchy/qfacet_value_component.rb
blacklight-hierarchy-4.2.0 app/components/blacklight/hierarchy/qfacet_value_component.rb