Sha256: b8fe1aa9db6111152da7ca564940833549e71f89c503dee33d0415ddf3d38cc9

Contents?: true

Size: 1.7 KB

Versions: 3

Compression:

Stored size: 1.7 KB

Contents

require 'rails_admin/custom_show_in_app'

<% if RocketCMS.mongoid? %>
RailsAdminSettings.track_history!
<% end %>

RailsAdmin.config do |config|
  ## == Devise ==
  # this is required if not using cancan
  #config.authenticate_with do
    #warden.authenticate! scope: :user
  #end
  
  config.current_user_method(&:current_user)
  
  ## == Cancan ==
  config.authorize_with :cancan
<% if RocketCMS.mongoid? %>
  ## == MongoidAudit
  config.audit_with :mongoid_audit, 'HistoryTracker'
<% elsif RocketCMS.active_record? %>
  config.audit_with :paper_trail, 'User', 'PaperTrail::Version'
<% end %>


  config.actions do
    dashboard # mandatory

    # collection actions
    index
    new
    export
    bulk_delete

    # member actions
    show
    edit
    delete

    history_index
    history_show

    nested_set do
      visible do
        ['Page', 'Gallery', 'GalleryImage'].include? bindings[:abstract_model].model_name
      end
    end
    
    custom_show_in_app do
      visible do
        #temporary
        false #['Page', 'News'].include? bindings[:abstract_model].model_name
      end
    end
    
    toggle
    toggle_menu
    sitemap
  end

  config.main_app_name = ['<%= Rails.application.class.name.split('::')[0] %>', 'Админка']

  config.excluded_models = [
      'RailsAdmin::CustomShowInApp', 'HistoryTracker',
      'Ckeditor::Asset', 'Ckeditor::AttachmentFile', 'Ckeditor::Picture',
      'EmbeddedGalleryImage'
  ]
end

# [required] fix for timezones to be displayed in local time instead of UTC
module RailsAdmin
  module Config
    module Fields
      module Types
        class Datetime
          def value
            bindings[:object].send(name)
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ack_rocket_cms-0.7.4.1 lib/generators/rocket_cms/templates/admin.erb
ack_rocket_cms-0.7.4 lib/generators/rocket_cms/templates/admin.erb
ack_rocket_cms-0.7.3 lib/generators/rocket_cms/templates/admin.erb