activeadmin 3.2.4 → 4.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activeadmin might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -69
- data/CONTRIBUTING.md +25 -108
- data/README.md +19 -32
- data/app/assets/config/active_admin_manifest.js +2 -0
- 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 +2 -2
- data/{lib → app/controllers}/active_admin/resource_controller/scoping.rb +1 -1
- data/{lib → app/controllers}/active_admin/resource_controller/streaming.rb +2 -2
- 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 +89 -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 -1
- 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 +16 -0
- data/app/views/active_admin/resource/_form_default.html.arb +12 -0
- data/app/views/active_admin/resource/_index_as_table_default.html.arb +9 -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 +3 -0
- data/app/views/active_admin/resource/edit.html.arb +1 -1
- data/app/views/active_admin/resource/index.html.arb +94 -1
- data/app/views/active_admin/resource/new.html.arb +1 -1
- data/app/views/active_admin/resource/show.html.arb +12 -1
- 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 +7 -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/locales/ar.yml +0 -16
- data/config/locales/az.yml +0 -16
- data/config/locales/bg.yml +0 -9
- data/config/locales/bs.yml +0 -7
- data/config/locales/ca.yml +0 -9
- data/config/locales/cs.yml +0 -9
- data/config/locales/da.yml +0 -16
- data/config/locales/de-CH.yml +0 -10
- data/config/locales/de.yml +0 -16
- data/config/locales/el.yml +0 -13
- data/config/locales/en-CA.yml +0 -16
- data/config/locales/en-GB.yml +0 -16
- data/config/locales/en.yml +18 -28
- data/config/locales/eo.yml +0 -17
- data/config/locales/es-MX.yml +0 -9
- data/config/locales/es.yml +0 -16
- data/config/locales/fa.yml +0 -9
- data/config/locales/fi.yml +0 -9
- data/config/locales/fr.yml +32 -26
- data/config/locales/he.yml +0 -16
- data/config/locales/hr.yml +0 -9
- data/config/locales/hu.yml +0 -6
- data/config/locales/id.yml +0 -16
- data/config/locales/it.yml +0 -16
- data/config/locales/ja.yml +0 -16
- data/config/locales/ko.yml +0 -9
- data/config/locales/lt.yml +0 -16
- data/config/locales/lv.yml +0 -6
- data/config/locales/mk.yml +0 -15
- data/config/locales/nb.yml +0 -12
- data/config/locales/nl.yml +21 -29
- data/config/locales/pl.yml +0 -16
- data/config/locales/pt-BR.yml +0 -16
- data/config/locales/pt-PT.yml +0 -6
- data/config/locales/ro.yml +0 -6
- data/config/locales/ru.yml +0 -16
- data/config/locales/sk.yml +0 -16
- data/config/locales/sv-SE.yml +0 -16
- data/config/locales/tr.yml +0 -16
- data/config/locales/uk.yml +0 -16
- data/config/locales/vi.yml +0 -16
- data/config/locales/zh-CN.yml +0 -16
- data/config/locales/zh-TW.yml +0 -16
- data/lib/active_admin/application.rb +1 -9
- data/lib/active_admin/batch_actions/controller.rb +1 -4
- data/lib/active_admin/batch_actions/resource_extension.rb +6 -13
- data/lib/active_admin/batch_actions/views/batch_action_form.rb +0 -6
- data/lib/active_admin/batch_actions/views/selection_cells.rb +2 -2
- data/lib/active_admin/batch_actions.rb +0 -5
- data/lib/active_admin/callbacks.rb +6 -4
- data/lib/active_admin/component.rb +0 -1
- data/lib/active_admin/csv_builder.rb +1 -1
- data/lib/active_admin/devise.rb +3 -3
- data/lib/active_admin/dsl.rb +2 -2
- data/lib/active_admin/dynamic_settings_node.rb +4 -4
- data/lib/active_admin/engine.rb +19 -6
- data/lib/active_admin/filters/active.rb +6 -4
- data/lib/active_admin/filters/active_filter.rb +1 -3
- data/lib/active_admin/filters/forms.rb +1 -42
- data/lib/active_admin/filters/resource_extension.rb +17 -9
- data/lib/active_admin/filters.rb +0 -2
- data/lib/active_admin/form_builder.rb +15 -14
- data/lib/active_admin/inputs/filters/base/search_method_select.rb +8 -10
- 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/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 +2 -44
- data/lib/active_admin/namespace_settings.rb +2 -35
- data/lib/active_admin/order_clause.rb +4 -1
- data/lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb +3 -75
- data/lib/active_admin/orm/active_record/comments.rb +10 -5
- data/lib/active_admin/pundit_adapter.rb +1 -1
- data/lib/active_admin/resource/action_items.rb +15 -20
- data/lib/active_admin/resource/attributes.rb +1 -8
- data/lib/active_admin/resource/naming.rb +1 -2
- data/lib/active_admin/resource.rb +1 -0
- data/lib/active_admin/resource_dsl.rb +1 -1
- data/lib/active_admin/scope.rb +1 -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.rb +0 -12
- data/lib/active_admin/views/components/active_admin_form.rb +21 -29
- data/lib/active_admin/views/components/attributes_table.rb +4 -12
- 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 +2 -10
- data/lib/active_admin/views/components/scopes.rb +12 -21
- data/lib/active_admin/views/components/status_tag.rb +22 -19
- data/lib/active_admin/views/components/table_for.rb +19 -24
- data/lib/active_admin/views/components/tabs.rb +10 -11
- data/lib/active_admin/views/index_as_table.rb +24 -97
- data/lib/active_admin.rb +7 -11
- 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 +18 -0
- 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 +46 -7
- data/lib/generators/active_admin/resource/templates/resource.rb.erb +42 -0
- data/lib/generators/active_admin/views_generator.rb +18 -0
- metadata +67 -214
- data/app/assets/javascripts/active_admin/base.js +0 -521
- 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/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/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/base_controller/authorization.rb +0 -0
- /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,28 @@
|
|
1
|
+
import Rails from '@rails/ujs';
|
2
|
+
|
3
|
+
const hasManyRemoveClick = function(event) {
|
4
|
+
event.preventDefault()
|
5
|
+
const oldGroup = this.closest("fieldset")
|
6
|
+
if (oldGroup) {
|
7
|
+
oldGroup.remove()
|
8
|
+
}
|
9
|
+
}
|
10
|
+
|
11
|
+
Rails.delegate(document, "form .has-many-remove", "click", hasManyRemoveClick)
|
12
|
+
|
13
|
+
const hasManyAddClick = function(event) {
|
14
|
+
event.preventDefault()
|
15
|
+
const parent = this.closest(".has-many-container")
|
16
|
+
|
17
|
+
let index = parseInt(parent.dataset.has_many_index || (parent.querySelectorAll('fieldset').length - 1), 10)
|
18
|
+
parent.dataset.has_many_index = ++index
|
19
|
+
|
20
|
+
const regex = new RegExp(this.dataset.placeholder, 'g')
|
21
|
+
const html = this.dataset.html.replace(regex, index)
|
22
|
+
|
23
|
+
const tempEl = document.createElement("div");
|
24
|
+
tempEl.innerHTML = html
|
25
|
+
this.before(tempEl.firstChild)
|
26
|
+
}
|
27
|
+
|
28
|
+
Rails.delegate(document, "form .has-many-add", "click", hasManyAddClick)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import Rails from '@rails/ujs';
|
2
|
+
|
3
|
+
const toggleMenu = function(event) {
|
4
|
+
const parent = this.parentNode
|
5
|
+
if (!("open" in parent.dataset)) {
|
6
|
+
parent.dataset.open = ""
|
7
|
+
} else {
|
8
|
+
delete parent.dataset.open
|
9
|
+
}
|
10
|
+
}
|
11
|
+
|
12
|
+
Rails.delegate(document, "#main-menu [data-menu-button]", "click", toggleMenu)
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import Rails from '@rails/ujs';
|
2
|
+
|
3
|
+
const setPerPage = function(event) {
|
4
|
+
const params = new URLSearchParams(window.location.search)
|
5
|
+
params.set("per_page", this.value)
|
6
|
+
window.location.search = params
|
7
|
+
}
|
8
|
+
|
9
|
+
Rails.delegate(document, ".pagination-per-page", "change", setPerPage)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
const nextSibling = function next(element, selector) {
|
2
|
+
let sibling = element.nextElementSibling;
|
3
|
+
|
4
|
+
if (!selector) {
|
5
|
+
return sibling;
|
6
|
+
}
|
7
|
+
|
8
|
+
while (sibling) {
|
9
|
+
if (sibling && sibling.matches(selector)) {
|
10
|
+
return sibling;
|
11
|
+
}
|
12
|
+
|
13
|
+
sibling = sibling.nextElementSibling;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
export { nextSibling }
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import "flowbite"
|
2
|
+
import Rails from "@rails/ujs"
|
3
|
+
import "active_admin/features/batch_actions"
|
4
|
+
import "active_admin/features/dark_mode_toggle"
|
5
|
+
import "active_admin/features/has_many"
|
6
|
+
import "active_admin/features/filters"
|
7
|
+
import "active_admin/features/main_menu"
|
8
|
+
import "active_admin/features/per_page"
|
9
|
+
|
10
|
+
Rails.start()
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<% if flash_messages.present? %>
|
2
|
+
<div class="px-2.5 lg:px-5 mb-8">
|
3
|
+
<% flash_messages.each do |type, message| %>
|
4
|
+
<% if type == "error" %>
|
5
|
+
<div class="flex items-center gap-3 p-4 mb-2 rounded-lg bg-red-50 text-red-800 dark:bg-red-800 dark:text-red-300">
|
6
|
+
<svg class="w-5 h-5 shrink-0" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"><path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM10 15a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm1-4a1 1 0 0 1-2 0V6a1 1 0 0 1 2 0v5Z"/></svg>
|
7
|
+
<%= message %>
|
8
|
+
</div>
|
9
|
+
<% elsif type == "alert" %>
|
10
|
+
<div class="flex items-center gap-3 p-4 mb-2 rounded-lg bg-yellow-50 text-yellow-800 dark:bg-yellow-800 dark:text-yellow-300">
|
11
|
+
<svg class="w-5 h-5 shrink-0 rtl:-scale-x-100" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"><path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"/></svg>
|
12
|
+
<%= message %>
|
13
|
+
</div>
|
14
|
+
<% elsif type == "notice" %>
|
15
|
+
<div class="flex items-center gap-3 p-4 mb-2 rounded-lg bg-green-50 text-green-800 dark:bg-green-800 dark:text-green-400">
|
16
|
+
<svg class="w-5 h-5 shrink-0 rtl:-scale-x-100" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"><path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5Zm3.707 8.207-4 4a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L9 10.586l3.293-3.293a1 1 0 0 1 1.414 1.414Z"/></svg>
|
17
|
+
<%= message %>
|
18
|
+
</div>
|
19
|
+
<% end %>
|
20
|
+
<% end %>
|
21
|
+
</div>
|
22
|
+
<% end %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%= stylesheet_link_tag "active_admin" %>
|
2
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
3
|
+
<%= csrf_meta_tags %>
|
4
|
+
<%= csp_meta_tag %>
|
5
|
+
<% # On page load or when changing themes, best to add inline in `head` to avoid FOUC %>
|
6
|
+
<%= javascript_tag nonce: true do %>
|
7
|
+
if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
8
|
+
document.documentElement.classList.add('dark')
|
9
|
+
} else {
|
10
|
+
document.documentElement.classList.remove('dark')
|
11
|
+
}
|
12
|
+
<% end %>
|
13
|
+
<%= javascript_importmap_tags "active_admin", importmap: ActiveAdmin.importmap %>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<div id="main-menu" class="fixed top-0 xl:top-16 bottom-0 start-0 z-40 w-72 xl:w-60 p-4 overflow-y-auto transition-transform duration-200 -translate-x-full xl:translate-x-0 bg-white dark:bg-gray-950 xl:border-e xl:border-gray-200 xl:dark:border-white/10" tabindex="-1" aria-labelledby="drawer-navigation-label">
|
2
|
+
<ul role="list" class="flex flex-1 flex-col space-y-1.5">
|
3
|
+
<% current_menu.items(self).each do |item| %>
|
4
|
+
<% children = item.items(self).presence %>
|
5
|
+
<li <%= current_menu_item?(item) && "data-open" %> class="group" data-item-id="<%= item.id %>">
|
6
|
+
<% if children %>
|
7
|
+
<button data-menu-button class="text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white flex items-center w-full rounded-md p-2 gap-x-2 text-sm">
|
8
|
+
<%= item.label(self) %>
|
9
|
+
<svg class="group-data-[open]:rotate-90 group-data-[open]:rtl:-rotate-90 ms-auto h-5 w-5 shrink-0 rtl:-scale-x-100" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
10
|
+
<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" />
|
11
|
+
</svg>
|
12
|
+
</button>
|
13
|
+
<ul role="list" class="mt-1 space-y-1 hidden group-data-[open]:block">
|
14
|
+
<% children.each do |j| %>
|
15
|
+
<li data-item-id="<%= j.id %>">
|
16
|
+
<%= link_to j.label(self), j.url(self), j.html_options.merge(class: "text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white block rounded-md py-1.5 px-2 text-sm no-underline #{(current_menu_item?(j) ? "bg-gray-100 dark:bg-white/5 text-gray-900 dark:text-white selected" : "")}") %>
|
17
|
+
</li>
|
18
|
+
<% end %>
|
19
|
+
</ul>
|
20
|
+
<% elsif url = item.url(self) %>
|
21
|
+
<%= link_to item.label(self), url, item.html_options.merge(class: "text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white flex items-center w-full rounded-md p-2 gap-x-2 text-sm no-underline #{(current_menu_item?(item) ? "bg-gray-100 dark:bg-white/5 text-gray-900 dark:text-white selected" : "")}") %>
|
22
|
+
<% else %>
|
23
|
+
<%= item.label(self) %>
|
24
|
+
<% end %>
|
25
|
+
</li>
|
26
|
+
<% end %>
|
27
|
+
</ul>
|
28
|
+
</div>
|
@@ -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 sticky 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="drawer-navigation">
|
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">
|
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">
|
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 bg-white rounded shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none dark:bg-gray-700 py-1 text-sm text-gray-700 dark:text-gray-200" 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-white dark:hover:bg-gray-600 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-white dark:hover:bg-gray-600 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 dark:border-gray-700">
|
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 dark:border-gray-700">
|
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 dark:border-gray-700">
|
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 dark:border-gray-700">
|
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 dark:border-gray-700">
|
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 dark:border-gray-700">
|
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('views.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('views.pagination.next').html_safe %></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('views.pagination.previous').html_safe %></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,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
div class: "main-content-container" do
|
3
|
+
if page_presenter.block
|
4
|
+
options = {
|
5
|
+
url: resource.persisted? ? resource_path(resource) : collection_path,
|
6
|
+
as: active_admin_config.param_key
|
7
|
+
}
|
8
|
+
options.merge!(page_presenter.options)
|
9
|
+
|
10
|
+
active_admin_form_for(resource, options, &page_presenter.block)
|
11
|
+
elsif page_presenter.options[:partial].present?
|
12
|
+
render page_presenter.options[:partial]
|
13
|
+
else
|
14
|
+
render "form_default"
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
options = {
|
3
|
+
url: resource.persisted? ? resource_path(resource) : collection_path,
|
4
|
+
as: active_admin_config.param_key
|
5
|
+
}
|
6
|
+
options.merge!(page_presenter.options)
|
7
|
+
|
8
|
+
active_admin_form_for(resource, options) do |f|
|
9
|
+
f.semantic_errors # show errors on :base by default
|
10
|
+
f.inputs
|
11
|
+
f.actions
|
12
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
insert_tag(ActiveAdmin::Views::IndexAsTable::IndexTableFor, collection, table_options) do |t|
|
3
|
+
selectable_column
|
4
|
+
id_column if resource_class.primary_key
|
5
|
+
active_admin_config.resource_columns.each do |attribute|
|
6
|
+
column attribute
|
7
|
+
end
|
8
|
+
actions
|
9
|
+
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,2 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
2
|
+
render "form"
|