activeadmin 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activeadmin might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/CHANGELOG.md +546 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/CONTRIBUTING.md +217 -0
- data/LICENSE +20 -0
- data/README.md +110 -0
- data/app/assets/images/active_admin/nested_menu_arrow.gif +0 -0
- data/app/assets/images/active_admin/nested_menu_arrow_dark.gif +0 -0
- data/app/assets/images/active_admin/orderable.png +0 -0
- data/app/assets/javascripts/active_admin/base.es6 +23 -0
- data/app/assets/javascripts/active_admin/ext/jquery-ui.es6 +7 -0
- data/app/assets/javascripts/active_admin/ext/jquery.es6 +9 -0
- data/app/assets/javascripts/active_admin/initializers/datepicker.es6 +16 -0
- data/app/assets/javascripts/active_admin/initializers/filters.es6 +45 -0
- data/app/assets/javascripts/active_admin/initializers/tabs.es6 +6 -0
- data/app/assets/javascripts/active_admin/lib/active_admin.es6 +41 -0
- data/app/assets/javascripts/active_admin/lib/batch_actions.es6 +55 -0
- data/app/assets/javascripts/active_admin/lib/checkbox-toggler.es6 +49 -0
- data/app/assets/javascripts/active_admin/lib/dropdown-menu.es6 +123 -0
- data/app/assets/javascripts/active_admin/lib/has_many.es6 +95 -0
- data/app/assets/javascripts/active_admin/lib/modal_dialog.es6 +61 -0
- data/app/assets/javascripts/active_admin/lib/per_page.es6 +47 -0
- data/app/assets/javascripts/active_admin/lib/table-checkbox-toggler.es6 +36 -0
- data/app/assets/stylesheets/active_admin/_base.scss +41 -0
- data/app/assets/stylesheets/active_admin/_forms.scss +326 -0
- data/app/assets/stylesheets/active_admin/_header.scss +156 -0
- data/app/assets/stylesheets/active_admin/_mixins.scss +1 -0
- data/app/assets/stylesheets/active_admin/_typography.scss +100 -0
- data/app/assets/stylesheets/active_admin/components/_batch_actions.scss +6 -0
- data/app/assets/stylesheets/active_admin/components/_blank_slates.scss +30 -0
- data/app/assets/stylesheets/active_admin/components/_breadcrumbs.scss +20 -0
- data/app/assets/stylesheets/active_admin/components/_buttons.scss +6 -0
- data/app/assets/stylesheets/active_admin/components/_columns.scss +3 -0
- data/app/assets/stylesheets/active_admin/components/_comments.scss +41 -0
- data/app/assets/stylesheets/active_admin/components/_date_picker.scss +149 -0
- data/app/assets/stylesheets/active_admin/components/_dropdown_menu.scss +152 -0
- data/app/assets/stylesheets/active_admin/components/_flash_messages.scss +37 -0
- data/app/assets/stylesheets/active_admin/components/_grid.scss +9 -0
- data/app/assets/stylesheets/active_admin/components/_index_list.scss +12 -0
- data/app/assets/stylesheets/active_admin/components/_links.scss +5 -0
- data/app/assets/stylesheets/active_admin/components/_modal_dialog.scss +34 -0
- data/app/assets/stylesheets/active_admin/components/_pagination.scss +55 -0
- data/app/assets/stylesheets/active_admin/components/_panels.scss +6 -0
- data/app/assets/stylesheets/active_admin/components/_scopes.scss +13 -0
- data/app/assets/stylesheets/active_admin/components/_status_tags.scss +12 -0
- data/app/assets/stylesheets/active_admin/components/_table_tools.scss +67 -0
- data/app/assets/stylesheets/active_admin/components/_tables.scss +113 -0
- data/app/assets/stylesheets/active_admin/components/_tabs.scss +65 -0
- data/app/assets/stylesheets/active_admin/components/_unsupported_browser.scss +16 -0
- data/app/assets/stylesheets/active_admin/mixins/_all.scss +8 -0
- data/app/assets/stylesheets/active_admin/mixins/_buttons.scss +65 -0
- data/app/assets/stylesheets/active_admin/mixins/_gradients.scss +28 -0
- data/app/assets/stylesheets/active_admin/mixins/_rounded.scss +22 -0
- data/app/assets/stylesheets/active_admin/mixins/_sections.scss +41 -0
- data/app/assets/stylesheets/active_admin/mixins/_shadows.scss +15 -0
- data/app/assets/stylesheets/active_admin/mixins/_typography.scss +3 -0
- data/app/assets/stylesheets/active_admin/mixins/_utilities.scss +17 -0
- data/app/assets/stylesheets/active_admin/mixins/_variables.scss +34 -0
- data/app/assets/stylesheets/active_admin/pages/_logged_out.scss +44 -0
- data/app/assets/stylesheets/active_admin/print.scss +287 -0
- data/app/assets/stylesheets/active_admin/structure/_footer.scss +14 -0
- data/app/assets/stylesheets/active_admin/structure/_main_structure.scss +29 -0
- data/app/assets/stylesheets/active_admin/structure/_title_bar.scss +41 -0
- data/app/views/active_admin/devise/confirmations/new.html.erb +15 -0
- data/app/views/active_admin/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/active_admin/devise/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/active_admin/devise/passwords/edit.html.erb +18 -0
- data/app/views/active_admin/devise/passwords/new.html.erb +15 -0
- data/app/views/active_admin/devise/registrations/new.html.erb +21 -0
- data/app/views/active_admin/devise/sessions/new.html.erb +20 -0
- data/app/views/active_admin/devise/shared/_error_messages.html.erb +15 -0
- data/app/views/active_admin/devise/shared/_links.erb +33 -0
- data/app/views/active_admin/devise/unlocks/new.html.erb +15 -0
- data/app/views/active_admin/page/index.html.arb +1 -0
- data/app/views/active_admin/resource/edit.html.arb +1 -0
- data/app/views/active_admin/resource/index.html.arb +1 -0
- data/app/views/active_admin/resource/new.html.arb +1 -0
- data/app/views/active_admin/resource/show.html.arb +1 -0
- data/app/views/kaminari/active_admin/_first_page.html.erb +11 -0
- data/app/views/kaminari/active_admin/_gap.html.erb +8 -0
- data/app/views/kaminari/active_admin/_last_page.html.erb +11 -0
- data/app/views/kaminari/active_admin/_next_page.html.erb +11 -0
- data/app/views/kaminari/active_admin/_page.html.erb +12 -0
- data/app/views/kaminari/active_admin/_paginator.html.erb +25 -0
- data/app/views/kaminari/active_admin/_prev_page.html.erb +11 -0
- data/app/views/layouts/active_admin.html.arb +1 -0
- data/app/views/layouts/active_admin_logged_out.html.erb +39 -0
- data/config/locales/ar.yml +135 -0
- data/config/locales/bg.yml +119 -0
- data/config/locales/bs.yml +121 -0
- data/config/locales/ca.yml +106 -0
- data/config/locales/cs.yml +109 -0
- data/config/locales/da.yml +137 -0
- data/config/locales/de-CH.yml +101 -0
- data/config/locales/de.yml +144 -0
- data/config/locales/el.yml +126 -0
- data/config/locales/en-CA.yml +139 -0
- data/config/locales/en-GB.yml +139 -0
- data/config/locales/en.yml +162 -0
- data/config/locales/eo.yml +145 -0
- data/config/locales/es-MX.yml +96 -0
- data/config/locales/es.yml +162 -0
- data/config/locales/fa.yml +119 -0
- data/config/locales/fi.yml +112 -0
- data/config/locales/fr.yml +141 -0
- data/config/locales/he.yml +141 -0
- data/config/locales/hr.yml +123 -0
- data/config/locales/hu.yml +102 -0
- data/config/locales/id.yml +135 -0
- data/config/locales/it.yml +144 -0
- data/config/locales/ja.yml +141 -0
- data/config/locales/ko.yml +120 -0
- data/config/locales/lt.yml +142 -0
- data/config/locales/lv.yml +92 -0
- data/config/locales/mk.yml +134 -0
- data/config/locales/nb.yml +130 -0
- data/config/locales/nl.yml +144 -0
- data/config/locales/pl.yml +168 -0
- data/config/locales/pt-BR.yml +143 -0
- data/config/locales/pt-PT.yml +92 -0
- data/config/locales/ro.yml +96 -0
- data/config/locales/ru.yml +141 -0
- data/config/locales/sk.yml +109 -0
- data/config/locales/sv-SE.yml +135 -0
- data/config/locales/tr.yml +144 -0
- data/config/locales/uk.yml +138 -0
- data/config/locales/vi.yml +134 -0
- data/config/locales/zh-CN.yml +143 -0
- data/config/locales/zh-TW.yml +135 -0
- data/docs/.gitignore +1 -0
- data/docs/0-installation.md +118 -0
- data/docs/1-general-configuration.md +204 -0
- data/docs/10-custom-pages.md +150 -0
- data/docs/11-decorators.md +59 -0
- data/docs/12-arbre-components.md +214 -0
- data/docs/13-authorization-adapter.md +285 -0
- data/docs/14-gotchas.md +138 -0
- data/docs/2-resource-customization.md +466 -0
- data/docs/3-index-pages.md +328 -0
- data/docs/3-index-pages/custom-index.md +35 -0
- data/docs/3-index-pages/index-as-block.md +19 -0
- data/docs/3-index-pages/index-as-blog.md +69 -0
- data/docs/3-index-pages/index-as-grid.md +27 -0
- data/docs/3-index-pages/index-as-table.md +227 -0
- data/docs/4-csv-format.md +74 -0
- data/docs/5-forms.md +232 -0
- data/docs/6-show-pages.md +81 -0
- data/docs/7-sidebars.md +75 -0
- data/docs/8-custom-actions.md +177 -0
- data/docs/9-batch-actions.md +237 -0
- data/docs/CNAME +1 -0
- data/docs/Gemfile +4 -0
- data/docs/Gemfile.lock +249 -0
- data/docs/README.md +24 -0
- data/docs/_config.yml +2 -0
- data/docs/_includes/footer.html +8 -0
- data/docs/_includes/google-analytics.html +16 -0
- data/docs/_includes/head.html +7 -0
- data/docs/_includes/toc.html +98 -0
- data/docs/_includes/top-menu.html +17 -0
- data/docs/_layouts/default.html +21 -0
- data/docs/documentation.md +60 -0
- data/docs/images/activeadmin.png +0 -0
- data/docs/images/code-header.png +0 -0
- data/docs/images/divider.png +0 -0
- data/docs/images/features.png +0 -0
- data/docs/images/tidelift.svg +14 -0
- data/docs/index.html +125 -0
- data/docs/stylesheets/main.css +1176 -0
- data/lib/active_admin.rb +134 -0
- data/lib/active_admin/abstract_view_factory.rb +47 -0
- data/lib/active_admin/application.rb +234 -0
- data/lib/active_admin/application_settings.rb +42 -0
- data/lib/active_admin/asset_registration.rb +29 -0
- data/lib/active_admin/authorization_adapter.rb +129 -0
- data/lib/active_admin/base_controller.rb +81 -0
- data/lib/active_admin/base_controller/authorization.rb +127 -0
- data/lib/active_admin/base_controller/menu.rb +34 -0
- data/lib/active_admin/batch_actions.rb +16 -0
- data/lib/active_admin/batch_actions/controller.rb +40 -0
- data/lib/active_admin/batch_actions/resource_extension.rb +155 -0
- data/lib/active_admin/batch_actions/views/batch_action_form.rb +38 -0
- data/lib/active_admin/batch_actions/views/batch_action_selector.rb +58 -0
- data/lib/active_admin/batch_actions/views/selection_cells.rb +38 -0
- data/lib/active_admin/callbacks.rb +88 -0
- data/lib/active_admin/cancan_adapter.rb +36 -0
- data/lib/active_admin/component.rb +5 -0
- data/lib/active_admin/controller_action.rb +13 -0
- data/lib/active_admin/csv_builder.rb +133 -0
- data/lib/active_admin/dependency.rb +100 -0
- data/lib/active_admin/deprecation.rb +10 -0
- data/lib/active_admin/devise.rb +80 -0
- data/lib/active_admin/dsl.rb +160 -0
- data/lib/active_admin/dynamic_setting.rb +38 -0
- data/lib/active_admin/dynamic_settings_node.rb +28 -0
- data/lib/active_admin/engine.rb +21 -0
- data/lib/active_admin/error.rb +64 -0
- data/lib/active_admin/filters.rb +11 -0
- data/lib/active_admin/filters/active.rb +29 -0
- data/lib/active_admin/filters/active_filter.rb +124 -0
- data/lib/active_admin/filters/active_sidebar.rb +54 -0
- data/lib/active_admin/filters/dsl.rb +21 -0
- data/lib/active_admin/filters/forms.rb +85 -0
- data/lib/active_admin/filters/formtastic_addons.rb +79 -0
- data/lib/active_admin/filters/resource_extension.rb +155 -0
- data/lib/active_admin/form_builder.rb +182 -0
- data/lib/active_admin/generators/boilerplate.rb +45 -0
- data/lib/active_admin/helpers/collection.rb +19 -0
- data/lib/active_admin/helpers/i18n.rb +7 -0
- data/lib/active_admin/helpers/optional_display.rb +38 -0
- data/lib/active_admin/helpers/routes/url_helpers.rb +15 -0
- data/lib/active_admin/helpers/scope_chain.rb +24 -0
- data/lib/active_admin/inputs.rb +21 -0
- data/lib/active_admin/inputs/datepicker_input.rb +27 -0
- data/lib/active_admin/inputs/filters/base.rb +44 -0
- data/lib/active_admin/inputs/filters/base/search_method_select.rb +75 -0
- data/lib/active_admin/inputs/filters/boolean_input.rb +24 -0
- data/lib/active_admin/inputs/filters/check_boxes_input.rb +50 -0
- data/lib/active_admin/inputs/filters/date_picker_input.rb +13 -0
- data/lib/active_admin/inputs/filters/date_range_input.rb +49 -0
- data/lib/active_admin/inputs/filters/numeric_input.rb +12 -0
- data/lib/active_admin/inputs/filters/select_input.rb +58 -0
- data/lib/active_admin/inputs/filters/string_input.rb +26 -0
- data/lib/active_admin/inputs/filters/text_input.rb +25 -0
- data/lib/active_admin/localizers.rb +11 -0
- data/lib/active_admin/localizers/resource_localizer.rb +35 -0
- data/lib/active_admin/menu.rb +102 -0
- data/lib/active_admin/menu_collection.rb +91 -0
- data/lib/active_admin/menu_item.rb +69 -0
- data/lib/active_admin/namespace.rb +266 -0
- data/lib/active_admin/namespace_settings.rb +110 -0
- data/lib/active_admin/order_clause.rb +48 -0
- data/lib/active_admin/orm/active_record.rb +5 -0
- data/lib/active_admin/orm/active_record/comments.rb +101 -0
- data/lib/active_admin/orm/active_record/comments/comment.rb +31 -0
- data/lib/active_admin/orm/active_record/comments/namespace_helper.rb +14 -0
- data/lib/active_admin/orm/active_record/comments/resource_helper.rb +17 -0
- data/lib/active_admin/orm/active_record/comments/show_page_helper.rb +23 -0
- data/lib/active_admin/orm/active_record/comments/views.rb +2 -0
- data/lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb +100 -0
- data/lib/active_admin/orm/mongoid.rb +1 -0
- data/lib/active_admin/orm/mongoid/.gitkeep +0 -0
- data/lib/active_admin/page.rb +111 -0
- data/lib/active_admin/page_controller.rb +29 -0
- data/lib/active_admin/page_dsl.rb +32 -0
- data/lib/active_admin/page_presenter.rb +33 -0
- data/lib/active_admin/pundit_adapter.rb +81 -0
- data/lib/active_admin/resource.rb +207 -0
- data/lib/active_admin/resource/action_items.rb +120 -0
- data/lib/active_admin/resource/attributes.rb +47 -0
- data/lib/active_admin/resource/belongs_to.rb +50 -0
- data/lib/active_admin/resource/controllers.rb +19 -0
- data/lib/active_admin/resource/includes.rb +12 -0
- data/lib/active_admin/resource/menu.rb +67 -0
- data/lib/active_admin/resource/naming.rb +62 -0
- data/lib/active_admin/resource/ordering.rb +11 -0
- data/lib/active_admin/resource/page_presenters.rb +82 -0
- data/lib/active_admin/resource/pagination.rb +23 -0
- data/lib/active_admin/resource/routes.rb +139 -0
- data/lib/active_admin/resource/scope_to.rb +74 -0
- data/lib/active_admin/resource/scopes.rb +52 -0
- data/lib/active_admin/resource/sidebars.rb +28 -0
- data/lib/active_admin/resource_collection.rb +72 -0
- data/lib/active_admin/resource_controller.rb +64 -0
- data/lib/active_admin/resource_controller/action_builder.rb +31 -0
- data/lib/active_admin/resource_controller/data_access.rb +322 -0
- data/lib/active_admin/resource_controller/decorators.rb +102 -0
- data/lib/active_admin/resource_controller/resource_class_methods.rb +26 -0
- data/lib/active_admin/resource_controller/scoping.rb +31 -0
- data/lib/active_admin/resource_controller/sidebars.rb +18 -0
- data/lib/active_admin/resource_controller/streaming.rb +43 -0
- data/lib/active_admin/resource_dsl.rb +224 -0
- data/lib/active_admin/router.rb +114 -0
- data/lib/active_admin/scope.rb +64 -0
- data/lib/active_admin/settings_node.rb +19 -0
- data/lib/active_admin/sidebar_section.rb +39 -0
- data/lib/active_admin/version.rb +3 -0
- data/lib/active_admin/view_factory.rb +27 -0
- data/lib/active_admin/view_helpers.rb +20 -0
- data/lib/active_admin/view_helpers/active_admin_application_helper.rb +12 -0
- data/lib/active_admin/view_helpers/auto_link_helper.rb +45 -0
- data/lib/active_admin/view_helpers/breadcrumb_helper.rb +33 -0
- data/lib/active_admin/view_helpers/display_helper.rb +104 -0
- data/lib/active_admin/view_helpers/download_format_links_helper.rb +59 -0
- data/lib/active_admin/view_helpers/fields_for.rb +50 -0
- data/lib/active_admin/view_helpers/flash_helper.rb +14 -0
- data/lib/active_admin/view_helpers/form_helper.rb +20 -0
- data/lib/active_admin/view_helpers/method_or_proc_helper.rb +100 -0
- data/lib/active_admin/view_helpers/scope_name_helper.rb +16 -0
- data/lib/active_admin/view_helpers/sidebar_helper.rb +15 -0
- data/lib/active_admin/view_helpers/title_helper.rb +11 -0
- data/lib/active_admin/view_helpers/view_factory_helper.rb +11 -0
- data/lib/active_admin/views.rb +8 -0
- data/lib/active_admin/views/action_items.rb +17 -0
- data/lib/active_admin/views/components/active_admin_form.rb +155 -0
- data/lib/active_admin/views/components/attributes_table.rb +94 -0
- data/lib/active_admin/views/components/blank_slate.rb +17 -0
- data/lib/active_admin/views/components/columns.rb +161 -0
- data/lib/active_admin/views/components/dropdown_menu.rb +71 -0
- data/lib/active_admin/views/components/index_list.rb +69 -0
- data/lib/active_admin/views/components/menu.rb +32 -0
- data/lib/active_admin/views/components/menu_item.rb +58 -0
- data/lib/active_admin/views/components/paginated_collection.rb +159 -0
- data/lib/active_admin/views/components/panel.rb +38 -0
- data/lib/active_admin/views/components/scopes.rb +72 -0
- data/lib/active_admin/views/components/sidebar.rb +13 -0
- data/lib/active_admin/views/components/sidebar_section.rb +34 -0
- data/lib/active_admin/views/components/site_title.rb +54 -0
- data/lib/active_admin/views/components/status_tag.rb +75 -0
- data/lib/active_admin/views/components/table_for.rb +209 -0
- data/lib/active_admin/views/components/tabs.rb +40 -0
- data/lib/active_admin/views/components/unsupported_browser.rb +11 -0
- data/lib/active_admin/views/footer.rb +30 -0
- data/lib/active_admin/views/header.rb +19 -0
- data/lib/active_admin/views/index_as_block.rb +36 -0
- data/lib/active_admin/views/index_as_blog.rb +155 -0
- data/lib/active_admin/views/index_as_grid.rb +80 -0
- data/lib/active_admin/views/index_as_table.rb +392 -0
- data/lib/active_admin/views/pages/base.rb +126 -0
- data/lib/active_admin/views/pages/form.rb +64 -0
- data/lib/active_admin/views/pages/index.rb +163 -0
- data/lib/active_admin/views/pages/layout.rb +26 -0
- data/lib/active_admin/views/pages/page.rb +30 -0
- data/lib/active_admin/views/pages/show.rb +65 -0
- data/lib/active_admin/views/tabbed_navigation.rb +11 -0
- data/lib/active_admin/views/title_bar.rb +55 -0
- data/lib/activeadmin.rb +1 -0
- data/lib/generators/active_admin/assets/assets_generator.rb +14 -0
- data/lib/generators/active_admin/assets/templates/active_admin.js +1 -0
- data/lib/generators/active_admin/assets/templates/active_admin.scss +17 -0
- data/lib/generators/active_admin/devise/devise_generator.rb +68 -0
- data/lib/generators/active_admin/install/install_generator.rb +49 -0
- data/lib/generators/active_admin/install/templates/active_admin.rb.erb +315 -0
- data/lib/generators/active_admin/install/templates/admin_users.rb.erb +28 -0
- data/lib/generators/active_admin/install/templates/dashboard.rb +32 -0
- data/lib/generators/active_admin/install/templates/migrations/create_active_admin_comments.rb.erb +16 -0
- data/lib/generators/active_admin/page/USAGE +8 -0
- data/lib/generators/active_admin/page/page_generator.rb +12 -0
- data/lib/generators/active_admin/page/templates/page.rb +5 -0
- data/lib/generators/active_admin/resource/resource_generator.rb +20 -0
- data/lib/generators/active_admin/resource/templates/admin.rb.erb +44 -0
- data/lib/ransack_ext.rb +20 -0
- data/vendor/assets/javascripts/jquery-ui/data.js +41 -0
- data/vendor/assets/javascripts/jquery-ui/disable-selection.js +48 -0
- data/vendor/assets/javascripts/jquery-ui/escape-selector.js +23 -0
- data/vendor/assets/javascripts/jquery-ui/focusable.js +86 -0
- data/vendor/assets/javascripts/jquery-ui/form-reset-mixin.js +80 -0
- data/vendor/assets/javascripts/jquery-ui/form.js +22 -0
- data/vendor/assets/javascripts/jquery-ui/ie.js +17 -0
- data/vendor/assets/javascripts/jquery-ui/keycode.js +47 -0
- data/vendor/assets/javascripts/jquery-ui/labels.js +65 -0
- data/vendor/assets/javascripts/jquery-ui/plugin.js +46 -0
- data/vendor/assets/javascripts/jquery-ui/position.js +500 -0
- data/vendor/assets/javascripts/jquery-ui/safe-active-element.js +42 -0
- data/vendor/assets/javascripts/jquery-ui/safe-blur.js +23 -0
- data/vendor/assets/javascripts/jquery-ui/scroll-parent.js +47 -0
- data/vendor/assets/javascripts/jquery-ui/tabbable.js +38 -0
- data/vendor/assets/javascripts/jquery-ui/unique-id.js +51 -0
- data/vendor/assets/javascripts/jquery-ui/version.js +17 -0
- data/vendor/assets/javascripts/jquery-ui/widget.js +735 -0
- data/vendor/assets/javascripts/jquery-ui/widgets/button.js +391 -0
- data/vendor/assets/javascripts/jquery-ui/widgets/checkboxradio.js +291 -0
- data/vendor/assets/javascripts/jquery-ui/widgets/controlgroup.js +300 -0
- data/vendor/assets/javascripts/jquery-ui/widgets/datepicker.js +2123 -0
- data/vendor/assets/javascripts/jquery-ui/widgets/dialog.js +954 -0
- data/vendor/assets/javascripts/jquery-ui/widgets/draggable.js +1259 -0
- data/vendor/assets/javascripts/jquery-ui/widgets/mouse.js +230 -0
- data/vendor/assets/javascripts/jquery-ui/widgets/resizable.js +1207 -0
- data/vendor/assets/javascripts/jquery-ui/widgets/sortable.js +1561 -0
- data/vendor/assets/javascripts/jquery-ui/widgets/tabs.js +931 -0
- data/vendor/assets/stylesheets/active_admin/_normalize.scss +447 -0
- metadata +616 -0
@@ -0,0 +1,55 @@
|
|
1
|
+
module ActiveAdmin
|
2
|
+
module Views
|
3
|
+
class TitleBar < Component
|
4
|
+
|
5
|
+
def build(title, action_items)
|
6
|
+
super(id: "title_bar")
|
7
|
+
@title = title
|
8
|
+
@action_items = action_items
|
9
|
+
build_titlebar_left
|
10
|
+
build_titlebar_right
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def build_titlebar_left
|
16
|
+
div id: "titlebar_left" do
|
17
|
+
build_breadcrumb
|
18
|
+
build_title_tag
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def build_titlebar_right
|
23
|
+
div id: "titlebar_right" do
|
24
|
+
build_action_items
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def build_breadcrumb(separator = "/")
|
29
|
+
breadcrumb_config = active_admin_config && active_admin_config.breadcrumb
|
30
|
+
|
31
|
+
links = if breadcrumb_config.is_a?(Proc)
|
32
|
+
instance_exec(controller, &active_admin_config.breadcrumb)
|
33
|
+
elsif breadcrumb_config.present?
|
34
|
+
breadcrumb_links
|
35
|
+
end
|
36
|
+
return unless links.present? && links.is_a?(::Array)
|
37
|
+
span class: "breadcrumb" do
|
38
|
+
links.each do |link|
|
39
|
+
text_node link
|
40
|
+
span(separator, class: "breadcrumb_sep")
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def build_title_tag
|
46
|
+
h2(@title, id: 'page_title')
|
47
|
+
end
|
48
|
+
|
49
|
+
def build_action_items
|
50
|
+
insert_tag(view_factory.action_items, @action_items)
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
data/lib/activeadmin.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'active_admin'
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module ActiveAdmin
|
2
|
+
module Generators
|
3
|
+
class AssetsGenerator < Rails::Generators::Base
|
4
|
+
|
5
|
+
source_root File.expand_path('templates', __dir__)
|
6
|
+
|
7
|
+
def install_assets
|
8
|
+
template 'active_admin.js', 'app/assets/javascripts/active_admin.js'
|
9
|
+
template "active_admin.scss", "app/assets/stylesheets/active_admin.scss"
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require active_admin/base
|
@@ -0,0 +1,17 @@
|
|
1
|
+
// SASS variable overrides must be declared before loading up Active Admin's styles.
|
2
|
+
//
|
3
|
+
// To view the variables that Active Admin provides, take a look at
|
4
|
+
// `app/assets/stylesheets/active_admin/mixins/_variables.scss` in the
|
5
|
+
// Active Admin source.
|
6
|
+
//
|
7
|
+
// For example, to change the sidebar width:
|
8
|
+
// $sidebar-width: 242px;
|
9
|
+
|
10
|
+
// Active Admin's got SASS!
|
11
|
+
@import "active_admin/mixins";
|
12
|
+
@import "active_admin/base";
|
13
|
+
|
14
|
+
// Overriding any non-variable SASS must be done after the fact.
|
15
|
+
// For example, to change the default status-tag color:
|
16
|
+
//
|
17
|
+
// .status_tag { background: #6090DB; }
|
@@ -0,0 +1,68 @@
|
|
1
|
+
require "active_admin/error"
|
2
|
+
require "active_admin/dependency"
|
3
|
+
|
4
|
+
module ActiveAdmin
|
5
|
+
module Generators
|
6
|
+
class DeviseGenerator < Rails::Generators::NamedBase
|
7
|
+
desc "Creates an admin user and uses Devise for authentication"
|
8
|
+
argument :name, type: :string, default: "AdminUser"
|
9
|
+
|
10
|
+
class_option :registerable, type: :boolean, default: false,
|
11
|
+
desc: "Should the generated resource be registerable?"
|
12
|
+
|
13
|
+
RESERVED_NAMES = [:active_admin_user]
|
14
|
+
|
15
|
+
class_option :default_user, type: :boolean, default: true,
|
16
|
+
desc: "Should a default user be created inside the migration?"
|
17
|
+
|
18
|
+
def install_devise
|
19
|
+
begin
|
20
|
+
Dependency.devise! Dependency::Requirements::DEVISE
|
21
|
+
rescue DependencyError => e
|
22
|
+
raise ActiveAdmin::GeneratorError, "#{e.message} If you don't want to use devise, run the generator with --skip-users."
|
23
|
+
end
|
24
|
+
|
25
|
+
require 'devise'
|
26
|
+
|
27
|
+
initializer_file =
|
28
|
+
File.join(destination_root, "config", "initializers", "devise.rb")
|
29
|
+
|
30
|
+
if File.exist?(initializer_file)
|
31
|
+
log :generate, "No need to install devise, already done."
|
32
|
+
else
|
33
|
+
log :generate, "devise:install"
|
34
|
+
invoke "devise:install"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def create_admin_user
|
39
|
+
if RESERVED_NAMES.include?(name.underscore)
|
40
|
+
raise ActiveAdmin::GeneratorError, "The name #{name} is reserved by Active Admin"
|
41
|
+
end
|
42
|
+
invoke "devise", [name]
|
43
|
+
end
|
44
|
+
|
45
|
+
def remove_registerable_from_model
|
46
|
+
unless options[:registerable]
|
47
|
+
model_file = File.join(destination_root, "app", "models", "#{file_path}.rb")
|
48
|
+
gsub_file model_file, /\:registerable([.]*,)?/, ""
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def set_namespace_for_path
|
53
|
+
routes_file = File.join(destination_root, "config", "routes.rb")
|
54
|
+
gsub_file routes_file, /devise_for :#{plural_table_name}$/, "devise_for :#{plural_table_name}, ActiveAdmin::Devise.config"
|
55
|
+
end
|
56
|
+
|
57
|
+
def add_default_user_to_seed
|
58
|
+
seeds_paths = Rails.application.paths["db/seeds.rb"]
|
59
|
+
seeds_file = seeds_paths.existent.first
|
60
|
+
return if seeds_file.nil? || !options[:default_user]
|
61
|
+
|
62
|
+
create_user_code = "#{class_name}.create!(email: 'admin@example.com', password: 'password', password_confirmation: 'password') if Rails.env.development?"
|
63
|
+
|
64
|
+
append_to_file seeds_file, create_user_code
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'rails/generators/active_record'
|
2
|
+
|
3
|
+
module ActiveAdmin
|
4
|
+
module Generators
|
5
|
+
class InstallGenerator < ActiveRecord::Generators::Base
|
6
|
+
desc "Installs Active Admin and generates the necessary migrations"
|
7
|
+
argument :name, type: :string, default: "AdminUser"
|
8
|
+
|
9
|
+
hook_for :users, default: "devise", desc: "Admin user generator to run. Skip with --skip-users"
|
10
|
+
class_option :skip_comments, type: :boolean, default: false, desc: "Skip installation of comments"
|
11
|
+
|
12
|
+
source_root File.expand_path('templates', __dir__)
|
13
|
+
|
14
|
+
def copy_initializer
|
15
|
+
@underscored_user_name = name.underscore.gsub('/', '_')
|
16
|
+
@use_authentication_method = options[:users].present?
|
17
|
+
@skip_comments = options[:skip_comments]
|
18
|
+
template 'active_admin.rb.erb', 'config/initializers/active_admin.rb'
|
19
|
+
end
|
20
|
+
|
21
|
+
def setup_directory
|
22
|
+
empty_directory "app/admin"
|
23
|
+
template 'dashboard.rb', 'app/admin/dashboard.rb'
|
24
|
+
if options[:users].present?
|
25
|
+
@user_class = name
|
26
|
+
template 'admin_users.rb.erb', "app/admin/#{name.underscore.pluralize}.rb"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def setup_routes
|
31
|
+
if options[:users] # Ensure Active Admin routes occur after Devise routes so that Devise has higher priority
|
32
|
+
inject_into_file "config/routes.rb", "\n ActiveAdmin.routes(self)", after: /devise_for .*, ActiveAdmin::Devise\.config/
|
33
|
+
else
|
34
|
+
route "ActiveAdmin.routes(self)"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def create_assets
|
39
|
+
generate "active_admin:assets"
|
40
|
+
end
|
41
|
+
|
42
|
+
def create_migrations
|
43
|
+
unless options[:skip_comments]
|
44
|
+
migration_template 'migrations/create_active_admin_comments.rb.erb', 'db/migrate/create_active_admin_comments.rb'
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,315 @@
|
|
1
|
+
ActiveAdmin.setup do |config|
|
2
|
+
# == Site Title
|
3
|
+
#
|
4
|
+
# Set the title that is displayed on the main layout
|
5
|
+
# for each of the active admin pages.
|
6
|
+
#
|
7
|
+
config.site_title = "<%= Rails.application.class.name.split("::").first.titlecase %>"
|
8
|
+
|
9
|
+
# Set the link url for the title. For example, to take
|
10
|
+
# users to your main site. Defaults to no link.
|
11
|
+
#
|
12
|
+
# config.site_title_link = "/"
|
13
|
+
|
14
|
+
# Set an optional image to be displayed for the header
|
15
|
+
# instead of a string (overrides :site_title)
|
16
|
+
#
|
17
|
+
# Note: Aim for an image that's 21px high so it fits in the header.
|
18
|
+
#
|
19
|
+
# config.site_title_image = "logo.png"
|
20
|
+
|
21
|
+
# == Default Namespace
|
22
|
+
#
|
23
|
+
# Set the default namespace each administration resource
|
24
|
+
# will be added to.
|
25
|
+
#
|
26
|
+
# eg:
|
27
|
+
# config.default_namespace = :hello_world
|
28
|
+
#
|
29
|
+
# This will create resources in the HelloWorld module and
|
30
|
+
# will namespace routes to /hello_world/*
|
31
|
+
#
|
32
|
+
# To set no namespace by default, use:
|
33
|
+
# config.default_namespace = false
|
34
|
+
#
|
35
|
+
# Default:
|
36
|
+
# config.default_namespace = :admin
|
37
|
+
#
|
38
|
+
# You can customize the settings for each namespace by using
|
39
|
+
# a namespace block. For example, to change the site title
|
40
|
+
# within a namespace:
|
41
|
+
#
|
42
|
+
# config.namespace :admin do |admin|
|
43
|
+
# admin.site_title = "Custom Admin Title"
|
44
|
+
# end
|
45
|
+
#
|
46
|
+
# This will ONLY change the title for the admin section. Other
|
47
|
+
# namespaces will continue to use the main "site_title" configuration.
|
48
|
+
|
49
|
+
# == User Authentication
|
50
|
+
#
|
51
|
+
# Active Admin will automatically call an authentication
|
52
|
+
# method in a before filter of all controller actions to
|
53
|
+
# ensure that there is a currently logged in admin user.
|
54
|
+
#
|
55
|
+
# This setting changes the method which Active Admin calls
|
56
|
+
# within the application controller.
|
57
|
+
<% unless @use_authentication_method %># <% end %>config.authentication_method = :authenticate_<%= @underscored_user_name %>!
|
58
|
+
|
59
|
+
# == User Authorization
|
60
|
+
#
|
61
|
+
# Active Admin will automatically call an authorization
|
62
|
+
# method in a before filter of all controller actions to
|
63
|
+
# ensure that there is a user with proper rights. You can use
|
64
|
+
# CanCanAdapter or make your own. Please refer to documentation.
|
65
|
+
# config.authorization_adapter = ActiveAdmin::CanCanAdapter
|
66
|
+
|
67
|
+
# In case you prefer Pundit over other solutions you can here pass
|
68
|
+
# the name of default policy class. This policy will be used in every
|
69
|
+
# case when Pundit is unable to find suitable policy.
|
70
|
+
# config.pundit_default_policy = "MyDefaultPunditPolicy"
|
71
|
+
|
72
|
+
# If you wish to maintain a separate set of Pundit policies for admin
|
73
|
+
# resources, you may set a namespace here that Pundit will search
|
74
|
+
# within when looking for a resource's policy.
|
75
|
+
# config.pundit_policy_namespace = :admin
|
76
|
+
|
77
|
+
# You can customize your CanCan Ability class name here.
|
78
|
+
# config.cancan_ability_class = "Ability"
|
79
|
+
|
80
|
+
# You can specify a method to be called on unauthorized access.
|
81
|
+
# This is necessary in order to prevent a redirect loop which happens
|
82
|
+
# because, by default, user gets redirected to Dashboard. If user
|
83
|
+
# doesn't have access to Dashboard, he'll end up in a redirect loop.
|
84
|
+
# Method provided here should be defined in application_controller.rb.
|
85
|
+
# config.on_unauthorized_access = :access_denied
|
86
|
+
|
87
|
+
# == Current User
|
88
|
+
#
|
89
|
+
# Active Admin will associate actions with the current
|
90
|
+
# user performing them.
|
91
|
+
#
|
92
|
+
# This setting changes the method which Active Admin calls
|
93
|
+
# (within the application controller) to return the currently logged in user.
|
94
|
+
<% unless @use_authentication_method %># <% end %>config.current_user_method = :current_<%= @underscored_user_name %>
|
95
|
+
|
96
|
+
# == Logging Out
|
97
|
+
#
|
98
|
+
# Active Admin displays a logout link on each screen. These
|
99
|
+
# settings configure the location and method used for the link.
|
100
|
+
#
|
101
|
+
# This setting changes the path where the link points to. If it's
|
102
|
+
# a string, the strings is used as the path. If it's a Symbol, we
|
103
|
+
# will call the method to return the path.
|
104
|
+
#
|
105
|
+
# Default:
|
106
|
+
config.logout_link_path = :destroy_<%= @underscored_user_name %>_session_path
|
107
|
+
|
108
|
+
# This setting changes the http method used when rendering the
|
109
|
+
# link. For example :get, :delete, :put, etc..
|
110
|
+
#
|
111
|
+
# Default:
|
112
|
+
# config.logout_link_method = :get
|
113
|
+
|
114
|
+
# == Root
|
115
|
+
#
|
116
|
+
# Set the action to call for the root path. You can set different
|
117
|
+
# roots for each namespace.
|
118
|
+
#
|
119
|
+
# Default:
|
120
|
+
# config.root_to = 'dashboard#index'
|
121
|
+
|
122
|
+
# == Admin Comments
|
123
|
+
#
|
124
|
+
# This allows your users to comment on any resource registered with Active Admin.
|
125
|
+
#
|
126
|
+
# You can completely disable comments:
|
127
|
+
<% unless @skip_comments %># <% end %>config.comments = false
|
128
|
+
#
|
129
|
+
# You can change the name under which comments are registered:
|
130
|
+
# config.comments_registration_name = 'AdminComment'
|
131
|
+
#
|
132
|
+
# You can change the order for the comments and you can change the column
|
133
|
+
# to be used for ordering:
|
134
|
+
# config.comments_order = 'created_at ASC'
|
135
|
+
#
|
136
|
+
# You can disable the menu item for the comments index page:
|
137
|
+
# config.comments_menu = false
|
138
|
+
#
|
139
|
+
# You can customize the comment menu:
|
140
|
+
# config.comments_menu = { parent: 'Admin', priority: 1 }
|
141
|
+
|
142
|
+
# == Batch Actions
|
143
|
+
#
|
144
|
+
# Enable and disable Batch Actions
|
145
|
+
#
|
146
|
+
config.batch_actions = true
|
147
|
+
|
148
|
+
# == Controller Filters
|
149
|
+
#
|
150
|
+
# You can add before, after and around filters to all of your
|
151
|
+
# Active Admin resources and pages from here.
|
152
|
+
#
|
153
|
+
# config.before_action :do_something_awesome
|
154
|
+
|
155
|
+
# == Attribute Filters
|
156
|
+
#
|
157
|
+
# You can exclude possibly sensitive model attributes from being displayed,
|
158
|
+
# added to forms, or exported by default by ActiveAdmin
|
159
|
+
#
|
160
|
+
config.filter_attributes = [:encrypted_password, :password, :password_confirmation]
|
161
|
+
|
162
|
+
# == Localize Date/Time Format
|
163
|
+
#
|
164
|
+
# Set the localize format to display dates and times.
|
165
|
+
# To understand how to localize your app with I18n, read more at
|
166
|
+
# https://guides.rubyonrails.org/i18n.html
|
167
|
+
#
|
168
|
+
# You can run `bin/rails runner 'puts I18n.t("date.formats")'` to see the
|
169
|
+
# available formats in your application.
|
170
|
+
#
|
171
|
+
config.localize_format = :long
|
172
|
+
|
173
|
+
# == Setting a Favicon
|
174
|
+
#
|
175
|
+
# config.favicon = 'favicon.ico'
|
176
|
+
|
177
|
+
# == Meta Tags
|
178
|
+
#
|
179
|
+
# Add additional meta tags to the head element of active admin pages.
|
180
|
+
#
|
181
|
+
# Add tags to all pages logged in users see:
|
182
|
+
# config.meta_tags = { author: 'My Company' }
|
183
|
+
|
184
|
+
# By default, sign up/sign in/recover password pages are excluded
|
185
|
+
# from showing up in search engine results by adding a robots meta
|
186
|
+
# tag. You can reset the hash of meta tags included in logged out
|
187
|
+
# pages:
|
188
|
+
# config.meta_tags_for_logged_out_pages = {}
|
189
|
+
|
190
|
+
# == Removing Breadcrumbs
|
191
|
+
#
|
192
|
+
# Breadcrumbs are enabled by default. You can customize them for individual
|
193
|
+
# resources or you can disable them globally from here.
|
194
|
+
#
|
195
|
+
# config.breadcrumb = false
|
196
|
+
|
197
|
+
# == Create Another Checkbox
|
198
|
+
#
|
199
|
+
# Create another checkbox is disabled by default. You can customize it for individual
|
200
|
+
# resources or you can enable them globally from here.
|
201
|
+
#
|
202
|
+
# config.create_another = true
|
203
|
+
|
204
|
+
# == Register Stylesheets & Javascripts
|
205
|
+
#
|
206
|
+
# We recommend using the built in Active Admin layout and loading
|
207
|
+
# up your own stylesheets / javascripts to customize the look
|
208
|
+
# and feel.
|
209
|
+
#
|
210
|
+
# To load a stylesheet:
|
211
|
+
# config.register_stylesheet 'my_stylesheet.css'
|
212
|
+
#
|
213
|
+
# You can provide an options hash for more control, which is passed along to stylesheet_link_tag():
|
214
|
+
# config.register_stylesheet 'my_print_stylesheet.css', media: :print
|
215
|
+
#
|
216
|
+
# To load a javascript file:
|
217
|
+
# config.register_javascript 'my_javascript.js'
|
218
|
+
|
219
|
+
# == CSV options
|
220
|
+
#
|
221
|
+
# Set the CSV builder separator
|
222
|
+
# config.csv_options = { col_sep: ';' }
|
223
|
+
#
|
224
|
+
# Force the use of quotes
|
225
|
+
# config.csv_options = { force_quotes: true }
|
226
|
+
|
227
|
+
# == Menu System
|
228
|
+
#
|
229
|
+
# You can add a navigation menu to be used in your application, or configure a provided menu
|
230
|
+
#
|
231
|
+
# To change the default utility navigation to show a link to your website & a logout btn
|
232
|
+
#
|
233
|
+
# config.namespace :admin do |admin|
|
234
|
+
# admin.build_menu :utility_navigation do |menu|
|
235
|
+
# menu.add label: "My Great Website", url: "http://www.mygreatwebsite.com", html_options: { target: :blank }
|
236
|
+
# admin.add_logout_button_to_menu menu
|
237
|
+
# end
|
238
|
+
# end
|
239
|
+
#
|
240
|
+
# If you wanted to add a static menu item to the default menu provided:
|
241
|
+
#
|
242
|
+
# config.namespace :admin do |admin|
|
243
|
+
# admin.build_menu :default do |menu|
|
244
|
+
# menu.add label: "My Great Website", url: "http://www.mygreatwebsite.com", html_options: { target: :blank }
|
245
|
+
# end
|
246
|
+
# end
|
247
|
+
|
248
|
+
# == Download Links
|
249
|
+
#
|
250
|
+
# You can disable download links on resource listing pages,
|
251
|
+
# or customize the formats shown per namespace/globally
|
252
|
+
#
|
253
|
+
# To disable/customize for the :admin namespace:
|
254
|
+
#
|
255
|
+
# config.namespace :admin do |admin|
|
256
|
+
#
|
257
|
+
# # Disable the links entirely
|
258
|
+
# admin.download_links = false
|
259
|
+
#
|
260
|
+
# # Only show XML & PDF options
|
261
|
+
# admin.download_links = [:xml, :pdf]
|
262
|
+
#
|
263
|
+
# # Enable/disable the links based on block
|
264
|
+
# # (for example, with cancan)
|
265
|
+
# admin.download_links = proc { can?(:view_download_links) }
|
266
|
+
#
|
267
|
+
# end
|
268
|
+
|
269
|
+
# == Pagination
|
270
|
+
#
|
271
|
+
# Pagination is enabled by default for all resources.
|
272
|
+
# You can control the default per page count for all resources here.
|
273
|
+
#
|
274
|
+
# config.default_per_page = 30
|
275
|
+
#
|
276
|
+
# You can control the max per page count too.
|
277
|
+
#
|
278
|
+
# config.max_per_page = 10_000
|
279
|
+
|
280
|
+
# == Filters
|
281
|
+
#
|
282
|
+
# By default the index screen includes a "Filters" sidebar on the right
|
283
|
+
# hand side with a filter for each attribute of the registered model.
|
284
|
+
# You can enable or disable them for all resources here.
|
285
|
+
#
|
286
|
+
# config.filters = true
|
287
|
+
#
|
288
|
+
# By default the filters include associations in a select, which means
|
289
|
+
# that every record will be loaded for each association.
|
290
|
+
# You can enabled or disable the inclusion
|
291
|
+
# of those filters by default here.
|
292
|
+
#
|
293
|
+
# config.include_default_association_filters = true
|
294
|
+
|
295
|
+
# == Head
|
296
|
+
#
|
297
|
+
# You can add your own content to the site head like analytics. Make sure
|
298
|
+
# you only pass content you trust.
|
299
|
+
#
|
300
|
+
# config.head = ''.html_safe
|
301
|
+
|
302
|
+
# == Footer
|
303
|
+
#
|
304
|
+
# By default, the footer shows the current Active Admin version. You can
|
305
|
+
# override the content of the footer here.
|
306
|
+
#
|
307
|
+
# config.footer = 'my custom footer text'
|
308
|
+
|
309
|
+
# == Sorting
|
310
|
+
#
|
311
|
+
# By default ActiveAdmin::OrderClause is used for sorting logic
|
312
|
+
# You can inherit it with own class and inject it for all resources
|
313
|
+
#
|
314
|
+
# config.order_clause = MyOrderClause
|
315
|
+
end
|