rails_admin 2.3.0 → 3.0.0.beta
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rails_admin might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile +9 -11
- data/README.md +37 -31
- data/Rakefile +2 -2
- data/app/assets/javascripts/rails_admin.js +21 -0
- data/app/assets/stylesheets/rails_admin/custom/mixins.scss +1 -1
- data/app/assets/stylesheets/rails_admin/custom/variables.scss +1 -1
- data/app/assets/stylesheets/rails_admin.scss.erb +76 -0
- data/app/controllers/rails_admin/application_controller.rb +4 -3
- data/app/controllers/rails_admin/main_controller.rb +43 -24
- data/app/helpers/rails_admin/application_helper.rb +69 -52
- data/app/helpers/rails_admin/form_builder.rb +5 -4
- data/app/helpers/rails_admin/main_helper.rb +27 -43
- data/app/views/kaminari/ra-twitter-bootstrap/_gap.html.erb +5 -0
- data/app/views/kaminari/ra-twitter-bootstrap/_next_page.html.erb +9 -0
- data/app/views/kaminari/ra-twitter-bootstrap/_page.html.erb +9 -0
- data/app/views/kaminari/ra-twitter-bootstrap/_paginator.html.erb +13 -0
- data/app/views/kaminari/ra-twitter-bootstrap/_prev_page.html.erb +9 -0
- data/app/views/kaminari/ra-twitter-bootstrap/without_count/_next_page.html.erb +9 -0
- data/app/views/kaminari/ra-twitter-bootstrap/without_count/_paginator.html.erb +6 -0
- data/app/views/kaminari/ra-twitter-bootstrap/without_count/_prev_page.html.erb +9 -0
- data/app/views/layouts/rails_admin/_head.html.erb +17 -0
- data/app/views/layouts/rails_admin/_navigation.html.erb +21 -0
- data/app/views/layouts/rails_admin/_secondary_navigation.html.erb +24 -0
- data/app/views/layouts/rails_admin/_sidebar_navigation.html.erb +9 -0
- data/app/views/layouts/rails_admin/application.html.erb +27 -0
- data/app/views/layouts/rails_admin/modal.js.erb +7 -0
- data/app/views/layouts/rails_admin/pjax.html.erb +20 -0
- data/app/views/rails_admin/main/_dashboard_history.html.erb +45 -0
- data/app/views/rails_admin/main/_delete_notice.html.erb +35 -0
- data/app/views/rails_admin/main/_form_action_text.html.erb +7 -0
- data/app/views/rails_admin/main/_form_boolean.html.erb +16 -0
- data/app/views/rails_admin/main/{_form_ck_editor.html.haml → _form_ck_editor.html.erb} +3 -3
- data/app/views/rails_admin/main/_form_code_mirror.html.erb +9 -0
- data/app/views/rails_admin/main/_form_colorpicker.html.erb +1 -0
- data/app/views/rails_admin/main/_form_datetime.html.erb +9 -0
- data/app/views/rails_admin/main/_form_enumeration.html.erb +21 -0
- data/app/views/rails_admin/main/_form_field.html.erb +1 -0
- data/app/views/rails_admin/main/_form_file_upload.html.erb +17 -0
- data/app/views/rails_admin/main/{_form_filtering_multiselect.html.haml → _form_filtering_multiselect.html.erb} +11 -11
- data/app/views/rails_admin/main/{_form_filtering_select.html.haml → _form_filtering_select.html.erb} +13 -12
- data/app/views/rails_admin/main/_form_froala.html.erb +8 -0
- data/app/views/rails_admin/main/_form_multiple_file_upload.html.erb +20 -0
- data/app/views/rails_admin/main/_form_nested_many.html.erb +21 -0
- data/app/views/rails_admin/main/_form_nested_one.html.erb +21 -0
- data/app/views/rails_admin/main/_form_polymorphic_association.html.erb +27 -0
- data/app/views/rails_admin/main/_form_simple_mde.html.erb +8 -0
- data/app/views/rails_admin/main/_form_text.html.erb +1 -0
- data/app/views/rails_admin/main/_form_wysihtml5.html.erb +8 -0
- data/app/views/rails_admin/main/_submit_buttons.html.erb +25 -0
- data/app/views/rails_admin/main/bulk_delete.html.erb +19 -0
- data/app/views/rails_admin/main/dashboard.html.erb +64 -0
- data/app/views/rails_admin/main/delete.html.erb +21 -0
- data/app/views/rails_admin/main/edit.html.erb +3 -0
- data/app/views/rails_admin/main/export.html.erb +146 -0
- data/app/views/rails_admin/main/history.html.erb +78 -0
- data/app/views/rails_admin/main/index.html.erb +193 -0
- data/app/views/rails_admin/main/new.html.erb +3 -0
- data/app/views/rails_admin/main/show.html.erb +28 -0
- data/config/initializers/active_record_extensions.rb +3 -1
- data/config/initializers/mongoid_extensions.rb +1 -1
- data/config/locales/rails_admin.en.yml +5 -1
- data/lib/generators/rails_admin/install_generator.rb +51 -3
- data/lib/generators/rails_admin/templates/environment.js +6 -0
- data/lib/generators/rails_admin/templates/initializer.erb +2 -1
- data/lib/generators/rails_admin/templates/rails_admin.js.erb +2 -0
- data/lib/generators/rails_admin/templates/rails_admin.scss +1 -0
- data/lib/generators/rails_admin/templates/webpack.config.js +32 -0
- data/lib/rails_admin/abstract_model.rb +24 -10
- data/lib/rails_admin/adapters/active_record/association.rb +20 -1
- data/lib/rails_admin/adapters/active_record/object_extension.rb +29 -0
- data/lib/rails_admin/adapters/active_record/property.rb +1 -1
- data/lib/rails_admin/adapters/active_record.rb +19 -21
- data/lib/rails_admin/adapters/mongoid/association.rb +38 -9
- data/lib/rails_admin/adapters/mongoid/bson.rb +4 -5
- data/lib/rails_admin/adapters/mongoid/extension.rb +3 -1
- data/lib/rails_admin/adapters/mongoid/object_extension.rb +32 -0
- data/lib/rails_admin/adapters/mongoid/property.rb +2 -2
- data/lib/rails_admin/adapters/mongoid.rb +25 -19
- data/lib/rails_admin/config/actions/base.rb +7 -2
- data/lib/rails_admin/config/actions/bulk_delete.rb +2 -2
- data/lib/rails_admin/config/actions/dashboard.rb +4 -3
- data/lib/rails_admin/config/actions/delete.rb +5 -9
- data/lib/rails_admin/config/actions/edit.rb +7 -7
- data/lib/rails_admin/config/actions/export.rb +2 -2
- data/lib/rails_admin/config/actions/history_index.rb +2 -2
- data/lib/rails_admin/config/actions/history_show.rb +2 -2
- data/lib/rails_admin/config/actions/index.rb +5 -7
- data/lib/rails_admin/config/actions/new.rb +9 -9
- data/lib/rails_admin/config/actions/show.rb +1 -1
- data/lib/rails_admin/config/actions/show_in_app.rb +6 -2
- data/lib/rails_admin/config/actions.rb +4 -4
- data/lib/rails_admin/config/configurable.rb +2 -2
- data/lib/rails_admin/config/fields/association.rb +15 -12
- data/lib/rails_admin/config/fields/base.rb +44 -24
- data/lib/rails_admin/config/fields/factories/active_storage.rb +1 -0
- data/lib/rails_admin/config/fields/factories/association.rb +6 -8
- data/lib/rails_admin/config/fields/factories/carrierwave.rb +2 -1
- data/lib/rails_admin/config/fields/factories/devise.rb +2 -1
- data/lib/rails_admin/config/fields/factories/dragonfly.rb +2 -1
- data/lib/rails_admin/config/fields/factories/paperclip.rb +2 -1
- data/lib/rails_admin/config/fields/factories/shrine.rb +1 -1
- data/lib/rails_admin/config/fields/group.rb +1 -2
- data/lib/rails_admin/config/fields/types/active_record_enum.rb +2 -0
- data/lib/rails_admin/config/fields/types/active_storage.rb +9 -7
- data/lib/rails_admin/config/fields/types/all.rb +1 -0
- data/lib/rails_admin/config/fields/types/belongs_to_association.rb +4 -12
- data/lib/rails_admin/config/fields/types/boolean.rb +32 -8
- data/lib/rails_admin/config/fields/types/carrierwave.rb +1 -0
- data/lib/rails_admin/config/fields/types/citext.rb +13 -0
- data/lib/rails_admin/config/fields/types/color.rb +6 -2
- data/lib/rails_admin/config/fields/types/date.rb +5 -8
- data/lib/rails_admin/config/fields/types/datetime.rb +18 -21
- data/lib/rails_admin/config/fields/types/decimal.rb +9 -2
- data/lib/rails_admin/config/fields/types/dragonfly.rb +3 -1
- data/lib/rails_admin/config/fields/types/enum.rb +1 -1
- data/lib/rails_admin/config/fields/types/file_upload.rb +4 -3
- data/lib/rails_admin/config/fields/types/float.rb +9 -2
- data/lib/rails_admin/config/fields/types/has_many_association.rb +1 -5
- data/lib/rails_admin/config/fields/types/has_one_association.rb +1 -13
- data/lib/rails_admin/config/fields/types/integer.rb +2 -6
- data/lib/rails_admin/config/fields/types/multiple_active_storage.rb +8 -6
- data/lib/rails_admin/config/fields/types/multiple_carrierwave.rb +1 -0
- data/lib/rails_admin/config/fields/types/multiple_file_upload.rb +4 -3
- data/lib/rails_admin/config/fields/types/numeric.rb +18 -0
- data/lib/rails_admin/config/fields/types/polymorphic_association.rb +3 -2
- data/lib/rails_admin/config/fields/types/string.rb +1 -1
- data/lib/rails_admin/config/fields/types/time.rb +1 -4
- data/lib/rails_admin/config/fields/types/timestamp.rb +0 -4
- data/lib/rails_admin/config/fields/types.rb +1 -1
- data/lib/rails_admin/config/fields.rb +3 -1
- data/lib/rails_admin/config/has_fields.rb +5 -6
- data/lib/rails_admin/config/hideable.rb +1 -1
- data/lib/rails_admin/config/inspectable.rb +1 -3
- data/lib/rails_admin/config/model.rb +10 -10
- data/lib/rails_admin/config/sections/base.rb +2 -3
- data/lib/rails_admin/config/sections/list.rb +4 -15
- data/lib/rails_admin/config/sections.rb +1 -1
- data/lib/rails_admin/config.rb +73 -38
- data/lib/rails_admin/engine.rb +36 -23
- data/lib/rails_admin/extension.rb +6 -14
- data/lib/rails_admin/extensions/cancancan/authorization_adapter.rb +4 -2
- data/lib/rails_admin/extensions/paper_trail/auditing_adapter.rb +12 -7
- data/lib/rails_admin/extensions/pundit/authorization_adapter.rb +6 -7
- data/lib/rails_admin/support/csv_converter.rb +12 -13
- data/lib/rails_admin/support/datetime.rb +40 -74
- data/lib/rails_admin/support/esmodule_preprocessor.rb +32 -0
- data/lib/rails_admin/support/hash_helper.rb +6 -5
- data/lib/rails_admin/version.rb +7 -3
- data/lib/rails_admin.rb +1 -4
- data/lib/tasks/rails_admin.rake +3 -3
- data/package.json +28 -0
- data/src/rails_admin/base.js +21 -0
- data/src/rails_admin/filter-box.js +405 -0
- data/src/rails_admin/filtering-multiselect.js +394 -0
- data/src/rails_admin/filtering-select.js +302 -0
- data/src/rails_admin/i18n.js +19 -0
- data/src/rails_admin/nested-form-hooks.js +100 -0
- data/src/rails_admin/remote-form.js +190 -0
- data/src/rails_admin/sidescroll.js +20 -0
- data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/base/theming.scss +93 -34
- data/src/rails_admin/styles/base.scss +64 -0
- data/src/rails_admin/styles/filtering-multiselect.scss +53 -0
- data/src/rails_admin/styles/filtering-select.scss +70 -0
- data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/themes/cerulean/theming.scss +23 -21
- data/src/rails_admin/styles/themes/cerulean/variables.scss +830 -0
- data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/themes/default/mixins.scss +1 -1
- data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/themes/default/variables.scss +1 -1
- data/src/rails_admin/styles/widgets.scss +35 -0
- data/src/rails_admin/ui.js +172 -0
- data/src/rails_admin/vendor/jquery.pjax.js +899 -0
- data/src/rails_admin/vendor/jquery_nested_form.js +122 -0
- data/src/rails_admin/widgets.js +512 -0
- data/vendor/assets/fonts/rails_admin/fa-solid-900.eot +0 -0
- data/vendor/assets/fonts/rails_admin/fa-solid-900.svg +5034 -0
- data/vendor/assets/fonts/rails_admin/fa-solid-900.ttf +0 -0
- data/vendor/assets/fonts/rails_admin/fa-solid-900.woff +0 -0
- data/vendor/assets/fonts/rails_admin/fa-solid-900.woff2 +0 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/data.js +41 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/effect.js +1637 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/ie.js +17 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/keycode.js +47 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/position.js +500 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/safe-active-element.js +42 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/scroll-parent.js +47 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/unique-id.js +51 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/version.js +17 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/widget.js +735 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/widgets/autocomplete.js +689 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/widgets/menu.js +680 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/widgets/mouse.js +230 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/widgets/sortable.js +1561 -0
- data/vendor/assets/javascripts/rails_admin/jquery3.js +10872 -0
- data/vendor/assets/stylesheets/rails_admin/font-awesome.scss +4476 -2216
- metadata +118 -263
- data/app/assets/images/rails_admin/aristo/images/bg_fallback.png +0 -0
- data/app/assets/images/rails_admin/aristo/images/icon_sprite.png +0 -0
- data/app/assets/images/rails_admin/aristo/images/progress_bar.gif +0 -0
- data/app/assets/images/rails_admin/aristo/images/slider_handles.png +0 -0
- data/app/assets/images/rails_admin/aristo/images/ui-icons_222222_256x240.png +0 -0
- data/app/assets/images/rails_admin/aristo/images/ui-icons_454545_256x240.png +0 -0
- data/app/assets/images/rails_admin/bullet_black.png +0 -0
- data/app/assets/images/rails_admin/bullet_white.png +0 -0
- data/app/assets/images/rails_admin/calendar.png +0 -0
- data/app/assets/images/rails_admin/clock.png +0 -0
- data/app/assets/images/rails_admin/logo.png +0 -0
- data/app/assets/images/rails_admin/magnifier.png +0 -0
- data/app/assets/images/rails_admin/multiselect/icon_sprite.png +0 -0
- data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-n-dark.png +0 -0
- data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-n-light.png +0 -0
- data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-s-dark.png +0 -0
- data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-s-light.png +0 -0
- data/app/assets/javascripts/rails_admin/jquery-ui.js.erb +0 -8
- data/app/assets/javascripts/rails_admin/jquery.migrate.js +0 -3
- data/app/assets/javascripts/rails_admin/ra.filter-box.js +0 -253
- data/app/assets/javascripts/rails_admin/ra.filtering-multiselect.js +0 -331
- data/app/assets/javascripts/rails_admin/ra.filtering-select.js +0 -294
- data/app/assets/javascripts/rails_admin/ra.i18n.js +0 -28
- data/app/assets/javascripts/rails_admin/ra.nested-form-hooks.js +0 -59
- data/app/assets/javascripts/rails_admin/ra.remote-form.js +0 -155
- data/app/assets/javascripts/rails_admin/ra.sidescroll.js +0 -31
- data/app/assets/javascripts/rails_admin/ra.widgets.js +0 -379
- data/app/assets/javascripts/rails_admin/rails_admin.js +0 -21
- data/app/assets/javascripts/rails_admin/ui.js +0 -135
- data/app/assets/stylesheets/rails_admin/aristo/images/bg_fallback.png +0 -0
- data/app/assets/stylesheets/rails_admin/aristo/images/icon_sprite.png +0 -0
- data/app/assets/stylesheets/rails_admin/aristo/images/progress_bar.gif +0 -0
- data/app/assets/stylesheets/rails_admin/aristo/images/slider_handles.png +0 -0
- data/app/assets/stylesheets/rails_admin/aristo/images/ui-icons_222222_256x240.png +0 -0
- data/app/assets/stylesheets/rails_admin/aristo/images/ui-icons_454545_256x240.png +0 -0
- data/app/assets/stylesheets/rails_admin/aristo/jquery-ui-1.8.7.custom.scss +0 -733
- data/app/assets/stylesheets/rails_admin/base/font-awesome-4-compability.scss +0 -153
- data/app/assets/stylesheets/rails_admin/ra.filtering-multiselect.scss +0 -88
- data/app/assets/stylesheets/rails_admin/ra.sidescroll.scss +0 -29
- data/app/assets/stylesheets/rails_admin/ra.widgets.scss +0 -17
- data/app/assets/stylesheets/rails_admin/rails_admin.scss.erb +0 -110
- data/app/assets/stylesheets/rails_admin/themes/cerulean/variables.scss +0 -857
- data/app/views/kaminari/ra-twitter-bootstrap/_gap.html.haml +0 -2
- data/app/views/kaminari/ra-twitter-bootstrap/_next_page.html.haml +0 -4
- data/app/views/kaminari/ra-twitter-bootstrap/_page.html.haml +0 -4
- data/app/views/kaminari/ra-twitter-bootstrap/_paginator.html.haml +0 -9
- data/app/views/kaminari/ra-twitter-bootstrap/_prev_page.html.haml +0 -4
- data/app/views/kaminari/ra-twitter-bootstrap/without_count/_next_page.html.haml +0 -4
- data/app/views/kaminari/ra-twitter-bootstrap/without_count/_paginator.html.haml +0 -4
- data/app/views/kaminari/ra-twitter-bootstrap/without_count/_prev_page.html.haml +0 -4
- data/app/views/layouts/rails_admin/_head.html.haml +0 -7
- data/app/views/layouts/rails_admin/_navigation.html.haml +0 -12
- data/app/views/layouts/rails_admin/_secondary_navigation.html.haml +0 -10
- data/app/views/layouts/rails_admin/_sidebar_navigation.html.haml +0 -3
- data/app/views/layouts/rails_admin/application.html.haml +0 -16
- data/app/views/layouts/rails_admin/pjax.html.haml +0 -12
- data/app/views/rails_admin/main/_dashboard_history.html.haml +0 -21
- data/app/views/rails_admin/main/_delete_notice.html.haml +0 -24
- data/app/views/rails_admin/main/_form_action_text.html.haml +0 -7
- data/app/views/rails_admin/main/_form_boolean.html.haml +0 -3
- data/app/views/rails_admin/main/_form_code_mirror.html.haml +0 -9
- data/app/views/rails_admin/main/_form_colorpicker.html.haml +0 -1
- data/app/views/rails_admin/main/_form_datetime.html.haml +0 -5
- data/app/views/rails_admin/main/_form_enumeration.html.haml +0 -19
- data/app/views/rails_admin/main/_form_field.html.haml +0 -1
- data/app/views/rails_admin/main/_form_file_upload.html.haml +0 -17
- data/app/views/rails_admin/main/_form_froala.html.haml +0 -8
- data/app/views/rails_admin/main/_form_multiple_file_upload.html.haml +0 -16
- data/app/views/rails_admin/main/_form_nested_many.html.haml +0 -15
- data/app/views/rails_admin/main/_form_nested_one.html.haml +0 -17
- data/app/views/rails_admin/main/_form_polymorphic_association.html.haml +0 -26
- data/app/views/rails_admin/main/_form_simple_mde.haml +0 -8
- data/app/views/rails_admin/main/_form_text.html.haml +0 -1
- data/app/views/rails_admin/main/_form_wysihtml5.html.haml +0 -8
- data/app/views/rails_admin/main/_submit_buttons.html.haml +0 -16
- data/app/views/rails_admin/main/bulk_delete.html.haml +0 -11
- data/app/views/rails_admin/main/dashboard.html.haml +0 -34
- data/app/views/rails_admin/main/delete.html.haml +0 -18
- data/app/views/rails_admin/main/edit.html.haml +0 -2
- data/app/views/rails_admin/main/export.html.haml +0 -92
- data/app/views/rails_admin/main/history.html.haml +0 -51
- data/app/views/rails_admin/main/index.html.haml +0 -126
- data/app/views/rails_admin/main/new.html.haml +0 -2
- data/app/views/rails_admin/main/show.html.haml +0 -15
- data/config/initializers/haml.rb +0 -5
- data/lib/rails_admin/adapters/active_record/abstract_object.rb +0 -38
- data/lib/rails_admin/adapters/active_record.rb.bak +0 -348
- data/lib/rails_admin/adapters/mongoid/abstract_object.rb +0 -42
- data/lib/rails_admin/bootstrap-sass/compass_functions.rb +0 -28
- data/lib/rails_admin/bootstrap-sass/sass_functions.rb +0 -16
- data/lib/rails_admin/bootstrap-sass.rb +0 -49
- data/lib/rails_admin/config/lazy_model.rb +0 -68
- data/lib/rails_admin/extensions/history/auditing_adapter.rb +0 -37
- data/lib/rails_admin/extensions/history/history.rb +0 -44
- data/lib/rails_admin/extensions/history.rb +0 -3
- data/lib/rails_admin/support/i18n.rb +0 -43
- data/vendor/assets/fonts/rails_admin/FontAwesome.otf +0 -0
- data/vendor/assets/fonts/rails_admin/fontawesome-webfont.eot +0 -0
- data/vendor/assets/fonts/rails_admin/fontawesome-webfont.svg +0 -2671
- data/vendor/assets/fonts/rails_admin/fontawesome-webfont.ttf +0 -0
- data/vendor/assets/fonts/rails_admin/fontawesome-webfont.woff +0 -0
- data/vendor/assets/fonts/rails_admin/fontawesome-webfont.woff2 +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/colorpicker_background.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/colorpicker_hex.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/colorpicker_hsb_b.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/colorpicker_hsb_h.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/colorpicker_hsb_s.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/colorpicker_indic.gif +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/colorpicker_overlay.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/colorpicker_rgb_b.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/colorpicker_rgb_g.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/colorpicker_rgb_r.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/colorpicker_select.gif +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/colorpicker_submit.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/custom_background.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/custom_hex.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/custom_hsb_b.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/custom_hsb_h.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/custom_hsb_s.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/custom_indic.gif +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/custom_rgb_b.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/custom_rgb_g.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/custom_rgb_r.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/custom_submit.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/select.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/select2.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/slider.png +0 -0
- data/vendor/assets/javascripts/rails_admin/jquery.colorpicker.js +0 -484
- data/vendor/assets/stylesheets/rails_admin/jquery.colorpicker.scss +0 -182
- /data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/base/README.txt +0 -0
- /data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/base/mixins.scss +0 -0
- /data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/base/variables.scss +0 -0
- /data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/themes/cerulean/mixins.scss +0 -0
- /data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/themes/default/theming.scss +0 -0
@@ -0,0 +1,146 @@
|
|
1
|
+
<% params = request.params.except(:action, :controller, :utf8, :page, :per_page, :format, :authenticity_token) %>
|
2
|
+
<% visible_fields = @model_config.export.with(view: self, object: @abstract_model.model.new, controller: self.controller).visible_fields %>
|
3
|
+
<%= form_tag export_path(params.merge(all: true)), method: 'post', class: 'form-horizontal' do %>
|
4
|
+
<input name="send_data" type="hidden" value="true">/</input>
|
5
|
+
<fieldset id="fields_to_export">
|
6
|
+
<legend>
|
7
|
+
<i class="fas fa-chevron-down"></i>
|
8
|
+
<%= t('admin.export.select') %>
|
9
|
+
</legend>
|
10
|
+
<div class="form-group control-group">
|
11
|
+
<div class="col-sm-12">
|
12
|
+
<div class="checkbox">
|
13
|
+
<label for="check_all">
|
14
|
+
<%= check_box_tag 'all', 'all', true, { id: 'check_all' } %>
|
15
|
+
<b>
|
16
|
+
<%= t('admin.export.select_all_fields') %>
|
17
|
+
</b>
|
18
|
+
</label>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
<div class="form-group control-group">
|
23
|
+
<div class="col-sm-12">
|
24
|
+
<div class="well well-sm reverse-selection" rel="tooltip" style="margin: 0; cursor: pointer;" title="<%= t('admin.export.click_to_reverse_selection') %>">
|
25
|
+
<b>
|
26
|
+
<%= t('admin.export.fields_from', name: @model_config.label_plural.downcase) %>
|
27
|
+
</b>
|
28
|
+
</div>
|
29
|
+
<div class="controls">
|
30
|
+
<div class="row">
|
31
|
+
<% visible_fields.select{ |f| !f.association? || f.association.polymorphic? }.each do |field| %>
|
32
|
+
<% list = field.virtual? ? 'methods' : 'only' %>
|
33
|
+
<div class="checkbox col-sm-3">
|
34
|
+
<% if field.association? && field.association.polymorphic? %>
|
35
|
+
<label for="schema_<%= list %>_<%= field.method_name %>">
|
36
|
+
<%= check_box_tag "schema[#{list}][]", field.method_name, true, { id: "schema_#{list}_#{field.method_name}" } %>
|
37
|
+
<%= field.label + " [id]" %>
|
38
|
+
</label>
|
39
|
+
<% polymorphic_type_column_name = @abstract_model.properties.detect {|p| field.association.foreign_type == p.name }.name %>
|
40
|
+
<label for="schema_<%= list %>_<%= polymorphic_type_column_name %>">
|
41
|
+
<%= check_box_tag "schema[#{list}][]", polymorphic_type_column_name, true, { id: "schema_#{list}_#{polymorphic_type_column_name}" } %>
|
42
|
+
<%= field.label + " [type]" %>
|
43
|
+
</label>
|
44
|
+
<% else %>
|
45
|
+
<label for="schema_<%= list %>_<%= field.name %>">
|
46
|
+
<%= check_box_tag "schema[#{list}][]", field.name, true, { id: "schema_#{list}_#{field.name}" } %>
|
47
|
+
<%= field.label %>
|
48
|
+
</label>
|
49
|
+
<% end %>
|
50
|
+
</div>
|
51
|
+
<% end %>
|
52
|
+
</div>
|
53
|
+
</div>
|
54
|
+
</div>
|
55
|
+
</div>
|
56
|
+
<% visible_fields.select{ |f| f.association? && !f.association.polymorphic? }.each do |field| %>
|
57
|
+
<% fields = field.associated_model_config.export.with(controller: self.controller, view: self, object: (associated_model = field.associated_model_config.abstract_model.model).new).visible_fields.select{ |f| !f.association? } %>
|
58
|
+
<div class="form-group control-group">
|
59
|
+
<div class="col-sm-12">
|
60
|
+
<div class="well well-sm reverse-selection" rel="tooltip" style="margin: 0; cursor: pointer;" title="<%= t('admin.export.click_to_reverse_selection') %>">
|
61
|
+
<b>
|
62
|
+
<%= t('admin.export.fields_from_associated', name: field.label.downcase) %>
|
63
|
+
</b>
|
64
|
+
</div>
|
65
|
+
<div class="controls">
|
66
|
+
<div class="row">
|
67
|
+
<% fields.each do |associated_model_field| %>
|
68
|
+
<% list = associated_model_field.virtual? ? 'methods' : 'only' %>
|
69
|
+
<div class="checkbox col-sm-3">
|
70
|
+
<label for="schema_include_<%= field.name %>_<%= list %>_<%= associated_model_field.name %>">
|
71
|
+
<%= check_box_tag "schema[include][#{field.name}][#{list}][]", associated_model_field.name, true, { id: "schema_include_#{field.name}_#{list}_#{associated_model_field.name}" } %>
|
72
|
+
<%= associated_model_field.label %>
|
73
|
+
</label>
|
74
|
+
</div>
|
75
|
+
<% end %>
|
76
|
+
</div>
|
77
|
+
</div>
|
78
|
+
</div>
|
79
|
+
</div>
|
80
|
+
<% end %>
|
81
|
+
</fieldset>
|
82
|
+
<fieldset>
|
83
|
+
<legend>
|
84
|
+
<i class="fas fa-chevron-down"></i>
|
85
|
+
<%= t('admin.export.options_for', name: 'csv') %>
|
86
|
+
</legend>
|
87
|
+
<div class="form-group control-group">
|
88
|
+
<% guessed_encoding = @abstract_model.encoding %>
|
89
|
+
<label class="col-sm-2 control-label" for="csv_options_encoding_to">
|
90
|
+
<%= t('admin.export.csv.encoding_to') %>
|
91
|
+
</label>
|
92
|
+
<div class="col-sm-10 controls">
|
93
|
+
<% # from http://books.google.com/support/partner/bin/answer.py?answer=30990 : %>
|
94
|
+
<%= select_tag 'csv_options[encoding_to]', options_for_select(Encoding.name_list.sort), include_blank: true, placeholder: t('admin.misc.search'), :'data-enumeration' => true %>
|
95
|
+
<p class="help-block">
|
96
|
+
<%= t('admin.export.csv.encoding_to_help', name: guessed_encoding) %>
|
97
|
+
</p>
|
98
|
+
</div>
|
99
|
+
</div>
|
100
|
+
<div class="form-group control-group">
|
101
|
+
<label class="col-sm-2 control-label" for="csv_options_skip_header">
|
102
|
+
<%= t('admin.export.csv.skip_header') %>
|
103
|
+
</label>
|
104
|
+
<div class="col-sm-10 controls">
|
105
|
+
<div class="checkbox">
|
106
|
+
<label style="display: block;">
|
107
|
+
<%= check_box_tag 'csv_options[skip_header]', 'true' %>
|
108
|
+
</label>
|
109
|
+
</div>
|
110
|
+
<p class="help-block">
|
111
|
+
<%= t('admin.export.csv.skip_header_help') %>
|
112
|
+
</p>
|
113
|
+
</div>
|
114
|
+
</div>
|
115
|
+
<div class="form-group control-group">
|
116
|
+
<label class="col-sm-2 control-label" for="csv_options_generator_col_sep">
|
117
|
+
<%= t('admin.export.csv.col_sep') %>
|
118
|
+
</label>
|
119
|
+
<div class="col-sm-10 controls">
|
120
|
+
<%= select_tag 'csv_options[generator][col_sep]', options_for_select({ '' => t('admin.export.csv.default_col_sep'), "<comma> ','" => ',', "<semicolon> ';'" => ';', '<tabs>' => "'\t'" }), placeholder: t('admin.misc.search'), :'data-enumeration' => true %>
|
121
|
+
<p class="help-block">
|
122
|
+
<%= t('admin.export.csv.col_sep_help', value: t('admin.export.csv.default_col_sep')) %>
|
123
|
+
</p>
|
124
|
+
</div>
|
125
|
+
</div>
|
126
|
+
</fieldset>
|
127
|
+
<div class="form-group form-actions">
|
128
|
+
<div class="col-sm-offset-2 col-sm-10">
|
129
|
+
<input name="return_to" type="<%= :hidden %>" value="<%= (params[:return_to].presence || request.referer) %>"></input>
|
130
|
+
<button class="btn btn-primary" name="csv" type="submit">
|
131
|
+
<i class="fas fa-check"></i>
|
132
|
+
<%= t("admin.export.confirmation", name: 'csv') %>
|
133
|
+
</button>
|
134
|
+
<button class="btn btn-info" name="json" type="submit">
|
135
|
+
<%= t("admin.export.confirmation", name: 'json') %>
|
136
|
+
</button>
|
137
|
+
<button class="btn btn-info" name="xml" type="submit">
|
138
|
+
<%= t("admin.export.confirmation", name: 'xml') %>
|
139
|
+
</button>
|
140
|
+
<button class="btn" name="_continue" type="submit">
|
141
|
+
<i class="fas fa-times"></i>
|
142
|
+
<%= t("admin.form.cancel") %>
|
143
|
+
</button>
|
144
|
+
</div>
|
145
|
+
</div>
|
146
|
+
<% end %>
|
@@ -0,0 +1,78 @@
|
|
1
|
+
<% params = request.params.except(:action, :controller, :model_name) %>
|
2
|
+
<% query = params[:query] %>
|
3
|
+
<% filter = params[:filter] %>
|
4
|
+
<% sort = params[:sort] %>
|
5
|
+
<% sort_reverse = params[:sort_reverse] %>
|
6
|
+
<% path_method = params[:id] ? "history_show_path" : "history_index_path" %>
|
7
|
+
<%= form_tag("", method: "get", class: "search pjax-form form-inline") do %>
|
8
|
+
<div class="well">
|
9
|
+
<div class="input-group">
|
10
|
+
<input class="input-small form-control input-small" name="query" placeholder="<%= t("admin.misc.filter") %>" type="search" value="<%= query %>"></input>
|
11
|
+
<span class="input-group-btn">
|
12
|
+
<button class="btn btn-primary" data-disable-with="<%= '<i class="fas fa-sync"></i> '.html_safe + t('admin.misc.refresh') %>" type="submit">
|
13
|
+
<i class="fas fa-sync"></i>
|
14
|
+
<%= t("admin.misc.refresh") %>
|
15
|
+
</button>
|
16
|
+
</span>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
<% end %>
|
20
|
+
<table class="table table-condensed table-striped table-hover" id="history">
|
21
|
+
<thead>
|
22
|
+
<tr>
|
23
|
+
<% columns = [] %>
|
24
|
+
<% columns << { property_name: "created_at", css_class: "created_at",link_text: t('admin.table_headers.created_at') } %>
|
25
|
+
<% columns << { property_name: "username", css_class: "username", link_text: t('admin.table_headers.username') } %>
|
26
|
+
<% columns << { property_name: "item", css_class: "item", link_text: t('admin.table_headers.item') } if @general %>
|
27
|
+
<% columns << { property_name: "message", css_class: "message", link_text: t('admin.table_headers.message') } %>
|
28
|
+
<% columns.each do |column| %>
|
29
|
+
<% property_name = column[:property_name] %>
|
30
|
+
<% selected = (sort == property_name) %>
|
31
|
+
<% sort_direction = (sort_reverse ? "headerSortUp" : "headerSortDown" if selected) %>
|
32
|
+
<% sort_location = send(path_method, params.except("sort_reverse").merge(model_name: @abstract_model.to_param, sort: property_name).merge(selected && sort_reverse != "true" ? {sort_reverse: "true"} : {})) %>
|
33
|
+
<th class="header pjax <%= column[:css_class] %> <%= sort_direction if selected %>" data-href="<%= sort_location %>">
|
34
|
+
<%= column[:link_text] %>
|
35
|
+
</th>
|
36
|
+
<% end %>
|
37
|
+
</tr>
|
38
|
+
</thead>
|
39
|
+
<tbody>
|
40
|
+
<% @history.each_with_index do |object, index| %>
|
41
|
+
<tr>
|
42
|
+
<% unless object.created_at.nil? %>
|
43
|
+
<td>
|
44
|
+
<%= l(object.created_at, format: :long, default: l(object.created_at, format: :long)) %>
|
45
|
+
</td>
|
46
|
+
<% end %>
|
47
|
+
<td>
|
48
|
+
<%= object.username %>
|
49
|
+
</td>
|
50
|
+
<% if @general %>
|
51
|
+
<% if o = @abstract_model.get(object.item) %>
|
52
|
+
<% label = o.send(@abstract_model.config.object_label_method) %>
|
53
|
+
<% if show_action = action(:show, @abstract_model, o) %>
|
54
|
+
<td>
|
55
|
+
<%= link_to(label, url_for(action: show_action.action_name, model_name: @abstract_model.to_param, id: o.id), class: 'pjax') %>
|
56
|
+
</td>
|
57
|
+
<% else %>
|
58
|
+
<td>
|
59
|
+
<%= label %>
|
60
|
+
</td>
|
61
|
+
<% end %>
|
62
|
+
<% else %>
|
63
|
+
<td>
|
64
|
+
<%= "#{@abstract_model.config.label} ##{object.item}" %>
|
65
|
+
</td>
|
66
|
+
<% end %>
|
67
|
+
<% end %>
|
68
|
+
<td>
|
69
|
+
<%= object.message.in?(['delete', 'new']) ? t("admin.actions.#{object.message}.done").capitalize : object.message %>
|
70
|
+
</td>
|
71
|
+
</tr>
|
72
|
+
<% end %>
|
73
|
+
</tbody>
|
74
|
+
</table>
|
75
|
+
<% unless params[:all] || !@history.respond_to?(:current_page) %>
|
76
|
+
<%= paginate(@history, theme: 'ra-twitter-bootstrap', remote: true) %>
|
77
|
+
<%= link_to(t("admin.misc.show_all"), send(path_method, params.merge(all: true)), class: "show-all btn pjax") unless (tc = @history.total_count) <= @history.size || tc > 100 %>
|
78
|
+
<% end %>
|
@@ -0,0 +1,193 @@
|
|
1
|
+
<%
|
2
|
+
query = params[:query]
|
3
|
+
params = request.params.except(:authenticity_token, :action, :controller, :utf8, :bulk_export, :_pjax)
|
4
|
+
params.delete(:query) if params[:query].blank?
|
5
|
+
params.delete(:sort_reverse) unless params[:sort_reverse] == 'true'
|
6
|
+
sort_reverse = params[:sort_reverse]
|
7
|
+
sort = params[:sort]
|
8
|
+
params.delete(:sort) if params[:sort] == @model_config.list.sort_by.to_s
|
9
|
+
export_action = RailsAdmin::Config::Actions.find(:export, { controller: self.controller, abstract_model: @abstract_model })
|
10
|
+
export_action = nil unless export_action && authorized?(export_action.authorization_key, @abstract_model)
|
11
|
+
description = RailsAdmin.config(@abstract_model.model_name).description
|
12
|
+
properties = @model_config.list.with(controller: self.controller, view: self, object: @abstract_model.model.new).fields_for_table
|
13
|
+
checkboxes = @model_config.list.checkboxes?
|
14
|
+
table_table_header_count = begin
|
15
|
+
count = checkboxes ? 1 : 0
|
16
|
+
count = count + properties.count
|
17
|
+
end
|
18
|
+
%>
|
19
|
+
|
20
|
+
<% content_for :contextual_tabs do %>
|
21
|
+
<% if checkboxes %>
|
22
|
+
<%= bulk_menu %>
|
23
|
+
<% end %>
|
24
|
+
<% if filterable_fields.present? %>
|
25
|
+
<li class="dropdown" style="float:right">
|
26
|
+
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
|
27
|
+
<%= t('admin.misc.add_filter') %>
|
28
|
+
<b class="caret"></b>
|
29
|
+
</a>
|
30
|
+
<ul class="dropdown-menu" id="filters" style="left:auto; right:0;">
|
31
|
+
<% filterable_fields.each do |field| %>
|
32
|
+
<%
|
33
|
+
field_options = case field.type
|
34
|
+
when :enum
|
35
|
+
options_for_select(field.with(object: @abstract_model.model.new).enum)
|
36
|
+
else
|
37
|
+
''
|
38
|
+
end
|
39
|
+
%>
|
40
|
+
<li>
|
41
|
+
<a
|
42
|
+
href="#"
|
43
|
+
data-field-label="<%= field.label %>"
|
44
|
+
data-field-name="<%= field.name %>"
|
45
|
+
data-field-operator="<%= field.default_filter_operator %>"
|
46
|
+
data-field-options="<%= "#{field_options}" %>"
|
47
|
+
data-field-required="<%= field.required.to_s %>"
|
48
|
+
data-field-type="<%= field.type %>"
|
49
|
+
data-field-value=""
|
50
|
+
data-field-datetimepicker-format="<%= field.try(:momentjs_format) %>"
|
51
|
+
>
|
52
|
+
<%= field.label %>
|
53
|
+
</a>
|
54
|
+
</li>
|
55
|
+
<% end %>
|
56
|
+
</ul>
|
57
|
+
</li>
|
58
|
+
<% end %>
|
59
|
+
<% end %>
|
60
|
+
|
61
|
+
<style>
|
62
|
+
<% properties.select{ |p| p.column_width.present? }.each do |property| %>
|
63
|
+
<%= "#list th.#{property.css_class} { width: #{property.column_width}px; min-width: #{property.column_width}px; }" %>
|
64
|
+
<%= "#list td.#{property.css_class} { max-width: #{property.column_width}px;}" %>
|
65
|
+
<% end %>
|
66
|
+
</style>
|
67
|
+
|
68
|
+
<div id="list">
|
69
|
+
<%= form_tag(index_path(params.except(*%w[page f query])), method: :get, class: "pjax-form form-inline") do %>
|
70
|
+
<div class="well">
|
71
|
+
<span data-options="<%= ordered_filter_options.to_json %>" id="filters_box"></span>
|
72
|
+
<hr class="filters_box" style="display:<%= ordered_filters.empty? ? 'none' : 'block' %>"/>
|
73
|
+
<div class="input-group">
|
74
|
+
<input class="form-control input-small" name="query" placeholder="<%= t("admin.misc.filter") %>" type="search" value="<%= query %>"></input>
|
75
|
+
<span class="input-group-btn">
|
76
|
+
<button class="btn btn-primary" data-disable-with="<%= '<i class="fas fa-sync"></i>' + t('admin.misc.refresh') %>" type="submit">
|
77
|
+
<i class="fas fa-sync"></i>
|
78
|
+
<%= t('admin.misc.refresh') %>
|
79
|
+
</button>
|
80
|
+
<button class="btn btn-info" id="remove_filter" title="<%= t('admin.misc.reset_filters') %>">
|
81
|
+
<i class="fas fa-times"></i>
|
82
|
+
</button>
|
83
|
+
</span>
|
84
|
+
</div>
|
85
|
+
<% if export_action %>
|
86
|
+
<span style="float:right">
|
87
|
+
<%= link_to wording_for(:link, export_action), export_path(params.except('page')), class: 'btn btn-info' %>
|
88
|
+
</span>
|
89
|
+
<% end %>
|
90
|
+
</div>
|
91
|
+
<% end %>
|
92
|
+
<% unless @model_config.list.scopes.empty? %>
|
93
|
+
<ul class="nav nav-tabs" id="scope_selector">
|
94
|
+
<% @model_config.list.scopes.each_with_index do |scope, index| %>
|
95
|
+
<% scope = '_all' if scope.nil? %>
|
96
|
+
<li class="<%= 'active' if scope.to_s == params[:scope] || (params[:scope].blank? && index == 0) %>">
|
97
|
+
<a class="pjax" href="<%= index_path(params.merge(scope: scope, page: nil)) %>">
|
98
|
+
<%= I18n.t("admin.scopes.#{@abstract_model.to_param}.#{scope}", default: I18n.t("admin.scopes.#{scope}", default: scope.to_s.titleize)) %>
|
99
|
+
</a>
|
100
|
+
</li>
|
101
|
+
<% end %>
|
102
|
+
</ul>
|
103
|
+
<% end %>
|
104
|
+
<%= form_tag bulk_action_path(model_name: @abstract_model.to_param), method: :post, id: "bulk_form", class: ["form"] do %>
|
105
|
+
<%= hidden_field_tag :bulk_action %>
|
106
|
+
<% if description.present? %>
|
107
|
+
<p>
|
108
|
+
<strong>
|
109
|
+
<%= description %>
|
110
|
+
</strong>
|
111
|
+
</p>
|
112
|
+
<% end %>
|
113
|
+
<div id="sidescroll">
|
114
|
+
<table class="table table-condensed table-striped table-hover">
|
115
|
+
<thead>
|
116
|
+
<tr>
|
117
|
+
<% if checkboxes %>
|
118
|
+
<th class="shrink sticky">
|
119
|
+
<input class="toggle" type="checkbox"></input>
|
120
|
+
</th>
|
121
|
+
<% end %>
|
122
|
+
<% properties.each do |property| %>
|
123
|
+
<% selected = (sort == property.name.to_s) %>
|
124
|
+
<% if property.sortable %>
|
125
|
+
<% sort_location = index_path params.except('sort_reverse').except('page').merge(sort: property.name).merge(selected && sort_reverse != "true" ? {sort_reverse: "true"} : {}) %>
|
126
|
+
<% sort_direction = (sort_reverse == 'true' ? "headerSortUp" : "headerSortDown" if selected) %>
|
127
|
+
<% end %>
|
128
|
+
<th class="<%= [property.sortable && "header pjax", property.sortable && sort_direction, property.sticky? && 'sticky', property.css_class, property.type_css_class].compact.join(' ') %>" data-href="<%= property.sortable && sort_location %>" rel="tooltip" title="<%= property.hint %>">
|
129
|
+
<%= property.label %>
|
130
|
+
</th>
|
131
|
+
<% end %>
|
132
|
+
<th class="last shrink"></th>
|
133
|
+
</tr>
|
134
|
+
</thead>
|
135
|
+
<tbody>
|
136
|
+
<% @objects.each do |object| %>
|
137
|
+
<tr class="<%= @abstract_model.param_key %>_row <%= @model_config.list.with(object: object).row_css_class %>">
|
138
|
+
<% if checkboxes %>
|
139
|
+
<td class="sticky">
|
140
|
+
<%= check_box_tag "bulk_ids[]", object.id, false %>
|
141
|
+
</td>
|
142
|
+
<% end %>
|
143
|
+
<% properties.map{ |property| property.bind(:object, object) }.each do |property| %>
|
144
|
+
<% value = property.pretty_value %>
|
145
|
+
<td class="<%= [property.sticky? && 'sticky', property.css_class, property.type_css_class].compact.join(' ') %>" title="<%= strip_tags(value.to_s) %>">
|
146
|
+
<%= value %>
|
147
|
+
</td>
|
148
|
+
<% end %>
|
149
|
+
<td class="last links ra-sidescroll-frozen">
|
150
|
+
<ul class="inline list-inline">
|
151
|
+
<%= menu_for :member, @abstract_model, object, true %>
|
152
|
+
</ul>
|
153
|
+
</td>
|
154
|
+
</tr>
|
155
|
+
<% end %>
|
156
|
+
<% if @objects.empty? %>
|
157
|
+
<tr class="empty_row">
|
158
|
+
<td colspan="<%= table_table_header_count %>">
|
159
|
+
<%= I18n.t('admin.actions.index.no_records') %>
|
160
|
+
</td>
|
161
|
+
</tr>
|
162
|
+
<% end %>
|
163
|
+
</tbody>
|
164
|
+
</table>
|
165
|
+
</div>
|
166
|
+
<% if @model_config.list.limited_pagination %>
|
167
|
+
<div class="row">
|
168
|
+
<div class="col-md-6">
|
169
|
+
<%= paginate(@objects, theme: 'ra-twitter-bootstrap/without_count', total_pages: Float::INFINITY, remote: true) %>
|
170
|
+
</div>
|
171
|
+
</div>
|
172
|
+
<% elsif @objects.respond_to?(:total_count) %>
|
173
|
+
<% total_count = @objects.total_count.to_i %>
|
174
|
+
<div class="row">
|
175
|
+
<div class="col-md-6">
|
176
|
+
<%= paginate(@objects, theme: 'ra-twitter-bootstrap', remote: true) %>
|
177
|
+
</div>
|
178
|
+
</div>
|
179
|
+
<div class="row">
|
180
|
+
<div class="col-md-6">
|
181
|
+
<%= link_to(t("admin.misc.show_all"), index_path(params.merge(all: true)), class: "show-all btn btn-default clearfix pjax") unless total_count > 100 || total_count <= @objects.to_a.size %>
|
182
|
+
</div>
|
183
|
+
</div>
|
184
|
+
<div class="clearfix total-count">
|
185
|
+
<%= "#{total_count} #{@model_config.pluralize(total_count).downcase}" %>
|
186
|
+
</div>
|
187
|
+
<% else %>
|
188
|
+
<div class="clearfix total-count">
|
189
|
+
<%= "#{@objects.size} #{@model_config.pluralize(@objects.size).downcase}" %>
|
190
|
+
</div>
|
191
|
+
<% end %>
|
192
|
+
<% end %>
|
193
|
+
</div>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<% @model_config.show.with(object: @object, view: self, controller: self.controller).visible_groups.each do |fieldset| %>
|
2
|
+
<% unless (fields = fieldset.with(object: @object, view: self, controller: self.controller).visible_fields).empty? %>
|
3
|
+
<% unless (fields = fields.reject{ |f| RailsAdmin::config.compact_show_view && (f.formatted_value.nil? || f.formatted_value == '') }).empty? %>
|
4
|
+
<div class="fieldset">
|
5
|
+
<h4>
|
6
|
+
<%= fieldset.label %>
|
7
|
+
</h4>
|
8
|
+
<% if fieldset.help %>
|
9
|
+
<p>
|
10
|
+
<%= fieldset.help %>
|
11
|
+
</p>
|
12
|
+
<% end %>
|
13
|
+
<dl>
|
14
|
+
<% fields.each_with_index do |field, index| %>
|
15
|
+
<dt>
|
16
|
+
<span class="<%= field.type_css_class %> <%= field.css_class %> label label-info">
|
17
|
+
<%= field.label %>
|
18
|
+
</span>
|
19
|
+
</dt>
|
20
|
+
<dd class="well">
|
21
|
+
<%= field.pretty_value %>
|
22
|
+
</dd>
|
23
|
+
<% end %>
|
24
|
+
</dl>
|
25
|
+
</div>
|
26
|
+
<% end %>
|
27
|
+
<% end %>
|
28
|
+
<% end %>
|
@@ -11,6 +11,7 @@ en:
|
|
11
11
|
yesterday: Yesterday
|
12
12
|
this_week: This week
|
13
13
|
last_week: Last week
|
14
|
+
time: Time ...
|
14
15
|
number: Number ...
|
15
16
|
contains: Contains
|
16
17
|
does_not_contain: Does not contain
|
@@ -19,6 +20,7 @@ en:
|
|
19
20
|
ends_with: Ends with
|
20
21
|
too_many_objects: "Too many objects, use search box above"
|
21
22
|
no_objects: "No objects found"
|
23
|
+
clear: Clear
|
22
24
|
loading: "Loading..."
|
23
25
|
toggle_navigation: Toggle navigation
|
24
26
|
home:
|
@@ -72,6 +74,7 @@ en:
|
|
72
74
|
title: "List of %{model_label_plural}"
|
73
75
|
menu: "List"
|
74
76
|
breadcrumb: "%{model_label_plural}"
|
77
|
+
no_records: "No records found"
|
75
78
|
show:
|
76
79
|
title: "Details for %{model_label} '%{object_label}'"
|
77
80
|
menu: "Show"
|
@@ -127,6 +130,7 @@ en:
|
|
127
130
|
save: "Save"
|
128
131
|
save_and_add_another: "Save and add another"
|
129
132
|
save_and_edit: "Save and edit"
|
133
|
+
delete_file: "Delete '%{field_label}' #%{number}"
|
130
134
|
all_of_the_following_related_items_will_be_deleted: "? The following related items may be deleted or orphaned:"
|
131
135
|
are_you_sure_you_want_to_delete_the_object: "Are you sure you want to delete this %{model_name}"
|
132
136
|
confirmation: "Yes, I'm sure"
|
@@ -141,7 +145,7 @@ en:
|
|
141
145
|
display: "Display %{name}: %{type}"
|
142
146
|
options_for: "Options for %{name}"
|
143
147
|
empty_value_for_associated_objects: "<empty>"
|
144
|
-
click_to_reverse_selection:
|
148
|
+
click_to_reverse_selection: "Click to reverse selection"
|
145
149
|
csv:
|
146
150
|
header_for_root_methods: "%{name}" # 'model' is available
|
147
151
|
header_for_association_methods: "%{name} [%{association}]"
|
@@ -1,18 +1,66 @@
|
|
1
1
|
require 'rails/generators'
|
2
|
-
require File.expand_path('
|
2
|
+
require File.expand_path('utils', __dir__)
|
3
3
|
|
4
4
|
module RailsAdmin
|
5
5
|
class InstallGenerator < Rails::Generators::Base
|
6
|
-
source_root File.expand_path('
|
6
|
+
source_root File.expand_path('templates', __dir__)
|
7
7
|
include Generators::Utils::InstanceMethods
|
8
8
|
|
9
9
|
argument :_namespace, type: :string, required: false, desc: 'RailsAdmin url namespace'
|
10
|
+
class_option :asset, type: :string, required: false, default: nil, desc: 'Asset delivery method [options: webpack, webpacker, sprockets]'
|
10
11
|
desc 'RailsAdmin installation generator'
|
11
12
|
|
12
13
|
def install
|
13
14
|
namespace = ask_for('Where do you want to mount rails_admin?', 'admin', _namespace)
|
14
15
|
route("mount RailsAdmin::Engine => '/#{namespace}', as: 'rails_admin'")
|
15
|
-
|
16
|
+
if File.exist? File.join(destination_root, 'config/initializers/rails_admin.rb')
|
17
|
+
insert_into_file 'config/initializers/rails_admin.rb', " config.asset_source = :#{asset}\n", after: "RailsAdmin.config do |config|\n"
|
18
|
+
else
|
19
|
+
template 'initializer.erb', 'config/initializers/rails_admin.rb'
|
20
|
+
end
|
21
|
+
display "Using [#{asset}] for asset delivery method"
|
22
|
+
case asset
|
23
|
+
when 'webpack'
|
24
|
+
configure_for_webpack
|
25
|
+
when 'webpacker'
|
26
|
+
configure_for_webpacker5
|
27
|
+
when 'sprockets'
|
28
|
+
configure_for_sprockets
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def asset
|
35
|
+
return options['asset'] if options['asset']
|
36
|
+
|
37
|
+
if Rails.root.join('webpack.config.js').exist?
|
38
|
+
'webpack'
|
39
|
+
elsif defined?(Webpacker)
|
40
|
+
'webpacker'
|
41
|
+
else
|
42
|
+
'sprockets'
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def configure_for_sprockets
|
47
|
+
gem 'sassc-rails'
|
48
|
+
end
|
49
|
+
|
50
|
+
def configure_for_webpacker5
|
51
|
+
run "yarn add rails_admin@#{RailsAdmin::Version.js}"
|
52
|
+
@scss_relative_dir = '../stylesheets/'
|
53
|
+
template 'rails_admin.js.erb', 'app/javascript/packs/rails_admin.js'
|
54
|
+
template 'rails_admin.scss', 'app/javascript/stylesheets/rails_admin.scss'
|
55
|
+
template 'environment.js', 'config/webpack/environment.js'
|
56
|
+
end
|
57
|
+
|
58
|
+
def configure_for_webpack
|
59
|
+
run "yarn add rails_admin@#{RailsAdmin::Version.js} css-loader mini-css-extract-plugin sass sass-loader"
|
60
|
+
@scss_relative_dir = './'
|
61
|
+
template 'rails_admin.js.erb', 'app/javascript/rails_admin.js'
|
62
|
+
template 'rails_admin.scss', 'app/javascript/rails_admin.scss'
|
63
|
+
template 'webpack.config.js', 'webpack.config.js'
|
16
64
|
end
|
17
65
|
end
|
18
66
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
RailsAdmin.config do |config|
|
2
|
+
config.asset_source = :<%= asset %>
|
2
3
|
|
3
4
|
### Popular gems integration
|
4
5
|
|
@@ -17,7 +18,7 @@ RailsAdmin.config do |config|
|
|
17
18
|
## == PaperTrail ==
|
18
19
|
# config.audit_with :paper_trail, 'User', 'PaperTrail::Version' # PaperTrail >= 3.0.0
|
19
20
|
|
20
|
-
### More at https://github.com/
|
21
|
+
### More at https://github.com/railsadminteam/rails_admin/wiki/Base-configuration
|
21
22
|
|
22
23
|
## == Gravatar integration ==
|
23
24
|
## To disable Gravatar integration in Navigation Bar set to false
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "~rails_admin/src/rails_admin/styles/base";
|
@@ -0,0 +1,32 @@
|
|
1
|
+
const path = require("path")
|
2
|
+
const webpack = require('webpack')
|
3
|
+
const MiniCssExtractPlugin = require("mini-css-extract-plugin")
|
4
|
+
|
5
|
+
module.exports = {
|
6
|
+
mode: "production",
|
7
|
+
entry: {
|
8
|
+
application: "./app/javascript/application.js",
|
9
|
+
rails_admin: "./app/javascript/rails_admin.js",
|
10
|
+
},
|
11
|
+
output: {
|
12
|
+
filename: "[name].js",
|
13
|
+
path: path.resolve(__dirname, "app/assets/builds"),
|
14
|
+
},
|
15
|
+
module: {
|
16
|
+
rules: [
|
17
|
+
{
|
18
|
+
test: /.s?css$/,
|
19
|
+
use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"],
|
20
|
+
},
|
21
|
+
],
|
22
|
+
},
|
23
|
+
plugins: [
|
24
|
+
new webpack.optimize.LimitChunkCountPlugin({
|
25
|
+
maxChunks: 1
|
26
|
+
}),
|
27
|
+
new webpack.ProvidePlugin({
|
28
|
+
jQuery: "jquery"
|
29
|
+
}),
|
30
|
+
new MiniCssExtractPlugin(),
|
31
|
+
]
|
32
|
+
}
|