lib/generators/hancock/cms/templates/admin.erb in hancock_cms-1.0.2.3 vs lib/generators/hancock/cms/templates/admin.erb in hancock_cms-2.0.0
- old
+ new
@@ -1,23 +1,20 @@
require 'rails_admin/custom_show_in_app'
-require_relative 'hancock_cms'
-# Add `require_relative '%hancock_plugin_name%'` here for configure it.
-# `require_relative 'hancock_cms'` reconfigure it by default.
-# So u need do it again. If u have some changes.
-
<% if Hancock.mongoid? %>
-RailsAdminSettings.track_history! if Hancock.config.history_tracking
+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.parent_controller = '::ApplicationController'
+
config.current_user_method(&:current_user)
## == Cancan ==
config.authorize_with :cancan
<% if Hancock.mongoid? %>
@@ -40,14 +37,12 @@
# member actions
show
edit
delete
- if Hancock.config.history_tracking
- history_index
- history_show
- end
+ history_index
+ history_show
toggle
# toggle_menu # for Hancock::Pages
# sitemap # for Hancock::Seo
@@ -57,14 +52,13 @@
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', 'Ckeditor::Folder',
+ 'Ckeditor::Asset', 'Ckeditor::AttachmentFile', 'Ckeditor::Picture',
'Hancock::EmbeddedElement'
]
config.excluded_models.flatten!
- config.excluded_models.uniq!
end
# [required] fix for timezones to be displayed in local time instead of UTC
module RailsAdmin
module Config