activeadmin 2.13.1 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activeadmin might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +78 -0
- data/CONTRIBUTING.md +3 -4
- data/README.md +2 -2
- data/app/assets/javascripts/active_admin/base.js +1 -4
- data/app/assets/stylesheets/active_admin/_forms.scss +1 -1
- data/app/assets/stylesheets/active_admin/structure/_footer.scss +6 -1
- data/app/views/layouts/active_admin_logged_out.html.erb +5 -4
- data/config/locales/ar.yml +0 -7
- data/config/locales/az.yml +0 -7
- data/config/locales/bg.yml +0 -7
- data/config/locales/bs.yml +0 -7
- data/config/locales/ca.yml +0 -7
- data/config/locales/cs.yml +0 -7
- data/config/locales/da.yml +0 -7
- data/config/locales/de-CH.yml +0 -7
- data/config/locales/de.yml +0 -8
- data/config/locales/el.yml +0 -7
- data/config/locales/en-CA.yml +0 -7
- data/config/locales/en-GB.yml +0 -7
- data/config/locales/en.yml +0 -8
- data/config/locales/eo.yml +0 -8
- data/config/locales/es-MX.yml +0 -7
- data/config/locales/es.yml +0 -8
- data/config/locales/fa.yml +0 -7
- data/config/locales/fi.yml +0 -7
- data/config/locales/fr.yml +3 -11
- data/config/locales/he.yml +0 -9
- data/config/locales/hr.yml +0 -7
- data/config/locales/hu.yml +0 -8
- data/config/locales/id.yml +0 -7
- data/config/locales/it.yml +0 -8
- data/config/locales/ja.yml +0 -8
- data/config/locales/ko.yml +0 -7
- data/config/locales/lt.yml +0 -8
- data/config/locales/lv.yml +0 -7
- data/config/locales/mk.yml +0 -8
- data/config/locales/nb.yml +0 -8
- data/config/locales/nl.yml +0 -8
- data/config/locales/pl.yml +0 -8
- data/config/locales/pt-BR.yml +0 -8
- data/config/locales/pt-PT.yml +0 -7
- data/config/locales/ro.yml +0 -7
- data/config/locales/ru.yml +0 -6
- data/config/locales/sk.yml +0 -8
- data/config/locales/sv-SE.yml +58 -39
- data/config/locales/tr.yml +0 -11
- data/config/locales/uk.yml +0 -6
- data/config/locales/vi.yml +34 -15
- data/config/locales/zh-CN.yml +34 -23
- data/config/locales/zh-TW.yml +0 -7
- data/lib/active_admin/asset_registration.rb +3 -3
- data/lib/active_admin/authorization_adapter.rb +2 -0
- data/lib/active_admin/base_controller/authorization.rb +2 -2
- data/lib/active_admin/dependency.rb +0 -4
- data/lib/active_admin/engine.rb +1 -1
- data/lib/active_admin/filters/active_filter.rb +1 -1
- data/lib/active_admin/filters/forms.rb +1 -1
- data/lib/active_admin/filters/resource_extension.rb +4 -4
- data/lib/active_admin/inputs/filters/base/search_method_select.rb +2 -2
- data/lib/active_admin/inputs/filters/date_range_input.rb +2 -2
- data/lib/active_admin/inputs/filters/numeric_input.rb +1 -1
- data/lib/active_admin/inputs/filters/string_input.rb +1 -1
- data/lib/active_admin/namespace_settings.rb +1 -1
- data/lib/active_admin/orm/active_record/comments/comment.rb +8 -0
- data/lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb +1 -1
- data/lib/active_admin/orm/active_record/comments.rb +8 -8
- data/lib/active_admin/pundit_adapter.rb +0 -2
- data/lib/active_admin/resource/action_items.rb +2 -2
- data/lib/active_admin/version.rb +1 -1
- data/lib/active_admin/view_helpers/auto_link_helper.rb +1 -1
- data/lib/active_admin/view_helpers/display_helper.rb +8 -1
- data/lib/active_admin/views/components/active_admin_form.rb +0 -4
- data/lib/active_admin/views/index_as_table.rb +1 -5
- data/lib/active_admin/views/pages/base.rb +4 -3
- data/lib/active_admin/views/pages/index.rb +1 -1
- data/lib/active_admin/views/pages/show.rb +1 -7
- data/lib/active_admin.rb +0 -1
- data/lib/generators/active_admin/install/templates/active_admin.rb.erb +18 -1
- metadata +9 -49
- data/docs/.gitignore +0 -1
- data/docs/0-installation.md +0 -142
- data/docs/1-general-configuration.md +0 -224
- data/docs/10-custom-pages.md +0 -150
- data/docs/11-decorators.md +0 -70
- data/docs/12-arbre-components.md +0 -214
- data/docs/13-authorization-adapter.md +0 -285
- data/docs/14-gotchas.md +0 -138
- data/docs/2-resource-customization.md +0 -475
- data/docs/3-index-pages/custom-index.md +0 -35
- data/docs/3-index-pages/index-as-block.md +0 -19
- data/docs/3-index-pages/index-as-blog.md +0 -69
- data/docs/3-index-pages/index-as-grid.md +0 -27
- data/docs/3-index-pages/index-as-table.md +0 -234
- data/docs/3-index-pages.md +0 -328
- data/docs/4-csv-format.md +0 -74
- data/docs/5-forms.md +0 -238
- data/docs/6-show-pages.md +0 -93
- data/docs/7-sidebars.md +0 -75
- data/docs/8-custom-actions.md +0 -177
- data/docs/9-batch-actions.md +0 -237
- data/docs/CNAME +0 -1
- data/docs/Gemfile +0 -4
- data/docs/Gemfile.lock +0 -283
- data/docs/README.md +0 -24
- data/docs/_config.yml +0 -4
- data/docs/_includes/footer.html +0 -8
- data/docs/_includes/google-analytics.html +0 -16
- data/docs/_includes/head.html +0 -7
- data/docs/_includes/toc.html +0 -98
- data/docs/_includes/top-menu.html +0 -17
- data/docs/_layouts/default.html +0 -21
- data/docs/documentation.md +0 -60
- data/docs/images/activeadmin.png +0 -0
- data/docs/images/code-header.png +0 -0
- data/docs/images/divider.png +0 -0
- data/docs/images/features.png +0 -0
- data/docs/images/tidelift.svg +0 -14
- data/docs/index.html +0 -226
- data/docs/stylesheets/main.css +0 -1205
- data/lib/ransack_ext.rb +0 -21
data/config/locales/zh-CN.yml
CHANGED
@@ -1,4 +1,20 @@
|
|
1
1
|
"zh-CN":
|
2
|
+
activerecord:
|
3
|
+
models:
|
4
|
+
comment:
|
5
|
+
one: "评论"
|
6
|
+
other: "评论"
|
7
|
+
active_admin/comment:
|
8
|
+
one: "评论"
|
9
|
+
other: "评论"
|
10
|
+
attributes:
|
11
|
+
active_admin/comment:
|
12
|
+
author_type: "作者类型"
|
13
|
+
body: "内容"
|
14
|
+
created_at: "创建"
|
15
|
+
namespace: "Namespace"
|
16
|
+
resource_type: "Resource 类型"
|
17
|
+
updated_at: "更新"
|
2
18
|
active_admin:
|
3
19
|
dashboard: "控制面板"
|
4
20
|
dashboard_welcome:
|
@@ -8,8 +24,8 @@
|
|
8
24
|
edit: "编辑"
|
9
25
|
delete: "删除"
|
10
26
|
delete_confirmation: "确定删除?"
|
11
|
-
create_another: "
|
12
|
-
new_model: "
|
27
|
+
create_another: "新增另一个%{model}"
|
28
|
+
new_model: "新增%{model}"
|
13
29
|
edit_model: "编辑%{model}"
|
14
30
|
delete_model: "删除%{model}"
|
15
31
|
details: "%{model}详情"
|
@@ -17,37 +33,32 @@
|
|
17
33
|
empty: "未定义"
|
18
34
|
previous: "上一个"
|
19
35
|
next: "下一个"
|
20
|
-
download: "
|
21
|
-
has_many_new: "
|
36
|
+
download: "下载:"
|
37
|
+
has_many_new: "新增一个%{model}"
|
22
38
|
has_many_delete: "删除"
|
23
39
|
has_many_remove: "清除"
|
40
|
+
move: "移动"
|
24
41
|
filters:
|
25
42
|
buttons:
|
26
43
|
filter: "过滤"
|
27
44
|
clear: "清除条件"
|
28
45
|
predicates:
|
29
|
-
contains: "包含"
|
30
|
-
equals: "等于"
|
31
|
-
starts_with: "开头"
|
32
|
-
ends_with: "完与"
|
33
|
-
greater_than: "大于"
|
34
|
-
less_than: "小于"
|
35
|
-
gteq_datetime: "大于等于"
|
36
|
-
lteq_datetime: "小于等于"
|
37
46
|
from: "起"
|
38
47
|
to: "止"
|
48
|
+
scopes:
|
49
|
+
all: "所有"
|
39
50
|
search_status:
|
40
51
|
headline: "搜索条件:"
|
41
|
-
current_scope: "
|
52
|
+
current_scope: "范围:"
|
42
53
|
current_filters: "过滤条件:"
|
43
54
|
no_current_filters: "无"
|
44
55
|
status_tag:
|
45
56
|
"yes": "是"
|
46
57
|
"no": "否"
|
47
58
|
"unset": "否"
|
48
|
-
main_content: "请执行 %{model}#main_content
|
59
|
+
main_content: "请执行 %{model}#main_content 来显示内容。"
|
49
60
|
logout: "退出"
|
50
|
-
powered_by: "
|
61
|
+
powered_by: "构建程序为 %{active_admin} %{version}"
|
51
62
|
sidebars:
|
52
63
|
filters: "所有条件"
|
53
64
|
search_status: "搜索条件"
|
@@ -63,14 +74,14 @@
|
|
63
74
|
other: "条目"
|
64
75
|
any: "任何"
|
65
76
|
blank_slate:
|
66
|
-
content: "暂时还没有%{resource_name}
|
67
|
-
link: "
|
77
|
+
content: "暂时还没有%{resource_name}。"
|
78
|
+
link: "新增一个"
|
68
79
|
dropdown_actions:
|
69
|
-
button_label: "
|
80
|
+
button_label: "操作"
|
70
81
|
batch_actions:
|
71
82
|
button_label: "批处理"
|
72
|
-
default_confirmation: "
|
73
|
-
delete_confirmation: "你确定要删除这些%{plural_model}
|
83
|
+
default_confirmation: "你确定要这样做?"
|
84
|
+
delete_confirmation: "你确定要删除这些%{plural_model}?"
|
74
85
|
succesfully_destroyed:
|
75
86
|
one: "成功删除 1 %{model}"
|
76
87
|
other: "成功删除 %{count} %{plural_model}"
|
@@ -92,7 +103,7 @@
|
|
92
103
|
author_missing: "匿名"
|
93
104
|
title_content: "(%{count})条评论"
|
94
105
|
errors:
|
95
|
-
empty_text: "
|
106
|
+
empty_text: "评论保存失败,内空不能为空。"
|
96
107
|
devise:
|
97
108
|
username:
|
98
109
|
title: "用户名"
|
@@ -121,8 +132,8 @@
|
|
121
132
|
title: "重新发送送解锁命令"
|
122
133
|
submit: "重新发送送解锁命令"
|
123
134
|
resend_confirmation_instructions:
|
124
|
-
title: "
|
125
|
-
submit: "
|
135
|
+
title: " 重新发送确认说明"
|
136
|
+
submit: " 重新发送确认说明"
|
126
137
|
links:
|
127
138
|
sign_up: "注册"
|
128
139
|
sign_in: "登录"
|
data/config/locales/zh-TW.yml
CHANGED
@@ -14,12 +14,12 @@ module ActiveAdmin
|
|
14
14
|
stylesheets.clear
|
15
15
|
end
|
16
16
|
|
17
|
-
def register_javascript(
|
18
|
-
javascripts
|
17
|
+
def register_javascript(path, options = {})
|
18
|
+
javascripts[path] = options
|
19
19
|
end
|
20
20
|
|
21
21
|
def javascripts
|
22
|
-
@javascripts ||=
|
22
|
+
@javascripts ||= {}
|
23
23
|
end
|
24
24
|
|
25
25
|
def clear_javascripts!
|
@@ -7,9 +7,9 @@ module ActiveAdmin
|
|
7
7
|
ACTIONS_DICTIONARY = {
|
8
8
|
index: ActiveAdmin::Authorization::READ,
|
9
9
|
show: ActiveAdmin::Authorization::READ,
|
10
|
-
new: ActiveAdmin::Authorization::
|
10
|
+
new: ActiveAdmin::Authorization::NEW,
|
11
11
|
create: ActiveAdmin::Authorization::CREATE,
|
12
|
-
edit: ActiveAdmin::Authorization::
|
12
|
+
edit: ActiveAdmin::Authorization::EDIT,
|
13
13
|
update: ActiveAdmin::Authorization::UPDATE,
|
14
14
|
destroy: ActiveAdmin::Authorization::DESTROY
|
15
15
|
}
|
data/lib/active_admin/engine.rb
CHANGED
@@ -12,7 +12,7 @@ module ActiveAdmin
|
|
12
12
|
ActiveAdmin.application.stylesheets.each do |path, _|
|
13
13
|
app.config.assets.precompile << path
|
14
14
|
end
|
15
|
-
ActiveAdmin.application.javascripts.each do |path|
|
15
|
+
ActiveAdmin.application.javascripts.each do |path, _|
|
16
16
|
app.config.assets.precompile << path
|
17
17
|
end
|
18
18
|
end
|
@@ -21,7 +21,7 @@ module ActiveAdmin
|
|
21
21
|
# Returns the default filter type for a given attribute. If you want
|
22
22
|
# to use a custom search method, you have to specify the type yourself.
|
23
23
|
def default_input_type(method, options = {})
|
24
|
-
if method =~ /_(eq|
|
24
|
+
if method =~ /_(eq|cont|start|end)\z/
|
25
25
|
:string
|
26
26
|
elsif klass._ransackers.key?(method.to_s)
|
27
27
|
klass._ransackers[method.to_s].type
|
@@ -3,8 +3,8 @@ module ActiveAdmin
|
|
3
3
|
module Filters
|
4
4
|
|
5
5
|
class Disabled < RuntimeError
|
6
|
-
def initialize
|
7
|
-
super "
|
6
|
+
def initialize(action)
|
7
|
+
super "Cannot #{action} a filter when filters are disabled. Enable filters with 'config.filters = true'"
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
@@ -61,7 +61,7 @@ module ActiveAdmin
|
|
61
61
|
#
|
62
62
|
# @param [Symbol] attributes The attributes to not filter on
|
63
63
|
def remove_filter(*attributes)
|
64
|
-
raise Disabled unless filters_enabled?
|
64
|
+
raise Disabled, "remove" unless filters_enabled?
|
65
65
|
|
66
66
|
attributes.each { |attribute| (@filters_to_remove ||= []) << attribute.to_sym }
|
67
67
|
end
|
@@ -73,7 +73,7 @@ module ActiveAdmin
|
|
73
73
|
# @param [Hash] options The set of options that are passed through to
|
74
74
|
# ransack for the field definition.
|
75
75
|
def add_filter(attribute, options = {})
|
76
|
-
raise Disabled unless filters_enabled?
|
76
|
+
raise Disabled, "add" unless filters_enabled?
|
77
77
|
|
78
78
|
(@filters ||= {})[attribute.to_sym] = options
|
79
79
|
end
|
@@ -9,7 +9,7 @@
|
|
9
9
|
# include Base
|
10
10
|
# include Base::SearchMethodSelect
|
11
11
|
#
|
12
|
-
# filter :
|
12
|
+
# filter :eq, :gt, :lt
|
13
13
|
# end
|
14
14
|
#
|
15
15
|
module ActiveAdmin
|
@@ -65,7 +65,7 @@ module ActiveAdmin
|
|
65
65
|
|
66
66
|
def filter_options
|
67
67
|
filters.collect do |filter|
|
68
|
-
[I18n.t("
|
68
|
+
[I18n.t("ransack.predicates.#{filter}").capitalize, "#{method}_#{filter}"]
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
@@ -15,12 +15,12 @@ module ActiveAdmin
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def gt_input_name
|
18
|
-
|
18
|
+
"#{method}_gteq"
|
19
19
|
end
|
20
20
|
alias :input_name :gt_input_name
|
21
21
|
|
22
22
|
def lt_input_name
|
23
|
-
|
23
|
+
"#{method}_lteq"
|
24
24
|
end
|
25
25
|
|
26
26
|
def input_html_options
|
@@ -6,7 +6,7 @@ module ActiveAdmin
|
|
6
6
|
include Base
|
7
7
|
include Base::SearchMethodSelect
|
8
8
|
|
9
|
-
filter :
|
9
|
+
filter :cont, :eq, :start, :end
|
10
10
|
|
11
11
|
# If the filter method includes a search condition, build a normal string search field.
|
12
12
|
# Else, build a search field with a companion dropdown to choose a search condition from.
|
@@ -119,7 +119,7 @@ module ActiveAdmin
|
|
119
119
|
:title,
|
120
120
|
:email,
|
121
121
|
]
|
122
|
-
register :filter_method_for_large_association, "
|
122
|
+
register :filter_method_for_large_association, "_start"
|
123
123
|
|
124
124
|
# Switch between asset pipeline and webpacker assets
|
125
125
|
register :use_webpacker, false
|
@@ -28,5 +28,13 @@ module ActiveAdmin
|
|
28
28
|
self.resource_type = self.class.resource_type(resource)
|
29
29
|
end
|
30
30
|
|
31
|
+
def self.ransackable_attributes(auth_object = nil)
|
32
|
+
authorizable_ransackable_attributes
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.ransackable_associations(auth_object = nil)
|
36
|
+
authorizable_ransackable_associations
|
37
|
+
end
|
38
|
+
|
31
39
|
end
|
32
40
|
end
|
@@ -72,15 +72,15 @@ ActiveAdmin.after_load do |app|
|
|
72
72
|
redirect_back fallback_location: active_admin_root
|
73
73
|
end
|
74
74
|
end
|
75
|
+
end
|
75
76
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
end
|
77
|
+
def destroy
|
78
|
+
destroy! do |success, failure|
|
79
|
+
success.html do
|
80
|
+
redirect_back fallback_location: active_admin_root
|
81
|
+
end
|
82
|
+
failure.html do
|
83
|
+
redirect_back fallback_location: active_admin_root
|
84
84
|
end
|
85
85
|
end
|
86
86
|
end
|
@@ -44,8 +44,6 @@ module ActiveAdmin
|
|
44
44
|
def format_action(action, subject)
|
45
45
|
# https://github.com/varvet/pundit/blob/master/lib/generators/pundit/install/templates/application_policy.rb
|
46
46
|
case action
|
47
|
-
when Auth::CREATE then :create?
|
48
|
-
when Auth::UPDATE then :update?
|
49
47
|
when Auth::READ then subject.is_a?(Class) ? :index? : :show?
|
50
48
|
when Auth::DESTROY then subject.is_a?(Class) ? :destroy_all? : :destroy?
|
51
49
|
else "#{action}?"
|
@@ -65,7 +65,7 @@ module ActiveAdmin
|
|
65
65
|
# Adds the default New link on index
|
66
66
|
def add_default_new_action_item
|
67
67
|
add_action_item :new, only: :index do
|
68
|
-
if controller.action_methods.include?("new") && authorized?(ActiveAdmin::Auth::
|
68
|
+
if controller.action_methods.include?("new") && authorized?(ActiveAdmin::Auth::NEW, active_admin_config.resource_class)
|
69
69
|
localizer = ActiveAdmin::Localizers.resource(active_admin_config)
|
70
70
|
link_to localizer.t(:new_model), new_resource_path
|
71
71
|
end
|
@@ -75,7 +75,7 @@ module ActiveAdmin
|
|
75
75
|
# Adds the default Edit link on show
|
76
76
|
def add_default_edit_action_item
|
77
77
|
add_action_item :edit, only: :show do
|
78
|
-
if controller.action_methods.include?("edit") && authorized?(ActiveAdmin::Auth::
|
78
|
+
if controller.action_methods.include?("edit") && authorized?(ActiveAdmin::Auth::EDIT, resource)
|
79
79
|
localizer = ActiveAdmin::Localizers.resource(active_admin_config)
|
80
80
|
link_to localizer.t(:edit_model), edit_resource_path(resource)
|
81
81
|
end
|
data/lib/active_admin/version.rb
CHANGED
@@ -29,7 +29,7 @@ module ActiveAdmin
|
|
29
29
|
authorized?(ActiveAdmin::Auth::READ, resource)
|
30
30
|
url_for config.route_instance_path resource, url_options
|
31
31
|
elsif config.controller.action_methods.include?("edit") &&
|
32
|
-
authorized?(ActiveAdmin::Auth::
|
32
|
+
authorized?(ActiveAdmin::Auth::EDIT, resource)
|
33
33
|
url_for config.route_edit_instance_path resource, url_options
|
34
34
|
end
|
35
35
|
end
|
@@ -24,7 +24,14 @@ module ActiveAdmin
|
|
24
24
|
# Attempts to call any known display name methods on the resource.
|
25
25
|
# See the setting in `application.rb` for the list of methods and their priority.
|
26
26
|
def display_name(resource)
|
27
|
-
|
27
|
+
unless resource.nil?
|
28
|
+
result = render_in_context(resource, display_name_method_for(resource))
|
29
|
+
if result.to_s&.strip&.present?
|
30
|
+
ERB::Util.html_escape(result)
|
31
|
+
else
|
32
|
+
ERB::Util.html_escape(render_in_context(resource, DISPLAY_NAME_FALLBACK))
|
33
|
+
end
|
34
|
+
end
|
28
35
|
end
|
29
36
|
|
30
37
|
# Looks up and caches the first available display name method.
|
@@ -102,10 +102,6 @@ module ActiveAdmin
|
|
102
102
|
form_builder.object
|
103
103
|
end
|
104
104
|
|
105
|
-
def form_buffers
|
106
|
-
raise "'form_buffers' has been removed from ActiveAdmin::FormBuilder, please read https://github.com/activeadmin/activeadmin/blob/master/docs/5-forms.md for details."
|
107
|
-
end
|
108
|
-
|
109
105
|
private
|
110
106
|
|
111
107
|
def create_another_checkbox
|
@@ -304,10 +304,6 @@ module ActiveAdmin
|
|
304
304
|
end
|
305
305
|
end
|
306
306
|
|
307
|
-
def default_actions
|
308
|
-
raise "`default_actions` is no longer provided in ActiveAdmin 1.x. Use `actions` instead."
|
309
|
-
end
|
310
|
-
|
311
307
|
# Add links to perform actions.
|
312
308
|
#
|
313
309
|
# ```ruby
|
@@ -377,7 +373,7 @@ module ActiveAdmin
|
|
377
373
|
if controller.action_methods.include?("show") && authorized?(ActiveAdmin::Auth::READ, resource)
|
378
374
|
item localizer.t(:view), resource_path(resource), class: "view_link #{options[:css_class]}", title: localizer.t(:view)
|
379
375
|
end
|
380
|
-
if controller.action_methods.include?("edit") && authorized?(ActiveAdmin::Auth::
|
376
|
+
if controller.action_methods.include?("edit") && authorized?(ActiveAdmin::Auth::EDIT, resource)
|
381
377
|
item localizer.t(:edit), edit_resource_path(resource), class: "edit_link #{options[:css_class]}", title: localizer.t(:edit)
|
382
378
|
end
|
383
379
|
if controller.action_methods.include?("destroy") && authorized?(ActiveAdmin::Auth::DESTROY, resource)
|
@@ -38,8 +38,8 @@ module ActiveAdmin
|
|
38
38
|
text_node(meta(name: name, content: content))
|
39
39
|
end
|
40
40
|
|
41
|
-
active_admin_application.javascripts.each do |path|
|
42
|
-
javascript_tag = active_admin_namespace.use_webpacker ? javascript_pack_tag(path) : javascript_include_tag(path)
|
41
|
+
active_admin_application.javascripts.each do |path, options|
|
42
|
+
javascript_tag = active_admin_namespace.use_webpacker ? javascript_pack_tag(path, **options) : javascript_include_tag(path, **options)
|
43
43
|
text_node(javascript_tag)
|
44
44
|
end
|
45
45
|
|
@@ -49,7 +49,8 @@ module ActiveAdmin
|
|
49
49
|
text_node(favicon_tag)
|
50
50
|
end
|
51
51
|
|
52
|
-
text_node
|
52
|
+
text_node csrf_meta_tags
|
53
|
+
text_node csp_meta_tag
|
53
54
|
end
|
54
55
|
end
|
55
56
|
|
@@ -112,7 +112,7 @@ module ActiveAdmin
|
|
112
112
|
|
113
113
|
def render_blank_slate
|
114
114
|
blank_slate_content = I18n.t("active_admin.blank_slate.content", resource_name: active_admin_config.plural_resource_label)
|
115
|
-
if controller.action_methods.include?("new") && authorized?(ActiveAdmin::Auth::
|
115
|
+
if controller.action_methods.include?("new") && authorized?(ActiveAdmin::Auth::NEW, active_admin_config.resource_class)
|
116
116
|
blank_slate_content = [blank_slate_content, blank_slate_link].compact.join(" ")
|
117
117
|
end
|
118
118
|
insert_tag(view_factory.blank_slate, blank_slate_content)
|
@@ -40,13 +40,7 @@ module ActiveAdmin
|
|
40
40
|
protected
|
41
41
|
|
42
42
|
def default_title
|
43
|
-
|
44
|
-
|
45
|
-
if title.blank?
|
46
|
-
title = "#{active_admin_config.resource_label} ##{resource.id}"
|
47
|
-
end
|
48
|
-
|
49
|
-
title
|
43
|
+
display_name(resource)
|
50
44
|
end
|
51
45
|
|
52
46
|
module DefaultMainContent
|
data/lib/active_admin.rb
CHANGED
@@ -18,6 +18,23 @@ ActiveAdmin.setup do |config|
|
|
18
18
|
#
|
19
19
|
# config.site_title_image = "logo.png"
|
20
20
|
|
21
|
+
# == Load Paths
|
22
|
+
#
|
23
|
+
# By default Active Admin files go inside app/admin/.
|
24
|
+
# You can change this directory.
|
25
|
+
#
|
26
|
+
# eg:
|
27
|
+
# config.load_paths = [File.join(Rails.root, 'app', 'ui')]
|
28
|
+
#
|
29
|
+
# Or, you can also load more directories.
|
30
|
+
# Useful when setting namespaces with users that are not your main AdminUser entity.
|
31
|
+
#
|
32
|
+
# eg:
|
33
|
+
# config.load_paths = [
|
34
|
+
# File.join(Rails.root, 'app', 'admin'),
|
35
|
+
# File.join(Rails.root, 'app', 'cashier')
|
36
|
+
# ]
|
37
|
+
|
21
38
|
# == Default Namespace
|
22
39
|
#
|
23
40
|
# Set the default namespace each administration resource
|
@@ -303,7 +320,7 @@ ActiveAdmin.setup do |config|
|
|
303
320
|
# :title,
|
304
321
|
# :email,
|
305
322
|
# ]
|
306
|
-
# config.filter_method_for_large_association = '
|
323
|
+
# config.filter_method_for_large_association = '_start'
|
307
324
|
|
308
325
|
# == Head
|
309
326
|
#
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeadmin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charles Maresh
|
@@ -15,7 +15,7 @@ authors:
|
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
|
-
date:
|
18
|
+
date: 2023-07-15 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: arbre
|
@@ -145,20 +145,20 @@ dependencies:
|
|
145
145
|
requirements:
|
146
146
|
- - ">="
|
147
147
|
- !ruby/object:Gem::Version
|
148
|
-
version:
|
148
|
+
version: '4.0'
|
149
149
|
- - "<"
|
150
150
|
- !ruby/object:Gem::Version
|
151
|
-
version: '
|
151
|
+
version: '5'
|
152
152
|
type: :runtime
|
153
153
|
prerelease: false
|
154
154
|
version_requirements: !ruby/object:Gem::Requirement
|
155
155
|
requirements:
|
156
156
|
- - ">="
|
157
157
|
- !ruby/object:Gem::Version
|
158
|
-
version:
|
158
|
+
version: '4.0'
|
159
159
|
- - "<"
|
160
160
|
- !ruby/object:Gem::Version
|
161
|
-
version: '
|
161
|
+
version: '5'
|
162
162
|
description: The administration framework for Ruby on Rails.
|
163
163
|
email:
|
164
164
|
- deivid.rodriguez@riseup.net
|
@@ -309,46 +309,6 @@ files:
|
|
309
309
|
- config/locales/vi.yml
|
310
310
|
- config/locales/zh-CN.yml
|
311
311
|
- config/locales/zh-TW.yml
|
312
|
-
- docs/.gitignore
|
313
|
-
- docs/0-installation.md
|
314
|
-
- docs/1-general-configuration.md
|
315
|
-
- docs/10-custom-pages.md
|
316
|
-
- docs/11-decorators.md
|
317
|
-
- docs/12-arbre-components.md
|
318
|
-
- docs/13-authorization-adapter.md
|
319
|
-
- docs/14-gotchas.md
|
320
|
-
- docs/2-resource-customization.md
|
321
|
-
- docs/3-index-pages.md
|
322
|
-
- docs/3-index-pages/custom-index.md
|
323
|
-
- docs/3-index-pages/index-as-block.md
|
324
|
-
- docs/3-index-pages/index-as-blog.md
|
325
|
-
- docs/3-index-pages/index-as-grid.md
|
326
|
-
- docs/3-index-pages/index-as-table.md
|
327
|
-
- docs/4-csv-format.md
|
328
|
-
- docs/5-forms.md
|
329
|
-
- docs/6-show-pages.md
|
330
|
-
- docs/7-sidebars.md
|
331
|
-
- docs/8-custom-actions.md
|
332
|
-
- docs/9-batch-actions.md
|
333
|
-
- docs/CNAME
|
334
|
-
- docs/Gemfile
|
335
|
-
- docs/Gemfile.lock
|
336
|
-
- docs/README.md
|
337
|
-
- docs/_config.yml
|
338
|
-
- docs/_includes/footer.html
|
339
|
-
- docs/_includes/google-analytics.html
|
340
|
-
- docs/_includes/head.html
|
341
|
-
- docs/_includes/toc.html
|
342
|
-
- docs/_includes/top-menu.html
|
343
|
-
- docs/_layouts/default.html
|
344
|
-
- docs/documentation.md
|
345
|
-
- docs/images/activeadmin.png
|
346
|
-
- docs/images/code-header.png
|
347
|
-
- docs/images/divider.png
|
348
|
-
- docs/images/features.png
|
349
|
-
- docs/images/tidelift.svg
|
350
|
-
- docs/index.html
|
351
|
-
- docs/stylesheets/main.css
|
352
312
|
- lib/active_admin.rb
|
353
313
|
- lib/active_admin/abstract_view_factory.rb
|
354
314
|
- lib/active_admin/application.rb
|
@@ -530,7 +490,6 @@ files:
|
|
530
490
|
- lib/generators/active_admin/webpacker/templates/active_admin.scss
|
531
491
|
- lib/generators/active_admin/webpacker/templates/print.scss
|
532
492
|
- lib/generators/active_admin/webpacker/webpacker_generator.rb
|
533
|
-
- lib/ransack_ext.rb
|
534
493
|
- vendor/assets/javascripts/jquery-ui/data.js
|
535
494
|
- vendor/assets/javascripts/jquery-ui/disable-selection.js
|
536
495
|
- vendor/assets/javascripts/jquery-ui/escape-selector.js
|
@@ -562,7 +521,8 @@ files:
|
|
562
521
|
homepage: https://activeadmin.info
|
563
522
|
licenses:
|
564
523
|
- MIT
|
565
|
-
metadata:
|
524
|
+
metadata:
|
525
|
+
rubygems_mfa_required: 'true'
|
566
526
|
post_install_message:
|
567
527
|
rdoc_options: []
|
568
528
|
require_paths:
|
@@ -578,7 +538,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
578
538
|
- !ruby/object:Gem::Version
|
579
539
|
version: '0'
|
580
540
|
requirements: []
|
581
|
-
rubygems_version: 3.
|
541
|
+
rubygems_version: 3.4.13
|
582
542
|
signing_key:
|
583
543
|
specification_version: 4
|
584
544
|
summary: Active Admin is a Ruby on Rails plugin for generating administration style
|