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
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1 +0,0 @@
|
|
1
|
-
#= override this file in your application to add custom behaviour
|
@@ -1,72 +0,0 @@
|
|
1
|
-
//= require jquery.iframe-transport.js
|
2
|
-
//= require_self
|
3
|
-
|
4
|
-
|
5
|
-
// This file is frozen in RailsAdmin to cope with https://github.com/JangoSteve/remotipart/pull/50
|
6
|
-
|
7
|
-
(function($) {
|
8
|
-
|
9
|
-
var remotipart;
|
10
|
-
|
11
|
-
$.remotipart = remotipart = {
|
12
|
-
|
13
|
-
setup: function(form) {
|
14
|
-
form
|
15
|
-
// Allow setup part of $.rails.handleRemote to setup remote settings before canceling default remote handler
|
16
|
-
// This is required in order to change the remote settings using the form details
|
17
|
-
.one('ajax:beforeSend.remotipart', function(e, xhr, settings){
|
18
|
-
// Delete the beforeSend bindings, since we're about to re-submit via ajaxSubmit with the beforeSubmit
|
19
|
-
// hook that was just setup and triggered via the default `$.rails.handleRemote`
|
20
|
-
// delete settings.beforeSend;
|
21
|
-
delete settings.beforeSend;
|
22
|
-
|
23
|
-
settings.iframe = true;
|
24
|
-
settings.files = $($.rails.fileInputSelector, form);
|
25
|
-
settings.data = form.serializeArray();
|
26
|
-
settings.processData = false;
|
27
|
-
|
28
|
-
// Modify some settings to integrate JS request with rails helpers and middleware
|
29
|
-
if (settings.dataType === undefined) { settings.dataType = 'script *'; }
|
30
|
-
settings.data.push({name: 'remotipart_submitted', value: true});
|
31
|
-
|
32
|
-
// Allow remotipartSubmit to be cancelled if needed
|
33
|
-
if ($.rails.fire(form, 'ajax:remotipartSubmit', [xhr, settings])) {
|
34
|
-
// Second verse, same as the first
|
35
|
-
$.rails.ajax(settings);
|
36
|
-
}
|
37
|
-
|
38
|
-
//Run cleanup
|
39
|
-
remotipart.teardown(form);
|
40
|
-
|
41
|
-
// Cancel the jQuery UJS request
|
42
|
-
return false;
|
43
|
-
})
|
44
|
-
|
45
|
-
// Keep track that we just set this particular form with Remotipart bindings
|
46
|
-
// Note: The `true` value will get over-written with the `settings.dataType` from the `ajax:beforeSend` handler
|
47
|
-
.data('remotipartSubmitted', true);
|
48
|
-
},
|
49
|
-
|
50
|
-
teardown: function(form) {
|
51
|
-
form
|
52
|
-
.unbind('ajax:beforeSend.remotipart')
|
53
|
-
.removeData('remotipartSubmitted')
|
54
|
-
}
|
55
|
-
};
|
56
|
-
|
57
|
-
$(document).on('ajax:aborted:file', 'form', function(){
|
58
|
-
var form = $(this);
|
59
|
-
|
60
|
-
remotipart.setup(form);
|
61
|
-
|
62
|
-
// If browser does not support submit bubbling, then this live-binding will be called before direct
|
63
|
-
// bindings. Therefore, we should directly call any direct bindings before remotely submitting form.
|
64
|
-
if (!$.support.submitBubbles && $().jquery < '1.7' && $.rails.callFormSubmitBindings(form) === false) return $.rails.stopEverything(e);
|
65
|
-
|
66
|
-
// Manually call jquery-ujs remote call so that it can setup form and settings as usual,
|
67
|
-
// and trigger the `ajax:beforeSend` callback to which remotipart binds functionality.
|
68
|
-
$.rails.handleRemote(form);
|
69
|
-
return false;
|
70
|
-
});
|
71
|
-
|
72
|
-
})(jQuery);
|
@@ -1,52 +0,0 @@
|
|
1
|
-
$ = jQuery
|
2
|
-
|
3
|
-
$(document).ready ->
|
4
|
-
window.nestedFormEvents.insertFields = (content, assoc, link) ->
|
5
|
-
tab_content = $(link).closest(".controls").siblings(".tab-content")
|
6
|
-
tab_content.append content
|
7
|
-
tab_content.children().last()
|
8
|
-
|
9
|
-
$(document).on 'nested:fieldAdded', 'form', (content) ->
|
10
|
-
field = content.field.addClass('tab-pane').attr('id', 'unique-id-' + (new Date().getTime()))
|
11
|
-
new_tab = $('<li><a data-toggle="tab" href="#' + field.attr('id') + '">' + field.children('.object-infos').data('object-label') + '</a></li>')
|
12
|
-
parent_group = field.closest('.control-group')
|
13
|
-
controls = parent_group.children('.controls')
|
14
|
-
one_to_one = controls.data('nestedone') != undefined
|
15
|
-
nav = controls.children('.nav')
|
16
|
-
content = parent_group.children('.tab-content')
|
17
|
-
toggler = controls.find('.toggler')
|
18
|
-
nav.append(new_tab)
|
19
|
-
$(window.document).trigger('rails_admin.dom_ready', [field, parent_group]) # fire dom_ready for new player in town
|
20
|
-
new_tab.children('a').tab('show') # activate added tab
|
21
|
-
nav.select(':hidden').show('slow') unless one_to_one # show nav if hidden
|
22
|
-
content.select(':hidden').show('slow') # show tabs content if hidden
|
23
|
-
# toggler 'on' if inactive
|
24
|
-
toggler.addClass('active').removeClass('disabled').children('i').addClass('icon-chevron-down').removeClass('icon-chevron-right')
|
25
|
-
|
26
|
-
# Convert the "add nested field" button to just showing the title of the new model
|
27
|
-
controls.find('.add_nested_fields').removeClass('add_nested_fields').html(field.children('.object-infos').data('object-label')) if one_to_one
|
28
|
-
|
29
|
-
$(document).on 'nested:fieldRemoved', 'form', (content) ->
|
30
|
-
field = content.field
|
31
|
-
nav = field.closest(".control-group").children('.controls').children('.nav')
|
32
|
-
current_li = nav.children('li').has('a[href=#' + field.attr('id') + ']')
|
33
|
-
parent_group = field.closest(".control-group")
|
34
|
-
controls = parent_group.children('.controls')
|
35
|
-
one_to_one = controls.data('nestedone') != undefined
|
36
|
-
toggler = controls.find('.toggler')
|
37
|
-
|
38
|
-
# try to activate another tab
|
39
|
-
(if current_li.next().length then current_li.next() else current_li.prev()).children('a:first').tab('show')
|
40
|
-
|
41
|
-
current_li.remove()
|
42
|
-
|
43
|
-
if nav.children().length == 0 # removed last tab
|
44
|
-
nav.select(':visible').hide('slow') # hide nav. No use anymore.
|
45
|
-
# toggler 'off' if active
|
46
|
-
toggler.removeClass('active').addClass('disabled').children('i').removeClass('icon-chevron-down').addClass('icon-chevron-right')
|
47
|
-
|
48
|
-
if one_to_one
|
49
|
-
# Converts the title button to an "add nested field" button
|
50
|
-
add_button = toggler.next()
|
51
|
-
add_button.addClass('add_nested_fields').html(add_button.data('add-label'))
|
52
|
-
|
@@ -1,308 +0,0 @@
|
|
1
|
-
$(document).on 'rails_admin.dom_ready', (e, content) ->
|
2
|
-
|
3
|
-
content = if content then content else $('form')
|
4
|
-
|
5
|
-
if content.length # don't waste time otherwise
|
6
|
-
|
7
|
-
# colorpicker
|
8
|
-
|
9
|
-
content.find('[data-color]').each ->
|
10
|
-
that = this
|
11
|
-
$(this).ColorPicker
|
12
|
-
color: $(that).val()
|
13
|
-
onShow: (el) ->
|
14
|
-
$(el).fadeIn(500)
|
15
|
-
false
|
16
|
-
onHide: (el) ->
|
17
|
-
$(el).fadeOut(500)
|
18
|
-
false
|
19
|
-
onChange: (hsb, hex, rgb) ->
|
20
|
-
$(that).val(hex)
|
21
|
-
$(that).css('backgroundColor', '#' + hex)
|
22
|
-
|
23
|
-
# datetime picker
|
24
|
-
$.fn.datetimepicker.defaults.icons =
|
25
|
-
time: 'fa fa-clock-o'
|
26
|
-
date: 'fa fa-calendar'
|
27
|
-
up: 'fa fa-chevron-up'
|
28
|
-
down: 'fa fa-chevron-down'
|
29
|
-
previous: 'fa fa-angle-double-left'
|
30
|
-
next: 'fa fa-angle-double-right'
|
31
|
-
today: 'fa fa-dot-circle-o'
|
32
|
-
clear: 'fa fa-trash'
|
33
|
-
close: 'fa fa-times'
|
34
|
-
|
35
|
-
content.find('[data-datetimepicker]').each ->
|
36
|
-
options = $(this).data('options')
|
37
|
-
$.extend(options, {locale: RailsAdmin.I18n.locale})
|
38
|
-
$(this).datetimepicker options
|
39
|
-
|
40
|
-
# enumeration
|
41
|
-
|
42
|
-
content.find('[data-enumeration]').each ->
|
43
|
-
if $(this).is('[multiple]')
|
44
|
-
$(this).filteringMultiselect $(this).data('options')
|
45
|
-
else
|
46
|
-
$(this).filteringSelect $(this).data('options')
|
47
|
-
|
48
|
-
# fileupload
|
49
|
-
|
50
|
-
content.find('[data-fileupload]').each ->
|
51
|
-
input = this
|
52
|
-
$(this).on 'click', ".delete input[type='checkbox']", ->
|
53
|
-
$(input).children('.toggle').toggle('slow')
|
54
|
-
|
55
|
-
# fileupload-preview
|
56
|
-
|
57
|
-
content.find('[data-fileupload]').change ->
|
58
|
-
input = this
|
59
|
-
image_container = $("#" + input.id).parent().children(".preview")
|
60
|
-
unless image_container.length
|
61
|
-
image_container = $("#" + input.id).parent().prepend($('<img />').addClass('preview').addClass('img-thumbnail')).find('img.preview')
|
62
|
-
image_container.parent().find('img:not(.preview)').hide()
|
63
|
-
ext = $("#" + input.id).val().split('.').pop().toLowerCase()
|
64
|
-
if input.files and input.files[0] and $.inArray(ext, ['gif','png','jpg','jpeg','bmp']) != -1
|
65
|
-
reader = new FileReader()
|
66
|
-
reader.onload = (e) ->
|
67
|
-
image_container.attr "src", e.target.result
|
68
|
-
reader.readAsDataURL input.files[0]
|
69
|
-
image_container.show()
|
70
|
-
else
|
71
|
-
image_container.hide()
|
72
|
-
|
73
|
-
# filtering-multiselect
|
74
|
-
|
75
|
-
content.find('[data-filteringmultiselect]').each ->
|
76
|
-
$(this).filteringMultiselect $(this).data('options')
|
77
|
-
if $(this).parents("#modal").length # hide link if we already are inside a dialog (endless issues on nested dialogs with JS)
|
78
|
-
$(this).siblings('.btn').remove()
|
79
|
-
else
|
80
|
-
$(this).parents('.control-group').first().remoteForm()
|
81
|
-
|
82
|
-
# filtering-select
|
83
|
-
|
84
|
-
content.find('[data-filteringselect]').each ->
|
85
|
-
$(this).filteringSelect $(this).data('options')
|
86
|
-
if $(this).parents("#modal").length # hide link if we already are inside a dialog (endless issues on nested dialogs with JS)
|
87
|
-
$(this).siblings('.btn').remove()
|
88
|
-
else
|
89
|
-
$(this).parents('.control-group').first().remoteForm()
|
90
|
-
|
91
|
-
# nested-many
|
92
|
-
|
93
|
-
content.find('[data-nestedmany]').each ->
|
94
|
-
field = $(this).parents('.control-group').first()
|
95
|
-
nav = field.find('> .controls > .nav')
|
96
|
-
tab_content = field.find('> .tab-content')
|
97
|
-
toggler = field.find('> .controls > .btn-group > .toggler')
|
98
|
-
# add each nested field to a tab-pane and reference it in the nav
|
99
|
-
tab_content.children('.fields:not(.tab-pane)').addClass('tab-pane').each ->
|
100
|
-
$(this).attr('id', 'unique-id-' + (new Date().getTime()) + Math.floor(Math.random()*100000)) # some elements are created on the same ms
|
101
|
-
nav.append('<li><a data-toggle="tab" href="#' + this.id + '">' + $(this).children('.object-infos').data('object-label') + '</a></li>')
|
102
|
-
# only if no tab is set to active
|
103
|
-
if nav.find("> li.active").length == 0
|
104
|
-
# init first tab, toggler and tab_content/tabs visibility
|
105
|
-
nav.find("> li > a[data-toggle='tab']:first").tab('show')
|
106
|
-
if nav.children().length == 0
|
107
|
-
nav.hide()
|
108
|
-
tab_content.hide()
|
109
|
-
toggler.addClass('disabled').removeClass('active').children('i').addClass('icon-chevron-right')
|
110
|
-
else
|
111
|
-
if toggler.hasClass('active')
|
112
|
-
nav.show()
|
113
|
-
tab_content.show()
|
114
|
-
toggler.children('i').addClass('icon-chevron-down')
|
115
|
-
else
|
116
|
-
nav.hide()
|
117
|
-
tab_content.hide()
|
118
|
-
toggler.children('i').addClass('icon-chevron-right')
|
119
|
-
|
120
|
-
# nested-one
|
121
|
-
|
122
|
-
content.find('[data-nestedone]').each ->
|
123
|
-
field = $(this).parents('.control-group').first()
|
124
|
-
nav = field.find("> .controls > .nav")
|
125
|
-
tab_content = field.find("> .tab-content")
|
126
|
-
toggler = field.find('> .controls > .btn-group > .toggler')
|
127
|
-
tab_content.children(".fields:not(.tab-pane)").addClass('tab-pane active').each ->
|
128
|
-
# Convert the "add nested field" button to just showing the title of the new model
|
129
|
-
field.find('> .controls .add_nested_fields').removeClass('add_nested_fields').html( $(this).children('.object-infos').data('object-label') )
|
130
|
-
nav.append('<li><a data-toggle="tab" href="#' + this.id + '">' + $(this).children('.object-infos').data('object-label') + '</a></li>')
|
131
|
-
first_tab = nav.find("> li > a[data-toggle='tab']:first")
|
132
|
-
first_tab.tab('show')
|
133
|
-
field.find("> .controls > [data-target]:first").html('<i class="icon-white"></i> ' + first_tab.html())
|
134
|
-
nav.hide()
|
135
|
-
if nav.children().length == 0
|
136
|
-
nav.hide()
|
137
|
-
tab_content.hide()
|
138
|
-
toggler.addClass('disabled').removeClass('active').children('i').addClass('icon-chevron-right')
|
139
|
-
else
|
140
|
-
if toggler.hasClass('active')
|
141
|
-
toggler.children('i').addClass('icon-chevron-down')
|
142
|
-
tab_content.show()
|
143
|
-
else
|
144
|
-
toggler.children('i').addClass('icon-chevron-right')
|
145
|
-
tab_content.hide()
|
146
|
-
|
147
|
-
# polymorphic-association
|
148
|
-
|
149
|
-
content.find('[data-polymorphic]').each ->
|
150
|
-
type_select = $(this)
|
151
|
-
field = type_select.parents('.control-group').first()
|
152
|
-
object_select = field.find('select').last()
|
153
|
-
urls = type_select.data('urls')
|
154
|
-
type_select.on 'change', (e) ->
|
155
|
-
if $(this).val() is ''
|
156
|
-
object_select.html('<option value=""></option>')
|
157
|
-
else
|
158
|
-
$.ajax
|
159
|
-
url: urls[type_select.val()]
|
160
|
-
data:
|
161
|
-
compact: true
|
162
|
-
all: true
|
163
|
-
beforeSend: (xhr) ->
|
164
|
-
xhr.setRequestHeader("Accept", "application/json")
|
165
|
-
success: (data, status, xhr) ->
|
166
|
-
html = $('<option></option>')
|
167
|
-
$(data).each (i, el) ->
|
168
|
-
option = $('<option></option>')
|
169
|
-
option.attr('value', el.id)
|
170
|
-
option.text(el.label)
|
171
|
-
html = html.add(option)
|
172
|
-
object_select.html(html)
|
173
|
-
|
174
|
-
# ckeditor
|
175
|
-
|
176
|
-
goCkeditors = ->
|
177
|
-
content.find('[data-richtext=ckeditor]').not('.ckeditored').each (index, domEle) ->
|
178
|
-
try
|
179
|
-
if instance = window.CKEDITOR.instances[this.id]
|
180
|
-
instance.destroy(true)
|
181
|
-
window.CKEDITOR.replace(this, $(this).data('options'))
|
182
|
-
$(this).addClass('ckeditored')
|
183
|
-
|
184
|
-
$editors = content.find('[data-richtext=ckeditor]').not('.ckeditored')
|
185
|
-
if $editors.length
|
186
|
-
if not window.CKEDITOR
|
187
|
-
options = $editors.first().data('options')
|
188
|
-
window.CKEDITOR_BASEPATH = options['base_location']
|
189
|
-
$.getScript options['jspath'], (script, textStatus, jqXHR) =>
|
190
|
-
goCkeditors()
|
191
|
-
else
|
192
|
-
goCkeditors()
|
193
|
-
|
194
|
-
#codemirror
|
195
|
-
|
196
|
-
goCodeMirrors = (array) =>
|
197
|
-
array.each (index, domEle) ->
|
198
|
-
options = $(this).data('options')
|
199
|
-
textarea = this
|
200
|
-
$.getScript options['locations']['mode'], (script, textStatus, jqXHR) ->
|
201
|
-
$('head').append('<link href="' + options['locations']['theme'] + '" rel="stylesheet" media="all" type="text\/css">')
|
202
|
-
CodeMirror.fromTextArea(textarea,options['options'])
|
203
|
-
$(textarea).addClass('codemirrored')
|
204
|
-
|
205
|
-
array = content.find('[data-richtext=codemirror]').not('.codemirrored')
|
206
|
-
if array.length
|
207
|
-
@array = array
|
208
|
-
if not window.CodeMirror
|
209
|
-
options = $(array[0]).data('options')
|
210
|
-
$('head').append('<link href="' + options['csspath'] + '" rel="stylesheet" media="all" type="text\/css">')
|
211
|
-
$.getScript options['jspath'], (script, textStatus, jqXHR) =>
|
212
|
-
goCodeMirrors(@array)
|
213
|
-
else
|
214
|
-
goCodeMirrors(@array)
|
215
|
-
|
216
|
-
# bootstrap_wysihtml5
|
217
|
-
|
218
|
-
goBootstrapWysihtml5s = (array, config_options) =>
|
219
|
-
array.each ->
|
220
|
-
$(@).addClass('bootstrap-wysihtml5ed')
|
221
|
-
$(@).closest('.controls').addClass('well')
|
222
|
-
$(@).wysihtml5(config_options)
|
223
|
-
|
224
|
-
array = content.find('[data-richtext=bootstrap-wysihtml5]').not('.bootstrap-wysihtml5ed')
|
225
|
-
if array.length
|
226
|
-
@array = array
|
227
|
-
options = $(array[0]).data('options')
|
228
|
-
config_options = $.parseJSON(options['config_options'])
|
229
|
-
if not window.wysihtml5
|
230
|
-
$('head').append('<link href="' + options['csspath'] + '" rel="stylesheet" media="all" type="text\/css">')
|
231
|
-
$.getScript options['jspath'], (script, textStatus, jqXHR) =>
|
232
|
-
goBootstrapWysihtml5s(@array, config_options)
|
233
|
-
else
|
234
|
-
goBootstrapWysihtml5s(@array, config_options)
|
235
|
-
|
236
|
-
# froala_wysiwyg
|
237
|
-
|
238
|
-
goFroalaWysiwygs = (array) =>
|
239
|
-
array.each ->
|
240
|
-
options = $(@).data('options')
|
241
|
-
config_options = $.parseJSON(options['config_options'])
|
242
|
-
if config_options
|
243
|
-
if !config_options['inlineMode']
|
244
|
-
config_options['inlineMode'] = false
|
245
|
-
else
|
246
|
-
config_options = { inlineMode: false }
|
247
|
-
|
248
|
-
uploadEnabled =
|
249
|
-
if config_options['imageUploadURL']
|
250
|
-
config_options['imageUploadParams'] =
|
251
|
-
authenticity_token: $('meta[name=csrf-token]').attr('content')
|
252
|
-
|
253
|
-
$(@).addClass('froala-wysiwyged')
|
254
|
-
$(@).editable(config_options)
|
255
|
-
if uploadEnabled
|
256
|
-
$(@).on 'editable.imageError', (e, editor, error) ->
|
257
|
-
alert("error uploading image: " + error.message);
|
258
|
-
# Custom error message returned from the server.
|
259
|
-
if error.code == 0
|
260
|
-
|
261
|
-
# Bad link.
|
262
|
-
else if error.code == 1
|
263
|
-
|
264
|
-
# No link in upload response.
|
265
|
-
else if error.code == 2
|
266
|
-
|
267
|
-
# Error during image upload.
|
268
|
-
else if error.code == 3
|
269
|
-
|
270
|
-
# Parsing response failed.
|
271
|
-
else if error.code == 4
|
272
|
-
|
273
|
-
# Image too large.
|
274
|
-
else if error.code == 5
|
275
|
-
|
276
|
-
# Invalid image type.
|
277
|
-
else if error.code == 6
|
278
|
-
|
279
|
-
# Image can be uploaded only to same domain in IE 8 and IE 9.
|
280
|
-
else if error.code == 7
|
281
|
-
|
282
|
-
else
|
283
|
-
|
284
|
-
return
|
285
|
-
|
286
|
-
.on('editable.afterRemoveImage', (e, editor, $img) ->
|
287
|
-
# Set the image source to the image delete params.
|
288
|
-
editor.options.imageDeleteParams =
|
289
|
-
src: $img.attr('src')
|
290
|
-
authenticity_token: $('meta[name=csrf-token]').attr('content')
|
291
|
-
# Make the delete request.
|
292
|
-
editor.deleteImage $img
|
293
|
-
return
|
294
|
-
).on('editable.imageDeleteSuccess', (e, editor, data) ->
|
295
|
-
# handle success
|
296
|
-
).on 'editable.imageDeleteError', (e, editor, error) ->
|
297
|
-
# handle error
|
298
|
-
alert("error deleting image: " + error.message);
|
299
|
-
|
300
|
-
array = content.find('[data-richtext=froala-wysiwyg]').not('.froala-wysiwyged')
|
301
|
-
if array.length
|
302
|
-
options = $(array[0]).data('options')
|
303
|
-
if not $.isFunction($.fn.editable)
|
304
|
-
$('head').append('<link href="' + options['csspath'] + '" rel="stylesheet" media="all" type="text\/css">')
|
305
|
-
$.getScript options['jspath'], (script, textStatus, jqXHR) =>
|
306
|
-
goFroalaWysiwygs(array)
|
307
|
-
else
|
308
|
-
goFroalaWysiwygs(array)
|
@@ -1,102 +0,0 @@
|
|
1
|
-
$ = jQuery
|
2
|
-
|
3
|
-
$(document).on "click", "#list input.toggle", ->
|
4
|
-
$("#list [name='bulk_ids[]']").prop "checked", $(this).is(":checked")
|
5
|
-
|
6
|
-
$(document).on 'click', '.pjax', (event) ->
|
7
|
-
if event.which > 1 || event.metaKey || event.ctrlKey
|
8
|
-
return
|
9
|
-
else if $.support.pjax
|
10
|
-
event.preventDefault()
|
11
|
-
$.pjax
|
12
|
-
container: $(this).data('pjax-container') || '[data-pjax-container]'
|
13
|
-
url: $(this).data('href') || $(this).attr('href')
|
14
|
-
timeout: 2000
|
15
|
-
else if $(this).data('href') # not a native #href, need some help
|
16
|
-
window.location = $(this).data('href')
|
17
|
-
|
18
|
-
$(document).on 'submit', '.pjax-form', (event) ->
|
19
|
-
if $.support.pjax
|
20
|
-
event.preventDefault()
|
21
|
-
$.pjax
|
22
|
-
container: $(this).data('pjax-container') || '[data-pjax-container]'
|
23
|
-
url: this.action + (if (this.action.indexOf('?') != -1) then '&' else '?') + $(this).serialize()
|
24
|
-
timeout: 2000
|
25
|
-
|
26
|
-
$(document)
|
27
|
-
.on 'pjax:start', ->
|
28
|
-
$('#loading').show()
|
29
|
-
.on 'pjax:end', ->
|
30
|
-
$('#loading').hide()
|
31
|
-
|
32
|
-
$(document).on 'click', '[data-target]', ->
|
33
|
-
if !$(this).hasClass('disabled')
|
34
|
-
if $(this).has('i.icon-chevron-down').length
|
35
|
-
$(this).removeClass('active').children('i').toggleClass('icon-chevron-down icon-chevron-right')
|
36
|
-
$($(this).data('target')).select(':visible').hide('slow')
|
37
|
-
else
|
38
|
-
if $(this).has('i.icon-chevron-right').length
|
39
|
-
$(this).addClass('active').children('i').toggleClass('icon-chevron-down icon-chevron-right')
|
40
|
-
$($(this).data('target')).select(':hidden').show('slow')
|
41
|
-
|
42
|
-
$(document).on 'click', '.form-horizontal legend', ->
|
43
|
-
if $(this).has('i.icon-chevron-down').length
|
44
|
-
$(this).siblings('.control-group:visible').hide('slow')
|
45
|
-
$(this).children('i').toggleClass('icon-chevron-down icon-chevron-right')
|
46
|
-
else
|
47
|
-
if $(this).has('i.icon-chevron-right').length
|
48
|
-
$(this).siblings('.control-group:hidden').show('slow')
|
49
|
-
$(this).children('i').toggleClass('icon-chevron-down icon-chevron-right')
|
50
|
-
|
51
|
-
$(document).on 'click', 'form .tab-content .tab-pane a.remove_nested_one_fields', ->
|
52
|
-
$(this).children('input[type="hidden"]').val($(this).hasClass('active')).
|
53
|
-
siblings('i').toggleClass('icon-check icon-trash')
|
54
|
-
|
55
|
-
$(document).ready ->
|
56
|
-
$(document).trigger('rails_admin.dom_ready')
|
57
|
-
|
58
|
-
$(document).on 'pjax:end', ->
|
59
|
-
$(document).trigger('rails_admin.dom_ready')
|
60
|
-
|
61
|
-
$(document).on 'rails_admin.dom_ready', ->
|
62
|
-
$('.animate-width-to').each ->
|
63
|
-
length = $(this).data("animate-length")
|
64
|
-
width = $(this).data("animate-width-to")
|
65
|
-
$(this).animate(width: width, length, 'easeOutQuad')
|
66
|
-
|
67
|
-
$('.form-horizontal legend').has('i.icon-chevron-right').each ->
|
68
|
-
$(this).siblings('.control-group').hide()
|
69
|
-
|
70
|
-
$(".table").tooltip selector: "th[rel=tooltip]"
|
71
|
-
|
72
|
-
# Workaround for jquery-ujs formnovalidate issue:
|
73
|
-
# https://github.com/rails/jquery-ujs/issues/316
|
74
|
-
$('[formnovalidate]').on 'click', ->
|
75
|
-
$(this).closest('form').attr('novalidate', true)
|
76
|
-
|
77
|
-
$(document).on 'click', '#fields_to_export label input#check_all', () ->
|
78
|
-
elems = $('#fields_to_export label input')
|
79
|
-
if $('#fields_to_export label input#check_all').is ':checked'
|
80
|
-
$(elems).prop('checked', true)
|
81
|
-
else
|
82
|
-
$(elems).prop('checked',false)
|
83
|
-
|
84
|
-
# when the user hits the back button, the inline JS <script> that
|
85
|
-
# highlights the current model in the left menu doesn't get run by
|
86
|
-
# pjax, so this code runs it:
|
87
|
-
# https://github.com/defunkt/jquery-pjax/issues/241#issuecomment-13251065
|
88
|
-
$(document).on 'pjax:popstate', () ->
|
89
|
-
$(document).one 'pjax:end', (event) ->
|
90
|
-
$(event.target).find('script').each () ->
|
91
|
-
$.globalEval(this.text || this.textContent || this.innerHTML || '')
|
92
|
-
return
|
93
|
-
return
|
94
|
-
return
|
95
|
-
|
96
|
-
#Remove all filter and then refresh
|
97
|
-
$(document).on 'click', "#remove_filter",(event) ->
|
98
|
-
event.preventDefault()
|
99
|
-
$("#filters_box").html("")
|
100
|
-
$("hr.filters_box").hide()
|
101
|
-
$(this).parent().siblings("input[type='search']").val("")
|
102
|
-
$(this).parents("form").submit()
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'rails_admin/config/fields'
|
2
|
-
require 'rails_admin/config/fields/types'
|
3
|
-
require 'rails_admin/config/fields/types/file_upload'
|
4
|
-
|
5
|
-
RailsAdmin::Config::Fields.register_factory do |parent, properties, fields|
|
6
|
-
extensions = [:id, :filename, :size, :content_type]
|
7
|
-
model = parent.abstract_model.model
|
8
|
-
if (properties.name.to_s =~ /^(.+)_id$/) && defined?(::Refile) && model.ancestors.map(&:to_s).include?("Refile::Attachment(#{attachment_name = Regexp.last_match[1].to_sym})")
|
9
|
-
field = RailsAdmin::Config::Fields::Types.load(:refile).new(parent, attachment_name, properties)
|
10
|
-
children_fields = []
|
11
|
-
extensions.each do |ext|
|
12
|
-
children_column_name = "#{attachment_name}_#{ext}".to_sym
|
13
|
-
next unless child_properties = parent.abstract_model.properties.detect { |p| p.name.to_s == children_column_name.to_s }
|
14
|
-
children_field = fields.detect { |f| f.name == children_column_name } || RailsAdmin::Config::Fields.default_factory.call(parent, child_properties, fields)
|
15
|
-
children_field.hide
|
16
|
-
children_field.filterable(false)
|
17
|
-
children_fields << children_field.name
|
18
|
-
end
|
19
|
-
field.children_fields(children_fields)
|
20
|
-
fields << field
|
21
|
-
true
|
22
|
-
else
|
23
|
-
false
|
24
|
-
end
|
25
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
require 'rails_admin/config/fields/base'
|
2
|
-
require 'rails_admin/config/fields/types/file_upload'
|
3
|
-
|
4
|
-
module RailsAdmin
|
5
|
-
module Config
|
6
|
-
module Fields
|
7
|
-
module Types
|
8
|
-
class Refile < RailsAdmin::Config::Fields::Types::FileUpload
|
9
|
-
RailsAdmin::Config::Fields::Types.register(self)
|
10
|
-
|
11
|
-
register_instance_option :thumb_method do
|
12
|
-
[:limit, 100, 100]
|
13
|
-
end
|
14
|
-
|
15
|
-
register_instance_option :delete_method do
|
16
|
-
"remove_#{name}"
|
17
|
-
end
|
18
|
-
|
19
|
-
def resource_url(thumb = [])
|
20
|
-
return nil unless value
|
21
|
-
Object.const_get(:Refile).attachment_url(bindings[:object], name, *thumb)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|