activeadmin 2.2.0 → 2.12.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.

Files changed (274) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +382 -32
  3. data/CONTRIBUTING.md +45 -67
  4. data/README.md +11 -4
  5. data/app/assets/javascripts/active_admin/base.js +524 -0
  6. data/app/assets/stylesheets/active_admin/_base.scss +53 -37
  7. data/app/assets/stylesheets/active_admin/_forms.scss +0 -10
  8. data/app/assets/stylesheets/active_admin/_header.scss +40 -8
  9. data/app/assets/stylesheets/active_admin/_mixins.scss +1 -1
  10. data/{vendor → app}/assets/stylesheets/active_admin/_normalize.scss +25 -123
  11. data/app/assets/stylesheets/active_admin/{print.scss → _print.scss} +2 -2
  12. data/app/assets/stylesheets/active_admin/components/_comments.scss +2 -2
  13. data/app/assets/stylesheets/active_admin/components/_date_picker.scss +1 -2
  14. data/app/assets/stylesheets/active_admin/components/_dropdown_menu.scss +0 -1
  15. data/app/assets/stylesheets/active_admin/components/_tables.scss +1 -2
  16. data/app/assets/stylesheets/active_admin/mixins/_all.scss +8 -8
  17. data/app/assets/stylesheets/active_admin/mixins/_variables.scss +17 -0
  18. data/app/assets/stylesheets/active_admin/structure/_main_structure.scss +1 -1
  19. data/app/assets/stylesheets/active_admin/structure/_title_bar.scss +0 -1
  20. data/app/javascript/active_admin/base.js +28 -0
  21. data/app/{assets/javascripts/active_admin/lib/batch_actions.es6 → javascript/active_admin/initializers/batch-actions.js} +9 -3
  22. data/app/javascript/active_admin/initializers/checkbox-toggler.js +3 -0
  23. data/app/javascript/active_admin/initializers/dropdown-menu.js +9 -0
  24. data/app/javascript/active_admin/initializers/filters.js +10 -0
  25. data/app/{assets/javascripts/active_admin/lib/has_many.es6 → javascript/active_admin/initializers/has-many.js} +4 -1
  26. data/app/javascript/active_admin/initializers/per-page.js +13 -0
  27. data/app/javascript/active_admin/initializers/table-checkbox-toggler.js +3 -0
  28. data/app/{assets/javascripts/active_admin/lib/checkbox-toggler.es6 → javascript/active_admin/lib/checkbox-toggler.js} +5 -5
  29. data/app/{assets/javascripts/active_admin/lib/dropdown-menu.es6 → javascript/active_admin/lib/dropdown-menu.js} +3 -10
  30. data/app/javascript/active_admin/lib/filters.js +39 -0
  31. data/app/{assets/javascripts/active_admin/lib/modal_dialog.es6 → javascript/active_admin/lib/modal-dialog.js} +10 -8
  32. data/app/javascript/active_admin/lib/per-page.js +38 -0
  33. data/app/{assets/javascripts/active_admin/lib/table-checkbox-toggler.es6 → javascript/active_admin/lib/table-checkbox-toggler.js} +5 -3
  34. data/app/javascript/active_admin/lib/utils.js +40 -0
  35. data/app/views/active_admin/devise/mailer/reset_password_instructions.html.erb +1 -1
  36. data/app/views/active_admin/devise/mailer/unlock_instructions.html.erb +2 -2
  37. data/app/views/active_admin/devise/shared/_links.erb +1 -1
  38. data/app/views/active_admin/page/index.html.arb +1 -0
  39. data/app/views/active_admin/resource/edit.html.arb +1 -0
  40. data/app/views/active_admin/resource/index.html.arb +1 -0
  41. data/app/views/active_admin/resource/new.html.arb +1 -0
  42. data/app/views/active_admin/resource/show.html.arb +1 -0
  43. data/app/views/kaminari/active_admin_countless/_first_page.html.erb +11 -0
  44. data/app/views/kaminari/active_admin_countless/_gap.html.erb +8 -0
  45. data/app/views/kaminari/active_admin_countless/_next_page.html.erb +11 -0
  46. data/app/views/kaminari/active_admin_countless/_page.html.erb +12 -0
  47. data/app/views/kaminari/active_admin_countless/_paginator.html.erb +24 -0
  48. data/app/views/kaminari/active_admin_countless/_prev_page.html.erb +11 -0
  49. data/app/views/layouts/active_admin.html.arb +1 -0
  50. data/app/views/layouts/active_admin_logged_out.html.erb +15 -5
  51. data/config/locales/ar.yml +6 -6
  52. data/config/locales/az.yml +138 -0
  53. data/config/locales/ca.yml +0 -1
  54. data/config/locales/de.yml +18 -0
  55. data/config/locales/en-CA.yml +3 -3
  56. data/config/locales/en-GB.yml +3 -3
  57. data/config/locales/en.yml +3 -3
  58. data/config/locales/es-MX.yml +2 -1
  59. data/config/locales/es.yml +5 -5
  60. data/config/locales/fr.yml +4 -4
  61. data/config/locales/it.yml +18 -0
  62. data/config/locales/ja.yml +3 -3
  63. data/config/locales/ko.yml +1 -1
  64. data/config/locales/lv.yml +2 -2
  65. data/config/locales/nl.yml +1 -1
  66. data/config/locales/ro.yml +3 -2
  67. data/config/locales/sk.yml +59 -0
  68. data/config/locales/vi.yml +6 -5
  69. data/docs/0-installation.md +27 -3
  70. data/docs/1-general-configuration.md +20 -0
  71. data/docs/11-decorators.md +16 -5
  72. data/docs/2-resource-customization.md +11 -2
  73. data/docs/3-index-pages/index-as-table.md +7 -0
  74. data/docs/3-index-pages.md +1 -1
  75. data/docs/5-forms.md +7 -2
  76. data/docs/6-show-pages.md +12 -0
  77. data/docs/8-custom-actions.md +1 -1
  78. data/docs/9-batch-actions.md +2 -2
  79. data/docs/Gemfile +3 -3
  80. data/docs/Gemfile.lock +192 -158
  81. data/docs/_config.yml +2 -0
  82. data/docs/_includes/top-menu.html +2 -2
  83. data/docs/documentation.md +1 -1
  84. data/docs/index.html +109 -8
  85. data/docs/stylesheets/main.css +29 -0
  86. data/lib/active_admin/abstract_view_factory.rb +1 -0
  87. data/lib/active_admin/application.rb +20 -20
  88. data/lib/active_admin/application_settings.rb +4 -3
  89. data/lib/active_admin/asset_registration.rb +1 -0
  90. data/lib/active_admin/authorization_adapter.rb +4 -3
  91. data/lib/active_admin/base_controller/authorization.rb +15 -13
  92. data/lib/active_admin/base_controller/menu.rb +1 -0
  93. data/lib/active_admin/base_controller.rb +6 -5
  94. data/lib/active_admin/batch_actions/controller.rb +4 -3
  95. data/lib/active_admin/batch_actions/resource_extension.rb +10 -8
  96. data/lib/active_admin/batch_actions/views/batch_action_form.rb +4 -3
  97. data/lib/active_admin/batch_actions/views/batch_action_selector.rb +7 -6
  98. data/lib/active_admin/batch_actions/views/selection_cells.rb +4 -3
  99. data/lib/active_admin/batch_actions.rb +1 -0
  100. data/lib/active_admin/callbacks.rb +1 -0
  101. data/lib/active_admin/cancan_adapter.rb +2 -1
  102. data/lib/active_admin/collection_decorator.rb +32 -0
  103. data/lib/active_admin/component.rb +1 -0
  104. data/lib/active_admin/controller_action.rb +1 -0
  105. data/lib/active_admin/csv_builder.rb +13 -23
  106. data/lib/active_admin/dependency.rb +13 -12
  107. data/lib/active_admin/deprecation.rb +1 -0
  108. data/lib/active_admin/devise.rb +16 -5
  109. data/lib/active_admin/dsl.rb +2 -1
  110. data/lib/active_admin/dynamic_setting.rb +1 -0
  111. data/lib/active_admin/dynamic_settings_node.rb +3 -2
  112. data/lib/active_admin/engine.rb +13 -9
  113. data/lib/active_admin/error.rb +1 -2
  114. data/lib/active_admin/filters/active.rb +2 -1
  115. data/lib/active_admin/filters/active_filter.rb +7 -7
  116. data/lib/active_admin/filters/active_sidebar.rb +4 -30
  117. data/lib/active_admin/filters/dsl.rb +1 -0
  118. data/lib/active_admin/filters/forms.rb +7 -6
  119. data/lib/active_admin/filters/formtastic_addons.rb +2 -6
  120. data/lib/active_admin/filters/resource_extension.rb +26 -1
  121. data/lib/active_admin/filters.rb +8 -7
  122. data/lib/active_admin/form_builder.rb +25 -20
  123. data/lib/active_admin/generators/boilerplate.rb +13 -4
  124. data/lib/active_admin/helpers/collection.rb +2 -0
  125. data/lib/active_admin/helpers/i18n.rb +1 -0
  126. data/lib/active_admin/helpers/optional_display.rb +3 -2
  127. data/lib/active_admin/helpers/routes/url_helpers.rb +1 -0
  128. data/lib/active_admin/helpers/scope_chain.rb +1 -0
  129. data/lib/active_admin/inputs/datepicker_input.rb +2 -1
  130. data/lib/active_admin/inputs/filters/base/search_method_select.rb +5 -4
  131. data/lib/active_admin/inputs/filters/base.rb +2 -1
  132. data/lib/active_admin/inputs/filters/boolean_input.rb +2 -1
  133. data/lib/active_admin/inputs/filters/check_boxes_input.rb +2 -1
  134. data/lib/active_admin/inputs/filters/date_picker_input.rb +1 -0
  135. data/lib/active_admin/inputs/filters/date_range_input.rb +16 -12
  136. data/lib/active_admin/inputs/filters/numeric_input.rb +1 -0
  137. data/lib/active_admin/inputs/filters/select_input.rb +3 -2
  138. data/lib/active_admin/inputs/filters/string_input.rb +1 -0
  139. data/lib/active_admin/inputs/filters/text_input.rb +1 -0
  140. data/lib/active_admin/inputs.rb +1 -0
  141. data/lib/active_admin/localizers/resource_localizer.rb +4 -3
  142. data/lib/active_admin/localizers.rb +2 -1
  143. data/lib/active_admin/menu.rb +7 -3
  144. data/lib/active_admin/menu_collection.rb +1 -0
  145. data/lib/active_admin/menu_item.rb +8 -7
  146. data/lib/active_admin/namespace.rb +14 -13
  147. data/lib/active_admin/namespace_settings.rb +21 -4
  148. data/lib/active_admin/order_clause.rb +3 -2
  149. data/lib/active_admin/orm/active_record/comments/comment.rb +4 -3
  150. data/lib/active_admin/orm/active_record/comments/namespace_helper.rb +1 -0
  151. data/lib/active_admin/orm/active_record/comments/resource_helper.rb +1 -0
  152. data/lib/active_admin/orm/active_record/comments/show_page_helper.rb +1 -0
  153. data/lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb +20 -19
  154. data/lib/active_admin/orm/active_record/comments/views.rb +3 -2
  155. data/lib/active_admin/orm/active_record/comments.rb +20 -19
  156. data/lib/active_admin/orm/active_record.rb +2 -1
  157. data/lib/active_admin/orm/mongoid.rb +1 -0
  158. data/lib/active_admin/page.rb +2 -1
  159. data/lib/active_admin/page_controller.rb +1 -0
  160. data/lib/active_admin/page_dsl.rb +1 -0
  161. data/lib/active_admin/page_presenter.rb +1 -0
  162. data/lib/active_admin/pundit_adapter.rb +47 -11
  163. data/lib/active_admin/resource/action_items.rb +6 -5
  164. data/lib/active_admin/resource/attributes.rb +2 -1
  165. data/lib/active_admin/resource/belongs_to.rb +6 -2
  166. data/lib/active_admin/resource/controllers.rb +2 -1
  167. data/lib/active_admin/resource/includes.rb +1 -0
  168. data/lib/active_admin/resource/menu.rb +5 -4
  169. data/lib/active_admin/resource/model.rb +16 -0
  170. data/lib/active_admin/resource/naming.rb +6 -5
  171. data/lib/active_admin/resource/ordering.rb +1 -0
  172. data/lib/active_admin/resource/page_presenters.rb +1 -0
  173. data/lib/active_admin/resource/pagination.rb +1 -0
  174. data/lib/active_admin/resource/routes.rb +17 -10
  175. data/lib/active_admin/resource/scope_to.rb +8 -7
  176. data/lib/active_admin/resource/scopes.rb +1 -0
  177. data/lib/active_admin/resource/sidebars.rb +2 -1
  178. data/lib/active_admin/resource.rb +33 -19
  179. data/lib/active_admin/resource_collection.rb +1 -0
  180. data/lib/active_admin/resource_controller/action_builder.rb +1 -0
  181. data/lib/active_admin/resource_controller/data_access.rb +31 -5
  182. data/lib/active_admin/resource_controller/decorators.rb +8 -29
  183. data/lib/active_admin/resource_controller/polymorphic_routes.rb +38 -0
  184. data/lib/active_admin/resource_controller/resource_class_methods.rb +1 -0
  185. data/lib/active_admin/resource_controller/scoping.rb +1 -0
  186. data/lib/active_admin/resource_controller/sidebars.rb +1 -0
  187. data/lib/active_admin/resource_controller/streaming.rb +9 -7
  188. data/lib/active_admin/resource_controller.rb +14 -10
  189. data/lib/active_admin/resource_dsl.rb +11 -25
  190. data/lib/active_admin/router.rb +1 -0
  191. data/lib/active_admin/scope.rb +7 -6
  192. data/lib/active_admin/settings_node.rb +1 -0
  193. data/lib/active_admin/sidebar_section.rb +1 -0
  194. data/lib/active_admin/version.rb +2 -1
  195. data/lib/active_admin/view_factory.rb +18 -17
  196. data/lib/active_admin/view_helpers/active_admin_application_helper.rb +1 -0
  197. data/lib/active_admin/view_helpers/auto_link_helper.rb +1 -0
  198. data/lib/active_admin/view_helpers/breadcrumb_helper.rb +4 -3
  199. data/lib/active_admin/view_helpers/display_helper.rb +15 -7
  200. data/lib/active_admin/view_helpers/download_format_links_helper.rb +2 -1
  201. data/lib/active_admin/view_helpers/fields_for.rb +3 -2
  202. data/lib/active_admin/view_helpers/flash_helper.rb +1 -0
  203. data/lib/active_admin/view_helpers/form_helper.rb +1 -0
  204. data/lib/active_admin/view_helpers/method_or_proc_helper.rb +1 -0
  205. data/lib/active_admin/view_helpers/scope_name_helper.rb +1 -0
  206. data/lib/active_admin/view_helpers/sidebar_helper.rb +1 -0
  207. data/lib/active_admin/view_helpers/title_helper.rb +1 -0
  208. data/lib/active_admin/view_helpers/view_factory_helper.rb +1 -0
  209. data/lib/active_admin/view_helpers.rb +2 -1
  210. data/lib/active_admin/views/action_items.rb +1 -0
  211. data/lib/active_admin/views/components/active_admin_form.rb +7 -6
  212. data/lib/active_admin/views/components/active_filters_sidebar_content.rb +59 -0
  213. data/lib/active_admin/views/components/attributes_table.rb +6 -5
  214. data/lib/active_admin/views/components/blank_slate.rb +2 -1
  215. data/lib/active_admin/views/components/columns.rb +1 -0
  216. data/lib/active_admin/views/components/dropdown_menu.rb +7 -9
  217. data/lib/active_admin/views/components/index_list.rb +4 -3
  218. data/lib/active_admin/views/components/menu.rb +2 -1
  219. data/lib/active_admin/views/components/menu_item.rb +5 -4
  220. data/lib/active_admin/views/components/paginated_collection.rb +21 -19
  221. data/lib/active_admin/views/components/panel.rb +2 -1
  222. data/lib/active_admin/views/components/scopes.rb +8 -5
  223. data/lib/active_admin/views/components/sidebar.rb +1 -0
  224. data/lib/active_admin/views/components/sidebar_section.rb +1 -0
  225. data/lib/active_admin/views/components/site_title.rb +2 -1
  226. data/lib/active_admin/views/components/status_tag.rb +12 -11
  227. data/lib/active_admin/views/components/table_for.rb +19 -17
  228. data/lib/active_admin/views/components/tabs.rb +4 -3
  229. data/lib/active_admin/views/components/unsupported_browser.rb +1 -0
  230. data/lib/active_admin/views/footer.rb +3 -1
  231. data/lib/active_admin/views/header.rb +3 -2
  232. data/lib/active_admin/views/index_as_block.rb +1 -0
  233. data/lib/active_admin/views/index_as_blog.rb +2 -1
  234. data/lib/active_admin/views/index_as_grid.rb +2 -1
  235. data/lib/active_admin/views/index_as_table.rb +24 -16
  236. data/lib/active_admin/views/pages/base.rb +19 -12
  237. data/lib/active_admin/views/pages/form.rb +1 -0
  238. data/lib/active_admin/views/pages/index.rb +16 -13
  239. data/lib/active_admin/views/pages/layout.rb +1 -0
  240. data/lib/active_admin/views/pages/page.rb +1 -0
  241. data/lib/active_admin/views/pages/show.rb +1 -0
  242. data/lib/active_admin/views/tabbed_navigation.rb +3 -2
  243. data/lib/active_admin/views/title_bar.rb +2 -1
  244. data/lib/active_admin/views.rb +2 -1
  245. data/lib/active_admin.rb +63 -64
  246. data/lib/activeadmin.rb +2 -1
  247. data/lib/generators/active_admin/assets/assets_generator.rb +3 -2
  248. data/lib/generators/active_admin/assets/templates/active_admin.scss +2 -2
  249. data/lib/generators/active_admin/devise/devise_generator.rb +6 -5
  250. data/lib/generators/active_admin/install/install_generator.rb +15 -8
  251. data/lib/generators/active_admin/install/templates/active_admin.rb.erb +21 -1
  252. data/lib/generators/active_admin/install/templates/dashboard.rb +1 -0
  253. data/lib/generators/active_admin/page/page_generator.rb +2 -1
  254. data/lib/generators/active_admin/page/templates/page.rb +1 -0
  255. data/lib/generators/active_admin/resource/resource_generator.rb +4 -3
  256. data/lib/generators/active_admin/resource/templates/admin.rb.erb +4 -2
  257. data/lib/generators/active_admin/webpacker/plugins/jquery.js +7 -0
  258. data/lib/generators/active_admin/webpacker/templates/active_admin.js +5 -0
  259. data/lib/generators/active_admin/webpacker/templates/active_admin.scss +17 -0
  260. data/lib/generators/active_admin/webpacker/templates/print.scss +2 -0
  261. data/lib/generators/active_admin/webpacker/webpacker_generator.rb +27 -0
  262. data/lib/ransack_ext.rb +9 -8
  263. metadata +62 -91
  264. data/app/assets/images/active_admin/nested_menu_arrow.gif +0 -0
  265. data/app/assets/images/active_admin/nested_menu_arrow_dark.gif +0 -0
  266. data/app/assets/images/active_admin/orderable.png +0 -0
  267. data/app/assets/javascripts/active_admin/base.es6 +0 -23
  268. data/app/assets/javascripts/active_admin/initializers/filters.es6 +0 -45
  269. data/app/assets/javascripts/active_admin/lib/active_admin.es6 +0 -41
  270. data/app/assets/javascripts/active_admin/lib/per_page.es6 +0 -47
  271. /data/app/{assets/javascripts/active_admin/ext/jquery-ui.es6 → javascript/active_admin/ext/jquery-ui.js} +0 -0
  272. /data/app/{assets/javascripts/active_admin/ext/jquery.es6 → javascript/active_admin/ext/jquery.js} +0 -0
  273. /data/app/{assets/javascripts/active_admin/initializers/datepicker.es6 → javascript/active_admin/initializers/datepicker.js} +0 -0
  274. /data/app/{assets/javascripts/active_admin/initializers/tabs.es6 → javascript/active_admin/initializers/tabs.js} +0 -0
@@ -91,8 +91,8 @@ en:
91
91
  default_confirmation: "Are you sure you want to do this?"
92
92
  delete_confirmation: "Are you sure you want to delete these %{plural_model}?"
93
93
  succesfully_destroyed:
94
- one: "Successfully destroyed 1 %{model}"
95
- other: "Successfully destroyed %{count} %{plural_model}"
94
+ one: "Successfully deleted 1 %{model}"
95
+ other: "Successfully deleted %{count} %{plural_model}"
96
96
  selection_toggle_explanation: "(Toggle Selection)"
97
97
  action_label: "%{title} Selected"
98
98
  labels:
@@ -105,7 +105,7 @@ en:
105
105
  author: "Author"
106
106
  add: "Add Comment"
107
107
  delete: "Delete Comment"
108
- delete_confirmation: "Are you sure you want to delete these comment?"
108
+ delete_confirmation: "Are you sure you want to delete these comments?"
109
109
  resource: "Resource"
110
110
  no_comments_yet: "No comments yet."
111
111
  author_missing: "Anonymous"
@@ -86,7 +86,8 @@ es-MX:
86
86
  title: "Cambie su contraseña"
87
87
  submit: "Cambiar mi contraseña"
88
88
  links:
89
- sign_in: "Registrarse"
89
+ sign_in: "Iniciar Sesión"
90
+ sign_up: "Registrarse"
90
91
  forgot_your_password: "¿Olvidó su contraseña?"
91
92
  sign_in_with_omniauth_provider: "Conéctate con %{provider}"
92
93
  index_list:
@@ -23,7 +23,7 @@ es:
23
23
  view: "Ver"
24
24
  edit: "Editar"
25
25
  delete: "Eliminar"
26
- delete_confirmation: "¿Está seguro de que quiere eliminar esto?"
26
+ delete_confirmation: "¿Confirma que desea borrar este elemento?"
27
27
  create_another: "Crear otro %{model}"
28
28
  new_model: "Añadir %{model}"
29
29
  edit_model: "Editar %{model}"
@@ -89,7 +89,7 @@ es:
89
89
  batch_actions:
90
90
  button_label: "Acciones en masa"
91
91
  default_confirmation: "¿Seguro que quieres hacer esto?"
92
- delete_confirmation: "Eliminar %{plural_model}: ¿Está seguro?"
92
+ delete_confirmation: "Se eliminarán %{plural_model}. ¿Desea continuar?"
93
93
  succesfully_destroyed:
94
94
  one: "Se ha destruido 1 %{model} con éxito"
95
95
  other: "Se han destruido %{count} %{plural_model} con éxito"
@@ -105,7 +105,7 @@ es:
105
105
  author: "Autor"
106
106
  add: "Comentar"
107
107
  delete: "Borrar Comentario"
108
- delete_confirmation: "¿Está seguro que desea borrar este comentario?"
108
+ delete_confirmation: "¿Confirma que desea borrar este comentario?"
109
109
  resource: "Recurso"
110
110
  no_comments_yet: "No hay comentarios aún."
111
111
  author_missing: "Anónimo"
@@ -143,8 +143,8 @@ es:
143
143
  title: "Reenviar instrucciones de confirmación"
144
144
  submit: "Reenviar instrucciones de confirmación"
145
145
  links:
146
- sign_up: "Ingresar"
147
- sign_in: "Registrarse"
146
+ sign_up: "Registrarse"
147
+ sign_in: "Iniciar Sesión"
148
148
  forgot_your_password: "¿Olvidó su contraseña?"
149
149
  sign_in_with_omniauth_provider: "Conéctate con %{provider}"
150
150
  resend_unlock_instructions: "Reenviar instrucciones de desbloqueo"
@@ -7,7 +7,7 @@ fr:
7
7
  view: "Voir"
8
8
  edit: "Modifier"
9
9
  delete: "Supprimer"
10
- delete_confirmation: "Êtes-vous certain de vouloir supprimer ceci ?"
10
+ delete_confirmation: "Voulez-vous vraiment supprimer ceci ?"
11
11
  create_another: "Créer autre %{model}"
12
12
  new_model: "Créer %{model}"
13
13
  edit_model: "Modifier %{model}"
@@ -69,8 +69,8 @@ fr:
69
69
  button_label: "Actions"
70
70
  batch_actions:
71
71
  button_label: "Actions groupées"
72
- default_confirmation: "Êtes-vous sûr de vouloir faire cela ?"
73
- delete_confirmation: "Êtes-vous sûr de vouloir supprimer ces %{plural_model} ?"
72
+ default_confirmation: "Voulez-vous vraiment faire cela ?"
73
+ delete_confirmation: "Voulez-vous vraiment supprimer ces %{plural_model} ?"
74
74
  succesfully_destroyed:
75
75
  one: "1 %{model} supprimé"
76
76
  other: "%{count} %{plural_model} supprimés"
@@ -86,7 +86,7 @@ fr:
86
86
  author: "Auteur"
87
87
  add: "Ajouter un commentaire"
88
88
  delete: "Supprimer ce commentaire"
89
- delete_confirmation: "Êtes-vous sûr de vouloir supprimer ce commentaire ?"
89
+ delete_confirmation: "Voulez-vous vraiment supprimer ce commentaire ?"
90
90
  resource: "Ressource"
91
91
  no_comments_yet: "Aucun commentaire actuellement"
92
92
  author_missing: "Anonyme"
@@ -1,4 +1,20 @@
1
1
  it:
2
+ activerecord:
3
+ models:
4
+ comment:
5
+ one: "Commento"
6
+ other: "Commenti"
7
+ active_admin/comment:
8
+ one: "Commento"
9
+ other: "Commenti"
10
+ attributes:
11
+ active_admin/comment:
12
+ author_type: "Tipo di Autore"
13
+ body: "Corpo"
14
+ created_at: "Creato il"
15
+ namespace: "Namespace"
16
+ resource_type: "Tipo di risorsa"
17
+ updated_at: "Aggiornato il"
2
18
  active_admin:
3
19
  dashboard: Dashboard
4
20
  dashboard_welcome:
@@ -37,6 +53,8 @@ it:
37
53
  lteq_datetime: "Minore o uguale a"
38
54
  from: "Da"
39
55
  to: "A"
56
+ scopes:
57
+ all: "Tutti"
40
58
  search_status:
41
59
  headline: "Situazione filtri:"
42
60
  current_scope: "Contesto selezionato:"
@@ -8,7 +8,7 @@ ja:
8
8
  edit: "編集"
9
9
  delete: "削除"
10
10
  delete_confirmation: "本当に削除しますか?"
11
- create_another: "%{model} を追加する"
11
+ create_another: "%{model} を続けて作成する"
12
12
  new_model: "%{model} を作成する"
13
13
  edit_model: "%{model} を編集する"
14
14
  delete_model: "%{model} を削除する"
@@ -18,7 +18,7 @@ ja:
18
18
  previous: "前"
19
19
  next: "次"
20
20
  download: "ダウンロード:"
21
- has_many_new: "新規に %{model} を追加する"
21
+ has_many_new: "%{model} を追加する"
22
22
  has_many_delete: "削除する"
23
23
  has_many_remove: "削除する"
24
24
  filters:
@@ -26,7 +26,7 @@ ja:
26
26
  filter: "絞り込む"
27
27
  clear: "条件を削除する"
28
28
  predicates:
29
- contains: "含まれています"
29
+ contains: "を含む"
30
30
  equals: "等しい"
31
31
  starts_with: "で始まる"
32
32
  ends_with: "で終わる"
@@ -69,7 +69,7 @@ ko:
69
69
  one: "성공적으로 1개 %{model}을/를 삭제하였습니다"
70
70
  other: "성공적으로 %{count}개의 %{plural_model}을/를 삭제하였습니다"
71
71
  selection_toggle_explanation: "(선택 항목 바꾸기)"
72
- action_label: "%{title} 선택됨"
72
+ action_label: "선택한 항목 %{title}"
73
73
  labels:
74
74
  destroy: "삭제"
75
75
  comments:
@@ -60,8 +60,8 @@ lv:
60
60
  default_confirmation: "Vai tiešām vēlaties to darīt?"
61
61
  delete_confirmation: "Vai tiešām vēlaties dzēst šos %{plural_model}?"
62
62
  succesfully_destroyed:
63
- one: "Successfully destroyed 1 %{model}"
64
- other: "Successfully destroyed %{count} %{plural_model}"
63
+ one: "Successfully deleted 1 %{model}"
64
+ other: "Successfully deleted %{count} %{plural_model}"
65
65
  selection_toggle_explanation: "(Toggle Selection)"
66
66
  action_label: "%{title} Selected"
67
67
  labels:
@@ -114,7 +114,7 @@ nl:
114
114
  submit: "inloggen"
115
115
  reset_password:
116
116
  title: "Wachtwoord vergeten?"
117
- submit: "Reset mijn wachtwoord vergeten"
117
+ submit: "Reset mijn wachtwoord"
118
118
  change_password:
119
119
  title: "Wijzig uw wachtwoord"
120
120
  submit: "Mijn wachtwoord wijzigen"
@@ -47,8 +47,9 @@ ro:
47
47
  multiple: "Sunt afisate <b>%{from}&nbsp;-&nbsp;%{to}</b> din <b>%{total}</b> inregistrari"
48
48
  multiple_without_total: "Sunt afisate <b>%{from}&nbsp;-&nbsp;%{to}</b>"
49
49
  entry:
50
- one: "inregistrare"
51
- other: "inregistrari"
50
+ one: "înregistrăre"
51
+ few: "înregistrări"
52
+ other: "înregistrări"
52
53
  any: "Oricare"
53
54
  blank_slate:
54
55
  content: "Momentan nu exista %{resource_name}."
@@ -1,4 +1,24 @@
1
1
  sk:
2
+ activerecord:
3
+ models:
4
+ comment:
5
+ one: "Komentár"
6
+ few: "Komentáre"
7
+ many: "Komentárov"
8
+ other: "Komentáre"
9
+ active_admin/comment:
10
+ one: "Komentár"
11
+ few: "Komentáre"
12
+ many: "Komentárov"
13
+ other: "Komentáre"
14
+ attributes:
15
+ active_admin/comment:
16
+ author_type: "Typ autora"
17
+ body: "Telo"
18
+ created_at: "Vytvorený"
19
+ namespace: "Namespace"
20
+ resource_type: "Typ komentovanej položky"
21
+ updated_at: "Upravený"
2
22
  active_admin:
3
23
  dashboard: Úvod
4
24
  dashboard_welcome:
@@ -8,6 +28,7 @@ sk:
8
28
  edit: "Upraviť"
9
29
  delete: "Zmazať"
10
30
  delete_confirmation: "Ste si istí, že chcete túto položku zmazať?"
31
+ create_another: "Vytvoriť ďalší %{model}"
11
32
  new_model: "Vytvoriť"
12
33
  edit_model: "Upraviť"
13
34
  delete_model: "Zmazať"
@@ -20,6 +41,7 @@ sk:
20
41
  has_many_new: "Pridať nový"
21
42
  has_many_delete: "Zmazať"
22
43
  has_many_remove: "Odstrániť"
44
+ move: "Presunúť"
23
45
  filters:
24
46
  buttons:
25
47
  filter: "Filtrovať"
@@ -31,6 +53,17 @@ sk:
31
53
  ends_with: "Končí na"
32
54
  greater_than: "Väčší ako"
33
55
  less_than: "Menší ako"
56
+ gteq_datetime: "Od"
57
+ lteq_datetime: "Do"
58
+ from: "Od"
59
+ to: "Do"
60
+ scopes:
61
+ all: "Všetko"
62
+ search_status:
63
+ headline: "Stav vyhľadávania:"
64
+ current_scope: "Scope:"
65
+ current_filters: "Filtre:"
66
+ no_current_filters: "Žiadne"
34
67
  status_tag:
35
68
  "yes": "Áno"
36
69
  "no": "Nie"
@@ -40,6 +73,7 @@ sk:
40
73
  powered_by: "%{active_admin} %{version}"
41
74
  sidebars:
42
75
  filters: "Filtre"
76
+ search_status: "Stav vyhľadávania"
43
77
  pagination:
44
78
  empty: "Nenájdený."
45
79
  one: "Zobrazená <b>1</b> položka"
@@ -70,11 +104,14 @@ sk:
70
104
  labels:
71
105
  destroy: "Vymazať"
72
106
  comments:
107
+ created_at: "Vytvorený"
73
108
  resource_type: "Typ zdroja"
74
109
  author_type: "Typ autora"
75
110
  body: "Telo"
76
111
  author: "Autor"
77
112
  add: "Pridať komentár"
113
+ delete: "Zmazať komentár"
114
+ delete_confirmation: "Naozaj chcete zmazať tento komentár?"
78
115
  resource: "Zdroj"
79
116
  no_comments_yet: "Žiadny komentár"
80
117
  author_missing: "Anonymný"
@@ -82,6 +119,19 @@ sk:
82
119
  errors:
83
120
  empty_text: "Komentár nebol uložený, je prázdny."
84
121
  devise:
122
+ username:
123
+ title: "Užívateľské meno"
124
+ email:
125
+ title: "Email"
126
+ subdomain:
127
+ title: "Subdoména"
128
+ password:
129
+ title: "Heslo"
130
+ password_confirmation:
131
+ title: "Potvrdenie hesla"
132
+ sign_up:
133
+ title: "Registrácia"
134
+ submit: "Registrovať"
85
135
  login:
86
136
  title: "Prihlásenie"
87
137
  remember_me: "Zapamätať si ma"
@@ -95,11 +145,20 @@ sk:
95
145
  unlock:
96
146
  title: "Zaslanie inštrukcií k odomknutiu účtu"
97
147
  submit: "Zaslať inštrukcií k odomknutiu účtu"
148
+ resend_confirmation_instructions:
149
+ title: "Preposlanie potvrdzovacie inštrukcie"
150
+ submit: "Preposlať potvrdzovacie inštrukcie"
98
151
  links:
99
152
  sign_in: "Prihlásiť sa"
100
153
  sign_up: "Registrovať sa"
101
154
  forgot_your_password: "Zabudli ste heslo?"
102
155
  sign_in_with_omniauth_provider: "Prihlásiť sa cez %{provider}"
156
+ resend_unlock_instructions: "Poslať znovu inštrukcie na odomknutie účtu"
157
+ resend_confirmation_instructions: "Preposlať potvrdzovacie inštrukcie"
158
+ unsupported_browser:
159
+ headline: "ActiveAdmin nepodporuje Internet Explorer vo verzii <= 8."
160
+ recommendation: "Odporúčame <a href=\"http://browsehappy.com/\">aktualizovať Váš prehliadač</a>."
161
+ turn_off_compatibility_view: "Ak používate Internet Explorer vo verzii >= 9, uistite sa, že <a href=\"https://support.microsoft.com/en-us/help/17471\">\"režim kompatibility\" je vypnutý</a>"
103
162
  access_denied:
104
163
  message: "Nemáte oprávnenie k vykonaniu tejto akcie."
105
164
  index_list:
@@ -3,20 +3,21 @@ vi:
3
3
  dashboard: Bảng điều khiển
4
4
  dashboard_welcome:
5
5
  welcome: "Chào mừng bạn đến với Active Admin. Đây là trang điều khiển mặc định."
6
- call_to_action: "Để thêm phần phần cho trang điều khiển hãy chỉnh sửa 'app/admin/dashboard.rb'"
6
+ call_to_action: "Để thêm thành phần cho trang điều khiển hãy chỉnh sửa 'app/admin/dashboard.rb'"
7
7
  view: "Xem"
8
8
  edit: "Chỉnh sửa"
9
9
  delete: "Xóa"
10
- delete_confirmation: "Bạn có chắc chắn rằng mình muốn xóa cái này?"
10
+ delete_confirmation: "Bạn có chắc chắn rằng mình muốn xóa không?"
11
11
  new_model: "Tạo mới %{model}"
12
12
  edit_model: "Chỉnh sửa %{model}"
13
13
  delete_model: "Xóa %{model}"
14
+ create_another: "Tạo thêm %{model}"
14
15
  details: "%{model} Chi tiết"
15
16
  cancel: "Hủy"
16
17
  empty: "Trống"
17
18
  previous: "Trước"
18
- next: "Tiếp"
19
- download: "Download:"
19
+ next: "Sau"
20
+ download: "Tải về:"
20
21
  has_many_new: "Thêm mới %{model}"
21
22
  has_many_delete: "Xóa"
22
23
  has_many_remove: "Hủy bỏ"
@@ -28,7 +29,7 @@ vi:
28
29
  contains: "Có chứa"
29
30
  equals: "Bằng"
30
31
  starts_with: "Bắt đầu với"
31
- ends_with: "Kết thúc với việc"
32
+ ends_with: "Kết thúc bởi"
32
33
  greater_than: "Lớn hơn"
33
34
  less_than: "Nhỏ hơn"
34
35
  gteq_datetime: "Lớn hơn hoặc bằng"
@@ -29,7 +29,7 @@ After installing the gem, you need to run the generator. Here are your options:
29
29
  rails g active_admin:install --skip-users
30
30
  ```
31
31
 
32
- * If you want to use an existing user class, provide it as an argument:
32
+ * If you want to customize the name of the generated user class, or if you want to use an existing user class, provide the class name as an argument:
33
33
 
34
34
  ```sh
35
35
  rails g active_admin:install User
@@ -51,8 +51,8 @@ The generator adds these core files, among others:
51
51
  Now, migrate and seed your database before starting the server:
52
52
 
53
53
  ```sh
54
- rake db:migrate
55
- rake db:seed
54
+ rails db:migrate
55
+ rails db:seed
56
56
  rails server
57
57
  ```
58
58
 
@@ -112,6 +112,30 @@ Draper::CollectionDecorator.send :delegate, :per_page_kaminari
112
112
 
113
113
  If you're getting the error `wrong number of arguments (6 for 4..5)`, [read #2703].
114
114
 
115
+ ## webpacker
116
+
117
+ You can **opt-in to using Webpacker for ActiveAdmin assets** as well by updating your configuration to turn on the `use_webpacker` option, either at installation time or manually.
118
+
119
+ * at active_admin installation:
120
+
121
+ ```sh
122
+ rails g active_admin:install --use_webpacker
123
+ ```
124
+
125
+ * manually:
126
+
127
+ ```ruby
128
+ ActiveAdmin.setup do |config|
129
+ config.use_webpacker = true
130
+ end
131
+ ```
132
+
133
+ And run the generator to get default Active Admin assets:
134
+
135
+ ```sh
136
+ rails g active_admin:webpacker
137
+ ```
138
+
115
139
  [CHANGELOG]: https://github.com/activeadmin/activeadmin/blob/master/CHANGELOG.md
116
140
  [dashboard.rb]: https://github.com/activeadmin/activeadmin/blob/master/lib/generators/active_admin/install/templates/dashboard.rb
117
141
  [active_admin.rb]: https://github.com/activeadmin/activeadmin/blob/master/lib/generators/active_admin/install/templates/active_admin.rb.erb
@@ -106,6 +106,26 @@ ActiveAdmin.setup do |config|
106
106
  end
107
107
  ```
108
108
 
109
+ If you are creating a multi-tenant application you may want to have multiple namespaces mounted to the same path. We can do this using the `route_options` settings on the namespace
110
+
111
+ ```ruby
112
+ config.namespace :site_1 do |admin|
113
+ admin.route_options = { path: :admin, constraints: ->(request){ request.domain == "site1.com" } }
114
+ end
115
+
116
+ config.namespace :site_2 do |admin|
117
+ admin.route_options = { path: :admin, constraints: ->(request){ request.domain == "site2.com" } }
118
+ end
119
+ ```
120
+
121
+ If you would like to mount the namespace to a subdomain instead of path we can use the `route_options` for this as well
122
+
123
+ ```ruby
124
+ config.namespace :admin do |admin|
125
+ admin.route_options = { path: '', subdomain: 'admin' }
126
+ end
127
+ ```
128
+
109
129
  Each setting available in the Active Admin setup block is configurable on a per
110
130
  namespace basis.
111
131
 
@@ -8,11 +8,6 @@ Active Admin allows you to use the decorator pattern to provide view-specific
8
8
  versions of a resource. [Draper](https://github.com/drapergem/draper) is
9
9
  recommended but not required.
10
10
 
11
- To use decorator support without Draper, your decorator must support a variety
12
- of collection methods to support pagination, filtering, etc. See
13
- [this github issue discussion](https://github.com/activeadmin/activeadmin/issues/3600)
14
- and [this gem](https://github.com/kiote/activeadmin-poro-decorator) for more details.
15
-
16
11
  ## Example usage
17
12
 
18
13
  ```ruby
@@ -42,6 +37,22 @@ ActiveAdmin.register Post do
42
37
  end
43
38
  ```
44
39
 
40
+ You can pass any decorator class as an argument to `decorate_with`
41
+ as long as it accepts the record to be decorated as a parameter in
42
+ the initializer, and responds to all the necessary methods.
43
+
44
+ ```ruby
45
+ # app/decorators/post_decorator.rb
46
+ class PostDecorator
47
+ attr_reader :post
48
+ delegate_missing_to :post
49
+
50
+ def initialize(post)
51
+ @post = post
52
+ end
53
+ end
54
+ ```
55
+
45
56
  ## Forms
46
57
 
47
58
  By default, ActiveAdmin does *not* decorate the resource used to render forms.
@@ -164,7 +164,8 @@ The menu method accepts a hash with the following options:
164
164
 
165
165
  * `:label` - The string or proc label to display in the menu. If it's a proc, it
166
166
  will be called each time the menu is rendered.
167
- * `:parent` - The string id (or label) of the parent used for this menu
167
+ * `:parent` - The string id (or label) of the parent used for this menu, or an array
168
+ of string ids (or labels) for a nested menu
168
169
  * `:if` - A block or a symbol of a method to call to decide if the menu item
169
170
  should be displayed
170
171
  * `:priority` - The integer value of the priority, which defaults to `10`
@@ -227,6 +228,14 @@ end
227
228
  Note that the "Blog" parent menu item doesn't even have to exist yet; it can be
228
229
  dynamically generated for you.
229
230
 
231
+ To further nest an item under a submenu, provide an array of parents.
232
+
233
+ ```ruby
234
+ ActiveAdmin.register Post do
235
+ menu parent: ["Admin", "Blog"]
236
+ end
237
+ ```
238
+
230
239
  ### Customizing Parent Menu Items
231
240
 
232
241
  All of the options given to a standard menu item are also available to
@@ -355,7 +364,7 @@ end
355
364
  ```
356
365
 
357
366
  If you need to completely replace the record retrieving code (e.g., you have a
358
- custom `to_param` implementation in your models), override the `resource` method
367
+ custom `to_param` implementation in your models), override the `find_resource` method
359
368
  on the controller:
360
369
 
361
370
  ```ruby
@@ -193,6 +193,13 @@ controller do
193
193
  end
194
194
  ```
195
195
 
196
+ You can also define associated objects to include outside of the
197
+ `scoped_collection` method:
198
+
199
+ ```ruby
200
+ includes :publisher
201
+ ```
202
+
196
203
  Then it's simple to sort by any Publisher attribute from within the index table:
197
204
 
198
205
  ```ruby
@@ -212,7 +212,7 @@ end
212
212
  ```
213
213
 
214
214
  Scopes can be labelled with a translation, e.g.
215
- `activerecord.scopes.invoice.expired`.
215
+ `active_admin.scopes.scope_method`.
216
216
 
217
217
  ### Scopes groups
218
218
 
data/docs/5-forms.md CHANGED
@@ -56,7 +56,7 @@ Which looks for something like this:
56
56
 
57
57
  ```ruby
58
58
  # app/views/admin/posts/_form.html.arb
59
- insert_tag active_admin_form_for resource do |f|
59
+ active_admin_form_for [:admin, resource] do |f|
60
60
  inputs :title, :body
61
61
  actions
62
62
  end
@@ -110,8 +110,9 @@ ActiveAdmin.register Post do
110
110
  end
111
111
  end
112
112
  f.inputs do
113
- f.has_many :comment,
113
+ f.has_many :comments,
114
114
  new_record: 'Leave Comment',
115
+ remove_record: 'Remove Comment',
115
116
  allow_destroy: -> (c) { c.author?(current_admin_user) } do |b|
116
117
  b.input :body
117
118
  end
@@ -139,6 +140,10 @@ The `:new_record` option controls the visibility of the new record button (shown
139
140
  by default). If you pass a string, it will be used as the text for the new
140
141
  record button.
141
142
 
143
+ The `:remove_record` option controls the text of the remove button (shown after
144
+ the new record button is pressed). If you pass a string, it will be used as the
145
+ text for the remove button.
146
+
142
147
  The `:sortable` option adds a hidden field and will enable drag & drop sorting
143
148
  of the children. It expects the name of the column that will store the index of
144
149
  each child.
data/docs/6-show-pages.md CHANGED
@@ -79,3 +79,15 @@ ActiveAdmin.register Book do
79
79
  end
80
80
  end
81
81
  ```
82
+
83
+ If you want to keep the default show data, but add something extra to it:
84
+
85
+ ```ruby
86
+ show do
87
+ div do
88
+ h3 'Some custom charts about this object'
89
+ render partial: 'charts'
90
+ end
91
+ default_main_content
92
+ end
93
+ ```
@@ -62,7 +62,7 @@ HTTP verbs. In that case, this is the suggested approach:
62
62
  ```ruby
63
63
  member_action :foo, method: [:get, :post] do
64
64
  if request.post?
65
- resource.update_attributes! foo: params[:foo] || {}
65
+ resource.update! foo: params[:foo] || {}
66
66
  head :ok
67
67
  else
68
68
  render :foo
@@ -154,13 +154,13 @@ batch_action :doit, form: -> { {user: User.pluck(:name, :id)} } do |ids, inputs|
154
154
  end
155
155
  ```
156
156
 
157
- Under the covers this is powered by the JS `ActiveAdmin.modal_dialog` which you
157
+ Under the covers this is powered by the JS `ActiveAdmin.ModalDialog` which you
158
158
  can use yourself:
159
159
 
160
160
  ```coffee
161
161
  if $('body.admin_users').length
162
162
  $('a[data-prompt]').click ->
163
- ActiveAdmin.modal_dialog $(@).data('prompt'), comment: 'textarea',
163
+ ActiveAdmin.ModalDialog $(@).data('prompt'), comment: 'textarea',
164
164
  (inputs)=>
165
165
  $.post "/admin/users/#{$(@).data 'id'}/change_state",
166
166
  comment: inputs.comment, state: $(@).data('state'),
data/docs/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'https://rubygems.org'
1
+ # frozen_string_literal: true
2
+ source "https://rubygems.org"
2
3
 
3
- gem 'github-pages'
4
- gem 'jekyll-redirect-from'
4
+ gem "github-pages"