Sha256: d7846a29af90f579852877c52dee0e9f7ad7d92804099a516997bd47f12e95a1

Contents?: true

Size: 1.54 KB

Versions: 8

Compression:

Stored size: 1.54 KB

Contents

require 'rails_admin/custom_show_in_app'

<% if Enjoy.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 Enjoy.mongoid? %>
  ## == MongoidAudit
  config.audit_with :mongoid_audit, 'HistoryTracker'
<% elsif Enjoy.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

    toggle
    # toggle_menu # for Enjoy::Pages
    # sitemap     # for Enjoy::Seo

    Enjoy.rails_admin_config_for_actions(self)
  end

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

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

8 entries across 8 versions & 1 rubygems

Version Path
enjoy_cms-0.4.1 lib/generators/enjoy/cms/templates/admin.erb
enjoy_cms-0.4.0.5 lib/generators/enjoy/cms/templates/admin.erb
enjoy_cms-0.4.0.4 lib/generators/enjoy/cms/templates/admin.erb
enjoy_cms-0.4.0.3 lib/generators/enjoy/cms/templates/admin.erb
enjoy_cms-0.4.0.2 lib/generators/enjoy/cms/templates/admin.erb
enjoy_cms-0.4.0.1 lib/generators/enjoy/cms/templates/admin.erb
enjoy_cms-0.4.0 lib/generators/enjoy/cms/templates/admin.erb
enjoy_cms-0.4.0.beta3 lib/generators/enjoy/cms/templates/admin.erb