activeadmin 3.4.0 → 4.0.0.beta18

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 (357) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -102
  3. data/CONTRIBUTING.md +32 -117
  4. data/README.md +17 -30
  5. data/UPGRADING.md +241 -0
  6. data/app/assets/config/active_admin_manifest.js +2 -0
  7. data/{lib → app/controllers}/active_admin/base_controller/authorization.rb +1 -1
  8. data/app/controllers/active_admin/base_controller/menu.rb +39 -0
  9. data/{lib → app/controllers}/active_admin/base_controller.rb +46 -18
  10. data/{lib → app/controllers}/active_admin/page_controller.rb +0 -4
  11. data/{lib → app/controllers}/active_admin/resource_controller/action_builder.rb +1 -1
  12. data/{lib → app/controllers}/active_admin/resource_controller/data_access.rb +11 -6
  13. data/{lib → app/controllers}/active_admin/resource_controller/scoping.rb +1 -1
  14. data/{lib → app/controllers}/active_admin/resource_controller/streaming.rb +4 -4
  15. data/app/controllers/active_admin/resource_controller.rb +102 -0
  16. data/app/helpers/active_admin/auto_link_helper.rb +66 -0
  17. data/app/helpers/active_admin/breadcrumb_helper.rb +41 -0
  18. data/app/helpers/active_admin/display_helper.rb +117 -0
  19. data/app/helpers/active_admin/form_helper.rb +95 -0
  20. data/app/helpers/active_admin/index_helper.rb +40 -0
  21. data/app/helpers/active_admin/layout_helper.rb +63 -0
  22. data/app/javascript/active_admin/features/batch_actions.js +95 -0
  23. data/app/javascript/active_admin/features/dark_mode_toggle.js +37 -0
  24. data/app/javascript/active_admin/features/filters.js +34 -0
  25. data/app/javascript/active_admin/features/has_many.js +28 -0
  26. data/app/javascript/active_admin/features/main_menu.js +12 -0
  27. data/app/javascript/active_admin/features/per_page.js +9 -0
  28. data/app/javascript/active_admin/utils/dom.js +17 -0
  29. data/app/javascript/active_admin.js +10 -0
  30. data/app/views/active_admin/_flash_messages.html.erb +22 -0
  31. data/app/views/active_admin/_html_head.html.erb +13 -0
  32. data/app/views/active_admin/_main_navigation.html.erb +28 -0
  33. data/app/views/active_admin/_page_header.html.erb +27 -0
  34. data/app/views/active_admin/_sidebar.html.erb +5 -0
  35. data/app/views/active_admin/_site_footer.html.erb +7 -0
  36. data/app/views/active_admin/_site_header.html.erb +30 -0
  37. data/app/views/active_admin/devise/confirmations/new.html.erb +5 -3
  38. data/app/views/active_admin/devise/passwords/edit.html.erb +5 -3
  39. data/app/views/active_admin/devise/passwords/new.html.erb +5 -4
  40. data/app/views/active_admin/devise/registrations/new.html.erb +6 -4
  41. data/app/views/active_admin/devise/sessions/new.html.erb +6 -4
  42. data/app/views/active_admin/devise/shared/_links.erb +3 -1
  43. data/app/views/active_admin/devise/unlocks/new.html.erb +6 -4
  44. data/app/views/{kaminari/active_admin_countless → active_admin/kaminari}/_gap.html.erb +3 -1
  45. data/app/views/active_admin/kaminari/_next_page.html.erb +16 -0
  46. data/app/views/active_admin/kaminari/_page.html.erb +14 -0
  47. data/app/views/{kaminari/active_admin_countless → active_admin/kaminari}/_paginator.html.erb +1 -2
  48. data/app/views/active_admin/kaminari/_prev_page.html.erb +16 -0
  49. data/app/views/active_admin/page/index.html.arb +5 -2
  50. data/app/views/active_admin/resource/_active_filters.html.erb +32 -0
  51. data/app/views/active_admin/resource/_batch_actions_dropdown.html.erb +19 -0
  52. data/app/views/active_admin/resource/_form.html.arb +15 -0
  53. data/app/views/active_admin/resource/_form_default.html.arb +11 -0
  54. data/app/views/active_admin/resource/_index_as_table_default.html.arb +8 -0
  55. data/app/views/active_admin/resource/_index_blank_slate.html.erb +14 -0
  56. data/app/views/active_admin/resource/_index_empty_results.html.erb +5 -0
  57. data/app/views/active_admin/resource/_index_table_actions_default.html.erb +9 -0
  58. data/app/views/active_admin/resource/_show_default.html.arb +2 -0
  59. data/app/views/active_admin/resource/edit.html.arb +1 -2
  60. data/app/views/active_admin/resource/index.html.arb +94 -2
  61. data/app/views/active_admin/resource/new.html.arb +1 -2
  62. data/app/views/active_admin/resource/show.html.arb +12 -2
  63. data/app/views/active_admin/shared/_action_items.html.erb +3 -0
  64. data/app/views/active_admin/shared/_download_format_links.html.erb +7 -0
  65. data/app/views/active_admin/shared/_resource_comments.html.erb +51 -0
  66. data/app/views/active_admin/shared/_sidebar_section.html.arb +6 -0
  67. data/app/views/active_admin/shared/_sidebar_sections.html.erb +5 -0
  68. data/app/views/layouts/active_admin.html.erb +20 -0
  69. data/app/views/layouts/active_admin_logged_out.html.erb +8 -45
  70. data/config/importmap.rb +5 -0
  71. data/config/locales/ar.yml +136 -116
  72. data/config/locales/az.yml +103 -118
  73. data/config/locales/bg.yml +91 -99
  74. data/config/locales/bs.yml +95 -101
  75. data/config/locales/ca.yml +131 -86
  76. data/config/locales/cs.yml +82 -90
  77. data/config/locales/da.yml +102 -117
  78. data/config/locales/de.yml +130 -141
  79. data/config/locales/el.yml +94 -106
  80. data/config/locales/en-CA.yml +104 -119
  81. data/config/locales/en-GB.yml +104 -119
  82. data/config/locales/en.yml +134 -140
  83. data/config/locales/eo.yml +107 -123
  84. data/config/locales/es-MX.yml +70 -78
  85. data/config/locales/es.yml +129 -138
  86. data/config/locales/fa.yml +91 -99
  87. data/config/locales/fi.yml +84 -92
  88. data/config/locales/fr.yml +135 -120
  89. data/config/locales/he.yml +103 -118
  90. data/config/locales/hr.yml +95 -103
  91. data/config/locales/hu.yml +76 -81
  92. data/config/locales/id.yml +97 -112
  93. data/config/locales/it.yml +134 -140
  94. data/config/locales/ja.yml +109 -120
  95. data/config/locales/ko.yml +136 -101
  96. data/config/locales/lt.yml +106 -121
  97. data/config/locales/lv.yml +70 -75
  98. data/config/locales/mk.yml +100 -114
  99. data/config/locales/nb.yml +98 -109
  100. data/config/locales/nl.yml +113 -122
  101. data/config/locales/pl.yml +137 -146
  102. data/config/locales/pt-BR.yml +134 -121
  103. data/config/locales/pt-PT.yml +71 -76
  104. data/config/locales/ro.yml +74 -79
  105. data/config/locales/ru.yml +142 -122
  106. data/config/locales/sk.yml +131 -146
  107. data/config/locales/sv-SE.yml +126 -141
  108. data/config/locales/tr.yml +105 -120
  109. data/config/locales/uk.yml +140 -119
  110. data/config/locales/vi.yml +125 -140
  111. data/config/locales/zh-CN.yml +135 -141
  112. data/config/locales/zh-TW.yml +136 -116
  113. data/lib/active_admin/application.rb +6 -14
  114. data/lib/active_admin/application_settings.rb +1 -1
  115. data/lib/active_admin/async_count.rb +23 -0
  116. data/lib/active_admin/batch_actions/controller.rb +1 -4
  117. data/lib/active_admin/batch_actions/resource_extension.rb +8 -15
  118. data/lib/active_admin/batch_actions/views/batch_action_form.rb +1 -7
  119. data/lib/active_admin/batch_actions/views/selection_cells.rb +3 -3
  120. data/lib/active_admin/batch_actions.rb +4 -9
  121. data/lib/active_admin/callbacks.rb +6 -4
  122. data/lib/active_admin/collection_decorator.rb +1 -1
  123. data/lib/active_admin/component.rb +0 -1
  124. data/lib/active_admin/csv_builder.rb +2 -2
  125. data/lib/active_admin/devise.rb +3 -3
  126. data/lib/active_admin/dsl.rb +3 -3
  127. data/lib/active_admin/dynamic_settings_node.rb +6 -6
  128. data/lib/active_admin/engine.rb +23 -7
  129. data/lib/active_admin/filters/active.rb +8 -6
  130. data/lib/active_admin/filters/active_filter.rb +2 -10
  131. data/lib/active_admin/filters/forms.rb +1 -45
  132. data/lib/active_admin/filters/resource_extension.rb +18 -10
  133. data/lib/active_admin/filters.rb +5 -7
  134. data/lib/active_admin/form_builder.rb +14 -17
  135. data/lib/active_admin/helpers/optional_display.rb +1 -1
  136. data/lib/active_admin/inputs/filters/base/search_method_select.rb +10 -12
  137. data/lib/active_admin/inputs/filters/base.rb +1 -1
  138. data/lib/active_admin/inputs/filters/check_boxes_input.rb +1 -6
  139. data/lib/active_admin/inputs/filters/date_range_input.rb +4 -2
  140. data/lib/active_admin/inputs.rb +0 -3
  141. data/lib/active_admin/localizers.rb +1 -1
  142. data/lib/active_admin/menu.rb +10 -7
  143. data/lib/active_admin/menu_collection.rb +1 -1
  144. data/lib/active_admin/menu_item.rb +24 -3
  145. data/lib/active_admin/namespace.rb +3 -45
  146. data/lib/active_admin/namespace_settings.rb +3 -36
  147. data/lib/active_admin/order_clause.rb +4 -1
  148. data/lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb +4 -76
  149. data/lib/active_admin/orm/active_record/comments/views.rb +2 -2
  150. data/lib/active_admin/orm/active_record/comments.rb +13 -8
  151. data/lib/active_admin/orm/active_record.rb +1 -1
  152. data/lib/active_admin/pundit_adapter.rb +3 -3
  153. data/lib/active_admin/resource/action_items.rb +18 -23
  154. data/lib/active_admin/resource/naming.rb +2 -3
  155. data/lib/active_admin/resource/page_presenters.rb +2 -2
  156. data/lib/active_admin/resource/sidebars.rb +1 -1
  157. data/lib/active_admin/resource.rb +17 -16
  158. data/lib/active_admin/resource_collection.rb +1 -1
  159. data/lib/active_admin/resource_dsl.rb +3 -3
  160. data/lib/active_admin/scope.rb +11 -1
  161. data/lib/active_admin/settings_node.rb +1 -1
  162. data/lib/active_admin/sidebar_section.rb +0 -5
  163. data/lib/active_admin/version.rb +1 -1
  164. data/lib/active_admin/view_helpers/method_or_proc_helper.rb +1 -1
  165. data/lib/active_admin/view_helpers.rb +0 -12
  166. data/lib/active_admin/views/components/active_admin_form.rb +21 -29
  167. data/lib/active_admin/views/components/attributes_table.rb +14 -16
  168. data/lib/active_admin/views/components/index_list.rb +10 -23
  169. data/lib/active_admin/views/components/paginated_collection.rb +34 -39
  170. data/lib/active_admin/views/components/panel.rb +3 -11
  171. data/lib/active_admin/views/components/scopes.rb +39 -26
  172. data/lib/active_admin/views/components/status_tag.rb +22 -19
  173. data/lib/active_admin/views/components/table_for.rb +25 -25
  174. data/lib/active_admin/views/index_as_table.rb +39 -101
  175. data/lib/active_admin.rb +16 -15
  176. data/lib/activeadmin.rb +1 -1
  177. data/lib/generators/active_admin/assets/assets_generator.rb +4 -4
  178. data/lib/generators/active_admin/assets/templates/active_admin.css +3 -0
  179. data/lib/generators/active_admin/assets/templates/tailwind.config.js +21 -0
  180. data/lib/generators/active_admin/devise/devise_generator.rb +2 -2
  181. data/lib/generators/active_admin/install/install_generator.rb +2 -8
  182. data/lib/generators/active_admin/install/templates/active_admin.rb.erb +10 -87
  183. data/lib/generators/active_admin/install/templates/dashboard.rb +8 -25
  184. data/lib/generators/active_admin/page/page_generator.rb +0 -1
  185. data/lib/generators/active_admin/resource/resource_generator.rb +50 -7
  186. data/lib/generators/active_admin/resource/templates/resource.rb.erb +42 -0
  187. data/lib/generators/active_admin/views_generator.rb +18 -0
  188. data/plugin.js +414 -0
  189. data/vendor/bundle/offense.rb +1 -0
  190. data/vendor/javascript/flowbite.js +1 -0
  191. data/vendor/javascript/rails_ujs_esm.js +1 -0
  192. metadata +80 -207
  193. data/app/assets/javascripts/active_admin/base.js +0 -517
  194. data/app/assets/stylesheets/active_admin/_base.scss +0 -57
  195. data/app/assets/stylesheets/active_admin/_forms.scss +0 -315
  196. data/app/assets/stylesheets/active_admin/_header.scss +0 -188
  197. data/app/assets/stylesheets/active_admin/_mixins.scss +0 -1
  198. data/app/assets/stylesheets/active_admin/_normalize.scss +0 -349
  199. data/app/assets/stylesheets/active_admin/_print.scss +0 -287
  200. data/app/assets/stylesheets/active_admin/_typography.scss +0 -100
  201. data/app/assets/stylesheets/active_admin/components/_batch_actions.scss +0 -6
  202. data/app/assets/stylesheets/active_admin/components/_blank_slates.scss +0 -30
  203. data/app/assets/stylesheets/active_admin/components/_breadcrumbs.scss +0 -20
  204. data/app/assets/stylesheets/active_admin/components/_buttons.scss +0 -6
  205. data/app/assets/stylesheets/active_admin/components/_columns.scss +0 -3
  206. data/app/assets/stylesheets/active_admin/components/_comments.scss +0 -41
  207. data/app/assets/stylesheets/active_admin/components/_date_picker.scss +0 -148
  208. data/app/assets/stylesheets/active_admin/components/_dropdown_menu.scss +0 -154
  209. data/app/assets/stylesheets/active_admin/components/_flash_messages.scss +0 -37
  210. data/app/assets/stylesheets/active_admin/components/_grid.scss +0 -9
  211. data/app/assets/stylesheets/active_admin/components/_index_list.scss +0 -12
  212. data/app/assets/stylesheets/active_admin/components/_links.scss +0 -5
  213. data/app/assets/stylesheets/active_admin/components/_modal_dialog.scss +0 -34
  214. data/app/assets/stylesheets/active_admin/components/_pagination.scss +0 -58
  215. data/app/assets/stylesheets/active_admin/components/_panels.scss +0 -6
  216. data/app/assets/stylesheets/active_admin/components/_scopes.scss +0 -13
  217. data/app/assets/stylesheets/active_admin/components/_status_tags.scss +0 -12
  218. data/app/assets/stylesheets/active_admin/components/_table_tools.scss +0 -70
  219. data/app/assets/stylesheets/active_admin/components/_tables.scss +0 -112
  220. data/app/assets/stylesheets/active_admin/components/_tabs.scss +0 -68
  221. data/app/assets/stylesheets/active_admin/components/_unsupported_browser.scss +0 -16
  222. data/app/assets/stylesheets/active_admin/mixins/_all.scss +0 -8
  223. data/app/assets/stylesheets/active_admin/mixins/_buttons.scss +0 -65
  224. data/app/assets/stylesheets/active_admin/mixins/_gradients.scss +0 -28
  225. data/app/assets/stylesheets/active_admin/mixins/_rounded.scss +0 -22
  226. data/app/assets/stylesheets/active_admin/mixins/_sections.scss +0 -41
  227. data/app/assets/stylesheets/active_admin/mixins/_shadows.scss +0 -15
  228. data/app/assets/stylesheets/active_admin/mixins/_typography.scss +0 -3
  229. data/app/assets/stylesheets/active_admin/mixins/_utilities.scss +0 -17
  230. data/app/assets/stylesheets/active_admin/mixins/_variables.scss +0 -51
  231. data/app/assets/stylesheets/active_admin/pages/_logged_out.scss +0 -44
  232. data/app/assets/stylesheets/active_admin/structure/_footer.scss +0 -19
  233. data/app/assets/stylesheets/active_admin/structure/_main_structure.scss +0 -29
  234. data/app/assets/stylesheets/active_admin/structure/_title_bar.scss +0 -43
  235. data/app/javascript/active_admin/base.js +0 -28
  236. data/app/javascript/active_admin/ext/jquery-ui.js +0 -7
  237. data/app/javascript/active_admin/ext/jquery.js +0 -9
  238. data/app/javascript/active_admin/initializers/batch-actions.js +0 -61
  239. data/app/javascript/active_admin/initializers/checkbox-toggler.js +0 -3
  240. data/app/javascript/active_admin/initializers/datepicker.js +0 -16
  241. data/app/javascript/active_admin/initializers/dropdown-menu.js +0 -9
  242. data/app/javascript/active_admin/initializers/filters.js +0 -10
  243. data/app/javascript/active_admin/initializers/has-many.js +0 -98
  244. data/app/javascript/active_admin/initializers/per-page.js +0 -13
  245. data/app/javascript/active_admin/initializers/table-checkbox-toggler.js +0 -3
  246. data/app/javascript/active_admin/initializers/tabs.js +0 -6
  247. data/app/javascript/active_admin/lib/checkbox-toggler.js +0 -49
  248. data/app/javascript/active_admin/lib/dropdown-menu.js +0 -116
  249. data/app/javascript/active_admin/lib/filters.js +0 -39
  250. data/app/javascript/active_admin/lib/modal-dialog.js +0 -63
  251. data/app/javascript/active_admin/lib/per-page.js +0 -38
  252. data/app/javascript/active_admin/lib/table-checkbox-toggler.js +0 -38
  253. data/app/javascript/active_admin/lib/utils.js +0 -40
  254. data/app/views/kaminari/active_admin/_first_page.html.erb +0 -11
  255. data/app/views/kaminari/active_admin/_gap.html.erb +0 -8
  256. data/app/views/kaminari/active_admin/_last_page.html.erb +0 -11
  257. data/app/views/kaminari/active_admin/_next_page.html.erb +0 -11
  258. data/app/views/kaminari/active_admin/_page.html.erb +0 -12
  259. data/app/views/kaminari/active_admin/_paginator.html.erb +0 -25
  260. data/app/views/kaminari/active_admin/_prev_page.html.erb +0 -11
  261. data/app/views/kaminari/active_admin_countless/_first_page.html.erb +0 -11
  262. data/app/views/kaminari/active_admin_countless/_next_page.html.erb +0 -11
  263. data/app/views/kaminari/active_admin_countless/_page.html.erb +0 -12
  264. data/app/views/kaminari/active_admin_countless/_prev_page.html.erb +0 -11
  265. data/app/views/layouts/active_admin.html.arb +0 -2
  266. data/config/locales/de-CH.yml +0 -94
  267. data/lib/active_admin/abstract_view_factory.rb +0 -48
  268. data/lib/active_admin/asset_registration.rb +0 -30
  269. data/lib/active_admin/base_controller/menu.rb +0 -35
  270. data/lib/active_admin/batch_actions/views/batch_action_selector.rb +0 -59
  271. data/lib/active_admin/filters/active_sidebar.rb +0 -28
  272. data/lib/active_admin/generators/boilerplate.rb +0 -54
  273. data/lib/active_admin/helpers/collection.rb +0 -21
  274. data/lib/active_admin/helpers/i18n.rb +0 -8
  275. data/lib/active_admin/inputs/datepicker_input.rb +0 -28
  276. data/lib/active_admin/inputs/filters/date_picker_input.rb +0 -14
  277. data/lib/active_admin/orm/active_record/comments/show_page_helper.rb +0 -24
  278. data/lib/active_admin/orm/mongoid.rb +0 -2
  279. data/lib/active_admin/resource_controller/sidebars.rb +0 -19
  280. data/lib/active_admin/resource_controller.rb +0 -68
  281. data/lib/active_admin/view_factory.rb +0 -28
  282. data/lib/active_admin/view_helpers/active_admin_application_helper.rb +0 -13
  283. data/lib/active_admin/view_helpers/auto_link_helper.rb +0 -46
  284. data/lib/active_admin/view_helpers/breadcrumb_helper.rb +0 -34
  285. data/lib/active_admin/view_helpers/display_helper.rb +0 -119
  286. data/lib/active_admin/view_helpers/download_format_links_helper.rb +0 -60
  287. data/lib/active_admin/view_helpers/fields_for.rb +0 -51
  288. data/lib/active_admin/view_helpers/flash_helper.rb +0 -15
  289. data/lib/active_admin/view_helpers/form_helper.rb +0 -21
  290. data/lib/active_admin/view_helpers/scope_name_helper.rb +0 -17
  291. data/lib/active_admin/view_helpers/sidebar_helper.rb +0 -16
  292. data/lib/active_admin/view_helpers/title_helper.rb +0 -12
  293. data/lib/active_admin/view_helpers/view_factory_helper.rb +0 -12
  294. data/lib/active_admin/views/action_items.rb +0 -18
  295. data/lib/active_admin/views/components/active_filters_sidebar_content.rb +0 -59
  296. data/lib/active_admin/views/components/blank_slate.rb +0 -18
  297. data/lib/active_admin/views/components/columns.rb +0 -162
  298. data/lib/active_admin/views/components/dropdown_menu.rb +0 -69
  299. data/lib/active_admin/views/components/menu.rb +0 -33
  300. data/lib/active_admin/views/components/menu_item.rb +0 -59
  301. data/lib/active_admin/views/components/sidebar.rb +0 -14
  302. data/lib/active_admin/views/components/sidebar_section.rb +0 -35
  303. data/lib/active_admin/views/components/site_title.rb +0 -55
  304. data/lib/active_admin/views/components/tabs.rb +0 -41
  305. data/lib/active_admin/views/components/unsupported_browser.rb +0 -12
  306. data/lib/active_admin/views/footer.rb +0 -32
  307. data/lib/active_admin/views/header.rb +0 -20
  308. data/lib/active_admin/views/index_as_block.rb +0 -37
  309. data/lib/active_admin/views/index_as_blog.rb +0 -156
  310. data/lib/active_admin/views/index_as_grid.rb +0 -81
  311. data/lib/active_admin/views/pages/base.rb +0 -134
  312. data/lib/active_admin/views/pages/form.rb +0 -65
  313. data/lib/active_admin/views/pages/index.rb +0 -166
  314. data/lib/active_admin/views/pages/layout.rb +0 -27
  315. data/lib/active_admin/views/pages/page.rb +0 -31
  316. data/lib/active_admin/views/pages/show.rb +0 -60
  317. data/lib/active_admin/views/tabbed_navigation.rb +0 -12
  318. data/lib/active_admin/views/title_bar.rb +0 -56
  319. data/lib/generators/active_admin/assets/templates/active_admin.js +0 -1
  320. data/lib/generators/active_admin/assets/templates/active_admin.scss +0 -17
  321. data/lib/generators/active_admin/resource/templates/admin.rb.erb +0 -46
  322. data/lib/generators/active_admin/webpacker/plugins/jquery.js +0 -7
  323. data/lib/generators/active_admin/webpacker/templates/active_admin.js +0 -5
  324. data/lib/generators/active_admin/webpacker/templates/active_admin.scss +0 -17
  325. data/lib/generators/active_admin/webpacker/templates/print.scss +0 -2
  326. data/lib/generators/active_admin/webpacker/webpacker_generator.rb +0 -27
  327. data/vendor/assets/javascripts/jquery-ui/data.js +0 -45
  328. data/vendor/assets/javascripts/jquery-ui/disable-selection.js +0 -51
  329. data/vendor/assets/javascripts/jquery-ui/focusable.js +0 -89
  330. data/vendor/assets/javascripts/jquery-ui/form-reset-mixin.js +0 -83
  331. data/vendor/assets/javascripts/jquery-ui/form.js +0 -25
  332. data/vendor/assets/javascripts/jquery-ui/ie.js +0 -20
  333. data/vendor/assets/javascripts/jquery-ui/keycode.js +0 -51
  334. data/vendor/assets/javascripts/jquery-ui/labels.js +0 -71
  335. data/vendor/assets/javascripts/jquery-ui/plugin.js +0 -49
  336. data/vendor/assets/javascripts/jquery-ui/position.js +0 -513
  337. data/vendor/assets/javascripts/jquery-ui/safe-active-element.js +0 -46
  338. data/vendor/assets/javascripts/jquery-ui/safe-blur.js +0 -27
  339. data/vendor/assets/javascripts/jquery-ui/scroll-parent.js +0 -50
  340. data/vendor/assets/javascripts/jquery-ui/tabbable.js +0 -41
  341. data/vendor/assets/javascripts/jquery-ui/unique-id.js +0 -54
  342. data/vendor/assets/javascripts/jquery-ui/version.js +0 -20
  343. data/vendor/assets/javascripts/jquery-ui/widget.js +0 -758
  344. data/vendor/assets/javascripts/jquery-ui/widgets/button.js +0 -454
  345. data/vendor/assets/javascripts/jquery-ui/widgets/checkboxradio.js +0 -294
  346. data/vendor/assets/javascripts/jquery-ui/widgets/controlgroup.js +0 -304
  347. data/vendor/assets/javascripts/jquery-ui/widgets/datepicker.js +0 -2243
  348. data/vendor/assets/javascripts/jquery-ui/widgets/dialog.js +0 -971
  349. data/vendor/assets/javascripts/jquery-ui/widgets/draggable.js +0 -1268
  350. data/vendor/assets/javascripts/jquery-ui/widgets/mouse.js +0 -241
  351. data/vendor/assets/javascripts/jquery-ui/widgets/resizable.js +0 -1228
  352. data/vendor/assets/javascripts/jquery-ui/widgets/sortable.js +0 -1622
  353. data/vendor/assets/javascripts/jquery-ui/widgets/tabs.js +0 -931
  354. /data/{lib → app/controllers}/active_admin/resource_controller/decorators.rb +0 -0
  355. /data/{lib → app/controllers}/active_admin/resource_controller/polymorphic_routes.rb +0 -0
  356. /data/{lib → app/controllers}/active_admin/resource_controller/resource_class_methods.rb +0 -0
  357. /data/lib/{active_admin/orm/mongoid/.gitkeep → generators/active_admin/assets/templates/builds/.keep} +0 -0
@@ -1,128 +1,148 @@
1
- "zh-TW":
1
+ ---
2
+ zh-TW:
2
3
  active_admin:
3
- dashboard: 儀表板
4
- dashboard_welcome:
5
- welcome: "歡迎來到 Active Admin,這是預設的儀表板頁面。"
6
- call_to_action: "要新增儀表板內容,請查看 'app/admin/dashboard.rb'"
7
- view: "檢視"
8
- edit: "編輯"
9
- delete: "刪除"
10
- delete_confirmation: "你確定要刪除嗎?"
11
- new_model: "新增 %{model}"
12
- edit_model: "編輯 %{model}"
13
- delete_model: "刪除 %{model}"
14
- details: "%{model} 明細"
15
- cancel: "取消"
16
- empty: "空的"
17
- previous: "前一個"
18
- next: "下一個"
19
- download: "下載:"
20
- has_many_new: "增加新的 %{model}"
21
- has_many_delete: "刪除"
22
- has_many_remove: "清除"
23
- filters:
24
- buttons:
25
- filter: "篩選"
26
- clear: "清除篩選條件"
27
- search_status:
28
- headline: "搜尋條件:"
29
- current_scope: "子集:"
30
- current_filters: "目前篩選條件:"
31
- no_current_filters: "無"
32
- status_tag:
33
- "yes": "是"
34
- "no": "否"
35
- "unset": "否"
36
- main_content: "請實作 %{model}#main_content 以顯示內容。"
37
- logout: "登出"
38
- powered_by: "Powered by %{active_admin} %{version}"
39
- sidebars:
40
- filters: "篩選條件"
41
- search_status: "搜尋條件"
42
- pagination:
43
- empty: "找不到 %{model} "
44
- one: "顯示 <b>1</b> %{model}"
45
- one_page: "顯示 <b>全部 %{n}</b> %{model}"
46
- multiple: "總計 <b>%{total}</b> 顯示 %{model} 中<b>%{from}&nbsp;-&nbsp;%{to}</b> 筆"
47
- multiple_without_total: "顯示 %{model} 中<b>%{from}&nbsp;-&nbsp;%{to}</b> 筆"
48
- entry:
49
- one: "筆"
50
- other: "筆"
51
- any: "任何"
52
- blank_slate:
53
- content: "尚無 %{resource_name}"
54
- link: "建立一筆"
55
- dropdown_actions:
56
- button_label: "操作"
4
+ access_denied:
5
+ message: 你沒有權限執行此項操作
6
+ any: 任何
57
7
  batch_actions:
58
- button_label: "批次作業"
59
- default_confirmation: "你確定你要這樣做?"
60
- delete_confirmation: "你確定要刪除這些 %{plural_model} 嗎?"
61
- succesfully_destroyed:
62
- one: "成功刪除 1 %{model}"
63
- other: "成功刪除 %{count} %{plural_model}"
64
- selection_toggle_explanation: "(切換選取)"
65
8
  action_label: "%{title} 已選取"
9
+ button_label: 批次操作
10
+ default_confirmation: 你確定要這樣做嗎?
11
+ delete_confirmation: 你確定要刪除這些 %{plural_model} 嗎?
66
12
  labels:
67
- 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: 取消
68
22
  comments:
69
- created_at: "建立"
70
- resource_type: "資源種類"
71
- author_type: "作者身份"
72
- body: "內文"
73
- author: "作者"
74
- add: "新增評論"
75
- delete: "刪除評論"
76
- delete_confirmation: "你確定要刪除這些評論嗎?"
77
- resource: "資源"
78
- no_comments_yet: "尚無評論"
79
- author_missing: "匿名"
80
- title_content: "(%{count}) 則評論"
23
+ add: 新增評論
24
+ author: 作者
25
+ author_missing: 匿名
26
+ author_type: 作者身份
27
+ body: 內文
28
+ created_at: 建立時間
29
+ delete: 刪除評論
30
+ delete_confirmation: 你確定要刪除這個評論嗎?
81
31
  errors:
82
- 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} 明細"
83
43
  devise:
84
- username:
85
- title: "帳號"
44
+ change_password:
45
+ submit: 更改我的密碼
46
+ title: 更改你的密碼
86
47
  email:
87
- title: "電子郵件信箱"
88
- subdomain:
89
- title: "子網域"
90
- password:
91
- title: "密碼"
92
- sign_up:
93
- title: "註冊"
94
- submit: "註冊"
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: 註冊
95
56
  login:
96
- title: "登入"
97
- remember_me: "記住我"
98
- submit: "登入"
57
+ remember_me: 記住我
58
+ submit: 登入
59
+ title: 登入
60
+ password:
61
+ title: 密碼
62
+ password_confirmation:
63
+ title: 確認密碼
64
+ resend_confirmation_instructions:
65
+ submit: 重新發送確認信
66
+ title: 重新發送確認信
99
67
  reset_password:
100
- title: "忘記密碼?"
101
- submit: "重置密碼"
102
- change_password:
103
- title: "更改你的密碼"
104
- submit: "更改我的密碼"
68
+ submit: 重設密碼
69
+ title: 忘記密碼?
70
+ sign_up:
71
+ submit: 註冊
72
+ title: 註冊
73
+ subdomain:
74
+ title: 子網域
105
75
  unlock:
106
- title: "重新發送解鎖指示"
107
- submit: "重新發送解鎖指示"
108
- resend_confirmation_instructions:
109
- title: '重新發送確認信'
110
- submit: '重新發送確認信'
111
- links:
112
- sign_up: "註冊"
113
- sign_in: "登入"
114
- forgot_your_password: "忘記密碼?"
115
- sign_in_with_omniauth_provider: "使用 %{provider} 登入"
116
- resend_unlock_instructions: "重新發送解鎖指示"
117
- resend_confirmation_instructions: "重新發送確認信"
118
- unsupported_browser:
119
- headline: "很抱歉,ActiveAdmin 已不再支援 Internet Explorer 8 以下版本的瀏覽器。"
120
- recommendation: "建議您升級到最新版本的<a href=\"http://windows.microsoft.com/ie\">Internet Explorer</a>,<a href=\"https://chrome.google.com/\">Google Chrome</a>,或是 <a href=\"https://mozilla.org/firefox/\">Firefox</a>。"
121
- turn_off_compatibility_view: "若您是使用 IE 9 或更新的版本,請確認<a href=\"https://support.microsoft.com/zh-tw/help/17471\">「相容性檢視」是關閉的</a>。"
122
- access_denied:
123
- 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: 移除
124
94
  index_list:
125
- table: "表格"
126
- block: "清單"
127
- grid: "格狀"
128
- blog: "部落格"
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: 評論
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
- require "active_admin/router"
3
- require "active_admin/application_settings"
4
- require "active_admin/namespace_settings"
2
+ require_relative "router"
3
+ require_relative "application_settings"
4
+ require_relative "namespace_settings"
5
5
 
6
6
  module ActiveAdmin
7
7
  class Application
@@ -43,15 +43,12 @@ module ActiveAdmin
43
43
  @namespaces = Namespace::Store.new
44
44
  end
45
45
 
46
- include AssetRegistration
47
-
48
46
  # Event that gets triggered on load of Active Admin
49
47
  BeforeLoadEvent = "active_admin.application.before_load".freeze
50
48
  AfterLoadEvent = "active_admin.application.after_load".freeze
51
49
 
52
50
  # Runs before the app's AA initializer
53
51
  def setup!
54
- register_default_assets
55
52
  end
56
53
 
57
54
  # Runs after the app's AA initializer
@@ -104,7 +101,7 @@ module ActiveAdmin
104
101
  # Removes all defined controllers from memory. Useful in
105
102
  # development, where they are reloaded on each request.
106
103
  def unload!
107
- namespaces.each &:unload!
104
+ namespaces.each(&:unload!)
108
105
  @@loaded = false
109
106
  end
110
107
 
@@ -148,7 +145,7 @@ module ActiveAdmin
148
145
  # ActiveAdmin.before_action :authenticate_admin!
149
146
  #
150
147
  AbstractController::Callbacks::ClassMethods.public_instance_methods.
151
- select { |m| m.match(/_action\z/) }.each do |name|
148
+ select { |m| m.end_with?('_action') }.each do |name|
152
149
  define_method name do |*args, &block|
153
150
  ActiveSupport.on_load(:active_admin_controller) do
154
151
  public_send name, *args, &block
@@ -158,17 +155,12 @@ module ActiveAdmin
158
155
 
159
156
  def controllers_for_filters
160
157
  controllers = [BaseController]
161
- controllers.push *Devise.controllers_for_filters if Dependency.devise?
158
+ controllers.push(*Devise.controllers_for_filters) if Dependency.devise?
162
159
  controllers
163
160
  end
164
161
 
165
162
  private
166
163
 
167
- def register_default_assets
168
- register_stylesheet "active_admin.css", media: "all"
169
- register_javascript "active_admin.js"
170
- end
171
-
172
164
  # Since app/admin is alphabetically before app/models, we have to remove it
173
165
  # from the host app's +autoload_paths+ to prevent missing constant errors.
174
166
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- require "active_admin/settings_node"
2
+ require_relative "settings_node"
3
3
 
4
4
  module ActiveAdmin
5
5
  class ApplicationSettings < SettingsNode
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+ module ActiveAdmin
3
+ class AsyncCount
4
+ class NotSupportedError < RuntimeError; end
5
+
6
+ def initialize(collection)
7
+ raise NotSupportedError, "#{collection.inspect} does not support :async_count" unless collection.respond_to?(:async_count)
8
+
9
+ @collection = collection.except(:select, :order)
10
+ @promise = @collection.async_count
11
+ end
12
+
13
+ def count
14
+ value = @promise.value
15
+ # value.value due to Rails bug https://github.com/rails/rails/issues/50776
16
+ value.respond_to?(:value) ? value.value : value
17
+ end
18
+
19
+ alias size count
20
+
21
+ delegate :except, :group_values, :length, :limit_value, to: :@collection
22
+ end
23
+ end
@@ -2,14 +2,11 @@
2
2
  module ActiveAdmin
3
3
  module BatchActions
4
4
  module Controller
5
-
6
5
  # Controller action that is called when submitting the batch action form
7
6
  def batch_action
8
7
  if action_present?
9
8
  selection = params[:collection_selection] || []
10
- inputs = JSON.parse params[:batch_action_inputs] || "{}"
11
- valid_keys = MethodOrProcHelper.render_in_context(self, current_batch_action.inputs).try(:keys)
12
- inputs = inputs.with_indifferent_access.slice *valid_keys
9
+ inputs = JSON.parse(params[:batch_action_inputs].presence || "{}")
13
10
  instance_exec selection, inputs, &current_batch_action.block
14
11
  else
15
12
  raise "Couldn't find batch action \"#{params[:batch_action]}\""
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module ActiveAdmin
3
-
4
3
  module BatchActions
5
4
  module ResourceExtension
6
5
  def initialize(*)
@@ -59,7 +58,7 @@ module ActiveAdmin
59
58
  destroy_options = {
60
59
  priority: 100,
61
60
  confirm: proc { I18n.t("active_admin.batch_actions.delete_confirmation", plural_model: active_admin_config.plural_resource_label.downcase) },
62
- if: proc { controller.action_methods.include?("destroy") && authorized?(ActiveAdmin::Auth::DESTROY, active_admin_config.resource_class) }
61
+ if: proc { destroy_action_authorized?(active_admin_config.resource_class) }
63
62
  }
64
63
 
65
64
  add_batch_action :destroy, proc { I18n.t("active_admin.delete") }, destroy_options do |selected_ids|
@@ -70,7 +69,7 @@ module ActiveAdmin
70
69
 
71
70
  redirect_to active_admin_config.route_collection_path(params),
72
71
  notice: I18n.t(
73
- "active_admin.batch_actions.succesfully_destroyed",
72
+ "active_admin.batch_actions.successfully_destroyed",
74
73
  count: selected_ids.count,
75
74
  model: active_admin_config.resource_label.downcase,
76
75
  plural_model: active_admin_config.plural_resource_label(count: selected_ids.count).downcase)
@@ -84,7 +83,7 @@ module ActiveAdmin
84
83
 
85
84
  include Comparable
86
85
 
87
- attr_reader :block, :title, :sym
86
+ attr_reader :block, :title, :sym, :partial, :link_html_options
88
87
 
89
88
  DEFAULT_CONFIRM_MESSAGE = proc { I18n.t "active_admin.batch_actions.default_confirmation" }
90
89
 
@@ -96,7 +95,7 @@ module ActiveAdmin
96
95
  # => Will create an action that appears in the action list popover
97
96
  #
98
97
  # BatchAction.new(:flag) { |selection| redirect_to collection_path, notice: "#{selection.length} users flagged" }
99
- # => Will create an action that uses a block to process the request (which receives one paramater of the selected objects)
98
+ # => Will create an action that uses a block to process the request (which receives one parameter of the selected objects)
100
99
  #
101
100
  # BatchAction.new("Perform Long Operation on") { |selection| }
102
101
  # => You can create batch actions with a title instead of a Symbol
@@ -110,8 +109,8 @@ module ActiveAdmin
110
109
  # BatchAction.new(:flag, confirm: "Are you sure?") { |selection| }
111
110
  # => You can pass a custom confirmation message through `:confirm`
112
111
  #
113
- # BatchAction.new(:flag, form: {foo: :text, bar: :checkbox}) { |selection, inputs| }
114
- # => You can pass a hash of options to `:form` that will be rendered as form input fields for the user to fill out.
112
+ # BatchAction.new(:flag, partial: "flag_form", link_html_options: { "data-modal-target": "modal-id", "data-modal-show": "modal-id" }) { |selection, inputs| }
113
+ # => Pass a partial that contains a modal and with a data attribute that opens the modal with the form for the user to fill out.
115
114
  #
116
115
  def initialize(sym, title, options = {}, &block)
117
116
  @sym = sym
@@ -119,23 +118,19 @@ module ActiveAdmin
119
118
  @options = options
120
119
  @block = block
121
120
  @confirm = options[:confirm]
121
+ @partial = options[:partial]
122
+ @link_html_options = options[:link_html_options] || {}
122
123
  @block ||= proc {}
123
124
  end
124
125
 
125
126
  def confirm
126
127
  if @confirm == true
127
128
  DEFAULT_CONFIRM_MESSAGE
128
- elsif !@confirm && @options[:form]
129
- DEFAULT_CONFIRM_MESSAGE
130
129
  else
131
130
  @confirm
132
131
  end
133
132
  end
134
133
 
135
- def inputs
136
- @options[:form]
137
- end
138
-
139
134
  # Returns the display if block. If the block was not explicitly defined
140
135
  # a default block always returning true will be returned.
141
136
  def display_if_block
@@ -151,7 +146,5 @@ module ActiveAdmin
151
146
  def <=>(other)
152
147
  self.priority <=> other.priority
153
148
  end
154
-
155
149
  end
156
-
157
150
  end
@@ -1,15 +1,10 @@
1
1
  # frozen_string_literal: true
2
- require "active_admin/component"
2
+ require_relative "../../component"
3
3
 
4
4
  module ActiveAdmin
5
5
  module BatchActions
6
-
7
6
  # Build a BatchActionForm
8
7
  class BatchActionForm < ActiveAdmin::Component
9
- builder_method :batch_action_form
10
-
11
- attr_reader :prefix_html
12
-
13
8
  def build(options = {}, &block)
14
9
  options[:id] ||= "collection_selection"
15
10
 
@@ -33,7 +28,6 @@ module ActiveAdmin
33
28
  def closing_form_tag
34
29
  "</form>".html_safe
35
30
  end
36
-
37
31
  end
38
32
  end
39
33
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- require "active_admin/component"
2
+ require_relative "../../component"
3
3
 
4
4
  module ActiveAdmin
5
5
  module BatchActions
@@ -10,7 +10,7 @@ module ActiveAdmin
10
10
 
11
11
  def build(label_text = "")
12
12
  label do
13
- input type: "checkbox", id: "collection_selection_toggle_all", name: "collection_selection_toggle_all", class: "toggle_all"
13
+ input type: "checkbox", id: "collection_selection_toggle_all", name: "collection_selection_toggle_all", class: "batch-actions-toggle-all"
14
14
  text_node label_text if label_text.present?
15
15
  end
16
16
  end
@@ -21,7 +21,7 @@ module ActiveAdmin
21
21
  builder_method :resource_selection_cell
22
22
 
23
23
  def build(resource)
24
- input type: "checkbox", id: "batch_action_item_#{resource.id}", value: resource.id, class: "collection_selection", name: "collection_selection[]"
24
+ input type: "checkbox", id: "batch_action_item_#{resource.id}", value: resource.id, class: "batch-actions-resource-selection", name: "collection_selection[]"
25
25
  end
26
26
  end
27
27
 
@@ -1,17 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
  ActiveAdmin.before_load do |app|
3
- require "active_admin/batch_actions/resource_extension"
4
- require "active_admin/batch_actions/controller"
3
+ require_relative "batch_actions/resource_extension"
4
+ require_relative "batch_actions/controller"
5
5
 
6
6
  # Add our Extensions
7
7
  ActiveAdmin::Resource.send :include, ActiveAdmin::BatchActions::ResourceExtension
8
8
  ActiveAdmin::ResourceController.send :include, ActiveAdmin::BatchActions::Controller
9
9
 
10
- # Require all the views
11
- require "active_admin/batch_actions/views/batch_action_form"
12
- require "active_admin/batch_actions/views/selection_cells"
13
- require "active_admin/batch_actions/views/batch_action_selector"
14
-
15
- # Register the views with the view factory
16
- app.view_factory.register batch_action_selector: ActiveAdmin::BatchActions::BatchActionSelector
10
+ require_relative "batch_actions/views/batch_action_form"
11
+ require_relative "batch_actions/views/selection_cells"
17
12
  end
@@ -3,6 +3,8 @@ module ActiveAdmin
3
3
  module Callbacks
4
4
  extend ActiveSupport::Concern
5
5
 
6
+ CALLBACK_TYPES = %i[before after].freeze
7
+
6
8
  private
7
9
 
8
10
  # Simple callback system. Implements before and after callbacks for
@@ -58,7 +60,7 @@ module ActiveAdmin
58
60
  #
59
61
  def define_active_admin_callbacks(*names)
60
62
  names.each do |name|
61
- [:before, :after].each do |type|
63
+ CALLBACK_TYPES.each do |type|
62
64
  callback_name = "#{type}_#{name}_callbacks"
63
65
  callback_ivar = "@#{callback_name}"
64
66
 
@@ -75,10 +77,10 @@ module ActiveAdmin
75
77
  end
76
78
 
77
79
  # def run_create_callbacks
78
- define_method "run_#{name}_callbacks" do |*args, &block|
79
- self.class.send("before_#{name}_callbacks").each { |cbk| run_callback(cbk, *args) }
80
+ define_method :"run_#{name}_callbacks" do |*args, &block|
81
+ self.class.send(:"before_#{name}_callbacks").each { |cbk| run_callback(cbk, *args) }
80
82
  value = block.try :call
81
- self.class.send("after_#{name}_callbacks").each { |cbk| run_callback(cbk, *args) }
83
+ self.class.send(:"after_#{name}_callbacks").each { |cbk| run_callback(cbk, *args) }
82
84
  return value
83
85
  end
84
86
  send :private, "run_#{name}_callbacks"
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  module ActiveAdmin
3
3
  # This class decorates a collection of objects delegating
4
- # mehods to behave like an Array. It's used to decouple ActiveAdmin
4
+ # methods to behave like an Array. It's used to decouple ActiveAdmin
5
5
  # from Draper and thus being able to use PORO decorators as well.
6
6
  #
7
7
  # It's implementation is heavily based on the Draper::CollectionDecorator
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module ActiveAdmin
3
3
  class Component < Arbre::Component
4
-
5
4
  end
6
5
  end
@@ -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
 
@@ -129,7 +129,7 @@ module ActiveAdmin
129
129
  module Sanitizer
130
130
  extend self
131
131
 
132
- ATTACK_CHARACTERS = ["=", "+", "-", "@", "\t", "\r"].freeze
132
+ ATTACK_CHARACTERS = ['=', '+', '-', '@', "\t", "\r"].freeze
133
133
 
134
134
  def sanitize(value)
135
135
  return "'#{value}" if require_sanitization?(value)
@@ -10,8 +10,7 @@ module ActiveAdmin
10
10
  {
11
11
  path: ActiveAdmin.application.default_namespace || "/",
12
12
  controllers: ActiveAdmin::Devise.controllers,
13
- path_names: { sign_in: "login", sign_out: "logout" },
14
- sign_out_via: [*::Devise.sign_out_via, ActiveAdmin.application.logout_link_method].uniq
13
+ path_names: { sign_in: "login", sign_out: "logout" }
15
14
  }
16
15
  end
17
16
 
@@ -29,7 +28,8 @@ module ActiveAdmin
29
28
  extend ::ActiveSupport::Concern
30
29
  included do
31
30
  layout "active_admin_logged_out"
32
- helper ::ActiveAdmin::ViewHelpers
31
+ helper ::ActiveAdmin::LayoutHelper
32
+ helper ::ActiveAdmin::FormHelper
33
33
  end
34
34
 
35
35
  # Redirect to the default namespace on logout
@@ -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_given?
16
+ instance_exec(&block) if block
17
17
  end
18
18
 
19
19
  # The instance of ActiveAdmin::Resource that's being registered
@@ -30,7 +30,7 @@ module ActiveAdmin
30
30
  @config
31
31
  end
32
32
 
33
- # Include a module with this resource. The modules's `included` method
33
+ # Include a module with this resource. The modules' `included` method
34
34
  # is called with the instance of the `ActiveAdmin::DSL` passed into it.
35
35
  #
36
36
  # eg:
@@ -72,7 +72,7 @@ module ActiveAdmin
72
72
  # end
73
73
  #
74
74
  def controller(&block)
75
- @config.controller.class_exec(&block) if block_given?
75
+ @config.controller.class_exec(&block) if block
76
76
  @config.controller
77
77
  end
78
78