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.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/UPGRADING.md +5 -3
  3. data/app/controllers/active_admin/resource_controller/data_access.rb +1 -1
  4. data/app/controllers/active_admin/resource_controller/streaming.rb +2 -2
  5. data/app/helpers/active_admin/form_helper.rb +1 -1
  6. data/app/views/active_admin/_site_header.html.erb +1 -1
  7. data/app/views/active_admin/kaminari/_gap.html.erb +1 -1
  8. data/app/views/active_admin/page/index.html.arb +1 -2
  9. data/app/views/active_admin/resource/_form.html.arb +0 -1
  10. data/app/views/active_admin/resource/_form_default.html.arb +0 -1
  11. data/app/views/active_admin/resource/_index_as_table_default.html.arb +0 -1
  12. data/app/views/active_admin/resource/_show_default.html.arb +0 -1
  13. data/app/views/active_admin/resource/edit.html.arb +0 -1
  14. data/app/views/active_admin/resource/index.html.arb +0 -1
  15. data/app/views/active_admin/resource/new.html.arb +0 -1
  16. data/app/views/active_admin/resource/show.html.arb +0 -1
  17. data/app/views/active_admin/shared/_sidebar_section.html.arb +0 -1
  18. data/app/views/layouts/active_admin.html.erb +1 -1
  19. data/config/importmap.rb +2 -2
  20. data/config/locales/ar.yml +135 -133
  21. data/config/locales/az.yml +103 -102
  22. data/config/locales/bg.yml +91 -90
  23. data/config/locales/bs.yml +95 -94
  24. data/config/locales/ca.yml +129 -128
  25. data/config/locales/cs.yml +82 -81
  26. data/config/locales/da.yml +102 -101
  27. data/config/locales/de.yml +130 -129
  28. data/config/locales/el.yml +94 -93
  29. data/config/locales/en-CA.yml +104 -103
  30. data/config/locales/en-GB.yml +104 -103
  31. data/config/locales/en.yml +134 -132
  32. data/config/locales/eo.yml +107 -106
  33. data/config/locales/es-MX.yml +70 -69
  34. data/config/locales/es.yml +129 -128
  35. data/config/locales/fa.yml +91 -90
  36. data/config/locales/fi.yml +84 -83
  37. data/config/locales/fr.yml +125 -124
  38. data/config/locales/he.yml +103 -102
  39. data/config/locales/hr.yml +95 -94
  40. data/config/locales/hu.yml +76 -75
  41. data/config/locales/id.yml +97 -96
  42. data/config/locales/it.yml +134 -132
  43. data/config/locales/ja.yml +109 -108
  44. data/config/locales/ko.yml +134 -132
  45. data/config/locales/lt.yml +106 -105
  46. data/config/locales/lv.yml +70 -69
  47. data/config/locales/mk.yml +100 -99
  48. data/config/locales/nb.yml +98 -97
  49. data/config/locales/nl.yml +113 -112
  50. data/config/locales/pl.yml +137 -136
  51. data/config/locales/pt-BR.yml +134 -105
  52. data/config/locales/pt-PT.yml +71 -70
  53. data/config/locales/ro.yml +74 -73
  54. data/config/locales/ru.yml +141 -140
  55. data/config/locales/sk.yml +131 -130
  56. data/config/locales/sv-SE.yml +126 -125
  57. data/config/locales/tr.yml +105 -104
  58. data/config/locales/uk.yml +140 -103
  59. data/config/locales/vi.yml +125 -124
  60. data/config/locales/zh-CN.yml +135 -133
  61. data/config/locales/zh-TW.yml +135 -133
  62. data/lib/active_admin/application.rb +2 -2
  63. data/lib/active_admin/batch_actions/resource_extension.rb +1 -1
  64. data/lib/active_admin/csv_builder.rb +1 -1
  65. data/lib/active_admin/dsl.rb +1 -1
  66. data/lib/active_admin/filters/active.rb +1 -1
  67. data/lib/active_admin/filters/active_filter.rb +1 -7
  68. data/lib/active_admin/filters/forms.rb +0 -3
  69. data/lib/active_admin/filters/resource_extension.rb +1 -1
  70. data/lib/active_admin/form_builder.rb +0 -4
  71. data/lib/active_admin/helpers/optional_display.rb +1 -1
  72. data/lib/active_admin/inputs/filters/base/search_method_select.rb +2 -2
  73. data/lib/active_admin/inputs/filters/select_input.rb +1 -3
  74. data/lib/active_admin/resource/action_items.rb +2 -2
  75. data/lib/active_admin/resource/belongs_to.rb +0 -1
  76. data/lib/active_admin/resource/naming.rb +1 -1
  77. data/lib/active_admin/resource.rb +1 -1
  78. data/lib/active_admin/resource_collection.rb +1 -1
  79. data/lib/active_admin/resource_dsl.rb +2 -2
  80. data/lib/active_admin/version.rb +1 -1
  81. data/lib/active_admin/view_helpers/method_or_proc_helper.rb +1 -1
  82. data/lib/active_admin/views/components/table_for.rb +1 -1
  83. data/lib/active_admin/views/index_as_table.rb +7 -2
  84. data/plugin.js +3 -12
  85. data/vendor/javascript/flowbite.js +1 -1
  86. metadata +8 -12
  87. data/lib/active_admin/views/components/tabs.rb +0 -40
@@ -1,146 +1,148 @@
1
- "zh-TW":
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: "命名空間"
16
- resource_type: "資源類型"
17
- updated_at: "更新時間"
1
+ ---
2
+ zh-TW:
18
3
  active_admin:
19
- dashboard: "儀表板"
20
- view: "檢視"
21
- edit: "編輯"
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}&nbsp;-&nbsp;%{to}</b> 筆"
69
- multiple_without_total: "顯示 %{model} 中<b>%{from}&nbsp;-&nbsp;%{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
- created_at: "建立時間"
93
- resource_type: "資源類型"
94
- author_type: "作者身份"
95
- body: "內文"
96
- author: "作者"
97
- add: "新增評論"
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
- username:
108
- title: "帳號"
44
+ change_password:
45
+ submit: 更改我的密碼
46
+ title: 更改你的密碼
109
47
  email:
110
- title: "電子郵件信箱"
111
- subdomain:
112
- title: "子網域"
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
- sign_up:
118
- title: "註冊"
119
- submit: "註冊"
120
- login:
121
- title: "登入"
122
- remember_me: "記住我"
123
- submit: "登入"
63
+ title: 確認密碼
64
+ resend_confirmation_instructions:
65
+ submit: 重新發送確認信
66
+ title: 重新發送確認信
124
67
  reset_password:
125
- title: "忘記密碼?"
126
- submit: "重設密碼"
127
- change_password:
128
- title: "更改你的密碼"
129
- submit: "更改我的密碼"
68
+ submit: 重設密碼
69
+ title: 忘記密碼?
70
+ sign_up:
71
+ submit: 註冊
72
+ title: 註冊
73
+ subdomain:
74
+ title: 子網域
130
75
  unlock:
131
- title: "重新發送解鎖指示"
132
- submit: "重新發送解鎖指示"
133
- resend_confirmation_instructions:
134
- title: "重新發送確認信"
135
- submit: "重新發送確認信"
136
- links:
137
- sign_up: "註冊"
138
- sign_in: "登入"
139
- forgot_your_password: "忘記密碼?"
140
- sign_in_with_omniauth_provider: "使用 %{provider} 登入"
141
- resend_unlock_instructions: "重新發送解鎖指示"
142
- resend_confirmation_instructions: "重新發送確認信"
143
- access_denied:
144
- message: "你沒有權限執行此項操作"
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}&nbsp;-&nbsp;%{to}</b> 筆
106
+ multiple_without_total: 顯示 %{model} 中<b>%{from}&nbsp;-&nbsp;%{to}</b> 筆
107
+ next: 下一個
108
+ one: 顯示 <b>1</b> %{model}
109
+ one_page: 顯示 <b>全部 %{n}</b> %{model}
110
+ per_page: '每頁 '
111
+ previous: 前一個
112
+ truncate: "&hellip;"
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 &:unload!
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 *Devise.controllers_for_filters if Dependency.devise?
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.succesfully_destroyed",
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 &@block if @block.present?
67
+ instance_exec(&@block) if @block.present?
68
68
  columns
69
69
  end
70
70
 
@@ -13,7 +13,7 @@ module ActiveAdmin
13
13
 
14
14
  # Runs the registration block inside this object
15
15
  def run_registration_block(&block)
16
- instance_exec &block if block
16
+ instance_exec(&block) if block
17
17
  end
18
18
 
19
19
  # The instance of ActiveAdmin::Resource that's being registered
@@ -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::DataAcces#apply_filtering
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
- I18n.t(
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)
@@ -146,7 +146,7 @@ module ActiveAdmin
146
146
  filters = poly.map(&:foreign_type) + low_arity.map(&:name) + high_arity
147
147
  end
148
148
 
149
- filters.map &:to_sym
149
+ filters.map(&:to_sym)
150
150
  else
151
151
  []
152
152
  end
@@ -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"
@@ -23,7 +23,7 @@ module ActiveAdmin
23
23
  when Symbol, String
24
24
  render_context.public_send condition
25
25
  when Proc
26
- render_context.instance_exec &condition
26
+ render_context.instance_exec(&condition)
27
27
  else
28
28
  true
29
29
  end
@@ -26,7 +26,7 @@ module ActiveAdmin
26
26
  attr_reader :filters
27
27
 
28
28
  def filter(*filters)
29
- (@filters ||= []).push *filters
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
- [I18n.t("ransack.predicates.#{filter}").capitalize, "#{method}_#{filter}"]
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
- name = method.to_s
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
- add_default_show_action_item
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 add_default_show_action_item
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(
@@ -1,5 +1,4 @@
1
1
  # frozen_string_literal: true
2
- require_relative "../resource"
3
2
 
4
3
  module ActiveAdmin
5
4
  class Resource
@@ -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 /\s/, "" if @options[:as]
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 *method_for_find(id)
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
 
@@ -22,7 +22,7 @@ module ActiveAdmin
22
22
 
23
23
  # Changes `each` to pass in the value, instead of both the key and value.
24
24
  def each(&block)
25
- values.each &block
25
+ values.each(&block)
26
26
  end
27
27
 
28
28
  def [](obj)
@@ -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 *args
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 *standard_rails_filters, to: :controller
196
+ delegate(*standard_rails_filters, to: :controller)
197
197
 
198
198
  # Specify which actions to create in the controller
199
199
  #
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ActiveAdmin
3
- VERSION = "4.0.0.beta15"
3
+ VERSION = "4.0.0.beta16"
4
4
  end
@@ -91,7 +91,7 @@ module MethodOrProcHelper
91
91
  context = self if context.nil? # default to `self` only when nil
92
92
  case obj
93
93
  when Proc
94
- context.instance_exec *args, &obj
94
+ context.instance_exec(*args, &obj)
95
95
  when Symbol
96
96
  context.public_send obj, *args
97
97
  else
@@ -94,7 +94,7 @@ module ActiveAdmin
94
94
  end
95
95
 
96
96
  def build_table_body
97
- @tbody = tbody **(@tbody_html || {}) do
97
+ @tbody = tbody(**(@tbody_html || {})) do
98
98
  # Build enough rows for our collection
99
99
  @collection.each do |elem|
100
100
  html_options = @row_html&.call(elem) || {}
@@ -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
- column(resource_class.human_attribute_name(resource_class.primary_key), sortable: resource_class.primary_key) do |resource|
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': {}