Sha256: a292428fd2e9fa2d508543444e7e9ce30b0bba5b01185e422d966942c28c5287

Contents?: true

Size: 824 Bytes

Versions: 13

Compression:

Stored size: 824 Bytes

Contents

module ItemsHelper
  def circulation_status_facet(facet)
    string = ''
    circulation_status = CirculationStatus.where(name: facet.value).select([:name, :display_name]).first
    if circulation_status
      string << form_icon(circulation_status)
      current = true if params[:circulation_status] == circulation_status.name
      if current
        content_tag :strong do
          link_to("#{circulation_status.display_name.localize} (" + facet.count.to_s + ")", url_for(params.merge(circulation_status: circulation_status.name, page: nil, view: nil, only_path: true)))
        end
      else
        link_to("#{circulation_status.display_name.localize} (" + facet.count.to_s + ")", url_for(params.merge(circulation_status: circulation_status.name, page: nil, view: nil, only_path: true)))
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
enju_circulation-0.2.0 app/helpers/items_helper.rb
enju_circulation-0.2.0.beta.4 app/helpers/items_helper.rb
enju_circulation-0.1.2 app/helpers/items_helper.rb
enju_circulation-0.1.1 app/helpers/items_helper.rb
enju_circulation-0.1.0 app/helpers/items_helper.rb
enju_circulation-0.1.0.pre49 app/helpers/items_helper.rb
enju_circulation-0.1.0.pre48 app/helpers/items_helper.rb
enju_circulation-0.1.0.pre47 app/helpers/items_helper.rb
enju_circulation-0.1.0.pre46 app/helpers/items_helper.rb
enju_circulation-0.1.0.pre45 app/helpers/items_helper.rb
enju_circulation-0.1.0.pre44 app/helpers/items_helper.rb
enju_circulation-0.1.0.pre43 app/helpers/items_helper.rb
enju_circulation-0.1.0.pre42 app/helpers/items_helper.rb