rails_admin 0.8.1 → 2.2.1
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 +5 -5
- data/Gemfile +17 -34
- data/LICENSE.md +1 -1
- data/README.md +34 -26
- data/app/assets/images/rails_admin/aristo/images/bg_fallback.png +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/magnifier.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-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/custom/ui.js +1 -0
- data/app/assets/javascripts/rails_admin/jquery-ui.js.erb +8 -0
- data/app/assets/javascripts/rails_admin/jquery.migrate.js +3 -0
- data/app/assets/javascripts/rails_admin/ra.filter-box.js +148 -60
- data/app/assets/javascripts/rails_admin/ra.filtering-multiselect.js +31 -26
- data/app/assets/javascripts/rails_admin/ra.filtering-select.js +211 -110
- data/app/assets/javascripts/rails_admin/ra.i18n.js +28 -0
- data/app/assets/javascripts/rails_admin/ra.nested-form-hooks.js +59 -0
- data/app/assets/javascripts/rails_admin/ra.sidescroll.js +31 -0
- data/app/assets/javascripts/rails_admin/ra.widgets.js +379 -0
- data/app/assets/javascripts/rails_admin/rails_admin.js +5 -5
- data/app/assets/javascripts/rails_admin/ui.js +135 -0
- data/app/assets/stylesheets/rails_admin/aristo/images/bg_fallback.png +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 +5 -5
- data/app/assets/stylesheets/rails_admin/ra.sidescroll.scss +29 -0
- data/app/assets/stylesheets/rails_admin/ra.widgets.scss +9 -1
- data/app/assets/stylesheets/rails_admin/rails_admin.scss.erb +2 -1
- data/app/controllers/rails_admin/application_controller.rb +14 -8
- data/app/controllers/rails_admin/main_controller.rb +9 -9
- data/app/helpers/rails_admin/application_helper.rb +26 -11
- data/app/helpers/rails_admin/form_builder.rb +20 -12
- data/app/helpers/rails_admin/main_helper.rb +8 -7
- data/app/views/kaminari/{twitter-bootstrap → ra-twitter-bootstrap}/_gap.html.haml +0 -0
- data/app/views/kaminari/{twitter-bootstrap → ra-twitter-bootstrap}/_next_page.html.haml +0 -0
- data/app/views/kaminari/{twitter-bootstrap → ra-twitter-bootstrap}/_page.html.haml +0 -0
- data/app/views/kaminari/{twitter-bootstrap → ra-twitter-bootstrap}/_paginator.html.haml +0 -0
- data/app/views/kaminari/{twitter-bootstrap → ra-twitter-bootstrap}/_prev_page.html.haml +0 -0
- data/app/views/kaminari/ra-twitter-bootstrap/without_count/_next_page.html.haml +4 -0
- data/app/views/kaminari/ra-twitter-bootstrap/without_count/_paginator.html.haml +4 -0
- data/app/views/kaminari/ra-twitter-bootstrap/without_count/_prev_page.html.haml +4 -0
- data/app/views/layouts/rails_admin/_head.html.haml +7 -0
- data/app/views/layouts/rails_admin/_secondary_navigation.html.haml +2 -2
- data/app/views/layouts/rails_admin/_sidebar_navigation.html.haml +2 -1
- data/app/views/layouts/rails_admin/application.html.haml +4 -10
- data/app/views/layouts/rails_admin/pjax.html.haml +1 -5
- data/app/views/rails_admin/main/_delete_notice.html.haml +14 -9
- data/app/views/rails_admin/main/_form_action_text.html.haml +7 -0
- data/app/views/rails_admin/main/_form_colorpicker.html.haml +1 -1
- data/app/views/rails_admin/main/_form_enumeration.html.haml +4 -3
- data/app/views/rails_admin/main/_form_file_upload.html.haml +5 -5
- data/app/views/rails_admin/main/_form_filtering_multiselect.html.haml +7 -6
- data/app/views/rails_admin/main/_form_filtering_select.html.haml +1 -1
- data/app/views/rails_admin/main/_form_multiple_file_upload.html.haml +16 -0
- data/app/views/rails_admin/main/_form_polymorphic_association.html.haml +18 -3
- data/app/views/rails_admin/main/_form_simple_mde.haml +8 -0
- data/app/views/rails_admin/main/dashboard.html.haml +5 -6
- data/app/views/rails_admin/main/export.html.haml +45 -36
- data/app/views/rails_admin/main/history.html.haml +3 -3
- data/app/views/rails_admin/main/index.html.haml +37 -26
- data/app/views/rails_admin/main/show.html.haml +6 -7
- data/config/initializers/active_record_extensions.rb +3 -3
- data/config/initializers/haml.rb +4 -1
- data/config/locales/rails_admin.en.yml +5 -2
- data/lib/generators/rails_admin/templates/initializer.erb +6 -2
- data/lib/rails_admin/abstract_model.rb +9 -10
- data/lib/rails_admin/adapters/active_record/abstract_object.rb +9 -3
- data/lib/rails_admin/adapters/active_record/property.rb +1 -5
- data/lib/rails_admin/adapters/active_record.rb +83 -28
- data/lib/rails_admin/adapters/mongoid/abstract_object.rb +3 -3
- data/lib/rails_admin/adapters/mongoid/association.rb +18 -6
- data/lib/rails_admin/adapters/mongoid/bson.rb +29 -0
- data/lib/rails_admin/adapters/mongoid/extension.rb +4 -2
- data/lib/rails_admin/adapters/mongoid/property.rb +3 -3
- data/lib/rails_admin/adapters/mongoid.rb +40 -26
- data/lib/rails_admin/bootstrap-sass/compass_functions.rb +1 -1
- data/lib/rails_admin/bootstrap-sass/sass_functions.rb +1 -3
- data/lib/rails_admin/bootstrap-sass.rb +8 -6
- data/lib/rails_admin/config/actions/base.rb +20 -5
- data/lib/rails_admin/config/actions/bulk_delete.rb +2 -4
- data/lib/rails_admin/config/actions/dashboard.rb +9 -5
- data/lib/rails_admin/config/actions/edit.rb +1 -3
- data/lib/rails_admin/config/actions/export.rb +1 -1
- data/lib/rails_admin/config/actions/index.rb +5 -3
- data/lib/rails_admin/config/actions/new.rb +4 -5
- data/lib/rails_admin/config/actions.rb +1 -1
- data/lib/rails_admin/config/configurable.rb +25 -18
- data/lib/rails_admin/config/fields/association.rb +11 -3
- data/lib/rails_admin/config/fields/base.rb +20 -27
- data/lib/rails_admin/config/fields/factories/action_text.rb +12 -0
- data/lib/rails_admin/config/fields/factories/active_storage.rb +30 -0
- data/lib/rails_admin/config/fields/factories/carrierwave.rb +4 -2
- data/lib/rails_admin/config/fields/factories/dragonfly.rb +1 -1
- data/lib/rails_admin/config/fields/factories/shrine.rb +27 -0
- data/lib/rails_admin/config/fields/types/action_text.rb +30 -0
- data/lib/rails_admin/config/fields/types/active_record_enum.rb +19 -2
- data/lib/rails_admin/config/fields/types/active_storage.rb +49 -0
- data/lib/rails_admin/config/fields/types/all.rb +7 -1
- data/lib/rails_admin/config/fields/types/belongs_to_association.rb +8 -0
- data/lib/rails_admin/config/fields/types/bson_object_id.rb +1 -15
- data/lib/rails_admin/config/fields/types/ck_editor.rb +7 -7
- data/lib/rails_admin/config/fields/types/code_mirror.rb +10 -12
- data/lib/rails_admin/config/fields/types/color.rb +2 -2
- data/lib/rails_admin/config/fields/types/datetime.rb +6 -3
- data/lib/rails_admin/config/fields/types/file_upload.rb +12 -4
- data/lib/rails_admin/config/fields/types/froala.rb +9 -11
- data/lib/rails_admin/config/fields/types/has_many_association.rb +1 -1
- data/lib/rails_admin/config/fields/types/hidden.rb +2 -2
- data/lib/rails_admin/config/fields/types/json.rb +9 -1
- data/lib/rails_admin/config/fields/types/multiple_active_storage.rb +53 -0
- data/lib/rails_admin/config/fields/types/multiple_carrierwave.rb +56 -0
- data/lib/rails_admin/config/fields/types/multiple_file_upload.rb +125 -0
- data/lib/rails_admin/config/fields/types/password.rb +5 -1
- data/lib/rails_admin/config/fields/types/polymorphic_association.rb +12 -1
- data/lib/rails_admin/config/fields/types/serialized.rb +2 -2
- data/lib/rails_admin/config/fields/types/shrine.rb +54 -0
- data/lib/rails_admin/config/fields/types/simple_mde.rb +36 -0
- data/lib/rails_admin/config/fields/types/string.rb +8 -7
- data/lib/rails_admin/config/fields/types/string_like.rb +19 -0
- data/lib/rails_admin/config/fields/types/text.rb +2 -20
- data/lib/rails_admin/config/fields/types/wysihtml5.rb +14 -10
- 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 +1 -1
- data/lib/rails_admin/config/has_groups.rb +1 -1
- data/lib/rails_admin/config/hideable.rb +1 -1
- data/lib/rails_admin/config/inspectable.rb +39 -0
- data/lib/rails_admin/config/lazy_model.rb +48 -8
- data/lib/rails_admin/config/model.rb +10 -22
- data/lib/rails_admin/config/proxyable/proxy.rb +7 -9
- data/lib/rails_admin/config/proxyable.rb +13 -1
- data/lib/rails_admin/config/sections/base.rb +4 -17
- data/lib/rails_admin/config/sections/list.rb +37 -0
- data/lib/rails_admin/config.rb +46 -25
- data/lib/rails_admin/engine.rb +37 -4
- data/lib/rails_admin/extension.rb +16 -4
- data/lib/rails_admin/extensions/cancancan/authorization_adapter.rb +23 -7
- data/lib/rails_admin/extensions/cancancan.rb +1 -1
- data/lib/rails_admin/extensions/controller_extension.rb +6 -0
- data/lib/rails_admin/extensions/history/auditing_adapter.rb +2 -2
- data/lib/rails_admin/extensions/history/history.rb +2 -2
- data/lib/rails_admin/extensions/paper_trail/auditing_adapter.rb +59 -17
- data/lib/rails_admin/extensions/pundit/authorization_adapter.rb +11 -3
- data/lib/rails_admin/support/csv_converter.rb +20 -14
- data/lib/rails_admin/support/datetime.rb +7 -6
- data/lib/rails_admin/support/i18n.rb +7 -5
- data/lib/rails_admin/version.rb +2 -2
- data/lib/rails_admin.rb +23 -1
- data/lib/tasks/rails_admin.rake +16 -7
- 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 +2671 -0
- 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/bootstrap/glyphicons-halflings-white.png +0 -0
- data/vendor/assets/images/rails_admin/bootstrap/glyphicons-halflings.png +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/{app → vendor}/assets/images/rails_admin/colorpicker/colorpicker_rgb_r.png +0 -0
- data/{app → 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/{app → vendor}/assets/images/rails_admin/colorpicker/custom_rgb_b.png +0 -0
- data/{app → vendor}/assets/images/rails_admin/colorpicker/custom_rgb_g.png +0 -0
- data/{app → 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/{app → vendor}/assets/images/rails_admin/colorpicker/select2.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/slider.png +0 -0
- data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap-affix.js +50 -28
- data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap-alert.js +10 -7
- data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap-button.js +35 -20
- data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap-carousel.js +48 -25
- data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap-collapse.js +70 -28
- data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap-dropdown.js +56 -42
- data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap-modal.js +118 -40
- data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap-popover.js +26 -16
- data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap-scrollspy.js +29 -27
- data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap-tab.js +46 -19
- data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap-tooltip.js +280 -60
- data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap-transition.js +5 -5
- data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap-typeahead.js +0 -0
- data/{app → vendor}/assets/javascripts/rails_admin/bootstrap/bootstrap.js +0 -0
- data/vendor/assets/javascripts/rails_admin/bootstrap-datetimepicker.js +317 -150
- data/{app → vendor}/assets/javascripts/rails_admin/jquery.colorpicker.js +0 -0
- data/{app → vendor}/assets/javascripts/rails_admin/jquery.pjax.js +316 -161
- data/vendor/assets/javascripts/rails_admin/moment-with-locales.js +16528 -8420
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_alerts.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_badges.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_breadcrumbs.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_button-groups.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_buttons.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_carousel.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_close.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_code.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_component-animations.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_dropdowns.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_forms.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_glyphicons.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_grid.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_input-groups.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_jumbotron.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_labels.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_list-group.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_media.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_mixins.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_modals.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_navbar.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_navs.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_normalize.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_pager.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_pagination.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_panels.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_popovers.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_print.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_progress-bars.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_responsive-embed.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_responsive-utilities.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_scaffolding.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_tables.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_theme.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_thumbnails.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_tooltip.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_type.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_utilities.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_variables.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/_wells.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/bootstrap.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_alerts.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_background-variant.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_border-radius.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_buttons.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_center-block.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_clearfix.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_forms.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_gradients.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_grid-framework.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_grid.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_hide-text.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_image.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_labels.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_list-group.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_nav-divider.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_nav-vertical-align.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_opacity.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_pagination.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_panels.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_progress-bar.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_reset-filter.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_resize.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_responsive-visibility.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_size.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_tab-focus.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_table-row.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_text-emphasis.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_text-overflow.scss +0 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/bootstrap/mixins/_vendor-prefixes.scss +0 -0
- data/vendor/assets/stylesheets/rails_admin/font-awesome.scss +2342 -0
- data/{app → vendor}/assets/stylesheets/rails_admin/jquery.colorpicker.scss +0 -0
- metadata +214 -199
- data/app/assets/images/rails_admin/bootstrap/glyphicons-halflings-white.png +0 -0
- data/app/assets/images/rails_admin/bootstrap/glyphicons-halflings.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_background.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_hex.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_hsb_b.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_hsb_h.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_hsb_s.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_indic.gif +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_overlay.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_rgb_b.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_rgb_g.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_submit.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_background.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_hex.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_hsb_b.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_hsb_h.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_hsb_s.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_indic.gif +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_submit.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/select.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/slider.png +0 -0
- data/app/assets/javascripts/rails_admin/custom/ui.coffee +0 -1
- data/app/assets/javascripts/rails_admin/jquery.remotipart.fixed.js +0 -72
- data/app/assets/javascripts/rails_admin/ra.i18n.coffee +0 -8
- data/app/assets/javascripts/rails_admin/ra.nested-form-hooks.coffee +0 -52
- data/app/assets/javascripts/rails_admin/ra.widgets.coffee +0 -308
- data/app/assets/javascripts/rails_admin/ui.coffee +0 -102
- data/config/initializers/devise_patch.rb +0 -9
- data/lib/rails_admin/config/fields/factories/refile.rb +0 -25
- data/lib/rails_admin/config/fields/types/refile.rb +0 -27
- data/lib/rails_admin/extensions/cancan/authorization_adapter.rb +0 -57
- data/lib/rails_admin/extensions/cancan.rb +0 -3
@@ -1,47 +1,55 @@
|
|
1
1
|
- params = request.params.except(:action, :controller, :utf8, :page, :per_page, :format, :authenticity_token)
|
2
2
|
- visible_fields = @model_config.export.with(view: self, object: @abstract_model.model.new, controller: self.controller).visible_fields
|
3
3
|
|
4
|
-
= form_tag export_path(params.merge(all: true)), method: 'post', class: 'form-horizontal
|
4
|
+
= form_tag export_path(params.merge(all: true)), method: 'post', class: 'form-horizontal' do
|
5
5
|
|
6
6
|
%input{name: "send_data", type: "hidden", value: "true"}/
|
7
7
|
%fieldset{id: 'fields_to_export'}
|
8
8
|
%legend
|
9
9
|
%i.icon-chevron-down
|
10
10
|
= t('admin.export.select')
|
11
|
-
.form-group.control-group
|
12
|
-
.
|
13
|
-
.
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
.form-group.control-group
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
11
|
+
.form-group.control-group
|
12
|
+
.col-sm-12
|
13
|
+
.checkbox
|
14
|
+
%label{for: 'check_all'}
|
15
|
+
= check_box_tag 'all', 'all', true, { id: 'check_all' }
|
16
|
+
%b= t('admin.export.select_all_fields')
|
17
|
+
.form-group.control-group
|
18
|
+
.col-sm-12
|
19
|
+
.well.well-sm.reverse-selection{rel: 'tooltip', title: t('admin.export.click_to_reverse_selection'), style: 'margin: 0; cursor: pointer;'}
|
20
|
+
%b= t('admin.export.fields_from', name: @model_config.label_plural.downcase)
|
21
|
+
.controls
|
22
|
+
.row
|
23
|
+
- visible_fields.select{ |f| !f.association? || f.association.polymorphic? }.each do |field|
|
24
|
+
- list = field.virtual? ? 'methods' : 'only'
|
25
|
+
.checkbox.col-sm-3
|
26
|
+
- if field.association? && field.association.polymorphic?
|
27
|
+
%label{for: "schema_#{list}_#{field.method_name}"}
|
28
|
+
= check_box_tag "schema[#{list}][]", field.method_name, true, { id: "schema_#{list}_#{field.method_name}" }
|
29
|
+
= field.label + " [id]"
|
30
|
+
- polymorphic_type_column_name = @abstract_model.properties.detect {|p| field.association.foreign_type == p.name }.name
|
31
|
+
%label{for: "schema_#{list}_#{polymorphic_type_column_name}"}
|
32
|
+
= check_box_tag "schema[#{list}][]", polymorphic_type_column_name, true, { id: "schema_#{list}_#{polymorphic_type_column_name}" }
|
33
|
+
= capitalize_first_letter(field.label) + " [type]"
|
34
|
+
- else
|
35
|
+
%label{for: "schema_#{list}_#{field.name}"}
|
36
|
+
= check_box_tag "schema[#{list}][]", field.name, true, { id: "schema_#{list}_#{field.name}" }
|
37
|
+
= capitalize_first_letter(field.label)
|
34
38
|
|
35
39
|
- visible_fields.select{ |f| f.association? && !f.association.polymorphic? }.each do |field|
|
36
40
|
- 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? }
|
37
|
-
.form-group.control-group
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
41
|
+
.form-group.control-group
|
42
|
+
.col-sm-12
|
43
|
+
.well.well-sm.reverse-selection{rel: 'tooltip', title: t('admin.export.click_to_reverse_selection'), style: 'margin: 0; cursor: pointer;'}
|
44
|
+
%b= t('admin.export.fields_from_associated', name: field.label.downcase)
|
45
|
+
.controls
|
46
|
+
.row
|
47
|
+
- fields.each do |associated_model_field|
|
48
|
+
- list = associated_model_field.virtual? ? 'methods' : 'only'
|
49
|
+
.checkbox.col-sm-3
|
50
|
+
%label{for: "schema_include_#{field.name}_#{list}_#{associated_model_field.name}"}
|
51
|
+
= check_box_tag "schema[include][#{field.name}][#{list}][]", associated_model_field.name, true, { id: "schema_include_#{field.name}_#{list}_#{associated_model_field.name}" }
|
52
|
+
= capitalize_first_letter(associated_model_field.label)
|
45
53
|
|
46
54
|
%fieldset
|
47
55
|
%legend
|
@@ -52,20 +60,21 @@
|
|
52
60
|
%label.col-sm-2.control-label{for: "csv_options_encoding_to"}= t('admin.export.csv.encoding_to')
|
53
61
|
.col-sm-10.controls
|
54
62
|
-# from http://books.google.com/support/partner/bin/answer.py?answer=30990 :
|
55
|
-
= select_tag 'csv_options[encoding_to]', options_for_select(
|
63
|
+
= select_tag 'csv_options[encoding_to]', options_for_select(Encoding.name_list.sort), include_blank: true, placeholder: t('admin.misc.search'), :'data-enumeration' => true
|
56
64
|
%p.help-block= t('admin.export.csv.encoding_to_help', name: guessed_encoding)
|
57
65
|
|
58
66
|
.form-group.control-group
|
59
67
|
%label.col-sm-2.control-label{for: "csv_options_skip_header"}= t('admin.export.csv.skip_header')
|
60
68
|
.col-sm-10.controls
|
61
|
-
|
62
|
-
|
69
|
+
.checkbox
|
70
|
+
%label{style: 'display: block;' }
|
71
|
+
= check_box_tag 'csv_options[skip_header]', 'true'
|
63
72
|
%p.help-block= t('admin.export.csv.skip_header_help')
|
64
73
|
|
65
74
|
.form-group.control-group
|
66
75
|
%label.col-sm-2.control-label{for: "csv_options_generator_col_sep"}= t('admin.export.csv.col_sep')
|
67
76
|
.col-sm-10.controls
|
68
|
-
= select_tag 'csv_options[generator][col_sep]', options_for_select({ '' => t('admin.export.csv.default_col_sep'), "<comma> ','" => ',', "<semicolon> ';'" => ';', '<tabs>' => "'\t'" })
|
77
|
+
= 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
|
69
78
|
%p.help-block= t('admin.export.csv.col_sep_help', value: t('admin.export.csv.default_col_sep'))
|
70
79
|
|
71
80
|
.form-group.form-actions
|
@@ -10,7 +10,7 @@
|
|
10
10
|
.input-group
|
11
11
|
%input.form-control.input-small{name: "query", type: "search", value: query, placeholder: "#{t("admin.misc.filter")}", class: 'input-small'}
|
12
12
|
%span.input-group-btn
|
13
|
-
%button.btn.btn-primary{type:
|
13
|
+
%button.btn.btn-primary{type: 'submit', :'data-disable-with' => '<i class="icon-white icon-refresh"></i> '.html_safe + t('admin.misc.refresh')}
|
14
14
|
%i.icon-white.icon-refresh
|
15
15
|
= t("admin.misc.refresh")
|
16
16
|
%table#history.table.table-striped.table-condensed
|
@@ -32,7 +32,7 @@
|
|
32
32
|
- @history.each_with_index do |object, index|
|
33
33
|
%tr
|
34
34
|
- unless object.created_at.nil?
|
35
|
-
%td= l(object.created_at, format: :long, default: l(object.created_at, format: :long
|
35
|
+
%td= l(object.created_at, format: :long, default: l(object.created_at, format: :long))
|
36
36
|
%td= object.username
|
37
37
|
- if @general
|
38
38
|
- if o = @abstract_model.get(object.item)
|
@@ -46,6 +46,6 @@
|
|
46
46
|
%td= object.message.in?(['delete', 'new']) ? t("admin.actions.#{object.message}.done").capitalize : object.message
|
47
47
|
|
48
48
|
- unless params[:all] || !@history.respond_to?(:current_page)
|
49
|
-
= paginate(@history, theme: 'twitter-bootstrap', remote: true)
|
49
|
+
= paginate(@history, theme: 'ra-twitter-bootstrap', remote: true)
|
50
50
|
= 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
|
51
51
|
|
@@ -10,14 +10,18 @@
|
|
10
10
|
export_action = nil unless export_action && authorized?(export_action.authorization_key, @abstract_model)
|
11
11
|
description = RailsAdmin.config(@abstract_model.model_name).description
|
12
12
|
properties = @model_config.list.with(controller: self.controller, view: self, object: @abstract_model.model.new).visible_fields
|
13
|
+
checkboxes = @model_config.list.checkboxes?
|
13
14
|
# columns paginate
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
unless (frozen_columns = @model_config.list.sidescroll_frozen_columns)
|
16
|
+
sets = get_column_sets(properties)
|
17
|
+
properties = sets[params[:set].to_i] || []
|
18
|
+
other_left = ((params[:set].to_i - 1) >= 0) && sets[params[:set].to_i - 1].present?
|
19
|
+
other_right = sets[params[:set].to_i + 1].present?
|
20
|
+
end
|
18
21
|
|
19
22
|
- content_for :contextual_tabs do
|
20
|
-
|
23
|
+
- if checkboxes
|
24
|
+
= bulk_menu
|
21
25
|
- if filterable_fields.present?
|
22
26
|
%li.dropdown{style: 'float:right'}
|
23
27
|
%a.dropdown-toggle{href: '#', :'data-toggle' => "dropdown"}
|
@@ -31,12 +35,7 @@
|
|
31
35
|
- else
|
32
36
|
- ''
|
33
37
|
%li
|
34
|
-
%a{href: '#', :"data-field-label" => field.label, :"data-field-name" => field.name, :"data-field-options" => field_options.html_safe, :"data-field-type" => field.type, :"data-field-value" => "", :"data-field-datetimepicker-format" => (field.try(:parser) && field.parser.to_momentjs)}= capitalize_first_letter(field.label)
|
35
|
-
|
36
|
-
:javascript
|
37
|
-
jQuery(function($) {
|
38
|
-
#{ordered_filter_string}
|
39
|
-
});
|
38
|
+
%a{href: '#', :"data-field-label" => field.label, :"data-field-name" => field.name, :"data-field-operator" => field.default_filter_operator, :"data-field-options" => field_options.html_safe, :"data-field-required" => field.required.to_s, :"data-field-type" => field.type, :"data-field-value" => "", :"data-field-datetimepicker-format" => (field.try(:parser) && field.parser.to_momentjs)}= capitalize_first_letter(field.label)
|
40
39
|
|
41
40
|
%style
|
42
41
|
- properties.select{ |p| p.column_width.present? }.each do |property|
|
@@ -46,15 +45,15 @@
|
|
46
45
|
#list
|
47
46
|
= form_tag(index_path(params.except(*%w[page f query])), method: :get, class: "pjax-form form-inline") do
|
48
47
|
.well
|
49
|
-
%span#filters_box
|
48
|
+
%span#filters_box{data: {options: ordered_filter_options.to_json}}
|
50
49
|
%hr.filters_box{style: "display:#{ordered_filters.empty? ? 'none' : 'block'}"}
|
51
50
|
.input-group
|
52
51
|
%input.form-control.input-small{name: "query", type: "search", value: query, placeholder: t("admin.misc.filter")}
|
53
52
|
%span.input-group-btn
|
54
|
-
%button.btn.btn-primary{type:
|
53
|
+
%button.btn.btn-primary{type: 'submit', :'data-disable-with' => '<i class="icon-white icon-refresh"></i> '.html_safe + t('admin.misc.refresh')}
|
55
54
|
%i.icon-white.icon-refresh
|
56
|
-
= t(
|
57
|
-
%button#remove_filter.btn.btn-info{title:
|
55
|
+
= t('admin.misc.refresh')
|
56
|
+
%button#remove_filter.btn.btn-info{title: t('admin.misc.reset_filters')}
|
58
57
|
%i.icon-white.icon-remove
|
59
58
|
- if export_action
|
60
59
|
%span{style: 'float:right'}= link_to wording_for(:link, export_action), export_path(params.except('set').except('page')), class: 'btn btn-info'
|
@@ -66,7 +65,7 @@
|
|
66
65
|
%li{class: "#{'active' if scope.to_s == params[:scope] || (params[:scope].blank? && index == 0)}"}
|
67
66
|
%a{href: index_path(params.merge(scope: scope, page: nil)), class: 'pjax'}= I18n.t("admin.scopes.#{@abstract_model.to_param}.#{scope}", default: I18n.t("admin.scopes.#{scope}", default: scope.to_s.titleize))
|
68
67
|
|
69
|
-
= form_tag bulk_action_path(model_name: @abstract_model.to_param), method: :post, id: "bulk_form", class: "form" do
|
68
|
+
= form_tag bulk_action_path(model_name: @abstract_model.to_param), method: :post, id: "bulk_form", class: ["form", frozen_columns ? 'ra-sidescroll' : nil], data: (frozen_columns ? {ra_sidescroll: frozen_columns} : {}) do
|
70
69
|
= hidden_field_tag :bulk_action
|
71
70
|
- if description.present?
|
72
71
|
%p
|
@@ -75,8 +74,11 @@
|
|
75
74
|
%table.table.table-condensed.table-striped
|
76
75
|
%thead
|
77
76
|
%tr
|
78
|
-
|
79
|
-
%
|
77
|
+
- if checkboxes
|
78
|
+
%th.shrink
|
79
|
+
%input.toggle{type: "checkbox"}
|
80
|
+
- if frozen_columns
|
81
|
+
%th.last.shrink
|
80
82
|
- if other_left
|
81
83
|
%th.other.left.shrink= "..."
|
82
84
|
- properties.each do |property|
|
@@ -87,12 +89,16 @@
|
|
87
89
|
%th{class: "#{property.sortable && "header pjax" || nil} #{sort_direction if property.sortable && sort_direction} #{property.css_class} #{property.type_css_class}", :'data-href' => (property.sortable && sort_location), rel: "tooltip", title: "#{property.hint}"}= capitalize_first_letter(property.label)
|
88
90
|
- if other_right
|
89
91
|
%th.other.right.shrink= "..."
|
90
|
-
|
92
|
+
- unless frozen_columns
|
93
|
+
%th.last.shrink
|
91
94
|
%tbody
|
92
95
|
- @objects.each do |object|
|
93
|
-
%tr{class: "#{@abstract_model.param_key}_row"}
|
94
|
-
|
95
|
-
= check_box_tag "bulk_ids[]", object.id, false
|
96
|
+
%tr{class: "#{@abstract_model.param_key}_row #{@model_config.list.with(object: object).row_css_class}"}
|
97
|
+
- if checkboxes
|
98
|
+
%td= check_box_tag "bulk_ids[]", object.id, false
|
99
|
+
- if frozen_columns
|
100
|
+
%td.last.links
|
101
|
+
%ul.inline.list-inline= menu_for :member, @abstract_model, object, true
|
96
102
|
- if @other_left_link ||= other_left && index_path(params.except('set').merge(params[:set].to_i != 1 ? {set: (params[:set].to_i - 1)} : {}))
|
97
103
|
%td.other.left= link_to "...", @other_left_link, class: 'pjax'
|
98
104
|
- properties.map{ |property| property.bind(:object, object) }.each do |property|
|
@@ -100,13 +106,18 @@
|
|
100
106
|
%td{class: "#{property.css_class} #{property.type_css_class}", title: strip_tags(value.to_s)}= value
|
101
107
|
- if @other_right_link ||= other_right && index_path(params.merge(set: (params[:set].to_i + 1)))
|
102
108
|
%td.other.right= link_to "...", @other_right_link, class: 'pjax'
|
103
|
-
|
104
|
-
%
|
109
|
+
- unless frozen_columns
|
110
|
+
%td.last.links
|
111
|
+
%ul.inline.list-inline= menu_for :member, @abstract_model, object, true
|
112
|
+
|
113
|
+
- if @model_config.list.limited_pagination
|
114
|
+
.row
|
115
|
+
.col-md-6= paginate(@objects, theme: 'ra-twitter-bootstrap/without_count', total_pages: Float::INFINITY, remote: true)
|
105
116
|
|
106
|
-
-
|
117
|
+
- elsif @objects.respond_to?(:total_count)
|
107
118
|
- total_count = @objects.total_count.to_i
|
108
119
|
.row
|
109
|
-
.col-md-6= paginate(@objects, theme: 'twitter-bootstrap', remote: true)
|
120
|
+
.col-md-6= paginate(@objects, theme: 'ra-twitter-bootstrap', remote: true)
|
110
121
|
.row
|
111
122
|
.col-md-6= 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
|
112
123
|
.clearfix.total-count= "#{total_count} #{@model_config.pluralize(total_count).downcase}"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
- @model_config.show.with(object: @object, view: self, controller: self.controller).visible_groups.each do |fieldset|
|
2
2
|
- unless (fields = fieldset.with(object: @object, view: self, controller: self.controller).visible_fields).empty?
|
3
|
-
-
|
3
|
+
- unless (fields = fields.reject{ |f| RailsAdmin::config.compact_show_view && (f.formatted_value.nil? || f.formatted_value == '') }).empty?
|
4
4
|
.fieldset
|
5
5
|
%h4
|
6
6
|
= fieldset.label
|
@@ -8,9 +8,8 @@
|
|
8
8
|
%p= fieldset.help
|
9
9
|
%dl
|
10
10
|
- fields.each_with_index do |field, index|
|
11
|
-
|
12
|
-
%
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
= field.pretty_value
|
11
|
+
%dt
|
12
|
+
%span.label.label-info{class: "#{field.type_css_class} #{field.css_class}"}
|
13
|
+
= field.label
|
14
|
+
%dd.well
|
15
|
+
= field.pretty_value
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
ActiveSupport.on_load(:active_record) do
|
2
2
|
module ActiveRecord
|
3
3
|
class Base
|
4
4
|
def self.rails_admin(&block)
|
@@ -6,11 +6,11 @@ if defined?(::ActiveRecord)
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def rails_admin_default_object_label_method
|
9
|
-
|
9
|
+
new_record? ? "new #{self.class}" : "#{self.class} ##{id}"
|
10
10
|
end
|
11
11
|
|
12
12
|
def safe_send(value)
|
13
|
-
if
|
13
|
+
if has_attribute?(value)
|
14
14
|
read_attribute(value)
|
15
15
|
else
|
16
16
|
send(value)
|
data/config/initializers/haml.rb
CHANGED
@@ -29,21 +29,24 @@ en:
|
|
29
29
|
misc:
|
30
30
|
search: "Search"
|
31
31
|
filter: "Filter"
|
32
|
+
reset_filters: "Reset filters"
|
32
33
|
refresh: "Refresh"
|
33
34
|
show_all: "Show all"
|
34
35
|
add_filter: "Add filter"
|
35
36
|
bulk_menu_title: "Selected items"
|
36
37
|
remove: "Remove"
|
37
38
|
add_new: "Add new"
|
38
|
-
chosen: "Chosen %{name}"
|
39
39
|
chose_all: "Choose all"
|
40
40
|
clear_all: "Clear all"
|
41
41
|
up: "Up"
|
42
42
|
down: "Down"
|
43
43
|
navigation: "Navigation"
|
44
|
+
root_navigation: "Actions"
|
44
45
|
navigation_static_label: "Links"
|
45
46
|
log_out: "Log out"
|
47
|
+
time_ago: "%{time} ago"
|
46
48
|
ago: "ago"
|
49
|
+
more: "Plus %{count} more %{models_name}"
|
47
50
|
flash:
|
48
51
|
successful: "%{name} successfully %{action}"
|
49
52
|
error: "%{name} failed to be %{action}"
|
@@ -52,7 +55,7 @@ en:
|
|
52
55
|
object_not_found: "%{model} with id '%{id}' could not be found"
|
53
56
|
table_headers:
|
54
57
|
model_name: "Model name"
|
55
|
-
|
58
|
+
last_created: "Last created"
|
56
59
|
records: "Records"
|
57
60
|
username: "User"
|
58
61
|
changes: "Changes"
|
@@ -8,8 +8,8 @@ RailsAdmin.config do |config|
|
|
8
8
|
# end
|
9
9
|
# config.current_user_method(&:current_user)
|
10
10
|
|
11
|
-
## ==
|
12
|
-
# config.authorize_with :
|
11
|
+
## == CancanCan ==
|
12
|
+
# config.authorize_with :cancancan
|
13
13
|
|
14
14
|
## == Pundit ==
|
15
15
|
# config.authorize_with :pundit
|
@@ -19,6 +19,10 @@ RailsAdmin.config do |config|
|
|
19
19
|
|
20
20
|
### More at https://github.com/sferik/rails_admin/wiki/Base-configuration
|
21
21
|
|
22
|
+
## == Gravatar integration ==
|
23
|
+
## To disable Gravatar integration in Navigation Bar set to false
|
24
|
+
# config.show_gravatar = true
|
25
|
+
|
22
26
|
config.actions do
|
23
27
|
dashboard # mandatory
|
24
28
|
index # mandatory
|
@@ -46,7 +46,7 @@ module RailsAdmin
|
|
46
46
|
def initialize(model_or_model_name)
|
47
47
|
@model_name = model_or_model_name.to_s
|
48
48
|
ancestors = model.ancestors.collect(&:to_s)
|
49
|
-
if ancestors.include?('ActiveRecord::Base') && !model.abstract_class?
|
49
|
+
if ancestors.include?('ActiveRecord::Base') && !model.abstract_class? && model.table_exists?
|
50
50
|
initialize_active_record
|
51
51
|
elsif ancestors.include?('Mongoid::Document')
|
52
52
|
initialize_mongoid
|
@@ -87,12 +87,11 @@ module RailsAdmin
|
|
87
87
|
case association.type
|
88
88
|
when :has_one
|
89
89
|
if child = object.send(association.name)
|
90
|
-
yield(association, child)
|
90
|
+
yield(association, [child])
|
91
91
|
end
|
92
92
|
when :has_many
|
93
|
-
object.send(association.name)
|
94
|
-
|
95
|
-
end
|
93
|
+
children = object.send(association.name)
|
94
|
+
yield(association, Array.new(children))
|
96
95
|
end
|
97
96
|
end
|
98
97
|
end
|
@@ -147,7 +146,7 @@ module RailsAdmin
|
|
147
146
|
end
|
148
147
|
|
149
148
|
def build_statement_for_type
|
150
|
-
|
149
|
+
raise('You must override build_statement_for_type in your StatementBuilder')
|
151
150
|
end
|
152
151
|
|
153
152
|
def build_statement_for_integer_decimal_or_float
|
@@ -179,17 +178,17 @@ module RailsAdmin
|
|
179
178
|
|
180
179
|
def build_statement_for_datetime_or_timestamp
|
181
180
|
start_date, end_date = get_filtering_duration
|
182
|
-
start_date = start_date.
|
183
|
-
end_date = end_date.
|
181
|
+
start_date = start_date.try(:beginning_of_day) if start_date
|
182
|
+
end_date = end_date.try(:end_of_day) if end_date
|
184
183
|
range_filter(start_date, end_date)
|
185
184
|
end
|
186
185
|
|
187
186
|
def unary_operators
|
188
|
-
|
187
|
+
raise('You must override unary_operators in your StatementBuilder')
|
189
188
|
end
|
190
189
|
|
191
190
|
def range_filter(_min, _max)
|
192
|
-
|
191
|
+
raise('You must override range_filter in your StatementBuilder')
|
193
192
|
end
|
194
193
|
|
195
194
|
class FilteringDuration
|
@@ -20,11 +20,17 @@ module RailsAdmin
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def save(options = {validate: true})
|
23
|
-
object.save(options)
|
23
|
+
object.save(**options)
|
24
24
|
end
|
25
25
|
|
26
|
-
|
27
|
-
|
26
|
+
if RUBY_VERSION >= '2.7'
|
27
|
+
def method_missing(method_name, *args, **kwargs, &block)
|
28
|
+
object.send(method_name, *args, **kwargs, &block)
|
29
|
+
end
|
30
|
+
else
|
31
|
+
def method_missing(method_name, *args, &block)
|
32
|
+
object.send(method_name, *args, &block)
|
33
|
+
end
|
28
34
|
end
|
29
35
|
end
|
30
36
|
end
|
@@ -48,11 +48,7 @@ module RailsAdmin
|
|
48
48
|
private
|
49
49
|
|
50
50
|
def serialized?
|
51
|
-
|
52
|
-
model.serialized_attributes[property.name.to_s]
|
53
|
-
else
|
54
|
-
model.type_for_attribute(property.name).class == ::ActiveRecord::Type::Serialized
|
55
|
-
end
|
51
|
+
model.type_for_attribute(property.name).class == ::ActiveRecord::Type::Serialized
|
56
52
|
end
|
57
53
|
end
|
58
54
|
end
|