rails_admin 2.1.0 → 3.0.0.beta
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rails_admin might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile +9 -11
- data/README.md +37 -31
- data/Rakefile +2 -2
- data/app/assets/javascripts/rails_admin.js +21 -0
- data/app/assets/stylesheets/rails_admin/custom/mixins.scss +1 -1
- data/app/assets/stylesheets/rails_admin/custom/variables.scss +1 -1
- data/app/assets/stylesheets/rails_admin.scss.erb +76 -0
- data/app/controllers/rails_admin/application_controller.rb +4 -3
- data/app/controllers/rails_admin/main_controller.rb +43 -24
- data/app/helpers/rails_admin/application_helper.rb +69 -52
- data/app/helpers/rails_admin/form_builder.rb +7 -4
- data/app/helpers/rails_admin/main_helper.rb +27 -43
- data/app/views/kaminari/ra-twitter-bootstrap/_gap.html.erb +5 -0
- data/app/views/kaminari/ra-twitter-bootstrap/_next_page.html.erb +9 -0
- data/app/views/kaminari/ra-twitter-bootstrap/_page.html.erb +9 -0
- data/app/views/kaminari/ra-twitter-bootstrap/_paginator.html.erb +13 -0
- data/app/views/kaminari/ra-twitter-bootstrap/_prev_page.html.erb +9 -0
- data/app/views/kaminari/ra-twitter-bootstrap/without_count/_next_page.html.erb +9 -0
- data/app/views/kaminari/ra-twitter-bootstrap/without_count/_paginator.html.erb +6 -0
- data/app/views/kaminari/ra-twitter-bootstrap/without_count/_prev_page.html.erb +9 -0
- data/app/views/layouts/rails_admin/_head.html.erb +17 -0
- data/app/views/layouts/rails_admin/_navigation.html.erb +21 -0
- data/app/views/layouts/rails_admin/_secondary_navigation.html.erb +24 -0
- data/app/views/layouts/rails_admin/_sidebar_navigation.html.erb +9 -0
- data/app/views/layouts/rails_admin/application.html.erb +27 -0
- data/app/views/layouts/rails_admin/modal.js.erb +7 -0
- data/app/views/layouts/rails_admin/pjax.html.erb +20 -0
- data/app/views/rails_admin/main/_dashboard_history.html.erb +45 -0
- data/app/views/rails_admin/main/_delete_notice.html.erb +35 -0
- data/app/views/rails_admin/main/_form_action_text.html.erb +7 -0
- data/app/views/rails_admin/main/_form_boolean.html.erb +16 -0
- data/app/views/rails_admin/main/{_form_ck_editor.html.haml → _form_ck_editor.html.erb} +3 -3
- data/app/views/rails_admin/main/_form_code_mirror.html.erb +9 -0
- data/app/views/rails_admin/main/_form_colorpicker.html.erb +1 -0
- data/app/views/rails_admin/main/_form_datetime.html.erb +9 -0
- data/app/views/rails_admin/main/_form_enumeration.html.erb +21 -0
- data/app/views/rails_admin/main/_form_field.html.erb +1 -0
- data/app/views/rails_admin/main/_form_file_upload.html.erb +17 -0
- data/app/views/rails_admin/main/{_form_filtering_multiselect.html.haml → _form_filtering_multiselect.html.erb} +11 -11
- data/app/views/rails_admin/main/{_form_filtering_select.html.haml → _form_filtering_select.html.erb} +13 -12
- data/app/views/rails_admin/main/_form_froala.html.erb +8 -0
- data/app/views/rails_admin/main/_form_multiple_file_upload.html.erb +20 -0
- data/app/views/rails_admin/main/_form_nested_many.html.erb +21 -0
- data/app/views/rails_admin/main/_form_nested_one.html.erb +21 -0
- data/app/views/rails_admin/main/_form_polymorphic_association.html.erb +27 -0
- data/app/views/rails_admin/main/_form_simple_mde.html.erb +8 -0
- data/app/views/rails_admin/main/_form_text.html.erb +1 -0
- data/app/views/rails_admin/main/_form_wysihtml5.html.erb +8 -0
- data/app/views/rails_admin/main/_submit_buttons.html.erb +25 -0
- data/app/views/rails_admin/main/bulk_delete.html.erb +19 -0
- data/app/views/rails_admin/main/dashboard.html.erb +64 -0
- data/app/views/rails_admin/main/delete.html.erb +21 -0
- data/app/views/rails_admin/main/edit.html.erb +3 -0
- data/app/views/rails_admin/main/export.html.erb +146 -0
- data/app/views/rails_admin/main/history.html.erb +78 -0
- data/app/views/rails_admin/main/index.html.erb +193 -0
- data/app/views/rails_admin/main/new.html.erb +3 -0
- data/app/views/rails_admin/main/show.html.erb +28 -0
- data/config/initializers/active_record_extensions.rb +3 -1
- data/config/initializers/mongoid_extensions.rb +1 -1
- data/config/locales/rails_admin.en.yml +6 -1
- data/lib/generators/rails_admin/install_generator.rb +51 -3
- data/lib/generators/rails_admin/templates/environment.js +6 -0
- data/lib/generators/rails_admin/templates/initializer.erb +2 -1
- data/lib/generators/rails_admin/templates/rails_admin.js.erb +2 -0
- data/lib/generators/rails_admin/templates/rails_admin.scss +1 -0
- data/lib/generators/rails_admin/templates/webpack.config.js +32 -0
- data/lib/rails_admin/abstract_model.rb +24 -10
- data/lib/rails_admin/adapters/active_record/association.rb +20 -1
- data/lib/rails_admin/adapters/active_record/object_extension.rb +29 -0
- data/lib/rails_admin/adapters/active_record/property.rb +1 -1
- data/lib/rails_admin/adapters/active_record.rb +27 -23
- data/lib/rails_admin/adapters/mongoid/association.rb +38 -9
- data/lib/rails_admin/adapters/mongoid/bson.rb +4 -5
- data/lib/rails_admin/adapters/mongoid/extension.rb +3 -1
- data/lib/rails_admin/adapters/mongoid/object_extension.rb +32 -0
- data/lib/rails_admin/adapters/mongoid/property.rb +2 -2
- data/lib/rails_admin/adapters/mongoid.rb +27 -19
- data/lib/rails_admin/config/actions/base.rb +7 -2
- data/lib/rails_admin/config/actions/bulk_delete.rb +2 -2
- data/lib/rails_admin/config/actions/dashboard.rb +4 -3
- data/lib/rails_admin/config/actions/delete.rb +5 -9
- data/lib/rails_admin/config/actions/edit.rb +7 -7
- data/lib/rails_admin/config/actions/export.rb +2 -2
- data/lib/rails_admin/config/actions/history_index.rb +2 -2
- data/lib/rails_admin/config/actions/history_show.rb +2 -2
- data/lib/rails_admin/config/actions/index.rb +5 -7
- data/lib/rails_admin/config/actions/new.rb +9 -9
- data/lib/rails_admin/config/actions/show.rb +1 -1
- data/lib/rails_admin/config/actions/show_in_app.rb +6 -2
- data/lib/rails_admin/config/actions.rb +4 -4
- data/lib/rails_admin/config/configurable.rb +2 -2
- data/lib/rails_admin/config/fields/association.rb +15 -12
- data/lib/rails_admin/config/fields/base.rb +44 -24
- data/lib/rails_admin/config/fields/factories/active_storage.rb +1 -0
- data/lib/rails_admin/config/fields/factories/association.rb +6 -8
- data/lib/rails_admin/config/fields/factories/carrierwave.rb +2 -1
- data/lib/rails_admin/config/fields/factories/devise.rb +2 -1
- data/lib/rails_admin/config/fields/factories/dragonfly.rb +2 -1
- data/lib/rails_admin/config/fields/factories/paperclip.rb +2 -1
- data/lib/rails_admin/config/fields/factories/shrine.rb +1 -1
- data/lib/rails_admin/config/fields/group.rb +1 -2
- data/lib/rails_admin/config/fields/types/active_record_enum.rb +2 -0
- data/lib/rails_admin/config/fields/types/active_storage.rb +9 -7
- data/lib/rails_admin/config/fields/types/all.rb +1 -0
- data/lib/rails_admin/config/fields/types/belongs_to_association.rb +4 -12
- data/lib/rails_admin/config/fields/types/boolean.rb +32 -8
- data/lib/rails_admin/config/fields/types/carrierwave.rb +1 -0
- data/lib/rails_admin/config/fields/types/citext.rb +13 -0
- data/lib/rails_admin/config/fields/types/color.rb +6 -2
- data/lib/rails_admin/config/fields/types/date.rb +5 -8
- data/lib/rails_admin/config/fields/types/datetime.rb +18 -21
- data/lib/rails_admin/config/fields/types/decimal.rb +9 -2
- data/lib/rails_admin/config/fields/types/dragonfly.rb +3 -1
- data/lib/rails_admin/config/fields/types/enum.rb +1 -1
- data/lib/rails_admin/config/fields/types/file_upload.rb +4 -3
- data/lib/rails_admin/config/fields/types/float.rb +9 -2
- data/lib/rails_admin/config/fields/types/has_many_association.rb +1 -5
- data/lib/rails_admin/config/fields/types/has_one_association.rb +1 -13
- data/lib/rails_admin/config/fields/types/integer.rb +2 -6
- data/lib/rails_admin/config/fields/types/multiple_active_storage.rb +8 -6
- data/lib/rails_admin/config/fields/types/multiple_carrierwave.rb +1 -0
- data/lib/rails_admin/config/fields/types/multiple_file_upload.rb +4 -3
- data/lib/rails_admin/config/fields/types/numeric.rb +18 -0
- data/lib/rails_admin/config/fields/types/polymorphic_association.rb +3 -2
- data/lib/rails_admin/config/fields/types/string.rb +1 -1
- data/lib/rails_admin/config/fields/types/time.rb +1 -4
- data/lib/rails_admin/config/fields/types/timestamp.rb +0 -4
- data/lib/rails_admin/config/fields/types.rb +1 -1
- data/lib/rails_admin/config/fields.rb +3 -1
- data/lib/rails_admin/config/has_fields.rb +5 -6
- data/lib/rails_admin/config/hideable.rb +1 -1
- data/lib/rails_admin/config/inspectable.rb +1 -3
- data/lib/rails_admin/config/model.rb +10 -10
- data/lib/rails_admin/config/sections/base.rb +2 -3
- data/lib/rails_admin/config/sections/list.rb +4 -15
- data/lib/rails_admin/config/sections.rb +1 -1
- data/lib/rails_admin/config.rb +73 -38
- data/lib/rails_admin/engine.rb +36 -23
- data/lib/rails_admin/extension.rb +6 -14
- data/lib/rails_admin/extensions/cancancan/authorization_adapter.rb +4 -2
- data/lib/rails_admin/extensions/paper_trail/auditing_adapter.rb +13 -8
- data/lib/rails_admin/extensions/pundit/authorization_adapter.rb +6 -7
- data/lib/rails_admin/support/csv_converter.rb +12 -13
- data/lib/rails_admin/support/datetime.rb +40 -74
- data/lib/rails_admin/support/esmodule_preprocessor.rb +32 -0
- data/lib/rails_admin/support/hash_helper.rb +6 -5
- data/lib/rails_admin/version.rb +7 -3
- data/lib/rails_admin.rb +1 -4
- data/lib/tasks/rails_admin.rake +3 -3
- data/package.json +28 -0
- data/src/rails_admin/base.js +21 -0
- data/src/rails_admin/filter-box.js +405 -0
- data/src/rails_admin/filtering-multiselect.js +394 -0
- data/src/rails_admin/filtering-select.js +302 -0
- data/src/rails_admin/i18n.js +19 -0
- data/src/rails_admin/nested-form-hooks.js +100 -0
- data/src/rails_admin/remote-form.js +190 -0
- data/src/rails_admin/sidescroll.js +20 -0
- data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/base/README.txt +0 -0
- data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/base/mixins.scss +0 -0
- data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/base/theming.scss +93 -34
- data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/base/variables.scss +0 -0
- data/src/rails_admin/styles/base.scss +64 -0
- data/src/rails_admin/styles/filtering-multiselect.scss +53 -0
- data/src/rails_admin/styles/filtering-select.scss +70 -0
- data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/themes/cerulean/mixins.scss +0 -0
- data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/themes/cerulean/theming.scss +23 -21
- data/src/rails_admin/styles/themes/cerulean/variables.scss +830 -0
- data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/themes/default/mixins.scss +1 -1
- data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/themes/default/theming.scss +0 -0
- data/{app/assets/stylesheets/rails_admin → src/rails_admin/styles}/themes/default/variables.scss +1 -1
- data/src/rails_admin/styles/widgets.scss +35 -0
- data/src/rails_admin/ui.js +172 -0
- data/src/rails_admin/vendor/jquery.pjax.js +899 -0
- data/src/rails_admin/vendor/jquery_nested_form.js +122 -0
- data/src/rails_admin/widgets.js +512 -0
- data/vendor/assets/fonts/rails_admin/fa-solid-900.eot +0 -0
- data/vendor/assets/fonts/rails_admin/fa-solid-900.svg +5034 -0
- data/vendor/assets/fonts/rails_admin/fa-solid-900.ttf +0 -0
- data/vendor/assets/fonts/rails_admin/fa-solid-900.woff +0 -0
- data/vendor/assets/fonts/rails_admin/fa-solid-900.woff2 +0 -0
- data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-affix.js +50 -28
- data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-alert.js +10 -7
- data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-button.js +35 -20
- data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-carousel.js +48 -25
- data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-collapse.js +70 -28
- data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-dropdown.js +56 -42
- data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-modal.js +118 -40
- data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-popover.js +26 -16
- data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-scrollspy.js +29 -27
- data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-tab.js +46 -19
- data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-tooltip.js +280 -60
- data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-transition.js +5 -5
- data/vendor/assets/javascripts/rails_admin/bootstrap-datetimepicker.js +317 -150
- data/vendor/assets/javascripts/rails_admin/jquery-ui/data.js +41 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/effect.js +1637 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/ie.js +17 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/keycode.js +47 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/position.js +500 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/safe-active-element.js +42 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/scroll-parent.js +47 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/unique-id.js +51 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/version.js +17 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/widget.js +735 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/widgets/autocomplete.js +689 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/widgets/menu.js +680 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/widgets/mouse.js +230 -0
- data/vendor/assets/javascripts/rails_admin/jquery-ui/widgets/sortable.js +1561 -0
- data/vendor/assets/javascripts/rails_admin/jquery.pjax.js +317 -160
- data/vendor/assets/javascripts/rails_admin/jquery3.js +10872 -0
- data/vendor/assets/javascripts/rails_admin/moment-with-locales.js +11210 -9290
- data/vendor/assets/stylesheets/rails_admin/font-awesome.scss +4476 -2216
- metadata +118 -262
- data/app/assets/images/rails_admin/aristo/images/bg_fallback.png +0 -0
- data/app/assets/images/rails_admin/aristo/images/icon_sprite.png +0 -0
- data/app/assets/images/rails_admin/aristo/images/progress_bar.gif +0 -0
- data/app/assets/images/rails_admin/aristo/images/slider_handles.png +0 -0
- data/app/assets/images/rails_admin/aristo/images/ui-icons_222222_256x240.png +0 -0
- data/app/assets/images/rails_admin/aristo/images/ui-icons_454545_256x240.png +0 -0
- data/app/assets/images/rails_admin/bullet_black.png +0 -0
- data/app/assets/images/rails_admin/bullet_white.png +0 -0
- data/app/assets/images/rails_admin/calendar.png +0 -0
- data/app/assets/images/rails_admin/clock.png +0 -0
- data/app/assets/images/rails_admin/logo.png +0 -0
- data/app/assets/images/rails_admin/magnifier.png +0 -0
- data/app/assets/images/rails_admin/multiselect/icon_sprite.png +0 -0
- data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-n-dark.png +0 -0
- data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-n-light.png +0 -0
- data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-s-dark.png +0 -0
- data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-s-light.png +0 -0
- data/app/assets/javascripts/rails_admin/jquery-ui.js.erb +0 -8
- data/app/assets/javascripts/rails_admin/ra.filter-box.js +0 -248
- data/app/assets/javascripts/rails_admin/ra.filtering-multiselect.js +0 -331
- data/app/assets/javascripts/rails_admin/ra.filtering-select.js +0 -294
- data/app/assets/javascripts/rails_admin/ra.i18n.js +0 -28
- data/app/assets/javascripts/rails_admin/ra.nested-form-hooks.js +0 -59
- data/app/assets/javascripts/rails_admin/ra.remote-form.js +0 -155
- data/app/assets/javascripts/rails_admin/ra.sidescroll.js +0 -31
- data/app/assets/javascripts/rails_admin/ra.widgets.js +0 -379
- data/app/assets/javascripts/rails_admin/rails_admin.js +0 -20
- data/app/assets/javascripts/rails_admin/ui.js +0 -135
- data/app/assets/stylesheets/rails_admin/aristo/images/bg_fallback.png +0 -0
- data/app/assets/stylesheets/rails_admin/aristo/images/icon_sprite.png +0 -0
- data/app/assets/stylesheets/rails_admin/aristo/images/progress_bar.gif +0 -0
- data/app/assets/stylesheets/rails_admin/aristo/images/slider_handles.png +0 -0
- data/app/assets/stylesheets/rails_admin/aristo/images/ui-icons_222222_256x240.png +0 -0
- data/app/assets/stylesheets/rails_admin/aristo/images/ui-icons_454545_256x240.png +0 -0
- data/app/assets/stylesheets/rails_admin/aristo/jquery-ui-1.8.7.custom.scss +0 -733
- data/app/assets/stylesheets/rails_admin/base/font-awesome-4-compability.scss +0 -153
- data/app/assets/stylesheets/rails_admin/ra.filtering-multiselect.scss +0 -88
- data/app/assets/stylesheets/rails_admin/ra.sidescroll.scss +0 -29
- data/app/assets/stylesheets/rails_admin/ra.widgets.scss +0 -17
- data/app/assets/stylesheets/rails_admin/rails_admin.scss.erb +0 -110
- data/app/assets/stylesheets/rails_admin/themes/cerulean/variables.scss +0 -857
- data/app/views/kaminari/ra-twitter-bootstrap/_gap.html.haml +0 -2
- data/app/views/kaminari/ra-twitter-bootstrap/_next_page.html.haml +0 -4
- data/app/views/kaminari/ra-twitter-bootstrap/_page.html.haml +0 -4
- data/app/views/kaminari/ra-twitter-bootstrap/_paginator.html.haml +0 -9
- data/app/views/kaminari/ra-twitter-bootstrap/_prev_page.html.haml +0 -4
- data/app/views/kaminari/ra-twitter-bootstrap/without_count/_next_page.html.haml +0 -4
- data/app/views/kaminari/ra-twitter-bootstrap/without_count/_paginator.html.haml +0 -4
- data/app/views/kaminari/ra-twitter-bootstrap/without_count/_prev_page.html.haml +0 -4
- data/app/views/layouts/rails_admin/_head.html.haml +0 -7
- data/app/views/layouts/rails_admin/_navigation.html.haml +0 -12
- data/app/views/layouts/rails_admin/_secondary_navigation.html.haml +0 -10
- data/app/views/layouts/rails_admin/_sidebar_navigation.html.haml +0 -3
- data/app/views/layouts/rails_admin/application.html.haml +0 -16
- data/app/views/layouts/rails_admin/pjax.html.haml +0 -12
- data/app/views/rails_admin/main/_dashboard_history.html.haml +0 -21
- data/app/views/rails_admin/main/_delete_notice.html.haml +0 -24
- data/app/views/rails_admin/main/_form_action_text.html.haml +0 -7
- data/app/views/rails_admin/main/_form_boolean.html.haml +0 -3
- data/app/views/rails_admin/main/_form_code_mirror.html.haml +0 -9
- data/app/views/rails_admin/main/_form_colorpicker.html.haml +0 -1
- data/app/views/rails_admin/main/_form_datetime.html.haml +0 -5
- data/app/views/rails_admin/main/_form_enumeration.html.haml +0 -19
- data/app/views/rails_admin/main/_form_field.html.haml +0 -1
- data/app/views/rails_admin/main/_form_file_upload.html.haml +0 -17
- data/app/views/rails_admin/main/_form_froala.html.haml +0 -8
- data/app/views/rails_admin/main/_form_multiple_file_upload.html.haml +0 -16
- data/app/views/rails_admin/main/_form_nested_many.html.haml +0 -15
- data/app/views/rails_admin/main/_form_nested_one.html.haml +0 -17
- data/app/views/rails_admin/main/_form_polymorphic_association.html.haml +0 -26
- data/app/views/rails_admin/main/_form_simple_mde.haml +0 -8
- data/app/views/rails_admin/main/_form_text.html.haml +0 -1
- data/app/views/rails_admin/main/_form_wysihtml5.html.haml +0 -8
- data/app/views/rails_admin/main/_submit_buttons.html.haml +0 -16
- data/app/views/rails_admin/main/bulk_delete.html.haml +0 -11
- data/app/views/rails_admin/main/dashboard.html.haml +0 -34
- data/app/views/rails_admin/main/delete.html.haml +0 -18
- data/app/views/rails_admin/main/edit.html.haml +0 -2
- data/app/views/rails_admin/main/export.html.haml +0 -92
- data/app/views/rails_admin/main/history.html.haml +0 -51
- data/app/views/rails_admin/main/index.html.haml +0 -126
- data/app/views/rails_admin/main/new.html.haml +0 -2
- data/app/views/rails_admin/main/show.html.haml +0 -15
- data/config/initializers/devise_patch.rb +0 -9
- data/config/initializers/haml.rb +0 -5
- data/lib/rails_admin/adapters/active_record/abstract_object.rb +0 -32
- data/lib/rails_admin/adapters/mongoid/abstract_object.rb +0 -42
- data/lib/rails_admin/bootstrap-sass/compass_functions.rb +0 -28
- data/lib/rails_admin/bootstrap-sass/sass_functions.rb +0 -16
- data/lib/rails_admin/bootstrap-sass.rb +0 -49
- data/lib/rails_admin/config/lazy_model.rb +0 -68
- data/lib/rails_admin/extensions/history/auditing_adapter.rb +0 -37
- data/lib/rails_admin/extensions/history/history.rb +0 -44
- data/lib/rails_admin/extensions/history.rb +0 -3
- data/lib/rails_admin/support/i18n.rb +0 -43
- data/vendor/assets/fonts/rails_admin/FontAwesome.otf +0 -0
- data/vendor/assets/fonts/rails_admin/fontawesome-webfont.eot +0 -0
- data/vendor/assets/fonts/rails_admin/fontawesome-webfont.svg +0 -2671
- data/vendor/assets/fonts/rails_admin/fontawesome-webfont.ttf +0 -0
- data/vendor/assets/fonts/rails_admin/fontawesome-webfont.woff +0 -0
- data/vendor/assets/fonts/rails_admin/fontawesome-webfont.woff2 +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/colorpicker_background.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/colorpicker_hex.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/colorpicker_hsb_b.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/colorpicker_hsb_h.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/colorpicker_hsb_s.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/colorpicker_indic.gif +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/colorpicker_overlay.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/colorpicker_rgb_b.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/colorpicker_rgb_g.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/colorpicker_rgb_r.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/colorpicker_select.gif +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/colorpicker_submit.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/custom_background.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/custom_hex.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/custom_hsb_b.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/custom_hsb_h.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/custom_hsb_s.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/custom_indic.gif +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/custom_rgb_b.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/custom_rgb_g.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/custom_rgb_r.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/custom_submit.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/select.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/select2.png +0 -0
- data/vendor/assets/images/rails_admin/colorpicker/slider.png +0 -0
- data/vendor/assets/javascripts/rails_admin/jquery.colorpicker.js +0 -484
- data/vendor/assets/stylesheets/rails_admin/jquery.colorpicker.scss +0 -182
@@ -1,17 +1,5 @@
|
|
1
|
-
require 'rails_admin/support/i18n'
|
2
|
-
|
3
1
|
module RailsAdmin
|
4
2
|
module ApplicationHelper
|
5
|
-
include RailsAdmin::Support::I18n
|
6
|
-
|
7
|
-
def capitalize_first_letter(wording)
|
8
|
-
return nil unless wording.present? && wording.is_a?(String)
|
9
|
-
|
10
|
-
wording = wording.dup
|
11
|
-
wording[0] = wording[0].mb_chars.capitalize.to_s
|
12
|
-
wording
|
13
|
-
end
|
14
|
-
|
15
3
|
def authorized?(action_name, abstract_model = nil, object = nil)
|
16
4
|
object = nil if object.try :new_record?
|
17
5
|
action(action_name, abstract_model, object).try(:authorized?)
|
@@ -34,19 +22,26 @@ module RailsAdmin
|
|
34
22
|
def edit_user_link
|
35
23
|
return nil unless _current_user.respond_to?(:email)
|
36
24
|
return nil unless abstract_model = RailsAdmin.config(_current_user.class).abstract_model
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
25
|
+
|
26
|
+
content = [
|
27
|
+
RailsAdmin::Config.show_gravatar && _current_user.email.present? && image_tag("#{request.ssl? ? 'https://secure' : 'http://www'}.gravatar.com/avatar/#{Digest::MD5.hexdigest _current_user.email}?s=30", alt: ''),
|
28
|
+
content_tag(:span, _current_user.email),
|
29
|
+
].compact.join.html_safe
|
30
|
+
if (edit_action = RailsAdmin::Config::Actions.find(:edit, controller: controller, abstract_model: abstract_model, object: _current_user)).try(:authorized?)
|
31
|
+
link_to content, rails_admin.url_for(action: edit_action.action_name, model_name: abstract_model.to_param, id: _current_user.id, controller: 'rails_admin/main')
|
32
|
+
else
|
33
|
+
content_tag :span, content
|
43
34
|
end
|
44
35
|
end
|
45
36
|
|
46
37
|
def logout_path
|
47
38
|
if defined?(Devise)
|
48
39
|
scope = Devise::Mapping.find_scope!(_current_user)
|
49
|
-
|
40
|
+
begin
|
41
|
+
main_app.send("destroy_#{scope}_session_path")
|
42
|
+
rescue StandardError
|
43
|
+
false
|
44
|
+
end
|
50
45
|
elsif main_app.respond_to?(:logout_path)
|
51
46
|
main_app.logout_path
|
52
47
|
end
|
@@ -54,18 +49,19 @@ module RailsAdmin
|
|
54
49
|
|
55
50
|
def logout_method
|
56
51
|
return [Devise.sign_out_via].flatten.first if defined?(Devise)
|
52
|
+
|
57
53
|
:delete
|
58
54
|
end
|
59
55
|
|
60
56
|
def wording_for(label, action = @action, abstract_model = @abstract_model, object = @object)
|
61
57
|
model_config = abstract_model.try(:config)
|
62
|
-
object = abstract_model && object.is_a?(abstract_model.model)
|
58
|
+
object = nil unless abstract_model && object.is_a?(abstract_model.model)
|
63
59
|
action = RailsAdmin::Config::Actions.find(action.to_sym) if action.is_a?(Symbol) || action.is_a?(String)
|
64
60
|
|
65
|
-
|
61
|
+
I18n.t(
|
66
62
|
"admin.actions.#{action.i18n_key}.#{label}",
|
67
|
-
model_label: model_config
|
68
|
-
model_label_plural: model_config
|
63
|
+
model_label: model_config&.label,
|
64
|
+
model_label_plural: model_config&.label_plural,
|
69
65
|
object_label: model_config && object.try(model_config.object_label_method),
|
70
66
|
)
|
71
67
|
end
|
@@ -73,21 +69,22 @@ module RailsAdmin
|
|
73
69
|
def main_navigation
|
74
70
|
nodes_stack = RailsAdmin::Config.visible_models(controller: controller)
|
75
71
|
node_model_names = nodes_stack.collect { |c| c.abstract_model.model_name }
|
72
|
+
parent_groups = nodes_stack.group_by { |n| n.parent&.to_s }
|
76
73
|
|
77
74
|
nodes_stack.group_by(&:navigation_label).collect do |navigation_label, nodes|
|
78
75
|
nodes = nodes.select { |n| n.parent.nil? || !n.parent.to_s.in?(node_model_names) }
|
79
|
-
li_stack = navigation
|
76
|
+
li_stack = navigation parent_groups, nodes
|
80
77
|
|
81
78
|
label = navigation_label || t('admin.misc.navigation')
|
82
79
|
|
83
|
-
%(<li class='dropdown-header'>#{
|
80
|
+
%(<li class='dropdown-header'>#{label}</li>#{li_stack}) if li_stack.present?
|
84
81
|
end.join.html_safe
|
85
82
|
end
|
86
83
|
|
87
84
|
def root_navigation
|
88
85
|
actions(:root).select(&:show_in_sidebar).group_by(&:sidebar_label).collect do |label, nodes|
|
89
86
|
li_stack = nodes.map do |node|
|
90
|
-
url = rails_admin.url_for(action: node.action_name, controller:
|
87
|
+
url = rails_admin.url_for(action: node.action_name, controller: 'rails_admin/main')
|
91
88
|
nav_icon = node.link_icon ? %(<i class="#{node.link_icon}"></i>).html_safe : ''
|
92
89
|
content_tag :li do
|
93
90
|
link_to nav_icon + " " + wording_for(:menu, node), url, class: "pjax"
|
@@ -95,7 +92,7 @@ module RailsAdmin
|
|
95
92
|
end.join.html_safe
|
96
93
|
label ||= t('admin.misc.root_navigation')
|
97
94
|
|
98
|
-
%(<li class='dropdown-header'>#{
|
95
|
+
%(<li class='dropdown-header'>#{label}</li>#{li_stack}) if li_stack.present?
|
99
96
|
end.join.html_safe
|
100
97
|
end
|
101
98
|
|
@@ -109,16 +106,18 @@ module RailsAdmin
|
|
109
106
|
li_stack
|
110
107
|
end
|
111
108
|
|
112
|
-
def navigation(
|
109
|
+
def navigation(parent_groups, nodes, level = 0)
|
113
110
|
nodes.collect do |node|
|
114
|
-
|
111
|
+
abstract_model = node.abstract_model
|
112
|
+
model_param = abstract_model.to_param
|
115
113
|
url = rails_admin.url_for(action: :index, controller: 'rails_admin/main', model_name: model_param)
|
116
114
|
level_class = " nav-level-#{level}" if level > 0
|
117
115
|
nav_icon = node.navigation_icon ? %(<i class="#{node.navigation_icon}"></i>).html_safe : ''
|
118
116
|
li = content_tag :li, data: {model: model_param} do
|
119
|
-
link_to nav_icon +
|
117
|
+
link_to nav_icon + node.label_plural, url, class: "pjax#{level_class}"
|
120
118
|
end
|
121
|
-
|
119
|
+
child_nodes = parent_groups[abstract_model.model_name]
|
120
|
+
child_nodes ? li + navigation(parent_groups, child_nodes, level + 1) : li
|
122
121
|
end.join.html_safe
|
123
122
|
end
|
124
123
|
|
@@ -132,44 +131,50 @@ module RailsAdmin
|
|
132
131
|
am = a.send(:eval, 'bindings[:abstract_model]')
|
133
132
|
o = a.send(:eval, 'bindings[:object]')
|
134
133
|
content_tag(:li, class: current_action?(a, am, o) && 'active') do
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
wording_for(:breadcrumb, a, am, o)
|
140
|
-
end
|
141
|
-
else
|
142
|
-
content_tag(:span, wording_for(:breadcrumb, a, am, o))
|
143
|
-
end
|
144
|
-
else
|
134
|
+
if current_action?(a, am, o)
|
135
|
+
wording_for(:breadcrumb, a, am, o)
|
136
|
+
elsif a.http_methods.include?(:get)
|
137
|
+
link_to rails_admin.url_for(action: a.action_name, controller: 'rails_admin/main', model_name: am.try(:to_param), id: (o.try(:persisted?) && o.try(:id) || nil)), class: 'pjax' do
|
145
138
|
wording_for(:breadcrumb, a, am, o)
|
146
139
|
end
|
140
|
+
else
|
141
|
+
content_tag(:span, wording_for(:breadcrumb, a, am, o))
|
147
142
|
end
|
148
|
-
crumb
|
149
143
|
end
|
150
144
|
end.reverse.join.html_safe
|
151
145
|
end
|
152
146
|
end
|
153
147
|
|
154
148
|
# parent => :root, :collection, :member
|
155
|
-
|
149
|
+
# perf matters here (no action view trickery)
|
150
|
+
def menu_for(parent, abstract_model = nil, object = nil, only_icon = false)
|
156
151
|
actions = actions(parent, abstract_model, object).select { |a| a.http_methods.include?(:get) && a.show_in_menu }
|
157
152
|
actions.collect do |action|
|
158
153
|
wording = wording_for(:menu, action)
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
154
|
+
li_class = ['icon', "#{action.key}_#{parent}_link"].
|
155
|
+
concat(current_action?(action) ? ['active'] : []).
|
156
|
+
concat(action.enabled? ? [] : ['disabled'])
|
157
|
+
content_tag(:li, {class: li_class}.merge(only_icon ? {title: wording, rel: 'tooltip'} : {})) do
|
158
|
+
label = content_tag(:i, '', {class: action.link_icon}) + content_tag(:span, wording, (only_icon ? {style: 'display:none'} : {}))
|
159
|
+
if action.enabled? || !only_icon
|
160
|
+
href =
|
161
|
+
if action.enabled?
|
162
|
+
rails_admin.url_for(action: action.action_name, controller: 'rails_admin/main', model_name: abstract_model.try(:to_param), id: (object.try(:persisted?) && object.try(:id) || nil))
|
163
|
+
else
|
164
|
+
'javascript:void(0)'
|
165
|
+
end
|
166
|
+
content_tag(:a, label, {href: href, target: action.link_target}.merge(action.pjax? ? {class: ['pjax']} : {}))
|
167
|
+
else
|
168
|
+
content_tag(:span, label)
|
169
|
+
end
|
170
|
+
end
|
171
|
+
end.join(' ').html_safe
|
168
172
|
end
|
169
173
|
|
170
174
|
def bulk_menu(abstract_model = @abstract_model)
|
171
175
|
actions = actions(:bulkable, abstract_model)
|
172
176
|
return '' if actions.empty?
|
177
|
+
|
173
178
|
content_tag :li, class: 'dropdown', style: 'float:right' do
|
174
179
|
content_tag(:a, class: 'dropdown-toggle', data: {toggle: 'dropdown'}, href: '#') { t('admin.misc.bulk_menu_title').html_safe + ' ' + '<b class="caret"></b>'.html_safe } +
|
175
180
|
content_tag(:ul, class: 'dropdown-menu', style: 'left:auto; right:0;') do
|
@@ -190,5 +195,17 @@ module RailsAdmin
|
|
190
195
|
else "alert-#{flash_key}"
|
191
196
|
end
|
192
197
|
end
|
198
|
+
|
199
|
+
def handle_asset_dependency_error
|
200
|
+
yield
|
201
|
+
rescue LoadError => e
|
202
|
+
if /sassc/.match?(e.message)
|
203
|
+
e = e.exception <<-MSG.gsub(/^\s{10}/, '')
|
204
|
+
#{e.message}
|
205
|
+
RailsAdmin requires the gem sassc-rails, make sure to put `gem 'sassc-rails'` to Gemfile.
|
206
|
+
MSG
|
207
|
+
end
|
208
|
+
raise e
|
209
|
+
end
|
193
210
|
end
|
194
211
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'nested_form/builder_mixin'
|
2
|
+
|
1
3
|
module RailsAdmin
|
2
4
|
class FormBuilder < ::ActionView::Helpers::FormBuilder
|
3
5
|
include ::NestedForm::BuilderMixin
|
@@ -30,7 +32,7 @@ module RailsAdmin
|
|
30
32
|
|
31
33
|
@template.content_tag :fieldset do
|
32
34
|
contents = []
|
33
|
-
contents << @template.content_tag(:legend, %(<i class="
|
35
|
+
contents << @template.content_tag(:legend, %(<i class="fas fa-chevron-#{fieldset.active? ? 'down' : 'right'}"></i> #{fieldset.label}).html_safe, style: fieldset.name == :default ? 'display:none' : '')
|
34
36
|
contents << @template.content_tag(:p, fieldset.help) if fieldset.help.present?
|
35
37
|
contents << fields.collect { |field| field_wrapper_for(field, nested_in) }.join
|
36
38
|
contents.join.html_safe
|
@@ -40,9 +42,10 @@ module RailsAdmin
|
|
40
42
|
def field_wrapper_for(field, nested_in)
|
41
43
|
# do not show nested field if the target is the origin
|
42
44
|
return if nested_field_association?(field, nested_in)
|
45
|
+
|
43
46
|
@template.content_tag(:div, class: "form-group control-group #{field.type_css_class} #{field.css_class} #{'error' if field.errors.present?}", id: "#{dom_id(field)}_field") do
|
44
47
|
if field.label
|
45
|
-
label(field.method_name,
|
48
|
+
label(field.method_name, field.label, class: 'col-sm-2 control-label') +
|
46
49
|
(field.nested_form ? field_for(field) : input_for(field))
|
47
50
|
else
|
48
51
|
field.nested_form ? field_for(field) : input_for(field)
|
@@ -75,13 +78,13 @@ module RailsAdmin
|
|
75
78
|
def object_infos
|
76
79
|
model_config = RailsAdmin.config(object)
|
77
80
|
model_label = model_config.label
|
78
|
-
object_label =
|
81
|
+
object_label =
|
79
82
|
if object.new_record?
|
80
83
|
I18n.t('admin.form.new_model', name: model_label)
|
81
84
|
else
|
82
85
|
object.send(model_config.object_label_method).presence || "#{model_config.label} ##{object.id}"
|
83
86
|
end
|
84
|
-
|
87
|
+
|
85
88
|
%(<span style="display:none" class="object-infos" data-model-label="#{model_label}" data-object-label="#{CGI.escapeHTML(object_label.to_s)}"></span>).html_safe
|
86
89
|
end
|
87
90
|
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'builder'
|
2
|
-
|
3
1
|
module RailsAdmin
|
4
2
|
module MainHelper
|
5
3
|
def rails_admin_form_for(*args, &block)
|
@@ -14,26 +12,8 @@ module RailsAdmin
|
|
14
12
|
return 'info' if percent < 34 # < 1/100 of max
|
15
13
|
return 'success' if percent < 67 # < 1/10 of max
|
16
14
|
return 'warning' if percent < 84 # < 1/3 of max
|
17
|
-
'danger' # > 1/3 of max
|
18
|
-
end
|
19
|
-
|
20
|
-
def get_column_sets(properties)
|
21
|
-
sets = []
|
22
|
-
property_index = 0
|
23
|
-
set_index = 0
|
24
15
|
|
25
|
-
|
26
|
-
current_set_width = 0
|
27
|
-
loop do
|
28
|
-
sets[set_index] ||= []
|
29
|
-
sets[set_index] << properties[property_index]
|
30
|
-
current_set_width += (properties[property_index].column_width || 120)
|
31
|
-
property_index += 1
|
32
|
-
break if current_set_width >= RailsAdmin::Config.total_columns_width || property_index >= properties.length
|
33
|
-
end
|
34
|
-
set_index += 1
|
35
|
-
end
|
36
|
-
sets
|
16
|
+
'danger' # > 1/3 of max
|
37
17
|
end
|
38
18
|
|
39
19
|
def filterable_fields
|
@@ -42,6 +22,7 @@ module RailsAdmin
|
|
42
22
|
|
43
23
|
def ordered_filters
|
44
24
|
return @ordered_filters if @ordered_filters.present?
|
25
|
+
|
45
26
|
@index = 0
|
46
27
|
@ordered_filters = (params[:f].try(:permit!).try(:to_h) || @model_config.list.filters).inject({}) do |memo, filter|
|
47
28
|
field_name = filter.is_a?(Array) ? filter.first : filter
|
@@ -57,29 +38,32 @@ module RailsAdmin
|
|
57
38
|
end
|
58
39
|
|
59
40
|
def ordered_filter_options
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
41
|
+
if ordered_filters
|
42
|
+
@ordered_filter_options ||= ordered_filters.map do |duplet|
|
43
|
+
options = {index: duplet[0]}
|
44
|
+
filter_for_field = duplet[1]
|
45
|
+
filter_name = filter_for_field.keys.first
|
46
|
+
filter_hash = filter_for_field.values.first
|
47
|
+
unless (field = filterable_fields.find { |f| f.name == filter_name.to_sym })
|
48
|
+
raise "#{filter_name} is not currently filterable; filterable fields are #{filterable_fields.map(&:name).join(', ')}"
|
49
|
+
end
|
50
|
+
|
51
|
+
case field.type
|
52
|
+
when :enum
|
53
|
+
options[:select_options] = options_for_select(field.with(object: @abstract_model.model.new).enum, filter_hash['v'])
|
54
|
+
when :date, :datetime, :time
|
55
|
+
options[:datetimepicker_format] = field.momentjs_format
|
56
|
+
end
|
57
|
+
options[:label] = field.label
|
58
|
+
options[:name] = field.name
|
59
|
+
options[:type] = field.type
|
60
|
+
options[:value] = filter_hash['v']
|
61
|
+
options[:label] = field.label
|
62
|
+
options[:operator] = filter_hash['o'] || field.default_filter_operator
|
63
|
+
options[:required] = field.required
|
64
|
+
options
|
73
65
|
end
|
74
|
-
|
75
|
-
options[:name] = field.name
|
76
|
-
options[:type] = field.type
|
77
|
-
options[:value] = filter_hash['v']
|
78
|
-
options[:label] = field.label
|
79
|
-
options[:operator] = filter_hash['o'] || field.default_filter_operator
|
80
|
-
options[:required] = field.required
|
81
|
-
options
|
82
|
-
end if ordered_filters
|
66
|
+
end
|
83
67
|
end
|
84
68
|
end
|
85
69
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%= paginator.render do %>
|
2
|
+
<ul class="pagination">
|
3
|
+
<%= prev_page_tag %>
|
4
|
+
<% each_page do |page| %>
|
5
|
+
<% if page.left_outer? or page.right_outer? or page.inside_window? %>
|
6
|
+
<%= page_tag page %>
|
7
|
+
<% elsif !page.was_truncated? %>
|
8
|
+
<%= gap_tag %>
|
9
|
+
<% end %>
|
10
|
+
<% end %>
|
11
|
+
<%= next_page_tag %>
|
12
|
+
</ul>
|
13
|
+
<% end %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
|
2
|
+
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
|
3
|
+
<meta content="width=device-width, initial-scale=1" name="viewport; charset=utf-8"/>
|
4
|
+
<meta content="NONE,NOARCHIVE" name="robots"/>
|
5
|
+
<%= csrf_meta_tag %>
|
6
|
+
<% case RailsAdmin::config.asset_source
|
7
|
+
when :webpacker %>
|
8
|
+
<%= stylesheet_pack_tag "rails_admin" %>
|
9
|
+
<%= javascript_pack_tag "rails_admin", async: true %>
|
10
|
+
<% when :webpack, :sprockets %>
|
11
|
+
<% handle_asset_dependency_error do %>
|
12
|
+
<%= stylesheet_link_tag "rails_admin.css", media: :all %>
|
13
|
+
<%= javascript_include_tag "rails_admin.js", async: true %>
|
14
|
+
<% end %>
|
15
|
+
<% else
|
16
|
+
raise "Unknown asset_source: #{RailsAdmin::config.asset_source}"
|
17
|
+
end %>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<div class="container-fluid">
|
2
|
+
<div class="navbar-header">
|
3
|
+
<button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target="#secondary-navigation">
|
4
|
+
<span class="sr-only">
|
5
|
+
<%= t('admin.toggle_navigation') %>
|
6
|
+
</span>
|
7
|
+
<span class="icon-bar"></span>
|
8
|
+
<span class="icon-bar"></span>
|
9
|
+
<span class="icon-bar"></span>
|
10
|
+
</button>
|
11
|
+
<a class="navbar-brand pjax" href="<%= dashboard_path %>">
|
12
|
+
<%= _get_plugin_name[0] || 'Rails' %>
|
13
|
+
<small>
|
14
|
+
<%= _get_plugin_name[1] || 'Admin' %>
|
15
|
+
</small>
|
16
|
+
</a>
|
17
|
+
</div>
|
18
|
+
<div class="collapse navbar-collapse" id="secondary-navigation">
|
19
|
+
<%= render partial: 'layouts/rails_admin/secondary_navigation' %>
|
20
|
+
</div>
|
21
|
+
</div>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<ul class="nav navbar-nav navbar-right root_links">
|
2
|
+
<% actions(:root).select(&:show_in_navigation).each do |action| %>
|
3
|
+
<li class="<%= action.action_name %>_root_link">
|
4
|
+
<%= link_to wording_for(:menu, action), { action: action.action_name, controller: 'rails_admin/main' }, class: action.pjax? ? "pjax" : "" %>
|
5
|
+
</li>
|
6
|
+
<% end %>
|
7
|
+
<% if main_app_root_path = (main_app.root_path rescue false) %>
|
8
|
+
<li>
|
9
|
+
<%= link_to t('admin.home.name'), main_app_root_path %>
|
10
|
+
</li>
|
11
|
+
<% end %>
|
12
|
+
<% if _current_user %>
|
13
|
+
<% if user_link = edit_user_link %>
|
14
|
+
<li class="edit_user_root_link">
|
15
|
+
<%= user_link %>
|
16
|
+
</li>
|
17
|
+
<% end %>
|
18
|
+
<% if logout_path.present? %>
|
19
|
+
<li>
|
20
|
+
<%= link_to content_tag('span', t('admin.misc.log_out'), class: 'label label-danger'), logout_path, method: logout_method %>
|
21
|
+
</li>
|
22
|
+
<% end %>
|
23
|
+
<% end %>
|
24
|
+
</ul>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="<%= I18n.locale %>">
|
3
|
+
<head>
|
4
|
+
<%= render "layouts/rails_admin/head" %>
|
5
|
+
</head>
|
6
|
+
<body class="rails_admin">
|
7
|
+
<div data-i18n-options="<%= I18n.t("admin.js").to_json %>" id="admin-js"></div>
|
8
|
+
<div class="label label-warning" id="loading" style="display:none; position:fixed; right:20px; bottom:20px; z-index:100000">
|
9
|
+
<%= t('admin.loading') %>
|
10
|
+
</div>
|
11
|
+
<nav class="navbar navbar-default navbar-fixed-top">
|
12
|
+
<%= render "layouts/rails_admin/navigation" %>
|
13
|
+
</nav>
|
14
|
+
<div class="container-fluid">
|
15
|
+
<div class="row">
|
16
|
+
<div class="col-sm-3 col-md-2 sidebar-nav">
|
17
|
+
<%= render "layouts/rails_admin/sidebar_navigation" %>
|
18
|
+
</div>
|
19
|
+
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2">
|
20
|
+
<div class="content" data-pjax-container="<%= true %>">
|
21
|
+
<%= render template: 'layouts/rails_admin/pjax' %>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
</body>
|
27
|
+
</html>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<title>
|
2
|
+
<%= "#{@abstract_model.try(:pretty_name) || @page_name} | #{[_get_plugin_name[0] || 'Rails', _get_plugin_name[1] || 'Admin'].join(' ')}" %>
|
3
|
+
</title>
|
4
|
+
<div class="page-header" data-model="<%= @abstract_model.to_param %>">
|
5
|
+
<h1>
|
6
|
+
<%= @page_name %>
|
7
|
+
</h1>
|
8
|
+
</div>
|
9
|
+
<% flash && flash.each do |key, value| %>
|
10
|
+
<div class="<%= flash_alert_class(key) %> alert alert-dismissible">
|
11
|
+
<button class="close" data-dismiss="alert" type="button">×</button>
|
12
|
+
<%= value %>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
<%= breadcrumb %>
|
16
|
+
<ul class="nav nav-tabs">
|
17
|
+
<%= menu_for((@abstract_model ? (@object.try(:persisted?) ? :member : :collection) : :root), @abstract_model, @object) %>
|
18
|
+
<%= content_for :contextual_tabs %>
|
19
|
+
</ul>
|
20
|
+
<%= yield %>
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<table class="table table-condensed table-striped table-hover">
|
2
|
+
<thead>
|
3
|
+
<tr>
|
4
|
+
<th class="shrink user">
|
5
|
+
<%= t("admin.table_headers.username") %>
|
6
|
+
</th>
|
7
|
+
<th class="shrink items">
|
8
|
+
<%= t("admin.table_headers.item") %>
|
9
|
+
</th>
|
10
|
+
<th class="changes">
|
11
|
+
<%= t("admin.table_headers.changes") %>
|
12
|
+
</th>
|
13
|
+
</tr>
|
14
|
+
</thead>
|
15
|
+
<tbody>
|
16
|
+
<% @history.each do |t| %>
|
17
|
+
<% abstract_model = RailsAdmin.config(t.table).abstract_model %>
|
18
|
+
<tr>
|
19
|
+
<td>
|
20
|
+
<%= t.try :username %>
|
21
|
+
</td>
|
22
|
+
<% if o = abstract_model.try(:get, t.item) %>
|
23
|
+
<% label = o.send(abstract_model.config.object_label_method) %>
|
24
|
+
<% if show_action = action(:show, abstract_model, o) %>
|
25
|
+
<td>
|
26
|
+
<%= link_to(label, url_for(action: show_action.action_name, model_name: abstract_model.to_param, id: o.id), class: 'pjax') %>
|
27
|
+
</td>
|
28
|
+
<% else %>
|
29
|
+
<td>
|
30
|
+
<%= label %>
|
31
|
+
</td>
|
32
|
+
<% end %>
|
33
|
+
<% else %>
|
34
|
+
<% label = Object.const_defined?(t.table) ? t.table.constantize.model_name.human : t.table %>
|
35
|
+
<td>
|
36
|
+
<%= "#{label} ##{t.item}" %>
|
37
|
+
</td>
|
38
|
+
<% end %>
|
39
|
+
<td>
|
40
|
+
<%= t.message %>
|
41
|
+
</td>
|
42
|
+
</tr>
|
43
|
+
<% end %>
|
44
|
+
</tbody>
|
45
|
+
</table>
|