2020-04-19 13:35:58 -07:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2014-12-10 08:01:59 -08:00
|
|
|
# workaround to get pagination right
|
|
|
|
RailsAdmin.config do |config|
|
|
|
|
config.main_app_name = ['justask', 'Kontrollzentrum']
|
2020-05-08 14:28:56 -07:00
|
|
|
config.parent_controller = '::ApplicationController'
|
2014-12-10 08:01:59 -08:00
|
|
|
|
|
|
|
## == Authentication ==
|
|
|
|
config.authenticate_with do
|
2020-04-19 13:35:58 -07:00
|
|
|
redirect_to main_app.root_path unless current_user&.has_role?(:administrator)
|
2014-12-10 08:01:59 -08:00
|
|
|
end
|
|
|
|
config.current_user_method(&:current_user)
|
|
|
|
|
|
|
|
config.actions do
|
|
|
|
dashboard # mandatory
|
|
|
|
index # mandatory
|
|
|
|
new
|
|
|
|
export
|
|
|
|
bulk_delete
|
|
|
|
show
|
|
|
|
edit
|
|
|
|
delete
|
|
|
|
show_in_app
|
|
|
|
|
|
|
|
## With an audit adapter, you can add:
|
|
|
|
# history_index
|
|
|
|
# history_show
|
|
|
|
end
|
|
|
|
|
|
|
|
config.included_models = %w[
|
|
|
|
Answer
|
|
|
|
Comment
|
2020-05-25 09:04:54 -07:00
|
|
|
List
|
|
|
|
ListMember
|
2014-12-10 08:01:59 -08:00
|
|
|
Inbox
|
2022-01-02 07:24:30 -08:00
|
|
|
MuteRule
|
2014-12-26 05:31:59 -08:00
|
|
|
Notification
|
2021-12-31 10:25:17 -08:00
|
|
|
Profile
|
2014-12-10 08:01:59 -08:00
|
|
|
Question
|
|
|
|
Relationship
|
2014-12-27 05:35:09 -08:00
|
|
|
Report
|
2014-12-26 05:31:59 -08:00
|
|
|
Service
|
|
|
|
Services::Twitter
|
2015-01-12 15:12:48 -08:00
|
|
|
Services::Tumblr
|
2014-12-10 08:01:59 -08:00
|
|
|
Smile
|
2015-08-25 12:10:08 -07:00
|
|
|
Theme
|
2014-12-10 08:01:59 -08:00
|
|
|
User
|
|
|
|
]
|
|
|
|
end
|