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
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<div data-test-page-header class="bg-gray-50 border-b p-4 mb-8 flex flex-col gap-4 md:flex-row md:items-center justify-between dark:border-gray-800/50 dark:bg-inherit">
|
|
2
|
+
<div class="flex flex-col gap-3 pt-1">
|
|
3
|
+
<% breadcrumb_links = build_breadcrumb_links(request.path, class: "text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 no-underline") %>
|
|
4
|
+
<% if breadcrumb_links.present? %>
|
|
5
|
+
<nav aria-label="breadcrumb">
|
|
6
|
+
<ol class="flex flex-wrap gap-1 text-sm">
|
|
7
|
+
<% breadcrumb_links.each_with_index do |link, index| %>
|
|
8
|
+
<li class="inline-flex items-center h-5 gap-1">
|
|
9
|
+
<% if index > 0 %>
|
|
10
|
+
<svg class="h-5 w-5 text-gray-300 dark:text-gray-700 flex-shrink-0 rtl:rotate-180" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
|
11
|
+
<path fill-rule="evenodd" d="M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z" clip-rule="evenodd"/>
|
|
12
|
+
</svg>
|
|
13
|
+
<% end %>
|
|
14
|
+
<%= link %>
|
|
15
|
+
</li>
|
|
16
|
+
<% end %>
|
|
17
|
+
</ol>
|
|
18
|
+
</nav>
|
|
19
|
+
<% end %>
|
|
20
|
+
<h2 class="text-2xl font-semibold"><%= title %></h2>
|
|
21
|
+
</div>
|
|
22
|
+
<% if action_items_for_action.present? %>
|
|
23
|
+
<div data-test-action-items class="flex gap-2 flex-wrap lg:justify-end">
|
|
24
|
+
<%= render "active_admin/shared/action_items" %>
|
|
25
|
+
</div>
|
|
26
|
+
<% end %>
|
|
27
|
+
</div>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<div class="text-sm text-center mt-16 mx-8 pt-9 pb-12 text-gray-500 border-t dark:border-gray-800">
|
|
2
|
+
<%= I18n.t(
|
|
3
|
+
"active_admin.powered_by",
|
|
4
|
+
active_admin: link_to("Active Admin", "https://activeadmin.info", class: "text-gray-500 dark:text-gray-500 hover:text-gray-900 dark:hover:text-gray-400 no-underline"),
|
|
5
|
+
version: ActiveAdmin::VERSION
|
|
6
|
+
).html_safe %>
|
|
7
|
+
</div>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<div class="border-b border-gray-200 dark:border-white/10 dark:bg-gray-950/75 px-4 py-2 flex items-center fixed top-0 z-20 h-16 w-full backdrop-blur-md">
|
|
2
|
+
<button class="xl:hidden pe-3 inline-flex items-center w-8 h-8 justify-center text-sm text-gray-500 dark:text-gray-400 focus-visible:outline-none focus-visible:ring-ring focus-visible:bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0" data-drawer-target="main-menu" data-drawer-show="main-menu" aria-controls="main-menu" aria-label="<%= t('active_admin.toggle_main_navigation_menu') %>">
|
|
3
|
+
<svg class="w-5 h-5 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 17 14"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 1h15M1 7h15M1 13h15"/></svg>
|
|
4
|
+
</button>
|
|
5
|
+
|
|
6
|
+
<div class="grow">
|
|
7
|
+
<h1 data-test-site-title class="text-lg font-semibold">
|
|
8
|
+
<%= title %>
|
|
9
|
+
</h1>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<button type="button" class="dark-mode-toggle flex items-center w-9 h-9 justify-center me-1 text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-400 focus:outline-none text-sm" aria-label="<%= t('active_admin.toggle_dark_mode') %>">
|
|
13
|
+
<svg class="hidden dark:block w-5 h-5 rtl:-scale-x-100" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 18 20"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8.509 5.75c0-1.493.394-2.96 1.144-4.25h-.081a8.5 8.5 0 1 0 7.356 12.746A8.5 8.5 0 0 1 8.509 5.75Z"/></svg>
|
|
14
|
+
<svg class="dark:hidden w-5 h-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 3V1m0 18v-2M5.05 5.05 3.636 3.636m12.728 12.728L14.95 14.95M3 10H1m18 0h-2M5.05 14.95l-1.414 1.414M16.364 3.636 14.95 5.05M14 10a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"/></svg>
|
|
15
|
+
</button>
|
|
16
|
+
|
|
17
|
+
<button id="user-menu-button" class="flex items-center w-9 h-9 justify-center text-sm text-gray-500 focus:outline-none dark:text-gray-200" data-dropdown-toggle="user-menu" data-dropdown-offset-distance="3" data-dropdown-placement="bottom-end" aria-label="<%= t('active_admin.toggle_user_menu') %>">
|
|
18
|
+
<svg class="w-7 h-7" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"><path d="M10 0a10 10 0 1 0 10 10A10.011 10.011 0 0 0 10 0Zm0 5a3 3 0 1 1 0 6 3 3 0 0 1 0-6Zm0 13a8.949 8.949 0 0 1-4.951-1.488A3.987 3.987 0 0 1 9 13h2a3.987 3.987 0 0 1 3.951 3.512A8.949 8.949 0 0 1 10 18Z"/></svg>
|
|
19
|
+
</button>
|
|
20
|
+
|
|
21
|
+
<div id="user-menu" class="z-50 hidden min-w-max rounded shadow-lg outline outline-1 outline-black/5 dark:-outline-offset-1 dark:outline-white/10 focus:outline-none py-1 text-sm bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300" aria-labelledby="user-menu-button">
|
|
22
|
+
<ul>
|
|
23
|
+
<% if current_active_admin_user? %>
|
|
24
|
+
<li><%= auto_link current_active_admin_user, class: "block px-2.5 py-2 no-underline text-gray-700 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-white/5 dark:hover:text-white" %></li>
|
|
25
|
+
<li><%= link_to I18n.t("active_admin.logout"), auto_logout_link_path, class: "block px-2.5 py-2 no-underline text-gray-700 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-white/5 dark:hover:text-white", data: { method: :delete } %></li>
|
|
26
|
+
<% end %>
|
|
27
|
+
</ul>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
</div>
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
<div
|
|
2
|
-
<h2
|
|
1
|
+
<div class="p-6 sm:p-8 space-y-4 md:space-y-6 w-full sm:max-w-md bg-white sm:rounded-md shadow dark:border dark:bg-gray-800/50 dark:border-gray-800">
|
|
2
|
+
<h2 class="text-xl font-bold text-gray-900 md:text-2xl dark:text-white">
|
|
3
|
+
<%= active_admin_application.site_title(self) %> <%= set_page_title t('active_admin.devise.resend_confirmation_instructions.title') %>
|
|
4
|
+
</h2>
|
|
3
5
|
|
|
4
6
|
<%= render partial: "active_admin/devise/shared/error_messages", resource: resource %>
|
|
5
7
|
<%= active_admin_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f|
|
|
@@ -7,7 +9,7 @@
|
|
|
7
9
|
f.input :email
|
|
8
10
|
end
|
|
9
11
|
f.actions do
|
|
10
|
-
f.action :submit, label: t('active_admin.devise.resend_confirmation_instructions.submit'), button_html: { value: t('active_admin.devise.resend_confirmation_instructions.submit') }
|
|
12
|
+
f.action :submit, label: t('active_admin.devise.resend_confirmation_instructions.submit'), button_html: { class: "w-full", value: t('active_admin.devise.resend_confirmation_instructions.submit') }
|
|
11
13
|
end
|
|
12
14
|
end %>
|
|
13
15
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
<div
|
|
2
|
-
<h2
|
|
1
|
+
<div class="p-6 sm:p-8 space-y-4 md:space-y-6 w-full sm:max-w-md bg-white sm:rounded-md shadow dark:border dark:bg-gray-800/50 dark:border-gray-800">
|
|
2
|
+
<h2 class="text-xl font-bold text-gray-900 md:text-2xl dark:text-white">
|
|
3
|
+
<%= active_admin_application.site_title(self) %> <%= set_page_title t('active_admin.devise.change_password.title') %>
|
|
4
|
+
</h2>
|
|
3
5
|
|
|
4
6
|
<%= render partial: "active_admin/devise/shared/error_messages", resource: resource %>
|
|
5
7
|
<%= active_admin_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f|
|
|
@@ -9,7 +11,7 @@
|
|
|
9
11
|
f.input :reset_password_token, as: :hidden, input_html: { value: resource.reset_password_token }
|
|
10
12
|
end
|
|
11
13
|
f.actions do
|
|
12
|
-
f.action :submit, label: t('active_admin.devise.change_password.submit'), button_html: { value: t('active_admin.devise.change_password.submit') }
|
|
14
|
+
f.action :submit, label: t('active_admin.devise.change_password.submit'), button_html: { class: "w-full", value: t('active_admin.devise.change_password.submit') }
|
|
13
15
|
end
|
|
14
16
|
end
|
|
15
17
|
%>
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
<div
|
|
2
|
-
<h2
|
|
1
|
+
<div class="p-6 sm:p-8 space-y-4 md:space-y-6 w-full sm:max-w-md bg-white sm:rounded-md shadow dark:border dark:bg-gray-800/50 dark:border-gray-800">
|
|
2
|
+
<h2 class="text-xl font-bold text-gray-900 md:text-2xl dark:text-white">
|
|
3
|
+
<%= active_admin_application.site_title(self) %> <%= set_page_title t('active_admin.devise.reset_password.title') %>
|
|
4
|
+
</h2>
|
|
3
5
|
|
|
4
|
-
<%= render partial: "active_admin/devise/shared/error_messages", resource: resource %>
|
|
5
6
|
<%= active_admin_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f|
|
|
6
7
|
f.inputs do
|
|
7
8
|
f.input :email
|
|
8
9
|
end
|
|
9
10
|
f.actions do
|
|
10
|
-
f.action :submit, label: t('active_admin.devise.reset_password.submit'), button_html: { value: t('active_admin.devise.reset_password.submit') }
|
|
11
|
+
f.action :submit, label: t('active_admin.devise.reset_password.submit'), button_html: { class: "w-full", value: t('active_admin.devise.reset_password.submit') }
|
|
11
12
|
end
|
|
12
13
|
end %>
|
|
13
14
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
<div
|
|
2
|
-
<h2
|
|
1
|
+
<div class="p-6 sm:p-8 space-y-4 md:space-y-6 w-full sm:max-w-md bg-white sm:rounded-md shadow dark:border dark:bg-gray-800/50 dark:border-gray-800">
|
|
2
|
+
<h2 class="text-xl font-bold text-gray-900 md:text-2xl dark:text-white">
|
|
3
|
+
<%= active_admin_application.site_title(self) %> <%= set_page_title t('active_admin.devise.sign_up.title') %>
|
|
4
|
+
</h2>
|
|
3
5
|
|
|
4
6
|
<% scope = Devise::Mapping.find_scope!(resource_name) %>
|
|
5
7
|
<%= render partial: "active_admin/devise/shared/error_messages", resource: resource %>
|
|
6
|
-
<%= active_admin_form_for(resource, as: resource_name, url: send(:"#{scope}_registration_path"), html: { id: "registration_new" }) do |f|
|
|
8
|
+
<%= active_admin_form_for(resource, as: resource_name, url: main_app.send(:"#{scope}_registration_path"), html: { id: "registration_new" }) do |f|
|
|
7
9
|
f.inputs do
|
|
8
10
|
resource.class.authentication_keys.each_with_index { |key, index|
|
|
9
11
|
f.input key, label: t('active_admin.devise.'+key.to_s+'.title'), input_html: { autofocus: index.zero? }
|
|
@@ -12,7 +14,7 @@
|
|
|
12
14
|
f.input :password_confirmation, label: t('active_admin.devise.password_confirmation.title')
|
|
13
15
|
end
|
|
14
16
|
f.actions do
|
|
15
|
-
f.action :submit, label: t('active_admin.devise.login.submit'), button_html: { value: t('active_admin.devise.sign_up.submit') }
|
|
17
|
+
f.action :submit, label: t('active_admin.devise.login.submit'), button_html: { class: "w-full", value: t('active_admin.devise.sign_up.submit') }
|
|
16
18
|
end
|
|
17
19
|
end
|
|
18
20
|
%>
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
<div
|
|
2
|
-
<h2
|
|
1
|
+
<div class="p-6 sm:p-8 space-y-4 md:space-y-6 w-full sm:max-w-md bg-white sm:rounded-md shadow dark:border dark:bg-gray-800/50 dark:border-gray-800">
|
|
2
|
+
<h2 class="text-xl font-bold text-gray-900 md:text-2xl dark:text-white">
|
|
3
|
+
<%= site_title %> <%= set_page_title t('active_admin.devise.login.title') %>
|
|
4
|
+
</h2>
|
|
3
5
|
|
|
4
6
|
<% scope = Devise::Mapping.find_scope!(resource_name) %>
|
|
5
|
-
<%= active_admin_form_for(resource, as: resource_name, url: send(:"#{scope}_session_path")
|
|
7
|
+
<%= active_admin_form_for(resource, as: resource_name, url: main_app.send(:"#{scope}_session_path")) do |f|
|
|
6
8
|
f.inputs do
|
|
7
9
|
resource.class.authentication_keys.each_with_index { |key, index|
|
|
8
10
|
f.input key, label: t("active_admin.devise.#{key}.title"), input_html: { autofocus: index.zero? }
|
|
@@ -11,7 +13,7 @@
|
|
|
11
13
|
f.input :remember_me, label: t('active_admin.devise.login.remember_me'), as: :boolean if devise_mapping.rememberable?
|
|
12
14
|
end
|
|
13
15
|
f.actions do
|
|
14
|
-
f.action :submit, label: t('active_admin.devise.login.submit'), button_html: { value: t('active_admin.devise.login.submit') }
|
|
16
|
+
f.action :submit, label: t('active_admin.devise.login.submit'), wrapper_html: { class: "grow" }, button_html: { class: "w-full", value: t('active_admin.devise.login.submit') }
|
|
15
17
|
end
|
|
16
18
|
end
|
|
17
19
|
%>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
<div class="mt-6 text-sm">
|
|
1
2
|
<%- if controller_name != 'sessions' %>
|
|
2
3
|
<% scope = Devise::Mapping.find_scope!(resource_name) %>
|
|
3
|
-
<%= link_to t('active_admin.devise.links.sign_in'), send(:"new_#{scope}_session_path") %>
|
|
4
|
+
<%= link_to t('active_admin.devise.links.sign_in'), main_app.send(:"new_#{scope}_session_path") %>
|
|
4
5
|
<br>
|
|
5
6
|
<% end -%>
|
|
6
7
|
|
|
@@ -31,3 +32,4 @@
|
|
|
31
32
|
<br>
|
|
32
33
|
<% end -%>
|
|
33
34
|
<% end -%>
|
|
35
|
+
</div>
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
<div
|
|
2
|
-
<h2
|
|
1
|
+
<div class="p-6 sm:p-8 space-y-4 md:space-y-6 w-full sm:max-w-md bg-white sm:rounded-md shadow dark:border dark:bg-gray-800/50 dark:border-gray-800">
|
|
2
|
+
<h2 class="text-xl font-bold text-gray-900 md:text-2xl dark:text-white">
|
|
3
|
+
<%= site_title %> <%= set_page_title t('active_admin.devise.unlock.title') %>
|
|
4
|
+
</h2>
|
|
3
5
|
|
|
4
6
|
<%= render partial: "active_admin/devise/shared/error_messages", resource: resource %>
|
|
5
7
|
<%= active_admin_form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f|
|
|
@@ -7,9 +9,9 @@
|
|
|
7
9
|
f.input :email
|
|
8
10
|
end
|
|
9
11
|
f.actions do
|
|
10
|
-
f.action :submit, label: t('active_admin.devise.unlock.submit'), button_html: { value: t('active_admin.devise.unlock.submit') }
|
|
12
|
+
f.action :submit, label: t('active_admin.devise.unlock.submit'), button_html: { class: "w-full", value: t('active_admin.devise.unlock.submit') }
|
|
11
13
|
end
|
|
12
14
|
end %>
|
|
13
15
|
|
|
14
|
-
<%= render partial: "active_admin/devise/shared/links" %>
|
|
16
|
+
<%= render partial: "active_admin/devise/shared/links" %>
|
|
15
17
|
</div>
|
|
@@ -5,4 +5,6 @@
|
|
|
5
5
|
per_page: number of items to fetch per page
|
|
6
6
|
remote: data-remote
|
|
7
7
|
-%>
|
|
8
|
-
<span class="
|
|
8
|
+
<span class="flex items-center justify-center px-2.5 py-3 h-8 leading-tight text-gray-500 dark:text-gray-400">
|
|
9
|
+
<%= t('active_admin.pagination.truncate').html_safe %>
|
|
10
|
+
</span>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<%# Link to the "Next" page
|
|
2
|
+
- available local variables
|
|
3
|
+
url: url to the next page
|
|
4
|
+
current_page: a page object for the currently displayed page
|
|
5
|
+
total_pages: total number of pages
|
|
6
|
+
per_page: number of items to fetch per page
|
|
7
|
+
remote: data-remote
|
|
8
|
+
-%>
|
|
9
|
+
<% unless current_page.last? %>
|
|
10
|
+
<%= link_to url, rel: 'next', remote: remote, class: "flex items-center justify-center px-2.5 py-3 h-8 leading-tight text-gray-500 dark:text-gray-400 hover:bg-gray-100 hover:text-gray-700 dark:hover:bg-gray-800 dark:hover:text-white rounded no-underline" do %>
|
|
11
|
+
<span class="sr-only"><%= t('active_admin.pagination.next') %></span>
|
|
12
|
+
<svg class="w-2.5 h-2.5 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 6 10">
|
|
13
|
+
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 9 4-4-4-4"/>
|
|
14
|
+
</svg>
|
|
15
|
+
<% end %>
|
|
16
|
+
<% end %>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<%# Link showing page number
|
|
2
|
+
- available local variables
|
|
3
|
+
page: a page object for "this" page
|
|
4
|
+
url: url to this page
|
|
5
|
+
current_page: a page object for the currently displayed page
|
|
6
|
+
total_pages: total number of pages
|
|
7
|
+
per_page: number of items to fetch per page
|
|
8
|
+
remote: data-remote
|
|
9
|
+
-%>
|
|
10
|
+
<% if page.current? %>
|
|
11
|
+
<%= link_to page, url, { remote: remote, rel: page.rel, class: "flex items-center justify-center px-2.5 py-3 h-8 leading-tight text-white bg-blue-500 dark:text-white dark:bg-blue-600 hover:bg-blue-500 hover:text-white dark:hover:bg-blue-600 dark:hover:text-white rounded no-underline" } %>
|
|
12
|
+
<% else %>
|
|
13
|
+
<%= link_to page, url, { remote: remote, rel: page.rel, class: "flex items-center justify-center px-2.5 py-3 h-8 leading-tight text-gray-500 dark:text-gray-400 hover:bg-gray-100 hover:text-gray-700 dark:hover:bg-gray-800 dark:hover:text-white rounded no-underline" } %>
|
|
14
|
+
<% end %>
|
data/app/views/{kaminari/active_admin_countless → active_admin/kaminari}/_paginator.html.erb
RENAMED
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
paginator: the paginator that renders the pagination tags inside
|
|
8
8
|
-%>
|
|
9
9
|
<%= paginator.render do -%>
|
|
10
|
-
<nav class="
|
|
11
|
-
<%= first_page_tag unless current_page.first? %>
|
|
10
|
+
<nav data-test-pagination class="inline-flex flex-wrap -space-x-px text-sm gap-1">
|
|
12
11
|
<%= prev_page_tag unless current_page.first? %>
|
|
13
12
|
<% each_page do |page| -%>
|
|
14
13
|
<% if page.display_tag? -%>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<%# Link to the "Previous" page
|
|
2
|
+
- available local variables
|
|
3
|
+
url: url to the previous page
|
|
4
|
+
current_page: a page object for the currently displayed page
|
|
5
|
+
total_pages: total number of pages
|
|
6
|
+
per_page: number of items to fetch per page
|
|
7
|
+
remote: data-remote
|
|
8
|
+
-%>
|
|
9
|
+
<% unless current_page.first? %>
|
|
10
|
+
<%= link_to url, rel: 'prev', remote: remote, class: "flex items-center justify-center px-2.5 py-3 h-8 leading-tight text-gray-500 dark:text-gray-400 hover:bg-gray-100 hover:text-gray-700 dark:hover:bg-gray-800 dark:hover:text-white rounded no-underline" do %>
|
|
11
|
+
<span class="sr-only"><%= t('active_admin.pagination.previous') %></span>
|
|
12
|
+
<svg class="w-2.5 h-2.5 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 6 10">
|
|
13
|
+
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 1 1 5l4 4"/>
|
|
14
|
+
</svg>
|
|
15
|
+
<% end %>
|
|
16
|
+
<% end %>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<div class="active-filters">
|
|
2
|
+
<h3 class="active-filters-title">
|
|
3
|
+
<% if current_scope %>
|
|
4
|
+
<%= I18n.t("active_admin.search_status.title_with_scope", name: scope_name(current_scope)) %>
|
|
5
|
+
<% else %>
|
|
6
|
+
<%= I18n.t("active_admin.search_status.title") %>
|
|
7
|
+
<% end %>
|
|
8
|
+
</h3>
|
|
9
|
+
<ul class="active-filters-list">
|
|
10
|
+
<% if active_filters.all_blank? %>
|
|
11
|
+
<li><%= I18n.t("active_admin.search_status.no_current_filters") %></li>
|
|
12
|
+
<% else %>
|
|
13
|
+
<% active_filters.filters.each do |filter| %>
|
|
14
|
+
<%= content_tag :li, filter.html_options do %>
|
|
15
|
+
<span>
|
|
16
|
+
<%= filter.label %>
|
|
17
|
+
<strong><%= to_sentence(filter.values.map { |v| pretty_format(v) }) %></strong>
|
|
18
|
+
</span>
|
|
19
|
+
<% end %>
|
|
20
|
+
<% end %>
|
|
21
|
+
<% active_filters.scopes.each do |name, value| %>
|
|
22
|
+
<% filter_name = name.gsub(/_eq$/, "") %>
|
|
23
|
+
<% filter = active_admin_config.filters[filter_name.to_sym] %>
|
|
24
|
+
<% label = filter.try(:[], :label) || filter_name.titleize %>
|
|
25
|
+
<li data-filter="<%= name %>">
|
|
26
|
+
<span><%= "#{label} #{Ransack::Translate.predicate('eq')}" %></span>
|
|
27
|
+
<strong><%= value %></strong>
|
|
28
|
+
</li>
|
|
29
|
+
<% end %>
|
|
30
|
+
<% end %>
|
|
31
|
+
</ul>
|
|
32
|
+
</div>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<% if batch_actions_to_display.any? %>
|
|
2
|
+
<div class="batch-actions-dropdown">
|
|
3
|
+
<button type="button" class="batch-actions-dropdown-toggle" data-dropdown-toggle="batch-action-menu" disabled data-dropdown-offset-distance="5" data-dropdown-placement="bottom-start">
|
|
4
|
+
<%= I18n.t("active_admin.batch_actions.button_label") %>
|
|
5
|
+
<svg class="batch-actions-dropdown-arrow" aria-hidden="true" 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>
|
|
6
|
+
</button>
|
|
7
|
+
<ul class="batch-actions-dropdown-menu" id="batch-action-menu">
|
|
8
|
+
<% batch_actions_to_display.each do |batch_action| %>
|
|
9
|
+
<li>
|
|
10
|
+
<% confirmation_text = render_or_call_method_or_proc_on(self, batch_action.confirm) %>
|
|
11
|
+
<% default_title = render_or_call_method_or_proc_on(self, batch_action.title) %>
|
|
12
|
+
<% title = I18n.t("active_admin.batch_actions.labels.#{batch_action.sym}", default: default_title) %>
|
|
13
|
+
<% label = I18n.t("active_admin.batch_actions.action_label", title: title) %>
|
|
14
|
+
<%= link_to(label, "#", batch_action.link_html_options.merge(data: { action: batch_action.sym, confirm: confirmation_text.presence, batch_action_item: "" })) %>
|
|
15
|
+
</li>
|
|
16
|
+
<% end %>
|
|
17
|
+
</ul>
|
|
18
|
+
</div>
|
|
19
|
+
<% end %>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
div class: "main-content-container" do
|
|
2
|
+
if page_presenter.block
|
|
3
|
+
options = {
|
|
4
|
+
url: resource.persisted? ? resource_path(resource) : collection_path,
|
|
5
|
+
as: active_admin_config.param_key
|
|
6
|
+
}
|
|
7
|
+
options.merge!(page_presenter.options)
|
|
8
|
+
|
|
9
|
+
active_admin_form_for(resource, options, &page_presenter.block)
|
|
10
|
+
elsif page_presenter.options[:partial].present?
|
|
11
|
+
render page_presenter.options[:partial]
|
|
12
|
+
else
|
|
13
|
+
render "form_default"
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
options = {
|
|
2
|
+
url: resource.persisted? ? resource_path(resource) : collection_path,
|
|
3
|
+
as: active_admin_config.param_key
|
|
4
|
+
}
|
|
5
|
+
options.merge!(page_presenter.options)
|
|
6
|
+
|
|
7
|
+
active_admin_form_for(resource, options) do |f|
|
|
8
|
+
f.semantic_errors # show errors on :base by default
|
|
9
|
+
f.inputs
|
|
10
|
+
f.actions
|
|
11
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<div class="w-full rounded-lg border-2 border-dashed border-gray-300 hover:border-gray-400 dark:border-gray-700 dark:hover:border-gray-600 px-6 py-12 text-center">
|
|
2
|
+
<h2 class="block mb-4 only:mb-0 font-semibold leading-6 text-gray-900 dark:text-gray-200">
|
|
3
|
+
<%= I18n.t("active_admin.blank_slate.content", resource_name: active_admin_config.plural_resource_label) %>
|
|
4
|
+
</h2>
|
|
5
|
+
<% if new_action_authorized?(active_admin_config.resource_class) %>
|
|
6
|
+
<%= if page_presenter.options.has_key?(:blank_slate_link)
|
|
7
|
+
link = page_presenter.options[:blank_slate_link]
|
|
8
|
+
instance_exec(&link) if link.is_a?(Proc)
|
|
9
|
+
else
|
|
10
|
+
link_to(I18n.t("active_admin.blank_slate.link"), new_resource_path)
|
|
11
|
+
end
|
|
12
|
+
%>
|
|
13
|
+
<% end %>
|
|
14
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<div class="w-full rounded-lg border-2 border-dashed border-gray-300 hover:border-gray-400 dark:border-gray-700 dark:hover:border-gray-600 px-6 py-12 text-center min-h-20">
|
|
2
|
+
<h2 class="block mb-4 only:mb-0 font-semibold leading-6 text-gray-900 dark:text-gray-200">
|
|
3
|
+
<%= I18n.t("active_admin.pagination.empty", model: active_admin_config.plural_resource_label) %>
|
|
4
|
+
</h2>
|
|
5
|
+
</div>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<% if show_action_authorized?(resource) %>
|
|
2
|
+
<%= link_to view_label, resource_path(resource) %>
|
|
3
|
+
<% end %>
|
|
4
|
+
<% if edit_action_authorized?(resource) %>
|
|
5
|
+
<%= link_to edit_label, edit_resource_path(resource) %>
|
|
6
|
+
<% end %>
|
|
7
|
+
<% if destroy_action_authorized?(resource) %>
|
|
8
|
+
<%= link_to delete_label, resource_path(resource), method: :delete, data: { confirm: delete_confirmation_text } %>
|
|
9
|
+
<% end %>
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
insert_tag renderer_for(:edit)
|
|
1
|
+
render "form"
|
|
@@ -1,2 +1,94 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
def wrap_with_batch_action_form(&block)
|
|
2
|
+
if active_admin_config.batch_actions.any?
|
|
3
|
+
insert_tag(ActiveAdmin::BatchActions::BatchActionForm, &block)
|
|
4
|
+
batch_actions_to_display.each do |batch_action|
|
|
5
|
+
if batch_action.partial.present?
|
|
6
|
+
render(batch_action.partial)
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
else
|
|
10
|
+
block.call
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def build_collection
|
|
15
|
+
if collection_empty?(collection)
|
|
16
|
+
if params[:q] || params[:scope]
|
|
17
|
+
render("active_admin/resource/index_empty_results")
|
|
18
|
+
else
|
|
19
|
+
render("active_admin/resource/index_blank_slate")
|
|
20
|
+
end
|
|
21
|
+
else
|
|
22
|
+
render_index
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def build_table_tools
|
|
27
|
+
div class: "index-data-table-toolbar" do
|
|
28
|
+
render "batch_actions_dropdown"
|
|
29
|
+
build_scopes
|
|
30
|
+
build_index_list
|
|
31
|
+
end if any_table_tools?
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def any_table_tools?
|
|
35
|
+
active_admin_config.batch_actions.any? ||
|
|
36
|
+
active_admin_config.scopes.any? ||
|
|
37
|
+
active_admin_config.page_presenters[:index].try(:size).try(:>, 1)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def build_scopes
|
|
41
|
+
if active_admin_config.scopes.any?
|
|
42
|
+
scope_options = { scope_count: page_presenter.fetch(:scope_count, true) }
|
|
43
|
+
insert_tag(ActiveAdmin::Views::Scopes, active_admin_config.scopes, scope_options)
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def build_index_list
|
|
48
|
+
indexes = active_admin_config.page_presenters[:index]
|
|
49
|
+
|
|
50
|
+
if indexes.kind_of?(Hash) && indexes.length > 1
|
|
51
|
+
index_classes = []
|
|
52
|
+
active_admin_config.page_presenters[:index].each do |type, page_presenter|
|
|
53
|
+
index_classes << find_index_renderer_class(page_presenter[:as])
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
insert_tag(ActiveAdmin::Views::IndexList, index_classes)
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Returns the actual class for rendering the main content on the index
|
|
61
|
+
# page. To set this, use the :as option in the page_presenter block.
|
|
62
|
+
def find_index_renderer_class(klass)
|
|
63
|
+
if klass.is_a?(Class)
|
|
64
|
+
klass
|
|
65
|
+
else
|
|
66
|
+
::ActiveAdmin::Views.const_get("IndexAs" + klass.to_s.camelcase)
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def render_index
|
|
71
|
+
renderer_class = find_index_renderer_class(page_presenter[:as])
|
|
72
|
+
|
|
73
|
+
paginator = page_presenter.fetch(:paginator, true)
|
|
74
|
+
download_links = page_presenter.fetch(:download_links, active_admin_config.namespace.download_links)
|
|
75
|
+
pagination_total = page_presenter.fetch(:pagination_total, true)
|
|
76
|
+
per_page = page_presenter.fetch(:per_page, active_admin_config.per_page)
|
|
77
|
+
|
|
78
|
+
paginated_collection(
|
|
79
|
+
collection, entry_name: active_admin_config.resource_label,
|
|
80
|
+
entries_name: active_admin_config.plural_resource_label(count: collection_size),
|
|
81
|
+
download_links: download_links,
|
|
82
|
+
paginator: paginator,
|
|
83
|
+
per_page: per_page,
|
|
84
|
+
pagination_total: pagination_total) do
|
|
85
|
+
insert_tag(renderer_class, page_presenter, collection)
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
div class: "main-content-container" do
|
|
90
|
+
wrap_with_batch_action_form do
|
|
91
|
+
build_table_tools
|
|
92
|
+
build_collection
|
|
93
|
+
end
|
|
94
|
+
end
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
insert_tag renderer_for(:new)
|
|
1
|
+
render "form"
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
def attributes_table(*args, &block)
|
|
2
|
+
attributes_table_for resource, *args, &block
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
div class: "main-content-container" do
|
|
6
|
+
if page_presenter.block
|
|
7
|
+
# Evaluate the show config from the controller
|
|
8
|
+
instance_exec resource, &page_presenter.block
|
|
9
|
+
else
|
|
10
|
+
render "show_default"
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<div class="max-w-[700px]">
|
|
2
|
+
<div class="font-bold py-3 border-b dark:border-gray-600">
|
|
3
|
+
<%= ActiveAdmin::Comment.model_name.human(count: 2.1) %>
|
|
4
|
+
</div>
|
|
5
|
+
<% if authorized?(ActiveAdmin::Auth::NEW, ActiveAdmin::Comment) %>
|
|
6
|
+
<%= active_admin_form_for(ActiveAdmin::Comment.new, url: comment_form_url, html: { class: "mb-12 max-w-[700px]", novalidate: false }) do |f|
|
|
7
|
+
f.inputs do
|
|
8
|
+
f.input :resource_type, as: :hidden, input_html: { value: ActiveAdmin::Comment.resource_type(resource) }
|
|
9
|
+
f.input :resource_id, as: :hidden, input_html: { value: resource.id }
|
|
10
|
+
f.input :body, label: false, input_html: { size: "80x4", required: true }
|
|
11
|
+
end
|
|
12
|
+
f.actions do
|
|
13
|
+
f.action :submit, label: I18n.t("active_admin.comments.add")
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
%>
|
|
17
|
+
<% end %>
|
|
18
|
+
<div class="font-bold py-3 border-b dark:border-gray-600">
|
|
19
|
+
<%= I18n.t "active_admin.comments.title_content", count: comments.total_count %>
|
|
20
|
+
</div>
|
|
21
|
+
<% if comments.any? %>
|
|
22
|
+
<% comments.each do |comment| %>
|
|
23
|
+
<div class="border-b dark:border-gray-600 py-6 max-w-[700px]" id="<%= dom_id(comment, :active_admin) %>" data-test-comment-container>
|
|
24
|
+
<div class="flex gap-4 items-end mb-2">
|
|
25
|
+
<span class="font-semibold">
|
|
26
|
+
<%= comment.author ? auto_link(comment.author) : I18n.t("active_admin.comments.author_missing") %>
|
|
27
|
+
</span>
|
|
28
|
+
<span class="text-xs text-gray-500 dark:text-gray-400">
|
|
29
|
+
<%= pretty_format comment.created_at %>
|
|
30
|
+
</span>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="mb-4 break-keep">
|
|
33
|
+
<%= simple_format(comment.body) %>
|
|
34
|
+
</div>
|
|
35
|
+
<% if authorized?(ActiveAdmin::Auth::DESTROY, comment) %>
|
|
36
|
+
<%= link_to I18n.t("active_admin.comments.delete"), url_for_comments(comment.id), method: :delete, data: { confirm: I18n.t("active_admin.comments.delete_confirmation") } %>
|
|
37
|
+
<% end %>
|
|
38
|
+
</div>
|
|
39
|
+
<% end %>
|
|
40
|
+
<div class="p-2 lg:p-4 flex flex-col-reverse lg:flex-row gap-4 items-center justify-between">
|
|
41
|
+
<div>
|
|
42
|
+
<%= page_entries_info(comments).html_safe %>
|
|
43
|
+
</div>
|
|
44
|
+
<%= paginate(comments, views_prefix: :active_admin, outer_window: 1, window: 2) %>
|
|
45
|
+
</div>
|
|
46
|
+
<% else %>
|
|
47
|
+
<div class="p-8 text-center">
|
|
48
|
+
<%= I18n.t("active_admin.comments.no_comments_yet") %>
|
|
49
|
+
</div>
|
|
50
|
+
<% end %>
|
|
51
|
+
</div>
|