Sha256: a7c8b23ab26614ac6c91cbc79b75959e44bf8b71e6a5696d38500bac31be5f77

Contents?: true

Size: 758 Bytes

Versions: 1

Compression:

Stored size: 758 Bytes

Contents

module EnjuLibrary
  module ApplicationHelper
    def library_shelf_facet(current_library, facet)
      library = Library.where(name: facet.value).select([:name, :display_name_translations]).first
      return nil unless library
      current = true if current_library.try(:name) == library.name
      content_tag :li do
        if current
          content_tag :strong do
            link_to("#{library.display_name} (" + facet.count.to_s + ")", url_for(filtered_params.merge(page: nil, library_id: library.name, only_path: true)))
          end
        else
          link_to("#{library.display_name} (" + facet.count.to_s + ")", url_for(filtered_params.merge(page: nil, library_id: library.name, only_path: true)))
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
enju_library-0.4.0.rc.1 app/helpers/enju_library/application_helper.rb