Sha256: c7df4678a8a2d18d09c3ff87933319d2f57cd1ed266318620c7269af3d206b86

Contents?: true

Size: 1.2 KB

Versions: 5

Compression:

Stored size: 1.2 KB

Contents

require 'active_support/core_ext/module/delegation'
require 'active_support/core_ext/module/attribute_accessors'
require 'active_support/hash_with_indifferent_access'

module Cmor
  module Blog
    module Configuration
      def configure
        yield self
      end

      mattr_accessor(:base_controller) do
        '::FrontendController'
      end

      mattr_accessor(:creator_class_name) do
        'User'
      end

      mattr_accessor(:user_factory_name) do
        :user
      end

      mattr_accessor(:posts_index_page_title_proc) do
        ->(view) { view.resource_class.model_name.human(count: :other) }
      end

      mattr_accessor(:pagination_options_proc) do
        ->(view) { { theme: 'twitter-bootstrap-4', pagination_class: 'justify-content-center' } }
      end
      mattr_accessor(:preview_picture_asset_variant_options) do
        { combine_options: { resize: "320x240^", extent: "384x216", gravity: "center" } }
      end

      mattr_accessor(:post_creation_information_proc) do
        -> (post) { "#{l(post.created_at)} | #{post.creator&.human}" }
      end

      mattr_accessor(:markdown_to_html_proc) do
        -> (string) { Kramdown::Document.new(string).to_html }
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cmor_blog-0.0.60.pre lib/cmor/blog/configuration.rb
cmor_blog-0.0.59.pre lib/cmor/blog/configuration.rb
cmor_blog-0.0.58.pre lib/cmor/blog/configuration.rb
cmor_blog-0.0.57.pre lib/cmor/blog/configuration.rb
cmor_blog-0.0.56.pre lib/cmor/blog/configuration.rb