Sha256: 9f484d960449bc6e6057617fa9600a9dfa5b2a2f8391d2ac21cedc6c45811321

Contents?: true

Size: 1.69 KB

Versions: 41

Compression:

Stored size: 1.69 KB

Contents

require 'rails_admin/custom_show_in_app'

RailsAdminSettings.track_history!

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', 'Slide', 'Partner'].include? bindings[:abstract_model].model_name
      end
    end
    
    custom_show_in_app do
      visible do
        ['Page', 'News'].include? bindings[:abstract_model].model_name
      end
    end
    
    toggle
    toggle_menu do
      visible do
        ['Page'].include? bindings[:abstract_model].model_name
      end
    end
  end

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

  config.excluded_models = [
      'RailsAdmin::CustomShowInApp', 'HistoryTracker',
      'Ckeditor::Asset', 'Ckeditor::AttachmentFile', 'Ckeditor::Picture',
  ]
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

41 entries across 41 versions & 1 rubygems

Version Path
rocket_cms-0.12.3 lib/generators/rocket_cms/templates/admin.erb
rocket_cms-0.12.2 lib/generators/rocket_cms/templates/admin.erb
rocket_cms-0.12.1 lib/generators/rocket_cms/templates/admin.erb
rocket_cms-0.12.0 lib/generators/rocket_cms/templates/admin.erb
rocket_cms-0.11.7 lib/generators/rocket_cms/templates/admin.erb
rocket_cms-0.11.5 lib/generators/rocket_cms/templates/admin.erb
rocket_cms-0.11.4 lib/generators/rocket_cms/templates/admin.erb
rocket_cms-0.11.3 lib/generators/rocket_cms/templates/admin.erb
rocket_cms-0.11.2 lib/generators/rocket_cms/templates/admin.erb
rocket_cms-0.11.1 lib/generators/rocket_cms/templates/admin.erb
rocket_cms-0.11.0 lib/generators/rocket_cms/templates/admin.erb
rocket_cms-0.10.2 lib/generators/rocket_cms/templates/admin.erb
rocket_cms-0.10.1 lib/generators/rocket_cms/templates/admin.erb
rocket_cms-0.10.0 lib/generators/rocket_cms/templates/admin.erb
rocket_cms-0.9.9 lib/generators/rocket_cms/templates/admin.erb
rocket_cms-0.9.8 lib/generators/rocket_cms/templates/admin.erb
rocket_cms-0.9.7 lib/generators/rocket_cms/templates/admin.erb
rocket_cms-0.9.5 lib/generators/rocket_cms/templates/admin.erb
rocket_cms-0.9.4 lib/generators/rocket_cms/templates/admin.erb
rocket_cms-0.9.3 lib/generators/rocket_cms/templates/admin.erb