Sha256: 881910ce6171280ca325d97b7a31ffed4c297c21093fe7e5d1195efa8ca3cd38
Contents?: true
Size: 1.28 KB
Versions: 26
Compression:
Stored size: 1.28 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, control_html: { class: 'text-dark' }, image_container_html: { class: 'col-12 text-center'}, text_container_html: { class: 'col-12 text-center'}, ) 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
26 entries across 26 versions & 1 rubygems