activeadmin 4.0.0.beta15 → 4.0.0.beta16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/UPGRADING.md +5 -3
- data/app/controllers/active_admin/resource_controller/data_access.rb +1 -1
- data/app/controllers/active_admin/resource_controller/streaming.rb +2 -2
- data/app/helpers/active_admin/form_helper.rb +1 -1
- data/app/views/active_admin/_site_header.html.erb +1 -1
- data/app/views/active_admin/kaminari/_gap.html.erb +1 -1
- data/app/views/active_admin/page/index.html.arb +1 -2
- data/app/views/active_admin/resource/_form.html.arb +0 -1
- data/app/views/active_admin/resource/_form_default.html.arb +0 -1
- data/app/views/active_admin/resource/_index_as_table_default.html.arb +0 -1
- data/app/views/active_admin/resource/_show_default.html.arb +0 -1
- data/app/views/active_admin/resource/edit.html.arb +0 -1
- data/app/views/active_admin/resource/index.html.arb +0 -1
- data/app/views/active_admin/resource/new.html.arb +0 -1
- data/app/views/active_admin/resource/show.html.arb +0 -1
- data/app/views/active_admin/shared/_sidebar_section.html.arb +0 -1
- data/app/views/layouts/active_admin.html.erb +1 -1
- data/config/importmap.rb +2 -2
- data/config/locales/ar.yml +135 -133
- data/config/locales/az.yml +103 -102
- data/config/locales/bg.yml +91 -90
- data/config/locales/bs.yml +95 -94
- data/config/locales/ca.yml +129 -128
- data/config/locales/cs.yml +82 -81
- data/config/locales/da.yml +102 -101
- data/config/locales/de.yml +130 -129
- data/config/locales/el.yml +94 -93
- data/config/locales/en-CA.yml +104 -103
- data/config/locales/en-GB.yml +104 -103
- data/config/locales/en.yml +134 -132
- data/config/locales/eo.yml +107 -106
- data/config/locales/es-MX.yml +70 -69
- data/config/locales/es.yml +129 -128
- data/config/locales/fa.yml +91 -90
- data/config/locales/fi.yml +84 -83
- data/config/locales/fr.yml +125 -124
- data/config/locales/he.yml +103 -102
- data/config/locales/hr.yml +95 -94
- data/config/locales/hu.yml +76 -75
- data/config/locales/id.yml +97 -96
- data/config/locales/it.yml +134 -132
- data/config/locales/ja.yml +109 -108
- data/config/locales/ko.yml +134 -132
- data/config/locales/lt.yml +106 -105
- data/config/locales/lv.yml +70 -69
- data/config/locales/mk.yml +100 -99
- data/config/locales/nb.yml +98 -97
- data/config/locales/nl.yml +113 -112
- data/config/locales/pl.yml +137 -136
- data/config/locales/pt-BR.yml +134 -105
- data/config/locales/pt-PT.yml +71 -70
- data/config/locales/ro.yml +74 -73
- data/config/locales/ru.yml +141 -140
- data/config/locales/sk.yml +131 -130
- data/config/locales/sv-SE.yml +126 -125
- data/config/locales/tr.yml +105 -104
- data/config/locales/uk.yml +140 -103
- data/config/locales/vi.yml +125 -124
- data/config/locales/zh-CN.yml +135 -133
- data/config/locales/zh-TW.yml +135 -133
- data/lib/active_admin/application.rb +2 -2
- data/lib/active_admin/batch_actions/resource_extension.rb +1 -1
- data/lib/active_admin/csv_builder.rb +1 -1
- data/lib/active_admin/dsl.rb +1 -1
- data/lib/active_admin/filters/active.rb +1 -1
- data/lib/active_admin/filters/active_filter.rb +1 -7
- data/lib/active_admin/filters/forms.rb +0 -3
- data/lib/active_admin/filters/resource_extension.rb +1 -1
- data/lib/active_admin/form_builder.rb +0 -4
- data/lib/active_admin/helpers/optional_display.rb +1 -1
- data/lib/active_admin/inputs/filters/base/search_method_select.rb +2 -2
- data/lib/active_admin/inputs/filters/select_input.rb +1 -3
- data/lib/active_admin/resource/action_items.rb +2 -2
- data/lib/active_admin/resource/belongs_to.rb +0 -1
- data/lib/active_admin/resource/naming.rb +1 -1
- data/lib/active_admin/resource.rb +1 -1
- data/lib/active_admin/resource_collection.rb +1 -1
- data/lib/active_admin/resource_dsl.rb +2 -2
- data/lib/active_admin/version.rb +1 -1
- data/lib/active_admin/view_helpers/method_or_proc_helper.rb +1 -1
- data/lib/active_admin/views/components/table_for.rb +1 -1
- data/lib/active_admin/views/index_as_table.rb +7 -2
- data/plugin.js +3 -12
- data/vendor/javascript/flowbite.js +1 -1
- metadata +8 -12
- data/lib/active_admin/views/components/tabs.rb +0 -40
data/config/locales/zh-TW.yml
CHANGED
@@ -1,146 +1,148 @@
|
|
1
|
-
|
2
|
-
|
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: "命名空間"
|
16
|
-
resource_type: "資源類型"
|
17
|
-
updated_at: "更新時間"
|
1
|
+
---
|
2
|
+
zh-TW:
|
18
3
|
active_admin:
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
delete: "刪除"
|
23
|
-
delete_confirmation: "你確定要刪除嗎?"
|
24
|
-
create_another: "新增另一個 %{model}"
|
25
|
-
new_model: "新增 %{model}"
|
26
|
-
edit_model: "編輯 %{model}"
|
27
|
-
delete_model: "刪除 %{model}"
|
28
|
-
details: "%{model} 明細"
|
29
|
-
cancel: "取消"
|
30
|
-
empty: "空的"
|
31
|
-
previous: "前一個"
|
32
|
-
next: "下一個"
|
33
|
-
download: "下載:"
|
34
|
-
has_many_new: "增加新的 %{model}"
|
35
|
-
has_many_delete: "刪除"
|
36
|
-
has_many_remove: "移除"
|
37
|
-
move: "移動"
|
38
|
-
filters:
|
39
|
-
buttons:
|
40
|
-
filter: "篩選"
|
41
|
-
clear: "清除篩選條件"
|
42
|
-
predicates:
|
43
|
-
from: "從"
|
44
|
-
to: "到"
|
45
|
-
scopes:
|
46
|
-
all: "全部"
|
47
|
-
search_status:
|
48
|
-
title: "進行中的搜尋"
|
49
|
-
title_with_scope: "正在搜尋 %{name}"
|
50
|
-
no_current_filters: "未套用篩選條件"
|
51
|
-
status_tag:
|
52
|
-
"yes": "是"
|
53
|
-
"no": "否"
|
54
|
-
"unset": "未知"
|
55
|
-
toggle_dark_mode: "切換暗黑模式"
|
56
|
-
toggle_main_navigation_menu: "切換主要導覽"
|
57
|
-
toggle_section: "切換區塊"
|
58
|
-
toggle_user_menu: "切換使用者選單"
|
59
|
-
logout: "登出"
|
60
|
-
powered_by: "由 %{active_admin} %{version} 提供"
|
61
|
-
sidebars:
|
62
|
-
filters: "篩選條件"
|
63
|
-
search_status: "搜尋狀態"
|
64
|
-
pagination:
|
65
|
-
empty: "找不到 %{model}"
|
66
|
-
one: "顯示 <b>1</b> %{model}"
|
67
|
-
one_page: "顯示 <b>全部 %{n}</b> %{model}"
|
68
|
-
multiple: "總計 <b>%{total}</b> 顯示 %{model} 中<b>%{from} - %{to}</b> 筆"
|
69
|
-
multiple_without_total: "顯示 %{model} 中<b>%{from} - %{to}</b> 筆"
|
70
|
-
per_page: "每頁 "
|
71
|
-
previous: "前一個"
|
72
|
-
next: "下一個"
|
73
|
-
entry:
|
74
|
-
one: "筆"
|
75
|
-
other: "筆"
|
76
|
-
any: "任何"
|
77
|
-
blank_slate:
|
78
|
-
content: "尚無 %{resource_name}。"
|
79
|
-
link: "建立一筆"
|
4
|
+
access_denied:
|
5
|
+
message: 你沒有權限執行此項操作
|
6
|
+
any: 任何
|
80
7
|
batch_actions:
|
81
|
-
button_label: "批次操作"
|
82
|
-
default_confirmation: "你確定要這樣做嗎?"
|
83
|
-
delete_confirmation: "你確定要刪除這些 %{plural_model} 嗎?"
|
84
|
-
succesfully_destroyed:
|
85
|
-
one: "成功刪除 1 %{model}"
|
86
|
-
other: "成功刪除 %{count} %{plural_model}"
|
87
|
-
selection_toggle_explanation: "(切換選取)"
|
88
8
|
action_label: "%{title} 已選取"
|
9
|
+
button_label: 批次操作
|
10
|
+
default_confirmation: 你確定要這樣做嗎?
|
11
|
+
delete_confirmation: 你確定要刪除這些 %{plural_model} 嗎?
|
89
12
|
labels:
|
90
|
-
destroy:
|
13
|
+
destroy: 刪除
|
14
|
+
selection_toggle_explanation: "(切換選取)"
|
15
|
+
successfully_destroyed:
|
16
|
+
one: 成功刪除 1 %{model}
|
17
|
+
other: 成功刪除 %{count} %{plural_model}
|
18
|
+
blank_slate:
|
19
|
+
content: 尚無 %{resource_name}。
|
20
|
+
link: 建立一筆
|
21
|
+
cancel: 取消
|
91
22
|
comments:
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
delete:
|
99
|
-
delete_confirmation:
|
100
|
-
resource: "資源"
|
101
|
-
no_comments_yet: "尚無評論"
|
102
|
-
author_missing: "匿名"
|
103
|
-
title_content: "%{count} 則評論"
|
23
|
+
add: 新增評論
|
24
|
+
author: 作者
|
25
|
+
author_missing: 匿名
|
26
|
+
author_type: 作者身份
|
27
|
+
body: 內文
|
28
|
+
created_at: 建立時間
|
29
|
+
delete: 刪除評論
|
30
|
+
delete_confirmation: 你確定要刪除這個評論嗎?
|
104
31
|
errors:
|
105
|
-
empty_text:
|
32
|
+
empty_text: 評論儲存失敗,不允許空白的內容。
|
33
|
+
no_comments_yet: 尚無評論
|
34
|
+
resource: 資源
|
35
|
+
resource_type: 資源類型
|
36
|
+
title_content: "%{count} 則評論"
|
37
|
+
create_another: 新增另一個 %{model}
|
38
|
+
dashboard: 儀表板
|
39
|
+
delete: 刪除
|
40
|
+
delete_confirmation: 你確定要刪除嗎?
|
41
|
+
delete_model: 刪除 %{model}
|
42
|
+
details: "%{model} 明細"
|
106
43
|
devise:
|
107
|
-
|
108
|
-
|
44
|
+
change_password:
|
45
|
+
submit: 更改我的密碼
|
46
|
+
title: 更改你的密碼
|
109
47
|
email:
|
110
|
-
title:
|
111
|
-
|
112
|
-
|
48
|
+
title: 電子郵件信箱
|
49
|
+
links:
|
50
|
+
forgot_your_password: 忘記密碼?
|
51
|
+
resend_confirmation_instructions: 重新發送確認信
|
52
|
+
resend_unlock_instructions: 重新發送解鎖指示
|
53
|
+
sign_in: 登入
|
54
|
+
sign_in_with_omniauth_provider: 使用 %{provider} 登入
|
55
|
+
sign_up: 註冊
|
56
|
+
login:
|
57
|
+
remember_me: 記住我
|
58
|
+
submit: 登入
|
59
|
+
title: 登入
|
113
60
|
password:
|
114
|
-
title:
|
61
|
+
title: 密碼
|
115
62
|
password_confirmation:
|
116
|
-
title:
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
login:
|
121
|
-
title: "登入"
|
122
|
-
remember_me: "記住我"
|
123
|
-
submit: "登入"
|
63
|
+
title: 確認密碼
|
64
|
+
resend_confirmation_instructions:
|
65
|
+
submit: 重新發送確認信
|
66
|
+
title: 重新發送確認信
|
124
67
|
reset_password:
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
68
|
+
submit: 重設密碼
|
69
|
+
title: 忘記密碼?
|
70
|
+
sign_up:
|
71
|
+
submit: 註冊
|
72
|
+
title: 註冊
|
73
|
+
subdomain:
|
74
|
+
title: 子網域
|
130
75
|
unlock:
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
title:
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
76
|
+
submit: 重新發送解鎖指示
|
77
|
+
title: 重新發送解鎖指示
|
78
|
+
username:
|
79
|
+
title: 帳號
|
80
|
+
download: 下載:
|
81
|
+
edit: 編輯
|
82
|
+
edit_model: 編輯 %{model}
|
83
|
+
empty: 空的
|
84
|
+
filters:
|
85
|
+
buttons:
|
86
|
+
clear: 清除篩選條件
|
87
|
+
filter: 篩選
|
88
|
+
predicates:
|
89
|
+
from: 從
|
90
|
+
to: 到
|
91
|
+
has_many_delete: 刪除
|
92
|
+
has_many_new: 增加新的 %{model}
|
93
|
+
has_many_remove: 移除
|
145
94
|
index_list:
|
146
|
-
table:
|
95
|
+
table: 表格
|
96
|
+
logout: 登出
|
97
|
+
move: 移動
|
98
|
+
new_model: 新增 %{model}
|
99
|
+
next: 下一個
|
100
|
+
pagination:
|
101
|
+
empty: 找不到 %{model}
|
102
|
+
entry:
|
103
|
+
one: 筆
|
104
|
+
other: 筆
|
105
|
+
multiple: 總計 <b>%{total}</b> 顯示 %{model} 中<b>%{from} - %{to}</b> 筆
|
106
|
+
multiple_without_total: 顯示 %{model} 中<b>%{from} - %{to}</b> 筆
|
107
|
+
next: 下一個
|
108
|
+
one: 顯示 <b>1</b> %{model}
|
109
|
+
one_page: 顯示 <b>全部 %{n}</b> %{model}
|
110
|
+
per_page: '每頁 '
|
111
|
+
previous: 前一個
|
112
|
+
truncate: "…"
|
113
|
+
powered_by: 由 %{active_admin} %{version} 提供
|
114
|
+
previous: 前一個
|
115
|
+
scopes:
|
116
|
+
all: 全部
|
117
|
+
search_status:
|
118
|
+
no_current_filters: 未套用篩選條件
|
119
|
+
title: 進行中的搜尋
|
120
|
+
title_with_scope: 正在搜尋 %{name}
|
121
|
+
sidebars:
|
122
|
+
filters: 篩選條件
|
123
|
+
search_status: 搜尋狀態
|
124
|
+
status_tag:
|
125
|
+
'no': 否
|
126
|
+
unset: 未知
|
127
|
+
'yes': 是
|
128
|
+
toggle_dark_mode: 切換暗黑模式
|
129
|
+
toggle_main_navigation_menu: 切換主要導覽
|
130
|
+
toggle_section: 切換區塊
|
131
|
+
toggle_user_menu: 切換使用者選單
|
132
|
+
view: 檢視
|
133
|
+
activerecord:
|
134
|
+
attributes:
|
135
|
+
active_admin/comment:
|
136
|
+
author_type: 作者類型
|
137
|
+
body: 內容
|
138
|
+
created_at: 建立時間
|
139
|
+
namespace: 命名空間
|
140
|
+
resource_type: 資源類型
|
141
|
+
updated_at: 更新時間
|
142
|
+
models:
|
143
|
+
active_admin/comment:
|
144
|
+
one: 評論
|
145
|
+
other: 評論
|
146
|
+
comment:
|
147
|
+
one: 評論
|
148
|
+
other: 評論
|
@@ -101,7 +101,7 @@ module ActiveAdmin
|
|
101
101
|
# Removes all defined controllers from memory. Useful in
|
102
102
|
# development, where they are reloaded on each request.
|
103
103
|
def unload!
|
104
|
-
namespaces.each
|
104
|
+
namespaces.each(&:unload!)
|
105
105
|
@@loaded = false
|
106
106
|
end
|
107
107
|
|
@@ -155,7 +155,7 @@ module ActiveAdmin
|
|
155
155
|
|
156
156
|
def controllers_for_filters
|
157
157
|
controllers = [BaseController]
|
158
|
-
controllers.push
|
158
|
+
controllers.push(*Devise.controllers_for_filters) if Dependency.devise?
|
159
159
|
controllers
|
160
160
|
end
|
161
161
|
|
@@ -69,7 +69,7 @@ module ActiveAdmin
|
|
69
69
|
|
70
70
|
redirect_to active_admin_config.route_collection_path(params),
|
71
71
|
notice: I18n.t(
|
72
|
-
"active_admin.batch_actions.
|
72
|
+
"active_admin.batch_actions.successfully_destroyed",
|
73
73
|
count: selected_ids.count,
|
74
74
|
model: active_admin_config.resource_label.downcase,
|
75
75
|
plural_model: active_admin_config.plural_resource_label(count: selected_ids.count).downcase)
|
@@ -64,7 +64,7 @@ module ActiveAdmin
|
|
64
64
|
def exec_columns(view_context = nil)
|
65
65
|
@view_context = view_context
|
66
66
|
@columns = [] # we want to re-render these every instance
|
67
|
-
instance_exec
|
67
|
+
instance_exec(&@block) if @block.present?
|
68
68
|
columns
|
69
69
|
end
|
70
70
|
|
data/lib/active_admin/dsl.rb
CHANGED
@@ -11,7 +11,7 @@ module ActiveAdmin
|
|
11
11
|
# @param resource [ActiveAdmin::Resource] current resource
|
12
12
|
# @param search [Ransack::Search] search object
|
13
13
|
#
|
14
|
-
# @see ActiveAdmin::ResourceController::
|
14
|
+
# @see ActiveAdmin::ResourceController::DataAccess#apply_filtering
|
15
15
|
def initialize(resource, search)
|
16
16
|
@resource = resource
|
17
17
|
@filters = build_filters(search.conditions)
|
@@ -38,9 +38,7 @@ module ActiveAdmin
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def predicate_name
|
41
|
-
|
42
|
-
"ransack.predicates.#{condition.predicate.name}",
|
43
|
-
default: ransack_predicate_name)
|
41
|
+
Ransack::Translate.predicate(condition.predicate.name)
|
44
42
|
end
|
45
43
|
|
46
44
|
def html_options
|
@@ -78,10 +76,6 @@ module ActiveAdmin
|
|
78
76
|
condition_attribute.attr_name
|
79
77
|
end
|
80
78
|
|
81
|
-
def ransack_predicate_name
|
82
|
-
Ransack::Translate.predicate(condition.predicate.name)
|
83
|
-
end
|
84
|
-
|
85
79
|
def find_class?
|
86
80
|
["eq", "in"].include? condition.predicate.arel_predicate
|
87
81
|
end
|
@@ -7,9 +7,6 @@ module ActiveAdmin
|
|
7
7
|
include ::ActiveAdmin::Filters::FormtasticAddons
|
8
8
|
self.input_namespaces = [::Object, ::ActiveAdmin::Inputs::Filters, ::ActiveAdmin::Inputs, ::Formtastic::Inputs]
|
9
9
|
|
10
|
-
# TODO: remove input class finders after formtastic 4 (where it will be default)
|
11
|
-
self.input_class_finder = ::Formtastic::InputClassFinder
|
12
|
-
|
13
10
|
def filter(method, options = {})
|
14
11
|
if method.present? && options[:as] ||= default_input_type(method)
|
15
12
|
template.concat input(method, options)
|
@@ -17,10 +17,6 @@ module ActiveAdmin
|
|
17
17
|
|
18
18
|
self.input_namespaces = [::Object, ::ActiveAdmin::Inputs, ::Formtastic::Inputs]
|
19
19
|
|
20
|
-
# TODO: remove both class finders after formtastic 4 (where it will be default)
|
21
|
-
self.input_class_finder = ::Formtastic::InputClassFinder
|
22
|
-
self.action_class_finder = ::Formtastic::ActionClassFinder
|
23
|
-
|
24
20
|
def cancel_link(url = { action: "index" }, html_options = {}, li_attrs = {})
|
25
21
|
li_attrs[:class] ||= "action cancel"
|
26
22
|
html_options[:class] ||= "cancel-link"
|
@@ -26,7 +26,7 @@ module ActiveAdmin
|
|
26
26
|
attr_reader :filters
|
27
27
|
|
28
28
|
def filter(*filters)
|
29
|
-
(@filters ||= []).push
|
29
|
+
(@filters ||= []).push(*filters)
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
@@ -63,7 +63,7 @@ module ActiveAdmin
|
|
63
63
|
|
64
64
|
def filter_options
|
65
65
|
filters.collect do |filter|
|
66
|
-
[
|
66
|
+
[Ransack::Translate.predicate(filter).capitalize, "#{method}_#{filter}"]
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
@@ -15,9 +15,7 @@ module ActiveAdmin
|
|
15
15
|
if searchable_has_many_through?
|
16
16
|
"#{reflection.through_reflection.name}_#{reflection.foreign_key}"
|
17
17
|
else
|
18
|
-
|
19
|
-
name.concat "_#{reflection.association_primary_key}" if reflection_searchable?
|
20
|
-
name
|
18
|
+
reflection_searchable? ? "#{method}_#{reflection.association_primary_key}" : method.to_s
|
21
19
|
end
|
22
20
|
end
|
23
21
|
|
@@ -59,7 +59,7 @@ module ActiveAdmin
|
|
59
59
|
def add_default_action_items
|
60
60
|
add_default_new_action_item
|
61
61
|
add_default_edit_action_item
|
62
|
-
|
62
|
+
add_default_destroy_action_item
|
63
63
|
end
|
64
64
|
|
65
65
|
# Adds the default New link on index
|
@@ -79,7 +79,7 @@ module ActiveAdmin
|
|
79
79
|
end
|
80
80
|
|
81
81
|
# Adds the default Destroy link on show
|
82
|
-
def
|
82
|
+
def add_default_destroy_action_item
|
83
83
|
add_action_item :destroy, only: :show, if: -> { destroy_action_authorized?(resource) } do
|
84
84
|
localizer = ActiveAdmin::Localizers.resource(active_admin_config)
|
85
85
|
link_to(
|
@@ -5,7 +5,7 @@ module ActiveAdmin
|
|
5
5
|
module Naming
|
6
6
|
def resource_name
|
7
7
|
@resource_name ||= begin
|
8
|
-
as = @options[:as].gsub
|
8
|
+
as = @options[:as].gsub(/\s/, "") if @options[:as]
|
9
9
|
|
10
10
|
if as || !resource_class.respond_to?(:model_name)
|
11
11
|
Name.new resource_class, as
|
@@ -177,7 +177,7 @@ module ActiveAdmin
|
|
177
177
|
end
|
178
178
|
|
179
179
|
def find_resource(id)
|
180
|
-
resource = resource_class.public_send
|
180
|
+
resource = resource_class.public_send(*method_for_find(id))
|
181
181
|
(decorator_class && resource) ? decorator_class.new(resource) : resource
|
182
182
|
end
|
183
183
|
|
@@ -40,7 +40,7 @@ module ActiveAdmin
|
|
40
40
|
|
41
41
|
# Store relations that should be included
|
42
42
|
def includes(*args)
|
43
|
-
config.includes.push
|
43
|
+
config.includes.push(*args)
|
44
44
|
end
|
45
45
|
|
46
46
|
#
|
@@ -193,7 +193,7 @@ module ActiveAdmin
|
|
193
193
|
|
194
194
|
standard_rails_filters =
|
195
195
|
AbstractController::Callbacks::ClassMethods.public_instance_methods.select { |m| m.end_with?('_action') }
|
196
|
-
delegate
|
196
|
+
delegate(*standard_rails_filters, to: :controller)
|
197
197
|
|
198
198
|
# Specify which actions to create in the controller
|
199
199
|
#
|
data/lib/active_admin/version.rb
CHANGED
@@ -256,9 +256,14 @@ module ActiveAdmin
|
|
256
256
|
end
|
257
257
|
|
258
258
|
# Display a column for the id
|
259
|
-
def id_column
|
259
|
+
def id_column(*args)
|
260
260
|
raise "#{resource_class.name} has no primary_key!" unless resource_class.primary_key
|
261
|
-
|
261
|
+
|
262
|
+
options = args.extract_options!
|
263
|
+
title = args[0].presence || resource_class.human_attribute_name(resource_class.primary_key)
|
264
|
+
sortable = options.fetch(:sortable, resource_class.primary_key)
|
265
|
+
|
266
|
+
column(title, sortable: sortable) do |resource|
|
262
267
|
if controller.action_methods.include?("show")
|
263
268
|
link_to resource.id, resource_path(resource)
|
264
269
|
elsif controller.action_methods.include?("edit")
|
data/plugin.js
CHANGED
@@ -352,7 +352,7 @@ export default plugin(
|
|
352
352
|
'@apply overflow-x-auto': {}
|
353
353
|
},
|
354
354
|
'.paginated-collection-pagination': {
|
355
|
-
'@apply p-2 lg:p-3 flex flex-col-reverse lg:flex-row gap-4 items-center justify-between': {}
|
355
|
+
'@apply p-2 lg:p-3 flex flex-col-reverse lg:flex-row gap-4 items-center justify-between border-t border-gray-200 dark:border-gray-800': {}
|
356
356
|
},
|
357
357
|
'.paginated-collection-footer': {
|
358
358
|
'@apply p-3 flex gap-2 items-center justify-between text-sm border-t border-gray-200 dark:border-gray-800': {}
|
@@ -382,7 +382,7 @@ export default plugin(
|
|
382
382
|
'@apply rotate-180': {}
|
383
383
|
},
|
384
384
|
'.data-table :where(tbody > tr)': {
|
385
|
-
'@apply border-b dark:border-gray-800': {}
|
385
|
+
'@apply border-b dark:border-gray-800 last:border-b-0': {}
|
386
386
|
},
|
387
387
|
'.data-table :where(td)': {
|
388
388
|
'@apply px-3 py-4': {}
|
@@ -454,7 +454,7 @@ export default plugin(
|
|
454
454
|
'@apply w-full text-sm text-gray-800 dark:text-gray-300': {}
|
455
455
|
},
|
456
456
|
'.attributes-table :where(tbody > tr)': {
|
457
|
-
'@apply border-b dark:border-gray-800': {}
|
457
|
+
'@apply border-b dark:border-gray-800 last:border-b-0': {}
|
458
458
|
},
|
459
459
|
'.attributes-table :where(tbody > tr > th)': {
|
460
460
|
'@apply w-32 sm:w-40 text-start text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-800/60 dark:text-gray-300': {}
|
@@ -471,15 +471,6 @@ export default plugin(
|
|
471
471
|
'.status-tag:where([data-status=yes])': {
|
472
472
|
'@apply bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-300': {}
|
473
473
|
},
|
474
|
-
'.tabs-nav': {
|
475
|
-
'@apply flex flex-wrap mb-2 text-sm font-medium text-center border-b border-gray-200 dark:border-gray-700': {}
|
476
|
-
},
|
477
|
-
'.tabs-nav > :where(a)': {
|
478
|
-
'@apply block p-4 border-b-2 border-transparent rounded-t-md hover:text-gray-600 dark:hover:text-gray-300 no-underline': {}
|
479
|
-
},
|
480
|
-
'.tabs-content': {
|
481
|
-
'@apply p-4 mb-6': {}
|
482
|
-
},
|
483
474
|
// Forms
|
484
475
|
'.formtastic': {
|
485
476
|
'@apply text-sm': {}
|