Sha256: df458c9bac7d989da1db1353e070655b87d0693542f873477a453e831833ed04

Contents?: true

Size: 970 Bytes

Versions: 4

Compression:

Stored size: 970 Bytes

Contents

module Cmor
  module Cms
    module Backend
      class LayoutsController < Cmor::Core::Backend::ResourcesController::Base
        include Cmor::Transports::ResourcesController::ExportConcern if Cmor::Core.features?(:cmor_transports)
        include Cmor::Audits::ResourcesController::PaperTrailConcern if Cmor::Core.features?(:cmor_audits)
        include Rao::ResourcesController::ActsAsPublishedConcern

        def self.resource_class
          Cmor::Cms::Layout
        end

        def self.has_paper_trail?
          Object.const_defined?('PaperTrail') && PaperTrail.request.enabled_for_model?(resource_class)
        end

        def self.available_rest_actions
          super + [:export, (has_paper_trail? ? :versions : nil)].compact
        end

        private

        def permitted_params
          params.require(:layout)
                .permit(:body, :pathname, :basename, :locale, :format, :handler, :published)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cmor_cms_backend-0.0.60.pre app/controllers/cmor/cms/backend/layouts_controller.rb
cmor_cms_backend-0.0.59.pre app/controllers/cmor/cms/backend/layouts_controller.rb
cmor_cms_backend-0.0.58.pre app/controllers/cmor/cms/backend/layouts_controller.rb
cmor_cms_backend-0.0.57.pre app/controllers/cmor/cms/backend/layouts_controller.rb