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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -102
- data/CONTRIBUTING.md +32 -117
- data/README.md +17 -30
- data/UPGRADING.md +241 -0
- data/app/assets/config/active_admin_manifest.js +2 -0
- data/{lib → app/controllers}/active_admin/base_controller/authorization.rb +1 -1
- data/app/controllers/active_admin/base_controller/menu.rb +39 -0
- data/{lib → app/controllers}/active_admin/base_controller.rb +46 -18
- data/{lib → app/controllers}/active_admin/page_controller.rb +0 -4
- data/{lib → app/controllers}/active_admin/resource_controller/action_builder.rb +1 -1
- data/{lib → app/controllers}/active_admin/resource_controller/data_access.rb +11 -6
- data/{lib → app/controllers}/active_admin/resource_controller/scoping.rb +1 -1
- data/{lib → app/controllers}/active_admin/resource_controller/streaming.rb +4 -4
- data/app/controllers/active_admin/resource_controller.rb +102 -0
- data/app/helpers/active_admin/auto_link_helper.rb +66 -0
- data/app/helpers/active_admin/breadcrumb_helper.rb +41 -0
- data/app/helpers/active_admin/display_helper.rb +117 -0
- data/app/helpers/active_admin/form_helper.rb +95 -0
- data/app/helpers/active_admin/index_helper.rb +40 -0
- data/app/helpers/active_admin/layout_helper.rb +63 -0
- data/app/javascript/active_admin/features/batch_actions.js +95 -0
- data/app/javascript/active_admin/features/dark_mode_toggle.js +37 -0
- data/app/javascript/active_admin/features/filters.js +34 -0
- data/app/javascript/active_admin/features/has_many.js +28 -0
- data/app/javascript/active_admin/features/main_menu.js +12 -0
- data/app/javascript/active_admin/features/per_page.js +9 -0
- data/app/javascript/active_admin/utils/dom.js +17 -0
- data/app/javascript/active_admin.js +10 -0
- data/app/views/active_admin/_flash_messages.html.erb +22 -0
- data/app/views/active_admin/_html_head.html.erb +13 -0
- data/app/views/active_admin/_main_navigation.html.erb +28 -0
- data/app/views/active_admin/_page_header.html.erb +27 -0
- data/app/views/active_admin/_sidebar.html.erb +5 -0
- data/app/views/active_admin/_site_footer.html.erb +7 -0
- data/app/views/active_admin/_site_header.html.erb +30 -0
- data/app/views/active_admin/devise/confirmations/new.html.erb +5 -3
- data/app/views/active_admin/devise/passwords/edit.html.erb +5 -3
- data/app/views/active_admin/devise/passwords/new.html.erb +5 -4
- data/app/views/active_admin/devise/registrations/new.html.erb +6 -4
- data/app/views/active_admin/devise/sessions/new.html.erb +6 -4
- data/app/views/active_admin/devise/shared/_links.erb +3 -1
- data/app/views/active_admin/devise/unlocks/new.html.erb +6 -4
- data/app/views/{kaminari/active_admin_countless → active_admin/kaminari}/_gap.html.erb +3 -1
- data/app/views/active_admin/kaminari/_next_page.html.erb +16 -0
- data/app/views/active_admin/kaminari/_page.html.erb +14 -0
- data/app/views/{kaminari/active_admin_countless → active_admin/kaminari}/_paginator.html.erb +1 -2
- data/app/views/active_admin/kaminari/_prev_page.html.erb +16 -0
- data/app/views/active_admin/page/index.html.arb +5 -2
- data/app/views/active_admin/resource/_active_filters.html.erb +32 -0
- data/app/views/active_admin/resource/_batch_actions_dropdown.html.erb +19 -0
- data/app/views/active_admin/resource/_form.html.arb +15 -0
- data/app/views/active_admin/resource/_form_default.html.arb +11 -0
- data/app/views/active_admin/resource/_index_as_table_default.html.arb +8 -0
- data/app/views/active_admin/resource/_index_blank_slate.html.erb +14 -0
- data/app/views/active_admin/resource/_index_empty_results.html.erb +5 -0
- data/app/views/active_admin/resource/_index_table_actions_default.html.erb +9 -0
- data/app/views/active_admin/resource/_show_default.html.arb +2 -0
- data/app/views/active_admin/resource/edit.html.arb +1 -2
- data/app/views/active_admin/resource/index.html.arb +94 -2
- data/app/views/active_admin/resource/new.html.arb +1 -2
- data/app/views/active_admin/resource/show.html.arb +12 -2
- data/app/views/active_admin/shared/_action_items.html.erb +3 -0
- data/app/views/active_admin/shared/_download_format_links.html.erb +7 -0
- data/app/views/active_admin/shared/_resource_comments.html.erb +51 -0
- data/app/views/active_admin/shared/_sidebar_section.html.arb +6 -0
- data/app/views/active_admin/shared/_sidebar_sections.html.erb +5 -0
- data/app/views/layouts/active_admin.html.erb +20 -0
- data/app/views/layouts/active_admin_logged_out.html.erb +8 -45
- data/config/importmap.rb +5 -0
- data/config/locales/ar.yml +136 -116
- data/config/locales/az.yml +103 -118
- data/config/locales/bg.yml +91 -99
- data/config/locales/bs.yml +95 -101
- data/config/locales/ca.yml +131 -86
- data/config/locales/cs.yml +82 -90
- data/config/locales/da.yml +102 -117
- data/config/locales/de.yml +130 -141
- data/config/locales/el.yml +94 -106
- data/config/locales/en-CA.yml +104 -119
- data/config/locales/en-GB.yml +104 -119
- data/config/locales/en.yml +134 -140
- data/config/locales/eo.yml +107 -123
- data/config/locales/es-MX.yml +70 -78
- data/config/locales/es.yml +129 -138
- data/config/locales/fa.yml +91 -99
- data/config/locales/fi.yml +84 -92
- data/config/locales/fr.yml +135 -120
- data/config/locales/he.yml +103 -118
- data/config/locales/hr.yml +95 -103
- data/config/locales/hu.yml +76 -81
- data/config/locales/id.yml +97 -112
- data/config/locales/it.yml +134 -140
- data/config/locales/ja.yml +109 -120
- data/config/locales/ko.yml +136 -101
- data/config/locales/lt.yml +106 -121
- data/config/locales/lv.yml +70 -75
- data/config/locales/mk.yml +100 -114
- data/config/locales/nb.yml +98 -109
- data/config/locales/nl.yml +113 -122
- data/config/locales/pl.yml +137 -146
- data/config/locales/pt-BR.yml +134 -121
- data/config/locales/pt-PT.yml +71 -76
- data/config/locales/ro.yml +74 -79
- data/config/locales/ru.yml +142 -122
- data/config/locales/sk.yml +131 -146
- data/config/locales/sv-SE.yml +126 -141
- data/config/locales/tr.yml +105 -120
- data/config/locales/uk.yml +140 -119
- data/config/locales/vi.yml +125 -140
- data/config/locales/zh-CN.yml +135 -141
- data/config/locales/zh-TW.yml +136 -116
- data/lib/active_admin/application.rb +6 -14
- data/lib/active_admin/application_settings.rb +1 -1
- data/lib/active_admin/async_count.rb +23 -0
- data/lib/active_admin/batch_actions/controller.rb +1 -4
- data/lib/active_admin/batch_actions/resource_extension.rb +8 -15
- data/lib/active_admin/batch_actions/views/batch_action_form.rb +1 -7
- data/lib/active_admin/batch_actions/views/selection_cells.rb +3 -3
- data/lib/active_admin/batch_actions.rb +4 -9
- data/lib/active_admin/callbacks.rb +6 -4
- data/lib/active_admin/collection_decorator.rb +1 -1
- data/lib/active_admin/component.rb +0 -1
- data/lib/active_admin/csv_builder.rb +2 -2
- data/lib/active_admin/devise.rb +3 -3
- data/lib/active_admin/dsl.rb +3 -3
- data/lib/active_admin/dynamic_settings_node.rb +6 -6
- data/lib/active_admin/engine.rb +23 -7
- data/lib/active_admin/filters/active.rb +8 -6
- data/lib/active_admin/filters/active_filter.rb +2 -10
- data/lib/active_admin/filters/forms.rb +1 -45
- data/lib/active_admin/filters/resource_extension.rb +18 -10
- data/lib/active_admin/filters.rb +5 -7
- data/lib/active_admin/form_builder.rb +14 -17
- data/lib/active_admin/helpers/optional_display.rb +1 -1
- data/lib/active_admin/inputs/filters/base/search_method_select.rb +10 -12
- data/lib/active_admin/inputs/filters/base.rb +1 -1
- data/lib/active_admin/inputs/filters/check_boxes_input.rb +1 -6
- data/lib/active_admin/inputs/filters/date_range_input.rb +4 -2
- data/lib/active_admin/inputs.rb +0 -3
- data/lib/active_admin/localizers.rb +1 -1
- data/lib/active_admin/menu.rb +10 -7
- data/lib/active_admin/menu_collection.rb +1 -1
- data/lib/active_admin/menu_item.rb +24 -3
- data/lib/active_admin/namespace.rb +3 -45
- data/lib/active_admin/namespace_settings.rb +3 -36
- data/lib/active_admin/order_clause.rb +4 -1
- data/lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb +4 -76
- data/lib/active_admin/orm/active_record/comments/views.rb +2 -2
- data/lib/active_admin/orm/active_record/comments.rb +13 -8
- data/lib/active_admin/orm/active_record.rb +1 -1
- data/lib/active_admin/pundit_adapter.rb +3 -3
- data/lib/active_admin/resource/action_items.rb +18 -23
- data/lib/active_admin/resource/naming.rb +2 -3
- data/lib/active_admin/resource/page_presenters.rb +2 -2
- data/lib/active_admin/resource/sidebars.rb +1 -1
- data/lib/active_admin/resource.rb +17 -16
- data/lib/active_admin/resource_collection.rb +1 -1
- data/lib/active_admin/resource_dsl.rb +3 -3
- data/lib/active_admin/scope.rb +11 -1
- data/lib/active_admin/settings_node.rb +1 -1
- data/lib/active_admin/sidebar_section.rb +0 -5
- data/lib/active_admin/version.rb +1 -1
- data/lib/active_admin/view_helpers/method_or_proc_helper.rb +1 -1
- data/lib/active_admin/view_helpers.rb +0 -12
- data/lib/active_admin/views/components/active_admin_form.rb +21 -29
- data/lib/active_admin/views/components/attributes_table.rb +14 -16
- data/lib/active_admin/views/components/index_list.rb +10 -23
- data/lib/active_admin/views/components/paginated_collection.rb +34 -39
- data/lib/active_admin/views/components/panel.rb +3 -11
- data/lib/active_admin/views/components/scopes.rb +39 -26
- data/lib/active_admin/views/components/status_tag.rb +22 -19
- data/lib/active_admin/views/components/table_for.rb +25 -25
- data/lib/active_admin/views/index_as_table.rb +39 -101
- data/lib/active_admin.rb +16 -15
- data/lib/activeadmin.rb +1 -1
- data/lib/generators/active_admin/assets/assets_generator.rb +4 -4
- data/lib/generators/active_admin/assets/templates/active_admin.css +3 -0
- data/lib/generators/active_admin/assets/templates/tailwind.config.js +21 -0
- data/lib/generators/active_admin/devise/devise_generator.rb +2 -2
- data/lib/generators/active_admin/install/install_generator.rb +2 -8
- data/lib/generators/active_admin/install/templates/active_admin.rb.erb +10 -87
- data/lib/generators/active_admin/install/templates/dashboard.rb +8 -25
- data/lib/generators/active_admin/page/page_generator.rb +0 -1
- data/lib/generators/active_admin/resource/resource_generator.rb +50 -7
- data/lib/generators/active_admin/resource/templates/resource.rb.erb +42 -0
- data/lib/generators/active_admin/views_generator.rb +18 -0
- data/plugin.js +414 -0
- data/vendor/bundle/offense.rb +1 -0
- data/vendor/javascript/flowbite.js +1 -0
- data/vendor/javascript/rails_ujs_esm.js +1 -0
- metadata +80 -207
- data/app/assets/javascripts/active_admin/base.js +0 -517
- data/app/assets/stylesheets/active_admin/_base.scss +0 -57
- data/app/assets/stylesheets/active_admin/_forms.scss +0 -315
- data/app/assets/stylesheets/active_admin/_header.scss +0 -188
- data/app/assets/stylesheets/active_admin/_mixins.scss +0 -1
- data/app/assets/stylesheets/active_admin/_normalize.scss +0 -349
- data/app/assets/stylesheets/active_admin/_print.scss +0 -287
- data/app/assets/stylesheets/active_admin/_typography.scss +0 -100
- data/app/assets/stylesheets/active_admin/components/_batch_actions.scss +0 -6
- data/app/assets/stylesheets/active_admin/components/_blank_slates.scss +0 -30
- data/app/assets/stylesheets/active_admin/components/_breadcrumbs.scss +0 -20
- data/app/assets/stylesheets/active_admin/components/_buttons.scss +0 -6
- data/app/assets/stylesheets/active_admin/components/_columns.scss +0 -3
- data/app/assets/stylesheets/active_admin/components/_comments.scss +0 -41
- data/app/assets/stylesheets/active_admin/components/_date_picker.scss +0 -148
- data/app/assets/stylesheets/active_admin/components/_dropdown_menu.scss +0 -154
- data/app/assets/stylesheets/active_admin/components/_flash_messages.scss +0 -37
- data/app/assets/stylesheets/active_admin/components/_grid.scss +0 -9
- data/app/assets/stylesheets/active_admin/components/_index_list.scss +0 -12
- data/app/assets/stylesheets/active_admin/components/_links.scss +0 -5
- data/app/assets/stylesheets/active_admin/components/_modal_dialog.scss +0 -34
- data/app/assets/stylesheets/active_admin/components/_pagination.scss +0 -58
- data/app/assets/stylesheets/active_admin/components/_panels.scss +0 -6
- data/app/assets/stylesheets/active_admin/components/_scopes.scss +0 -13
- data/app/assets/stylesheets/active_admin/components/_status_tags.scss +0 -12
- data/app/assets/stylesheets/active_admin/components/_table_tools.scss +0 -70
- data/app/assets/stylesheets/active_admin/components/_tables.scss +0 -112
- data/app/assets/stylesheets/active_admin/components/_tabs.scss +0 -68
- data/app/assets/stylesheets/active_admin/components/_unsupported_browser.scss +0 -16
- data/app/assets/stylesheets/active_admin/mixins/_all.scss +0 -8
- data/app/assets/stylesheets/active_admin/mixins/_buttons.scss +0 -65
- data/app/assets/stylesheets/active_admin/mixins/_gradients.scss +0 -28
- data/app/assets/stylesheets/active_admin/mixins/_rounded.scss +0 -22
- data/app/assets/stylesheets/active_admin/mixins/_sections.scss +0 -41
- data/app/assets/stylesheets/active_admin/mixins/_shadows.scss +0 -15
- data/app/assets/stylesheets/active_admin/mixins/_typography.scss +0 -3
- data/app/assets/stylesheets/active_admin/mixins/_utilities.scss +0 -17
- data/app/assets/stylesheets/active_admin/mixins/_variables.scss +0 -51
- data/app/assets/stylesheets/active_admin/pages/_logged_out.scss +0 -44
- data/app/assets/stylesheets/active_admin/structure/_footer.scss +0 -19
- data/app/assets/stylesheets/active_admin/structure/_main_structure.scss +0 -29
- data/app/assets/stylesheets/active_admin/structure/_title_bar.scss +0 -43
- data/app/javascript/active_admin/base.js +0 -28
- data/app/javascript/active_admin/ext/jquery-ui.js +0 -7
- data/app/javascript/active_admin/ext/jquery.js +0 -9
- data/app/javascript/active_admin/initializers/batch-actions.js +0 -61
- data/app/javascript/active_admin/initializers/checkbox-toggler.js +0 -3
- data/app/javascript/active_admin/initializers/datepicker.js +0 -16
- data/app/javascript/active_admin/initializers/dropdown-menu.js +0 -9
- data/app/javascript/active_admin/initializers/filters.js +0 -10
- data/app/javascript/active_admin/initializers/has-many.js +0 -98
- data/app/javascript/active_admin/initializers/per-page.js +0 -13
- data/app/javascript/active_admin/initializers/table-checkbox-toggler.js +0 -3
- data/app/javascript/active_admin/initializers/tabs.js +0 -6
- data/app/javascript/active_admin/lib/checkbox-toggler.js +0 -49
- data/app/javascript/active_admin/lib/dropdown-menu.js +0 -116
- data/app/javascript/active_admin/lib/filters.js +0 -39
- data/app/javascript/active_admin/lib/modal-dialog.js +0 -63
- data/app/javascript/active_admin/lib/per-page.js +0 -38
- data/app/javascript/active_admin/lib/table-checkbox-toggler.js +0 -38
- data/app/javascript/active_admin/lib/utils.js +0 -40
- data/app/views/kaminari/active_admin/_first_page.html.erb +0 -11
- data/app/views/kaminari/active_admin/_gap.html.erb +0 -8
- data/app/views/kaminari/active_admin/_last_page.html.erb +0 -11
- data/app/views/kaminari/active_admin/_next_page.html.erb +0 -11
- data/app/views/kaminari/active_admin/_page.html.erb +0 -12
- data/app/views/kaminari/active_admin/_paginator.html.erb +0 -25
- data/app/views/kaminari/active_admin/_prev_page.html.erb +0 -11
- data/app/views/kaminari/active_admin_countless/_first_page.html.erb +0 -11
- data/app/views/kaminari/active_admin_countless/_next_page.html.erb +0 -11
- data/app/views/kaminari/active_admin_countless/_page.html.erb +0 -12
- data/app/views/kaminari/active_admin_countless/_prev_page.html.erb +0 -11
- data/app/views/layouts/active_admin.html.arb +0 -2
- data/config/locales/de-CH.yml +0 -94
- data/lib/active_admin/abstract_view_factory.rb +0 -48
- data/lib/active_admin/asset_registration.rb +0 -30
- data/lib/active_admin/base_controller/menu.rb +0 -35
- data/lib/active_admin/batch_actions/views/batch_action_selector.rb +0 -59
- data/lib/active_admin/filters/active_sidebar.rb +0 -28
- data/lib/active_admin/generators/boilerplate.rb +0 -54
- data/lib/active_admin/helpers/collection.rb +0 -21
- data/lib/active_admin/helpers/i18n.rb +0 -8
- data/lib/active_admin/inputs/datepicker_input.rb +0 -28
- data/lib/active_admin/inputs/filters/date_picker_input.rb +0 -14
- data/lib/active_admin/orm/active_record/comments/show_page_helper.rb +0 -24
- data/lib/active_admin/orm/mongoid.rb +0 -2
- data/lib/active_admin/resource_controller/sidebars.rb +0 -19
- data/lib/active_admin/resource_controller.rb +0 -68
- data/lib/active_admin/view_factory.rb +0 -28
- data/lib/active_admin/view_helpers/active_admin_application_helper.rb +0 -13
- data/lib/active_admin/view_helpers/auto_link_helper.rb +0 -46
- data/lib/active_admin/view_helpers/breadcrumb_helper.rb +0 -34
- data/lib/active_admin/view_helpers/display_helper.rb +0 -119
- data/lib/active_admin/view_helpers/download_format_links_helper.rb +0 -60
- data/lib/active_admin/view_helpers/fields_for.rb +0 -51
- data/lib/active_admin/view_helpers/flash_helper.rb +0 -15
- data/lib/active_admin/view_helpers/form_helper.rb +0 -21
- data/lib/active_admin/view_helpers/scope_name_helper.rb +0 -17
- data/lib/active_admin/view_helpers/sidebar_helper.rb +0 -16
- data/lib/active_admin/view_helpers/title_helper.rb +0 -12
- data/lib/active_admin/view_helpers/view_factory_helper.rb +0 -12
- data/lib/active_admin/views/action_items.rb +0 -18
- data/lib/active_admin/views/components/active_filters_sidebar_content.rb +0 -59
- data/lib/active_admin/views/components/blank_slate.rb +0 -18
- data/lib/active_admin/views/components/columns.rb +0 -162
- data/lib/active_admin/views/components/dropdown_menu.rb +0 -69
- data/lib/active_admin/views/components/menu.rb +0 -33
- data/lib/active_admin/views/components/menu_item.rb +0 -59
- data/lib/active_admin/views/components/sidebar.rb +0 -14
- data/lib/active_admin/views/components/sidebar_section.rb +0 -35
- data/lib/active_admin/views/components/site_title.rb +0 -55
- data/lib/active_admin/views/components/tabs.rb +0 -41
- data/lib/active_admin/views/components/unsupported_browser.rb +0 -12
- data/lib/active_admin/views/footer.rb +0 -32
- data/lib/active_admin/views/header.rb +0 -20
- data/lib/active_admin/views/index_as_block.rb +0 -37
- data/lib/active_admin/views/index_as_blog.rb +0 -156
- data/lib/active_admin/views/index_as_grid.rb +0 -81
- data/lib/active_admin/views/pages/base.rb +0 -134
- data/lib/active_admin/views/pages/form.rb +0 -65
- data/lib/active_admin/views/pages/index.rb +0 -166
- data/lib/active_admin/views/pages/layout.rb +0 -27
- data/lib/active_admin/views/pages/page.rb +0 -31
- data/lib/active_admin/views/pages/show.rb +0 -60
- data/lib/active_admin/views/tabbed_navigation.rb +0 -12
- data/lib/active_admin/views/title_bar.rb +0 -56
- data/lib/generators/active_admin/assets/templates/active_admin.js +0 -1
- data/lib/generators/active_admin/assets/templates/active_admin.scss +0 -17
- data/lib/generators/active_admin/resource/templates/admin.rb.erb +0 -46
- data/lib/generators/active_admin/webpacker/plugins/jquery.js +0 -7
- data/lib/generators/active_admin/webpacker/templates/active_admin.js +0 -5
- data/lib/generators/active_admin/webpacker/templates/active_admin.scss +0 -17
- data/lib/generators/active_admin/webpacker/templates/print.scss +0 -2
- data/lib/generators/active_admin/webpacker/webpacker_generator.rb +0 -27
- data/vendor/assets/javascripts/jquery-ui/data.js +0 -45
- data/vendor/assets/javascripts/jquery-ui/disable-selection.js +0 -51
- data/vendor/assets/javascripts/jquery-ui/focusable.js +0 -89
- data/vendor/assets/javascripts/jquery-ui/form-reset-mixin.js +0 -83
- data/vendor/assets/javascripts/jquery-ui/form.js +0 -25
- data/vendor/assets/javascripts/jquery-ui/ie.js +0 -20
- data/vendor/assets/javascripts/jquery-ui/keycode.js +0 -51
- data/vendor/assets/javascripts/jquery-ui/labels.js +0 -71
- data/vendor/assets/javascripts/jquery-ui/plugin.js +0 -49
- data/vendor/assets/javascripts/jquery-ui/position.js +0 -513
- data/vendor/assets/javascripts/jquery-ui/safe-active-element.js +0 -46
- data/vendor/assets/javascripts/jquery-ui/safe-blur.js +0 -27
- data/vendor/assets/javascripts/jquery-ui/scroll-parent.js +0 -50
- data/vendor/assets/javascripts/jquery-ui/tabbable.js +0 -41
- data/vendor/assets/javascripts/jquery-ui/unique-id.js +0 -54
- data/vendor/assets/javascripts/jquery-ui/version.js +0 -20
- data/vendor/assets/javascripts/jquery-ui/widget.js +0 -758
- data/vendor/assets/javascripts/jquery-ui/widgets/button.js +0 -454
- data/vendor/assets/javascripts/jquery-ui/widgets/checkboxradio.js +0 -294
- data/vendor/assets/javascripts/jquery-ui/widgets/controlgroup.js +0 -304
- data/vendor/assets/javascripts/jquery-ui/widgets/datepicker.js +0 -2243
- data/vendor/assets/javascripts/jquery-ui/widgets/dialog.js +0 -971
- data/vendor/assets/javascripts/jquery-ui/widgets/draggable.js +0 -1268
- data/vendor/assets/javascripts/jquery-ui/widgets/mouse.js +0 -241
- data/vendor/assets/javascripts/jquery-ui/widgets/resizable.js +0 -1228
- data/vendor/assets/javascripts/jquery-ui/widgets/sortable.js +0 -1622
- data/vendor/assets/javascripts/jquery-ui/widgets/tabs.js +0 -931
- /data/{lib → app/controllers}/active_admin/resource_controller/decorators.rb +0 -0
- /data/{lib → app/controllers}/active_admin/resource_controller/polymorphic_routes.rb +0 -0
- /data/{lib → app/controllers}/active_admin/resource_controller/resource_class_methods.rb +0 -0
- /data/lib/{active_admin/orm/mongoid/.gitkeep → generators/active_admin/assets/templates/builds/.keep} +0 -0
|
@@ -16,10 +16,14 @@ module ActiveAdmin
|
|
|
16
16
|
@resource_class ||= @collection.klass if @collection.respond_to? :klass
|
|
17
17
|
|
|
18
18
|
@columns = []
|
|
19
|
+
@tbody_html = options.delete(:tbody_html)
|
|
20
|
+
@row_html = options.delete(:row_html)
|
|
21
|
+
# To be deprecated, please use row_html instead.
|
|
19
22
|
@row_class = options.delete(:row_class)
|
|
20
23
|
|
|
21
24
|
build_table
|
|
22
25
|
super(options)
|
|
26
|
+
add_class "data-table"
|
|
23
27
|
columns(*attrs)
|
|
24
28
|
end
|
|
25
29
|
|
|
@@ -66,40 +70,42 @@ module ActiveAdmin
|
|
|
66
70
|
end
|
|
67
71
|
|
|
68
72
|
def build_table_header(col)
|
|
69
|
-
classes = Arbre::HTML::ClassList.new
|
|
70
73
|
sort_key = sortable? && col.sortable? && col.sort_key
|
|
71
74
|
params = request.query_parameters.except :page, :order, :commit, :format
|
|
72
75
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
attributes = {
|
|
77
|
+
class: col.html_class,
|
|
78
|
+
"data-column": col.title_id.presence,
|
|
79
|
+
"data-sortable": (sort_key.present?) ? "" : nil,
|
|
80
|
+
"data-sort-direction": (sort_key && current_sort[0] == sort_key) ? current_sort[1] : nil
|
|
81
|
+
}
|
|
76
82
|
|
|
77
83
|
if sort_key
|
|
78
|
-
th
|
|
79
|
-
link_to
|
|
84
|
+
th(attributes) do
|
|
85
|
+
link_to params: params, order: "#{sort_key}_#{order_for_sort_key(sort_key)}" do
|
|
86
|
+
svg = '<svg class="data-table-sorted-icon" fill="none" viewBox="0 0 10 6"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 4 4 4-4"/></svg>'
|
|
87
|
+
|
|
88
|
+
(col.pretty_title + svg).html_safe
|
|
89
|
+
end
|
|
80
90
|
end
|
|
81
91
|
else
|
|
82
|
-
th col.pretty_title,
|
|
92
|
+
th col.pretty_title, attributes
|
|
83
93
|
end
|
|
84
94
|
end
|
|
85
95
|
|
|
86
96
|
def build_table_body
|
|
87
|
-
@tbody = tbody do
|
|
97
|
+
@tbody = tbody(**(@tbody_html || {})) do
|
|
88
98
|
# Build enough rows for our collection
|
|
89
99
|
@collection.each do |elem|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
classes << @row_class.call(elem)
|
|
94
|
-
end
|
|
95
|
-
|
|
96
|
-
tr(class: classes.flatten.join(" "), id: dom_id_for(elem))
|
|
100
|
+
html_options = @row_html&.call(elem) || {}
|
|
101
|
+
html_options.reverse_merge!(class: @row_class&.call(elem))
|
|
102
|
+
tr(id: dom_id_for(elem), **html_options)
|
|
97
103
|
end
|
|
98
104
|
end
|
|
99
105
|
end
|
|
100
106
|
|
|
101
107
|
def build_table_cell(col, resource)
|
|
102
|
-
td class: col.html_class do
|
|
108
|
+
td class: col.html_class, "data-column": col.title_id.presence do
|
|
103
109
|
html = helpers.format_attribute(resource, col.data)
|
|
104
110
|
# Don't add the same Arbre twice, while still allowing format_attribute to call status_tag
|
|
105
111
|
current_arbre_element << html unless current_arbre_element.children.include? html
|
|
@@ -139,19 +145,13 @@ module ActiveAdmin
|
|
|
139
145
|
|
|
140
146
|
class Column
|
|
141
147
|
|
|
142
|
-
attr_accessor :title, :data, :html_class
|
|
148
|
+
attr_accessor :title, :title_id, :data, :html_class
|
|
143
149
|
|
|
144
150
|
def initialize(*args, &block)
|
|
145
151
|
@options = args.extract_options!
|
|
146
|
-
|
|
147
152
|
@title = args[0]
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
html_classes << @options.delete(:class)
|
|
151
|
-
elsif @title.present?
|
|
152
|
-
html_classes << "col-#{@title.to_s.parameterize(separator: "_")}"
|
|
153
|
-
end
|
|
154
|
-
@html_class = html_classes.join(" ")
|
|
153
|
+
@title_id = @title.to_s.parameterize(separator: "_") if @title.present? && !title.is_a?(Arbre::Element)
|
|
154
|
+
@html_class = @options.delete(:class)
|
|
155
155
|
@data = args[1] || args[0]
|
|
156
156
|
@data = block if block
|
|
157
157
|
@resource_class = args[2]
|
|
@@ -72,7 +72,7 @@ module ActiveAdmin
|
|
|
72
72
|
# selectable_column
|
|
73
73
|
# column :title
|
|
74
74
|
# actions do |post|
|
|
75
|
-
# item "Preview", admin_preview_post_path(post), class: "
|
|
75
|
+
# item "Preview", admin_preview_post_path(post), class: "preview-link"
|
|
76
76
|
# end
|
|
77
77
|
# end
|
|
78
78
|
# ```
|
|
@@ -99,32 +99,6 @@ module ActiveAdmin
|
|
|
99
99
|
# end
|
|
100
100
|
# ```
|
|
101
101
|
#
|
|
102
|
-
# In case you prefer to list actions links in a dropdown menu:
|
|
103
|
-
#
|
|
104
|
-
# ```ruby
|
|
105
|
-
# index do
|
|
106
|
-
# selectable_column
|
|
107
|
-
# column :title
|
|
108
|
-
# actions dropdown: true do |post|
|
|
109
|
-
# item "Preview", admin_preview_post_path(post)
|
|
110
|
-
# end
|
|
111
|
-
# end
|
|
112
|
-
# ```
|
|
113
|
-
#
|
|
114
|
-
# In addition, you can insert the position of the row in the greater
|
|
115
|
-
# collection by using the index_column special command:
|
|
116
|
-
#
|
|
117
|
-
# ```ruby
|
|
118
|
-
# index do
|
|
119
|
-
# selectable_column
|
|
120
|
-
# index_column
|
|
121
|
-
# column :title
|
|
122
|
-
# end
|
|
123
|
-
# ```
|
|
124
|
-
#
|
|
125
|
-
# index_column take an optional offset parameter to allow a developer to set
|
|
126
|
-
# the starting number for the index (default is 1).
|
|
127
|
-
#
|
|
128
102
|
# ## Sorting
|
|
129
103
|
#
|
|
130
104
|
# When a column is generated from an Active Record attribute, the table is
|
|
@@ -222,47 +196,45 @@ module ActiveAdmin
|
|
|
222
196
|
# end
|
|
223
197
|
# ```
|
|
224
198
|
#
|
|
225
|
-
# ## Custom
|
|
199
|
+
# ## Custom tbody HTML attributes
|
|
226
200
|
#
|
|
227
|
-
# In order to add
|
|
228
|
-
# of the `index` method.
|
|
201
|
+
# In order to add HTML attributes to the tbody use the `:tbody_html` option.
|
|
229
202
|
#
|
|
230
203
|
# ```ruby
|
|
231
|
-
# index
|
|
204
|
+
# index tbody_html: { class: "my-class", data: { controller: 'stimulus-controller' } } do
|
|
232
205
|
# # columns
|
|
233
206
|
# end
|
|
234
207
|
# ```
|
|
235
208
|
#
|
|
209
|
+
# ## Custom row HTML attributes
|
|
210
|
+
#
|
|
211
|
+
# In order to add HTML attributes to table rows, use a proc object in the `:row_html` option.
|
|
212
|
+
#
|
|
213
|
+
# ```ruby
|
|
214
|
+
# index row_html: ->elem { { class: ('active' if elem.active?), data: { 'element-id' => elem.id } } } do
|
|
215
|
+
# # columns
|
|
216
|
+
# end
|
|
217
|
+
# ```
|
|
236
218
|
class IndexAsTable < ActiveAdmin::Component
|
|
237
|
-
|
|
238
219
|
def build(page_presenter, collection)
|
|
220
|
+
add_class "index-as-table"
|
|
239
221
|
table_options = {
|
|
240
222
|
id: "index_table_#{active_admin_config.resource_name.plural}",
|
|
241
223
|
sortable: true,
|
|
242
|
-
class: "index_table index",
|
|
243
224
|
i18n: active_admin_config.resource_class,
|
|
244
225
|
paginator: page_presenter[:paginator] != false,
|
|
226
|
+
tbody_html: page_presenter[:tbody_html],
|
|
227
|
+
row_html: page_presenter[:row_html],
|
|
228
|
+
# To be deprecated, please use row_html instead.
|
|
245
229
|
row_class: page_presenter[:row_class]
|
|
246
230
|
}
|
|
247
231
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
end
|
|
252
|
-
end
|
|
253
|
-
|
|
254
|
-
def table_for(*args, &block)
|
|
255
|
-
insert_tag IndexTableFor, *args, &block
|
|
256
|
-
end
|
|
257
|
-
|
|
258
|
-
def default_table
|
|
259
|
-
proc do
|
|
260
|
-
selectable_column
|
|
261
|
-
id_column if resource_class.primary_key
|
|
262
|
-
active_admin_config.resource_columns.each do |attribute|
|
|
263
|
-
column attribute
|
|
232
|
+
if page_presenter.block
|
|
233
|
+
insert_tag(IndexTableFor, collection, table_options) do |t|
|
|
234
|
+
instance_exec(t, &page_presenter.block)
|
|
264
235
|
end
|
|
265
|
-
|
|
236
|
+
else
|
|
237
|
+
render "index_as_table_default", table_options: table_options
|
|
266
238
|
end
|
|
267
239
|
end
|
|
268
240
|
|
|
@@ -275,21 +247,14 @@ module ActiveAdmin
|
|
|
275
247
|
# methods for quickly displaying items on the index page
|
|
276
248
|
#
|
|
277
249
|
class IndexTableFor < ::ActiveAdmin::Views::TableFor
|
|
278
|
-
|
|
279
250
|
# Display a column for checkbox
|
|
280
|
-
def selectable_column
|
|
251
|
+
def selectable_column(**options)
|
|
281
252
|
return unless active_admin_config.batch_actions.any?
|
|
282
|
-
column resource_selection_toggle_cell, class:
|
|
253
|
+
column resource_selection_toggle_cell, class: options[:class], sortable: false do |resource|
|
|
283
254
|
resource_selection_cell resource
|
|
284
255
|
end
|
|
285
256
|
end
|
|
286
257
|
|
|
287
|
-
def index_column(start_value = 1)
|
|
288
|
-
column "#", class: "col-index", sortable: false do |resource|
|
|
289
|
-
@collection.offset_value + @collection.index(resource) + start_value
|
|
290
|
-
end
|
|
291
|
-
end
|
|
292
|
-
|
|
293
258
|
# Display a column for the id
|
|
294
259
|
def id_column(*args)
|
|
295
260
|
raise "#{resource_class.name} has no primary_key!" unless resource_class.primary_key
|
|
@@ -300,9 +265,9 @@ module ActiveAdmin
|
|
|
300
265
|
|
|
301
266
|
column(title, sortable: sortable) do |resource|
|
|
302
267
|
if controller.action_methods.include?("show")
|
|
303
|
-
link_to resource.id, resource_path(resource)
|
|
268
|
+
link_to resource.id, resource_path(resource)
|
|
304
269
|
elsif controller.action_methods.include?("edit")
|
|
305
|
-
link_to resource.id, edit_resource_path(resource)
|
|
270
|
+
link_to resource.id, edit_resource_path(resource)
|
|
306
271
|
else
|
|
307
272
|
resource.id
|
|
308
273
|
end
|
|
@@ -334,38 +299,17 @@ module ActiveAdmin
|
|
|
334
299
|
# item 'Grant Admin', grant_admin_admin_user_path(admin_user)
|
|
335
300
|
# end
|
|
336
301
|
#
|
|
337
|
-
# # Append some actions onto the end of the default actions displayed in a Dropdown Menu
|
|
338
|
-
# actions dropdown: true do |admin_user|
|
|
339
|
-
# item 'Grant Admin', grant_admin_admin_user_path(admin_user)
|
|
340
|
-
# end
|
|
341
|
-
#
|
|
342
|
-
# # Custom actions without the defaults displayed in a Dropdown Menu.
|
|
343
|
-
# actions defaults: false, dropdown: true, dropdown_name: 'Additional actions' do |admin_user|
|
|
344
|
-
# item 'Grant Admin', grant_admin_admin_user_path(admin_user)
|
|
345
|
-
# end
|
|
346
|
-
#
|
|
347
302
|
# ```
|
|
348
303
|
def actions(options = {}, &block)
|
|
349
304
|
name = options.delete(:name) { "" }
|
|
350
305
|
defaults = options.delete(:defaults) { true }
|
|
351
|
-
dropdown = options.delete(:dropdown) { false }
|
|
352
|
-
dropdown_name = options.delete(:dropdown_name) { I18n.t "active_admin.dropdown_actions.button_label", default: "Actions" }
|
|
353
|
-
|
|
354
|
-
options[:class] ||= "col-actions"
|
|
355
306
|
|
|
356
307
|
column name, options do |resource|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
instance_exec(resource, &block)
|
|
361
|
-
|
|
362
|
-
else
|
|
363
|
-
table_actions do
|
|
364
|
-
defaults(resource, css_class: :member_link) if defaults
|
|
365
|
-
if block_given?
|
|
366
|
-
block_result = instance_exec(resource, &block)
|
|
367
|
-
text_node block_result unless block_result.is_a? Arbre::Element
|
|
368
|
-
end
|
|
308
|
+
insert_tag(TableActions, class: "data-table-resource-actions") do
|
|
309
|
+
render "index_table_actions_default", defaults_data(resource) if defaults
|
|
310
|
+
if block
|
|
311
|
+
block_result = instance_exec(resource, &block)
|
|
312
|
+
text_node block_result unless block_result.is_a? Arbre::Element
|
|
369
313
|
end
|
|
370
314
|
end
|
|
371
315
|
end
|
|
@@ -373,29 +317,23 @@ module ActiveAdmin
|
|
|
373
317
|
|
|
374
318
|
private
|
|
375
319
|
|
|
376
|
-
def
|
|
320
|
+
def defaults_data(resource)
|
|
377
321
|
localizer = ActiveAdmin::Localizers.resource(active_admin_config)
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
item localizer.t(:delete), resource_path(resource), class: "delete_link #{options[:css_class]}", title: localizer.t(:delete),
|
|
386
|
-
method: :delete, data: { confirm: localizer.t(:delete_confirmation) }
|
|
387
|
-
end
|
|
322
|
+
{
|
|
323
|
+
resource: resource,
|
|
324
|
+
view_label: localizer.t(:view),
|
|
325
|
+
edit_label: localizer.t(:edit),
|
|
326
|
+
delete_label: localizer.t(:delete),
|
|
327
|
+
delete_confirmation_text: localizer.t(:delete_confirmation)
|
|
328
|
+
}
|
|
388
329
|
end
|
|
389
330
|
|
|
390
331
|
class TableActions < ActiveAdmin::Component
|
|
391
|
-
builder_method :table_actions
|
|
392
|
-
|
|
393
332
|
def item *args, **kwargs
|
|
394
333
|
text_node link_to(*args, **kwargs)
|
|
395
334
|
end
|
|
396
335
|
end
|
|
397
336
|
end # IndexTableFor
|
|
398
|
-
|
|
399
337
|
end
|
|
400
338
|
end
|
|
401
339
|
end
|
data/lib/active_admin.rb
CHANGED
|
@@ -7,21 +7,22 @@ require "kaminari"
|
|
|
7
7
|
require "formtastic"
|
|
8
8
|
require "formtastic_i18n"
|
|
9
9
|
require "inherited_resources"
|
|
10
|
-
require "jquery-rails"
|
|
11
10
|
require "arbre"
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
begin
|
|
13
|
+
require "importmap-rails"
|
|
14
|
+
rescue LoadError
|
|
15
|
+
# importmap-rails is optional
|
|
16
|
+
end
|
|
14
17
|
|
|
15
18
|
module ActiveAdmin
|
|
16
19
|
|
|
17
20
|
autoload :VERSION, "active_admin/version"
|
|
18
21
|
autoload :Application, "active_admin/application"
|
|
19
|
-
autoload :AssetRegistration, "active_admin/asset_registration"
|
|
20
22
|
autoload :Authorization, "active_admin/authorization_adapter"
|
|
21
23
|
autoload :AuthorizationAdapter, "active_admin/authorization_adapter"
|
|
22
24
|
autoload :Callbacks, "active_admin/callbacks"
|
|
23
25
|
autoload :Component, "active_admin/component"
|
|
24
|
-
autoload :BaseController, "active_admin/base_controller"
|
|
25
26
|
autoload :CanCanAdapter, "active_admin/cancan_adapter"
|
|
26
27
|
autoload :ControllerAction, "active_admin/controller_action"
|
|
27
28
|
autoload :CSVBuilder, "active_admin/csv_builder"
|
|
@@ -38,30 +39,31 @@ module ActiveAdmin
|
|
|
38
39
|
autoload :OrderClause, "active_admin/order_clause"
|
|
39
40
|
autoload :Page, "active_admin/page"
|
|
40
41
|
autoload :PagePresenter, "active_admin/page_presenter"
|
|
41
|
-
autoload :PageController, "active_admin/page_controller"
|
|
42
42
|
autoload :PageDSL, "active_admin/page_dsl"
|
|
43
43
|
autoload :PunditAdapter, "active_admin/pundit_adapter"
|
|
44
44
|
autoload :Resource, "active_admin/resource"
|
|
45
|
-
autoload :ResourceController, "active_admin/resource_controller"
|
|
46
45
|
autoload :ResourceDSL, "active_admin/resource_dsl"
|
|
47
46
|
autoload :Scope, "active_admin/scope"
|
|
48
47
|
autoload :ScopeChain, "active_admin/helpers/scope_chain"
|
|
49
48
|
autoload :SidebarSection, "active_admin/sidebar_section"
|
|
50
49
|
autoload :TableBuilder, "active_admin/table_builder"
|
|
51
|
-
autoload :ViewFactory, "active_admin/view_factory"
|
|
52
50
|
autoload :ViewHelpers, "active_admin/view_helpers"
|
|
53
51
|
autoload :Views, "active_admin/views"
|
|
54
52
|
|
|
55
53
|
class << self
|
|
56
54
|
|
|
57
|
-
attr_accessor :application
|
|
55
|
+
attr_accessor :application, :importmap
|
|
58
56
|
|
|
59
57
|
def application
|
|
60
58
|
@application ||= ::ActiveAdmin::Application.new
|
|
61
59
|
end
|
|
62
60
|
|
|
63
61
|
def deprecator
|
|
64
|
-
@deprecator ||= ActiveSupport::Deprecation.new("4.
|
|
62
|
+
@deprecator ||= ActiveSupport::Deprecation.new("4.1", "active-admin")
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def importmap
|
|
66
|
+
@importmap ||= Importmap::Map.new
|
|
65
67
|
end
|
|
66
68
|
|
|
67
69
|
# Gets called within the initializer
|
|
@@ -123,13 +125,12 @@ module ActiveAdmin
|
|
|
123
125
|
end
|
|
124
126
|
|
|
125
127
|
# Require things that don't support autoload
|
|
126
|
-
|
|
127
|
-
|
|
128
|
+
require_relative "active_admin/engine"
|
|
129
|
+
require_relative "active_admin/error"
|
|
128
130
|
|
|
129
131
|
# Require internal plugins
|
|
130
|
-
|
|
131
|
-
|
|
132
|
+
require_relative "active_admin/batch_actions"
|
|
133
|
+
require_relative "active_admin/filters"
|
|
132
134
|
|
|
133
135
|
# Require ORM-specific plugins
|
|
134
|
-
|
|
135
|
-
require "active_admin/orm/mongoid" if defined? Mongoid
|
|
136
|
+
require_relative "active_admin/orm/active_record" if defined? ActiveRecord
|
data/lib/activeadmin.rb
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
2
|
+
require_relative "active_admin"
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
module ActiveAdmin
|
|
3
3
|
module Generators
|
|
4
4
|
class AssetsGenerator < Rails::Generators::Base
|
|
5
|
-
|
|
6
5
|
source_root File.expand_path("templates", __dir__)
|
|
7
6
|
|
|
8
7
|
def install_assets
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
remove_file "app/assets/stylesheets/active_admin.scss"
|
|
9
|
+
remove_file "app/assets/javascripts/active_admin.js"
|
|
10
|
+
template "active_admin.css", "app/assets/stylesheets/active_admin.css"
|
|
11
|
+
template "tailwind.config.js", "tailwind-active_admin.config.js"
|
|
11
12
|
end
|
|
12
|
-
|
|
13
13
|
end
|
|
14
14
|
end
|
|
15
15
|
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { execSync } from 'child_process';
|
|
2
|
+
import activeAdminPlugin from '@activeadmin/activeadmin/plugin';
|
|
3
|
+
|
|
4
|
+
const activeAdminPath = execSync('bundle show activeadmin', { encoding: 'utf-8' }).trim();
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
content: [
|
|
8
|
+
`${activeAdminPath}/vendor/javascript/flowbite.js`,
|
|
9
|
+
`${activeAdminPath}/plugin.js`,
|
|
10
|
+
`${activeAdminPath}/app/views/**/*.{arb,erb,html,rb}`,
|
|
11
|
+
'./app/admin/**/*.{arb,erb,html,rb}',
|
|
12
|
+
'./app/views/active_admin/**/*.{arb,erb,html,rb}',
|
|
13
|
+
'./app/views/admin/**/*.{arb,erb,html,rb}',
|
|
14
|
+
'./app/views/layouts/active_admin*.{erb,html}',
|
|
15
|
+
'./app/javascript/**/*.js'
|
|
16
|
+
],
|
|
17
|
+
darkMode: "selector",
|
|
18
|
+
plugins: [
|
|
19
|
+
activeAdminPlugin
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -9,15 +9,13 @@ module ActiveAdmin
|
|
|
9
9
|
|
|
10
10
|
hook_for :users, default: "devise", desc: "Admin user generator to run. Skip with --skip-users"
|
|
11
11
|
class_option :skip_comments, type: :boolean, default: false, desc: "Skip installation of comments"
|
|
12
|
-
class_option :use_webpacker, type: :boolean, default: false, desc: "Use Webpacker assets instead of Sprockets"
|
|
13
12
|
|
|
14
13
|
source_root File.expand_path("templates", __dir__)
|
|
15
14
|
|
|
16
15
|
def copy_initializer
|
|
17
|
-
@underscored_user_name = name.underscore.
|
|
16
|
+
@underscored_user_name = name.underscore.tr("/", "_")
|
|
18
17
|
@use_authentication_method = options[:users].present?
|
|
19
18
|
@skip_comments = options[:skip_comments]
|
|
20
|
-
@use_webpacker = options[:use_webpacker]
|
|
21
19
|
template "active_admin.rb.erb", "config/initializers/active_admin.rb"
|
|
22
20
|
end
|
|
23
21
|
|
|
@@ -39,11 +37,7 @@ module ActiveAdmin
|
|
|
39
37
|
end
|
|
40
38
|
|
|
41
39
|
def create_assets
|
|
42
|
-
|
|
43
|
-
generate "active_admin:webpacker"
|
|
44
|
-
else
|
|
45
|
-
generate "active_admin:assets"
|
|
46
|
-
end
|
|
40
|
+
generate "active_admin:assets"
|
|
47
41
|
end
|
|
48
42
|
|
|
49
43
|
def create_migrations
|
|
@@ -2,22 +2,12 @@ ActiveAdmin.setup do |config|
|
|
|
2
2
|
# == Site Title
|
|
3
3
|
#
|
|
4
4
|
# Set the title that is displayed on the main layout
|
|
5
|
-
# for each of the active admin pages.
|
|
5
|
+
# for each of the active admin pages. Can also be customized
|
|
6
|
+
# by extracting the _site_header partial into your project
|
|
7
|
+
# to use your own logo, styles, etc.
|
|
6
8
|
#
|
|
7
9
|
config.site_title = "<%= Rails.application.class.name.split("::").first.titlecase %>"
|
|
8
10
|
|
|
9
|
-
# Set the link url for the title. For example, to take
|
|
10
|
-
# users to your main site. Defaults to no link.
|
|
11
|
-
#
|
|
12
|
-
# config.site_title_link = "/"
|
|
13
|
-
|
|
14
|
-
# Set an optional image to be displayed for the header
|
|
15
|
-
# instead of a string (overrides :site_title)
|
|
16
|
-
#
|
|
17
|
-
# Note: Aim for an image that's 21px high so it fits in the header.
|
|
18
|
-
#
|
|
19
|
-
# config.site_title_image = "logo.png"
|
|
20
|
-
|
|
21
11
|
# == Load Paths
|
|
22
12
|
#
|
|
23
13
|
# By default Active Admin files go inside app/admin/.
|
|
@@ -78,8 +68,10 @@ ActiveAdmin.setup do |config|
|
|
|
78
68
|
# Active Admin will automatically call an authorization
|
|
79
69
|
# method in a before filter of all controller actions to
|
|
80
70
|
# ensure that there is a user with proper rights. You can use
|
|
81
|
-
# CanCanAdapter or make your own. Please
|
|
71
|
+
# CanCanAdapter, PunditAdapter, or make your own. Please
|
|
72
|
+
# refer to the documentation.
|
|
82
73
|
# config.authorization_adapter = ActiveAdmin::CanCanAdapter
|
|
74
|
+
# config.authorization_adapter = ActiveAdmin::PunditAdapter
|
|
83
75
|
|
|
84
76
|
# In case you prefer Pundit over other solutions you can here pass
|
|
85
77
|
# the name of default policy class. This policy will be used in every
|
|
@@ -116,18 +108,12 @@ ActiveAdmin.setup do |config|
|
|
|
116
108
|
# settings configure the location and method used for the link.
|
|
117
109
|
#
|
|
118
110
|
# This setting changes the path where the link points to. If it's
|
|
119
|
-
# a string, the
|
|
111
|
+
# a string, the string is used as the path. If it's a Symbol, we
|
|
120
112
|
# will call the method to return the path.
|
|
121
113
|
#
|
|
122
114
|
# Default:
|
|
123
115
|
config.logout_link_path = :destroy_<%= @underscored_user_name %>_session_path
|
|
124
116
|
|
|
125
|
-
# This setting changes the http method used when rendering the
|
|
126
|
-
# link. For example :get, :delete, :put, etc..
|
|
127
|
-
#
|
|
128
|
-
# Default:
|
|
129
|
-
# config.logout_link_method = :get
|
|
130
|
-
|
|
131
117
|
# == Root
|
|
132
118
|
#
|
|
133
119
|
# Set the action to call for the root path. You can set different
|
|
@@ -187,23 +173,6 @@ ActiveAdmin.setup do |config|
|
|
|
187
173
|
#
|
|
188
174
|
config.localize_format = :long
|
|
189
175
|
|
|
190
|
-
# == Setting a Favicon
|
|
191
|
-
#
|
|
192
|
-
# config.favicon = 'favicon.ico'
|
|
193
|
-
|
|
194
|
-
# == Meta Tags
|
|
195
|
-
#
|
|
196
|
-
# Add additional meta tags to the head element of active admin pages.
|
|
197
|
-
#
|
|
198
|
-
# Add tags to all pages logged in users see:
|
|
199
|
-
# config.meta_tags = { author: 'My Company' }
|
|
200
|
-
|
|
201
|
-
# By default, sign up/sign in/recover password pages are excluded
|
|
202
|
-
# from showing up in search engine results by adding a robots meta
|
|
203
|
-
# tag. You can reset the hash of meta tags included in logged out
|
|
204
|
-
# pages:
|
|
205
|
-
# config.meta_tags_for_logged_out_pages = {}
|
|
206
|
-
|
|
207
176
|
# == Removing Breadcrumbs
|
|
208
177
|
#
|
|
209
178
|
# Breadcrumbs are enabled by default. You can customize them for individual
|
|
@@ -218,21 +187,6 @@ ActiveAdmin.setup do |config|
|
|
|
218
187
|
#
|
|
219
188
|
# config.create_another = true
|
|
220
189
|
|
|
221
|
-
# == Register Stylesheets & Javascripts
|
|
222
|
-
#
|
|
223
|
-
# We recommend using the built in Active Admin layout and loading
|
|
224
|
-
# up your own stylesheets / javascripts to customize the look
|
|
225
|
-
# and feel.
|
|
226
|
-
#
|
|
227
|
-
# To load a stylesheet:
|
|
228
|
-
# config.register_stylesheet 'my_stylesheet.css'
|
|
229
|
-
#
|
|
230
|
-
# You can provide an options hash for more control, which is passed along to stylesheet_link_tag():
|
|
231
|
-
# config.register_stylesheet 'my_print_stylesheet.css', media: :print
|
|
232
|
-
#
|
|
233
|
-
# To load a javascript file:
|
|
234
|
-
# config.register_javascript 'my_javascript.js'
|
|
235
|
-
|
|
236
190
|
# == CSV options
|
|
237
191
|
#
|
|
238
192
|
# Set the CSV builder separator
|
|
@@ -245,20 +199,11 @@ ActiveAdmin.setup do |config|
|
|
|
245
199
|
#
|
|
246
200
|
# You can add a navigation menu to be used in your application, or configure a provided menu
|
|
247
201
|
#
|
|
248
|
-
# To change the default utility navigation to show a link to your website & a logout btn
|
|
249
|
-
#
|
|
250
|
-
# config.namespace :admin do |admin|
|
|
251
|
-
# admin.build_menu :utility_navigation do |menu|
|
|
252
|
-
# menu.add label: "My Great Website", url: "http://www.mygreatwebsite.com", html_options: { target: :blank }
|
|
253
|
-
# admin.add_logout_button_to_menu menu
|
|
254
|
-
# end
|
|
255
|
-
# end
|
|
256
|
-
#
|
|
257
202
|
# If you wanted to add a static menu item to the default menu provided:
|
|
258
203
|
#
|
|
259
204
|
# config.namespace :admin do |admin|
|
|
260
205
|
# admin.build_menu :default do |menu|
|
|
261
|
-
# menu.add label: "My Great Website", url: "
|
|
206
|
+
# menu.add label: "My Great Website", url: "https://mygreatwebsite.example.com", html_options: { target: "_blank" }
|
|
262
207
|
# end
|
|
263
208
|
# end
|
|
264
209
|
|
|
@@ -274,11 +219,10 @@ ActiveAdmin.setup do |config|
|
|
|
274
219
|
# # Disable the links entirely
|
|
275
220
|
# admin.download_links = false
|
|
276
221
|
#
|
|
277
|
-
# # Only show XML & PDF options
|
|
222
|
+
# # Only show XML & PDF options. You must register the format mime type with `Mime::Type.register`.
|
|
278
223
|
# admin.download_links = [:xml, :pdf]
|
|
279
224
|
#
|
|
280
|
-
# # Enable/disable the links based on block
|
|
281
|
-
# # (for example, with cancan)
|
|
225
|
+
# # Enable/disable the links based on block (for example, with cancan)
|
|
282
226
|
# admin.download_links = proc { can?(:view_download_links) }
|
|
283
227
|
#
|
|
284
228
|
# end
|
|
@@ -322,31 +266,10 @@ ActiveAdmin.setup do |config|
|
|
|
322
266
|
# ]
|
|
323
267
|
# config.filter_method_for_large_association = '_start'
|
|
324
268
|
|
|
325
|
-
# == Head
|
|
326
|
-
#
|
|
327
|
-
# You can add your own content to the site head like analytics. Make sure
|
|
328
|
-
# you only pass content you trust.
|
|
329
|
-
#
|
|
330
|
-
# config.head = ''.html_safe
|
|
331
|
-
|
|
332
|
-
# == Footer
|
|
333
|
-
#
|
|
334
|
-
# By default, the footer shows the current Active Admin version. You can
|
|
335
|
-
# override the content of the footer here.
|
|
336
|
-
#
|
|
337
|
-
# config.footer = 'my custom footer text'
|
|
338
|
-
|
|
339
269
|
# == Sorting
|
|
340
270
|
#
|
|
341
271
|
# By default ActiveAdmin::OrderClause is used for sorting logic
|
|
342
272
|
# You can inherit it with own class and inject it for all resources
|
|
343
273
|
#
|
|
344
274
|
# config.order_clause = MyOrderClause
|
|
345
|
-
|
|
346
|
-
# == Webpacker
|
|
347
|
-
#
|
|
348
|
-
# By default, Active Admin uses Sprocket's asset pipeline.
|
|
349
|
-
# You can switch to using Webpacker here.
|
|
350
|
-
#
|
|
351
|
-
<% unless @use_webpacker %># <% end %>config.use_webpacker = true
|
|
352
275
|
end
|