Sha256: 4b7e7a3b49892402c7c8331843c6bba81b9c53c48b494d051c41aecf08c0ff99

Contents?: true

Size: 1.05 KB

Versions: 7

Compression:

Stored size: 1.05 KB

Contents

module Cmor
  module Testimonials
    class ApplicationViewHelper < Rao::ViewHelper::Base
      def render_category(category_or_identifier, options = {})
        default_variant_options = Cmor::Testimonials::Configuration.image_variant_options[:category]
        options.reverse_merge!(
          autostart:       true,
          interval:        5.0,
          keyboard:        true,
          pause:           :hover,
          ride:            false,
          wrap:            true,
          controls:        true,
          indicators:      false,
          variant_options: default_variant_options,
          font_awesome:    false,
          show_image:      true
        )
        category = if category_or_identifier.is_a?(Cmor::Testimonials::Category)
          category_or_identifier
        else
          Cmor::Testimonials::Category.where(identifier: category_or_identifier).first
        end

        if category.present? && category.testimonials.published.any?
          render category: category, options: options
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cmor_testimonials-0.0.17.pre app/view_helpers/cmor/testimonials/application_view_helper.rb
cmor_testimonials-0.0.16.pre app/view_helpers/cmor/testimonials/application_view_helper.rb
cmor_testimonials-0.0.15.pre app/view_helpers/cmor/testimonials/application_view_helper.rb
cmor_testimonials-0.0.14.pre app/view_helpers/cmor/testimonials/application_view_helper.rb
cmor_testimonials-0.0.13.pre app/view_helpers/cmor/testimonials/application_view_helper.rb
cmor_testimonials-0.0.12.pre app/view_helpers/cmor/testimonials/application_view_helper.rb
cmor_testimonials-0.0.11.pre app/view_helpers/cmor/testimonials/application_view_helper.rb