obitum-rails_admin 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +1 -8
- data/README.md +6 -2
- data/app/assets/javascripts/rails_admin/custom/ui.js +5 -5
- data/app/assets/javascripts/rails_admin/jquery-ui-1.8.16.custom.js +4727 -4727
- data/app/assets/javascripts/rails_admin/jquery.colorpicker.js +484 -484
- data/app/assets/javascripts/rails_admin/jquery.pjax.js +250 -85
- data/app/assets/javascripts/rails_admin/jquery.ui.timepicker.js +1371 -1219
- data/app/assets/javascripts/rails_admin/ra.filter-box.js +30 -30
- data/app/assets/javascripts/rails_admin/ra.filtering-select.js +11 -11
- data/app/assets/javascripts/rails_admin/ra.nested-form-hooks.coffee +40 -0
- data/app/assets/javascripts/rails_admin/ra.remote-form.js +41 -39
- data/app/assets/javascripts/rails_admin/rails_admin.js.erb +4 -3
- data/app/assets/javascripts/rails_admin/themes/default/ui.js +6 -6
- data/app/assets/javascripts/rails_admin/ui.js.coffee +44 -16
- data/app/assets/stylesheets/rails_admin/base/README +2 -2
- data/app/assets/stylesheets/rails_admin/base/theming.css.scss +226 -113
- data/app/assets/stylesheets/rails_admin/custom/mixins.css.scss +1 -1
- data/app/assets/stylesheets/rails_admin/custom/theming.css.scss +2 -2
- data/app/assets/stylesheets/rails_admin/custom/variables.css.scss +3 -3
- data/app/assets/stylesheets/rails_admin/imports.css.scss.erb +36 -1
- data/app/assets/stylesheets/rails_admin/jquery.ui.timepicker.css.scss +16 -0
- data/app/assets/stylesheets/rails_admin/ra.filtering-multiselect.css.scss +2 -2
- data/app/assets/stylesheets/rails_admin/themes/default/mixins.css.scss +1 -1
- data/app/assets/stylesheets/rails_admin/themes/default/theming.css.scss +2 -2
- data/app/assets/stylesheets/rails_admin/themes/default/variables.css.scss +3 -3
- data/app/controllers/rails_admin/application_controller.rb +13 -18
- data/app/controllers/rails_admin/main_controller.rb +15 -16
- data/app/helpers/rails_admin/application_helper.rb +67 -41
- data/app/helpers/rails_admin/form_builder.rb +31 -29
- data/app/helpers/rails_admin/main_helper.rb +4 -4
- data/app/views/layouts/rails_admin/_secondary_navigation.html.haml +12 -11
- data/app/views/layouts/rails_admin/application.html.haml +29 -29
- data/app/views/rails_admin/main/_dashboard_history.html.haml +1 -1
- data/app/views/rails_admin/main/_delete_notice.html.haml +4 -5
- data/app/views/rails_admin/main/_form_colorpicker.html.haml +2 -1
- data/app/views/rails_admin/main/_form_datetime.html.haml +1 -1
- data/app/views/rails_admin/main/_form_enumeration.html.haml +1 -1
- data/app/views/rails_admin/main/_form_field.html.haml +1 -1
- data/app/views/rails_admin/main/_form_file_upload.html.haml +3 -2
- data/app/views/rails_admin/main/_form_filtering_multiselect.html.haml +6 -4
- data/app/views/rails_admin/main/_form_filtering_select.html.haml +6 -5
- data/app/views/rails_admin/main/_form_nested_many.html.haml +41 -6
- data/app/views/rails_admin/main/_form_nested_one.html.haml +34 -5
- data/app/views/rails_admin/main/_form_text.html.haml +3 -3
- data/app/views/rails_admin/main/_submit_buttons.html.haml +6 -4
- data/app/views/rails_admin/main/bulk_delete.html.haml +7 -3
- data/app/views/rails_admin/main/dashboard.html.haml +4 -4
- data/app/views/rails_admin/main/delete.html.haml +7 -3
- data/app/views/rails_admin/main/edit.html.haml +1 -1
- data/app/views/rails_admin/main/export.html.haml +57 -53
- data/app/views/rails_admin/main/history.html.haml +8 -8
- data/app/views/rails_admin/main/index.html.haml +22 -21
- data/app/views/rails_admin/main/new.html.haml +1 -1
- data/app/views/rails_admin/main/show.html.haml +2 -2
- data/config/initializers/active_record_extensions.rb +2 -2
- data/config/initializers/haml.rb +0 -1
- data/config/locales/rails_admin.en.yml +5 -5
- data/lib/generators/rails_admin/templates/initializer.erb +7 -7
- data/lib/rails_admin/abstract_model.rb +36 -53
- data/lib/rails_admin/adapters/active_record/abstract_object.rb +32 -0
- data/lib/rails_admin/adapters/active_record.rb +56 -137
- data/lib/rails_admin/config/actions/base.rb +40 -28
- data/lib/rails_admin/config/actions/bulk_delete.rb +10 -11
- data/lib/rails_admin/config/actions/dashboard.rb +9 -5
- data/lib/rails_admin/config/actions/delete.rb +12 -9
- data/lib/rails_admin/config/actions/edit.rb +13 -9
- data/lib/rails_admin/config/actions/export.rb +9 -6
- data/lib/rails_admin/config/actions/history_index.rb +9 -5
- data/lib/rails_admin/config/actions/history_show.rb +9 -5
- data/lib/rails_admin/config/actions/index.rb +23 -13
- data/lib/rails_admin/config/actions/new.rb +14 -10
- data/lib/rails_admin/config/actions/show.rb +10 -5
- data/lib/rails_admin/config/actions/show_in_app.rb +9 -4
- data/lib/rails_admin/config/actions.rb +16 -16
- data/lib/rails_admin/config/configurable.rb +92 -0
- data/lib/rails_admin/config/fields/association.rb +6 -23
- data/lib/rails_admin/config/fields/base.rb +58 -40
- data/lib/rails_admin/config/fields/factories/belongs_to_association.rb +26 -0
- data/lib/rails_admin/config/fields/factories/carrierwave.rb +21 -2
- data/lib/rails_admin/config/fields/factories/devise.rb +9 -12
- data/lib/rails_admin/config/fields/factories/dragonfly.rb +13 -7
- data/lib/rails_admin/config/fields/factories/paperclip.rb +14 -15
- data/lib/rails_admin/config/fields/group.rb +16 -3
- data/lib/rails_admin/config/fields/types/belongs_to_association.rb +2 -2
- data/lib/rails_admin/config/fields/types/carrierwave.rb +0 -9
- data/lib/rails_admin/config/fields/types/color.rb +3 -3
- data/lib/rails_admin/config/fields/types/dragonfly.rb +1 -19
- data/lib/rails_admin/config/fields/types/file_upload.rb +7 -11
- data/lib/rails_admin/config/fields/types/has_many_association.rb +1 -6
- data/lib/rails_admin/config/fields/types/has_one_association.rb +4 -4
- data/lib/rails_admin/config/fields/types/paperclip.rb +0 -18
- data/lib/rails_admin/config/fields/types/password.rb +2 -2
- data/lib/rails_admin/config/fields/types/polymorphic_association.rb +2 -2
- data/lib/rails_admin/config/fields/types/text.rb +2 -2
- data/lib/rails_admin/config/fields.rb +7 -17
- data/lib/rails_admin/config/has_fields.rb +9 -9
- data/lib/rails_admin/config/has_groups.rb +2 -2
- data/lib/rails_admin/config/hideable.rb +2 -2
- data/lib/rails_admin/config/model.rb +23 -17
- data/lib/rails_admin/config/proxyable/proxy.rb +43 -0
- data/lib/rails_admin/config/proxyable.rb +12 -0
- data/lib/rails_admin/config/sections/base.rb +14 -4
- data/lib/rails_admin/config.rb +38 -9
- data/lib/rails_admin/extension.rb +1 -1
- data/lib/rails_admin/extensions/history/auditing_adapter.rb +6 -6
- data/lib/rails_admin/extensions/history/history.rb +2 -1
- data/lib/rails_admin/extensions/paper_trail/auditing_adapter.rb +13 -13
- data/lib/rails_admin/support/csv_converter.rb +6 -6
- data/lib/rails_admin/version.rb +1 -1
- data/lib/rails_admin.rb +0 -5
- data/spec/controllers/main_controller_spec.rb +7 -7
- data/spec/dummy_app/Gemfile +10 -7
- data/spec/dummy_app/Rakefile +1 -1
- data/spec/dummy_app/app/assets/images/rails.png +0 -0
- data/spec/dummy_app/app/assets/javascripts/application.js +15 -0
- data/spec/dummy_app/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy_app/app/controllers/players_controller.rb +1 -1
- data/spec/dummy_app/app/models/cms/basic_page.rb +1 -1
- data/spec/dummy_app/app/models/division.rb +5 -1
- data/spec/dummy_app/app/models/field_test.rb +4 -4
- data/spec/dummy_app/app/models/nested_field_test.rb +3 -0
- data/spec/dummy_app/app/models/player.rb +3 -3
- data/spec/dummy_app/app/views/layouts/application.html.erb +3 -2
- data/spec/dummy_app/app/views/players/show.html.haml +1 -1
- data/spec/dummy_app/config/application.rb +20 -5
- data/spec/dummy_app/config/database.yml +5 -2
- data/spec/dummy_app/config/environments/development.rb +11 -1
- data/spec/dummy_app/config/environments/production.rb +19 -3
- data/spec/dummy_app/config/environments/test.rb +5 -7
- data/spec/dummy_app/config/initializers/devise.rb +6 -0
- data/spec/dummy_app/config/initializers/inflections.rb +5 -0
- data/spec/dummy_app/config/initializers/secret_token.rb +1 -1
- data/spec/dummy_app/{foo/test/dummy/config → config}/initializers/wrap_parameters.rb +1 -1
- data/spec/dummy_app/config/routes.rb +1 -1
- data/spec/dummy_app/db/migrate/00000000000006_devise_create_users.rb +35 -5
- data/spec/dummy_app/db/migrate/20120118122004_add_categories.rb +1 -1
- data/spec/dummy_app/doc/README_FOR_APP +2 -0
- data/spec/dummy_app/public/404.html +26 -0
- data/spec/dummy_app/{foo/test/dummy/public → public}/422.html +0 -0
- data/spec/dummy_app/{foo/test/dummy/public → public}/500.html +0 -1
- data/spec/dummy_app/public/favicon.ico +0 -0
- data/spec/dummy_app/public/robots.txt +5 -0
- data/spec/helpers/application_helper_spec.rb +107 -42
- data/spec/{requests → integration}/authorization/cancan_spec.rb +4 -5
- data/spec/{requests → integration}/basic/bulk_action/rails_admin_basic_bulk_action_spec.rb +0 -0
- data/spec/{requests → integration}/basic/bulk_destroy/rails_admin_basic_bulk_destroy_spec.rb +3 -16
- data/spec/{requests → integration}/basic/create/rails_admin_basic_create_spec.rb +0 -2
- data/spec/{requests → integration}/basic/create/rails_admin_namespaced_model_create_spec.rb +0 -16
- data/spec/{requests → integration}/basic/delete/rails_admin_basic_delete_spec.rb +0 -0
- data/spec/{requests → integration}/basic/destroy/rails_admin_basic_destroy_spec.rb +0 -0
- data/spec/{requests → integration}/basic/edit/rails_admin_basic_edit_spec.rb +2 -2
- data/spec/{requests → integration}/basic/export/rails_admin_basic_export_spec.rb +1 -1
- data/spec/{requests → integration}/basic/list/rails_admin_basic_list_spec.rb +12 -38
- data/spec/{requests → integration}/basic/new/rails_admin_basic_new_spec.rb +0 -0
- data/spec/{requests → integration}/basic/new/rails_admin_namespaced_model_new_spec.rb +0 -0
- data/spec/{requests → integration}/basic/show/rails_admin_basic_show_spec.rb +1 -2
- data/spec/{requests → integration}/basic/update/rails_admin_basic_update_spec.rb +2 -2
- data/spec/{requests → integration}/config/edit/rails_admin_config_edit_spec.rb +65 -24
- data/spec/{requests → integration}/config/list/rails_admin_config_list_spec.rb +2 -2
- data/spec/{requests → integration}/config/show/rails_admin_config_show_spec.rb +20 -0
- data/spec/{requests → integration}/history/rails_admin_history_spec.rb +3 -3
- data/spec/{requests → integration}/rails_admin_spec.rb +8 -41
- data/spec/{requests → integration}/relation_spec.rb +0 -0
- data/spec/spec_helper.rb +13 -31
- data/spec/{lib → unit/adapters/active_record}/abstract_object_spec.rb +17 -5
- data/spec/unit/adapters/active_record_spec.rb +53 -0
- data/spec/{requests/actions.rb → unit/config/actions_spec.rb} +47 -31
- data/spec/unit/config/fields/base_spec.rb +291 -0
- data/spec/unit/config/model_spec.rb +75 -0
- data/spec/unit/config/sections_spec.rb +123 -0
- data/spec/{lib/rails_admin_spec.rb → unit/config_spec.rb} +65 -93
- metadata +127 -223
- data/app/assets/javascripts/rails_admin/jquery_nested_form.js +0 -58
- data/app/views/layouts/rails_admin/_navigation.html.haml +0 -17
- data/lib/rails_admin/abstract_object.rb +0 -28
- data/lib/rails_admin/config/base.rb +0 -111
- data/lib/rails_admin/config/proxy.rb +0 -40
- data/lib/rails_admin/generic_support.rb +0 -18
- data/spec/dummy_app/config/initializers/quiet_assets.rb +0 -10
- data/spec/dummy_app/foo/Gemfile +0 -17
- data/spec/dummy_app/foo/MIT-LICENSE +0 -20
- data/spec/dummy_app/foo/README.rdoc +0 -3
- data/spec/dummy_app/foo/Rakefile +0 -39
- data/spec/dummy_app/foo/app/assets/javascripts/foo/application.js +0 -9
- data/spec/dummy_app/foo/app/assets/stylesheets/foo/application.css +0 -7
- data/spec/dummy_app/foo/app/controllers/foo/application_controller.rb +0 -4
- data/spec/dummy_app/foo/app/helpers/foo/application_helper.rb +0 -4
- data/spec/dummy_app/foo/app/models/foo/bar.rb +0 -4
- data/spec/dummy_app/foo/app/views/layouts/foo/application.html.erb +0 -14
- data/spec/dummy_app/foo/config/routes.rb +0 -2
- data/spec/dummy_app/foo/foo.gemspec +0 -23
- data/spec/dummy_app/foo/lib/foo/engine.rb +0 -5
- data/spec/dummy_app/foo/lib/foo/version.rb +0 -3
- data/spec/dummy_app/foo/lib/foo.rb +0 -4
- data/spec/dummy_app/foo/lib/tasks/foo_tasks.rake +0 -4
- data/spec/dummy_app/foo/script/rails +0 -6
- data/spec/dummy_app/foo/test/dummy/Rakefile +0 -7
- data/spec/dummy_app/foo/test/dummy/app/assets/javascripts/application.js +0 -9
- data/spec/dummy_app/foo/test/dummy/app/assets/stylesheets/application.css +0 -7
- data/spec/dummy_app/foo/test/dummy/app/controllers/application_controller.rb +0 -3
- data/spec/dummy_app/foo/test/dummy/app/helpers/application_helper.rb +0 -2
- data/spec/dummy_app/foo/test/dummy/app/views/layouts/application.html.erb +0 -14
- data/spec/dummy_app/foo/test/dummy/config/application.rb +0 -45
- data/spec/dummy_app/foo/test/dummy/config/boot.rb +0 -10
- data/spec/dummy_app/foo/test/dummy/config/database.yml +0 -25
- data/spec/dummy_app/foo/test/dummy/config/environment.rb +0 -5
- data/spec/dummy_app/foo/test/dummy/config/environments/development.rb +0 -30
- data/spec/dummy_app/foo/test/dummy/config/environments/production.rb +0 -60
- data/spec/dummy_app/foo/test/dummy/config/environments/test.rb +0 -39
- data/spec/dummy_app/foo/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy_app/foo/test/dummy/config/initializers/inflections.rb +0 -10
- data/spec/dummy_app/foo/test/dummy/config/initializers/mime_types.rb +0 -5
- data/spec/dummy_app/foo/test/dummy/config/initializers/secret_token.rb +0 -7
- data/spec/dummy_app/foo/test/dummy/config/initializers/session_store.rb +0 -8
- data/spec/dummy_app/foo/test/dummy/config/locales/en.yml +0 -5
- data/spec/dummy_app/foo/test/dummy/config/routes.rb +0 -4
- data/spec/dummy_app/foo/test/dummy/config.ru +0 -4
- data/spec/dummy_app/foo/test/dummy/db/schema.rb +0 -21
- data/spec/dummy_app/foo/test/dummy/public/404.html +0 -26
- data/spec/dummy_app/foo/test/dummy/public/favicon.ico +0 -0
- data/spec/dummy_app/foo/test/dummy/script/rails +0 -6
- data/spec/dummy_app/foo/test/fixtures/foo/bars.yml +0 -11
- data/spec/dummy_app/foo/test/foo_test.rb +0 -7
- data/spec/dummy_app/foo/test/integration/navigation_test.rb +0 -10
- data/spec/dummy_app/foo/test/test_helper.rb +0 -10
- data/spec/dummy_app/foo/test/unit/foo/bar_test.rb +0 -9
- data/spec/generator_helpers.rb +0 -30
- data/spec/generators/install_generator_spec.rb +0 -85
- data/spec/generators/uninstall_generator_spec.rb +0 -35
- data/spec/lib/custom_field.rb +0 -7
- data/spec/requests/config/navigation/rails_admin_config_navigation_spec.rb +0 -107
- data/spec/requests/config/rails_admin_config_spec.rb +0 -227
@@ -1,6 +1,41 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
= form.
|
1
|
+
.controls
|
2
|
+
.btn-group
|
3
|
+
%a.btn.btn-info.toggler{:'data-toggle' => "button", :'data-target' => "#{form.jquery_namespace(field)} > .tab-content, #{form.jquery_namespace(field)} > .controls > .nav", :class => (field.active? ? 'active' : '')}
|
4
|
+
%i.icon-white
|
5
|
+
= form.link_to_add "<i class=\"icon-plus icon-white\"></i> #{wording_for(:link, :new, field.associated_model_config.abstract_model)}".html_safe, field.name, { :class => 'btn btn-info' }
|
6
|
+
= form.errors_for(field)
|
7
|
+
= form.help_for(field)
|
8
|
+
%ul.nav.nav-tabs{ :style => 'margin-top:5px' }
|
9
|
+
.tab-content
|
10
|
+
= form.fields_for field.name do |nested_form|
|
11
|
+
= nested_form.link_to_remove '<span class="btn btn-small btn-danger"><i class="icon-trash icon-white"></i></span>'.html_safe
|
12
|
+
= nested_form.generate({:action => :nested, :model_config => field.associated_model_config, :nested_in => field.name })
|
13
|
+
|
14
|
+
= form.javascript_for(field) do
|
15
|
+
:plain
|
16
|
+
var field = $("#{form.jquery_namespace(field)}");
|
17
|
+
var nav = field.find('> .controls > .nav');
|
18
|
+
var content = field.find('> .tab-content');
|
19
|
+
var toggler = field.find('> .controls > .btn-group > .toggler');
|
20
|
+
|
21
|
+
// add each nested field to a tab-pane and reference it in the nav
|
22
|
+
content.children(".fields").addClass('tab-pane').each(function(){
|
23
|
+
nav.append('<li><a data-toggle="tab" href="#' + this.id + '">' + $(this).children('.object-infos').data('object-label') + '</a></li>');
|
24
|
+
});
|
25
|
+
|
26
|
+
// init first tab, toggler and content/tabs visibility
|
27
|
+
nav.find("> li > a[data-toggle='tab']:first").tab('show');
|
28
|
+
if(nav.children().length == 0) {
|
29
|
+
nav.hide(); content.hide();
|
30
|
+
toggler.addClass('disabled').removeClass('active').children('i').addClass('icon-chevron-right')
|
31
|
+
} else {
|
32
|
+
if (toggler.hasClass('active')) {
|
33
|
+
nav.show(); content.show();
|
34
|
+
toggler.children('i').addClass('icon-chevron-down')
|
35
|
+
} else {
|
36
|
+
nav.hide(); content.hide();
|
37
|
+
toggler.children('i').addClass('icon-chevron-right')
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
// dynamic behaviour is in nested-form-hooks
|
@@ -1,6 +1,35 @@
|
|
1
|
+
.controls
|
2
|
+
%ul.nav{:style => 'margin-bottom:0px; display:none'}
|
3
|
+
%a.btn.btn-info.toggler{:'data-toggle' => "button", :'data-target' => "#{form.jquery_namespace(field)} > .tab-content", :class => (field.active? ? 'active' : '') }
|
4
|
+
= form.errors_for(field)
|
5
|
+
= form.help_for(field)
|
6
|
+
|
1
7
|
- form.object.send("build_#{field.name}") unless form.object.send(field.name)
|
2
|
-
|
3
|
-
|
4
|
-
= nested_form.
|
5
|
-
|
6
|
-
|
8
|
+
.tab-content
|
9
|
+
= form.fields_for field.name do |nested_form|
|
10
|
+
= nested_form.generate({:action => :nested, :model_config => field.associated_model_config, :nested_in => field.name })
|
11
|
+
|
12
|
+
= form.javascript_for(field) do
|
13
|
+
:plain
|
14
|
+
var field = $("#{form.jquery_namespace(field)}");
|
15
|
+
var nav = field.find("> .controls > .nav");
|
16
|
+
var content = field.find("> .tab-content");
|
17
|
+
var toggler = field.find('> .controls > .toggler');
|
18
|
+
|
19
|
+
content.children(".fields").addClass('tab-pane').each(function(){
|
20
|
+
nav.append('<li><a data-toggle="tab" href="#' + this.id + '">' + $(this).children('.object-infos').data('object-label') + '</a></li>');
|
21
|
+
});
|
22
|
+
|
23
|
+
var first_tab = nav.find("> li > a[data-toggle='tab']:first");
|
24
|
+
|
25
|
+
first_tab.tab('show');
|
26
|
+
field.find("> .controls > [data-target]:first").html('<i class="icon-white"></i> ' + first_tab.html());
|
27
|
+
|
28
|
+
if (toggler.hasClass('active')) {
|
29
|
+
toggler.children('i').addClass('icon-chevron-down');
|
30
|
+
content.show()
|
31
|
+
} else {
|
32
|
+
toggler.children('i').addClass('icon-chevron-right');
|
33
|
+
content.hide()
|
34
|
+
}
|
35
|
+
|
@@ -1,9 +1,9 @@
|
|
1
|
-
= form.send field.view_helper, field.method_name, field.
|
1
|
+
= form.send field.view_helper, field.method_name, field.html_attributes.reverse_merge((hdv = field.html_default_value).nil? ? {} : { :value => hdv })
|
2
2
|
|
3
3
|
- if field.ckeditor
|
4
4
|
= javascript_tag do
|
5
|
-
var CKEDITOR_BASEPATH = '/
|
6
|
-
= javascript_include_tag "/
|
5
|
+
var CKEDITOR_BASEPATH = '/assets/ckeditor/';
|
6
|
+
= javascript_include_tag "/assets/ckeditor/ckeditor.js"
|
7
7
|
= form.javascript_for(field, :modal => false) do
|
8
8
|
:plain
|
9
9
|
CKEDITOR.replace('#{form.dom_id(field)}', { customConfig : '#{field.ckeditor_config_js.html_safe}' });
|
@@ -1,13 +1,15 @@
|
|
1
1
|
%input{:type => :hidden, :name => 'return_to', :value => (params[:return_to].presence || request.referer)}
|
2
|
-
.actions
|
3
|
-
%button.btn.primary{:type => "submit", :name => "_save", :'data-disable-with' => t("admin.form.save")}
|
2
|
+
.form-actions
|
3
|
+
%button.btn.btn-primary{:type => "submit", :name => "_save", :'data-disable-with' => t("admin.form.save")}
|
4
|
+
%i.icon-white.icon-ok
|
4
5
|
= t("admin.form.save")
|
5
6
|
%span.extra_buttons
|
6
7
|
- if authorized? :new, @abstract_model
|
7
|
-
%button.btn{:type => "submit", :name => "_add_another", :'data-disable-with' => t("admin.form.save_and_add_another")}
|
8
|
+
%button.btn.btn-info{:type => "submit", :name => "_add_another", :'data-disable-with' => t("admin.form.save_and_add_another")}
|
8
9
|
= t("admin.form.save_and_add_another")
|
9
10
|
- if authorized? :edit, @abstract_model
|
10
|
-
%button.btn{:type => "submit", :name => "_add_edit", :'data-disable-with' => t("admin.form.save_and_edit")}
|
11
|
+
%button.btn.btn-info{:type => "submit", :name => "_add_edit", :'data-disable-with' => t("admin.form.save_and_edit")}
|
11
12
|
= t("admin.form.save_and_edit")
|
12
13
|
%button.btn{:type => "submit", :name => "_continue", :'data-disable-with' => t("admin.form.cancel")}
|
14
|
+
%i.icon-remove
|
13
15
|
= t("admin.form.cancel")
|
@@ -1,7 +1,11 @@
|
|
1
1
|
%h4= I18n.t('admin.form.bulk_delete')
|
2
2
|
%ul= render :partial => "delete_notice", :collection => @objects
|
3
3
|
= form_tag bulk_delete_path(:model_name => @abstract_model.to_param, :bulk_ids => @objects.map(&:id)), :method => :delete do
|
4
|
-
.actions
|
4
|
+
.form-actions
|
5
5
|
%input{:type => :hidden, :name => 'return_to', :value => (params[:return_to].presence || request.referer)}
|
6
|
-
%button.btn.danger{:type => "submit", :'data-disable-with' => t("admin.form.confirmation")}
|
7
|
-
|
6
|
+
%button.btn.btn-danger{:type => "submit", :'data-disable-with' => t("admin.form.confirmation")}
|
7
|
+
%i.icon-white.icon-ok
|
8
|
+
= t("admin.form.confirmation")
|
9
|
+
%button.btn{:type => "submit", :name => "_continue", :'data-disable-with' => t("admin.form.cancel")}
|
10
|
+
%i.icon-remove
|
11
|
+
= t("admin.form.cancel")
|
@@ -1,4 +1,4 @@
|
|
1
|
-
%table.
|
1
|
+
%table.table.table-condensed.table-striped
|
2
2
|
%thead
|
3
3
|
%tr
|
4
4
|
%th.shrink.model-name= t "admin.table_headers.model_name"
|
@@ -13,7 +13,7 @@
|
|
13
13
|
|
14
14
|
%tr{:class => row_class, :"data-link" => index_path}
|
15
15
|
%td
|
16
|
-
%span.show= link_to
|
16
|
+
%span.show= link_to abstract_model.config.label_plural, index_path
|
17
17
|
%td
|
18
18
|
- if (last_used = @most_recent_changes[abstract_model.pretty_name])
|
19
19
|
= time_ago_in_words last_used
|
@@ -21,9 +21,9 @@
|
|
21
21
|
%td
|
22
22
|
- count = @count[abstract_model.pretty_name]
|
23
23
|
- percent = count > 0 ? (@max < 2.0 ? count : ((Math.log(count) * 100.0) / Math.log(@max))) : -1
|
24
|
-
.label.animate-width-to{:class => get_indicator(percent), :'data-animate-length' => ([1.0, percent].max.to_i * 20), :'data-animate-width-to' => "#{[2.0, percent].max.to_i}%", :style => "width:2%"}= @count[abstract_model.pretty_name]
|
24
|
+
.label.animate-width-to{:class => 'label-'+get_indicator(percent), :'data-animate-length' => ([1.0, percent].max.to_i * 20), :'data-animate-width-to' => "#{[2.0, percent - 1].max.to_i}%", :style => "width:2%"}= @count[abstract_model.pretty_name]
|
25
25
|
%td.links
|
26
|
-
%ul.inline= menu_for :collection, abstract_model
|
26
|
+
%ul.inline= menu_for :collection, abstract_model, nil, true
|
27
27
|
- if @auditing_adapter && authorized?(:history)
|
28
28
|
#block-tables.block
|
29
29
|
.content
|
@@ -9,6 +9,10 @@
|
|
9
9
|
%ul= render :partial => "delete_notice", :object => @object
|
10
10
|
= form_for(@object, :url => delete_path(:model_name => @abstract_model.to_param, :id => @object.id), :html => {:method => "delete"}) do
|
11
11
|
%input{:type => :hidden, :name => 'return_to', :value => (params[:return_to].presence || request.referer)}
|
12
|
-
.actions
|
13
|
-
%button.btn.danger{:type => "submit", :'data-disable-with' => t("admin.form.confirmation")}
|
14
|
-
|
12
|
+
.form-actions
|
13
|
+
%button.btn.btn-danger{:type => "submit", :'data-disable-with' => t("admin.form.confirmation")}
|
14
|
+
%i.icon-white.icon-ok
|
15
|
+
= t("admin.form.confirmation")
|
16
|
+
%button.btn{:type => "submit", :name => "_continue", :'data-disable-with' => t("admin.form.cancel")}
|
17
|
+
%i.icon-remove
|
18
|
+
= t("admin.form.cancel")
|
@@ -1,2 +1,2 @@
|
|
1
|
-
= rails_admin_form_for @object, :url => edit_path(@abstract_model, @object.id), :as => @abstract_model.param_key, :html => { :method => "put", :multipart => true, :data => { :title => @page_name } } do |form|
|
1
|
+
= rails_admin_form_for @object, :url => edit_path(@abstract_model, @object.id), :as => @abstract_model.param_key, :html => { :method => "put", :multipart => true, :class => "form-horizontal denser", :data => { :title => @page_name } } do |form|
|
2
2
|
= form.generate :action => :update
|
@@ -1,71 +1,75 @@
|
|
1
1
|
- params = request.params.except(:action, :controller, :utf8, :page, :per_page, :format, :authenticity_token)
|
2
2
|
- visible_fields = @model_config.export.with(:view => self, :object => @abstract_model.model.new).visible_fields
|
3
3
|
|
4
|
-
= form_tag export_path(params.merge(:all => true)), :method => 'post', :class => 'form-
|
4
|
+
= form_tag export_path(params.merge(:all => true)), :method => 'post', :class => 'form-horizontal denser' do
|
5
5
|
|
6
6
|
%input{:name => "send_data", :type => "hidden", :value => "true"}/
|
7
|
-
|
8
|
-
%
|
9
|
-
%
|
10
|
-
.
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
%
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
%legend= t('admin.export.options_for', :name => 'csv')
|
7
|
+
%fieldset
|
8
|
+
%legend
|
9
|
+
%i.icon-chevron-down
|
10
|
+
= t('admin.export.select')
|
11
|
+
.control-group
|
12
|
+
%label.control-label{:rel => 'tooltip', :'data-original-title' => t('admin.export.click_to_reverse_selection'), :onclick => 'jQuery(this).siblings(".controls").find("input").click()'}= t('admin.export.fields_from', :name => @model_config.label_plural.downcase)
|
13
|
+
.controls
|
14
|
+
- visible_fields.select{ |f| !f.association? || f.association[:polymorphic] }.each do |field|
|
15
|
+
- list = field.virtual? ? 'methods' : 'only'
|
16
|
+
- if field.association? && field.association[:polymorphic]
|
17
|
+
%label.checkbox{:for => "schema_#{list}_#{field.method_name}"}
|
18
|
+
= check_box_tag "schema[#{list}][]", field.method_name, true, { :id => "schema_#{list}_#{field.method_name}" }
|
19
|
+
= field.label + " [id]"
|
20
|
+
- polymorphic_type_column_name = @abstract_model.properties.find {|p| field.association[:foreign_type] == p[:name] }[:name]
|
21
|
+
%label.checkbox{:for => "schema_#{list}_#{polymorphic_type_column_name}"}
|
22
|
+
= check_box_tag "schema[#{list}][]", polymorphic_type_column_name, true, { :id => "schema_#{list}_#{polymorphic_type_column_name}" }
|
23
|
+
= field.label + " [type]"
|
24
|
+
- else
|
25
|
+
%label.checkbox{:for => "schema_#{list}_#{field.name}"}
|
26
|
+
= check_box_tag "schema[#{list}][]", field.name, true, { :id => "schema_#{list}_#{field.name}" }
|
27
|
+
= field.label
|
28
|
+
|
29
|
+
- visible_fields.select{ |f| f.association? && !f.association[:polymorphic] }.each do |field|
|
30
|
+
- fields = field.associated_model_config.export.with(:view => self, :object => (associated_model = field.associated_model_config.abstract_model.model).new).visible_fields.select{ |f| !f.association? }
|
31
|
+
.control-group
|
32
|
+
%label.control-label{:rel => 'tooltip', :'data-original-title' => t('admin.export.click_to_reverse_selection'), :onclick => 'jQuery(this).siblings(".controls").find("input").click()'}= t('admin.export.fields_from_associated', :name => field.label.downcase)
|
33
|
+
.controls
|
34
|
+
- fields.each do |associated_model_field|
|
35
|
+
- list = associated_model_field.type != 'virtual' ? 'only' : 'methods'
|
36
|
+
%label.checkbox{:for => "schema_include_#{field.name}_#{list}_#{associated_model_field.name}"}
|
37
|
+
= check_box_tag "schema[include][#{field.name}][#{list}][]", associated_model_field.name, true, { :id => "schema_include_#{field.name}_#{list}_#{associated_model_field.name}" }
|
38
|
+
= associated_model.human_attribute_name(associated_model_field.name)
|
39
|
+
|
40
|
+
%fieldset
|
41
|
+
%legend
|
42
|
+
%i.icon-chevron-down
|
43
|
+
= t('admin.export.options_for', :name => 'csv')
|
44
|
+
.control-group
|
46
45
|
- guessed_encoding = (Rails.configuration.database_configuration[Rails.env]['encoding'].presence rescue 'UTF-8') || 'UTF-8'
|
47
|
-
.
|
48
|
-
|
46
|
+
%label.control-label{:for => "csv_options_encoding_to"}= t('admin.export.csv.encoding_to')
|
47
|
+
.controls
|
49
48
|
-# from http://books.google.com/support/partner/bin/answer.py?answer=30990 :
|
50
49
|
= select_tag 'csv_options[encoding_to]', options_for_select(["", "UTF-8", "UTF-16LE", "UTF-16BE", "UTF-32LE", "UTF-32BE", "UTF-7", "ISO-8859-1", "ISO-8859-15", "IBM-850", "MacRoman", "Windows-1252", "ISO-8859-3", "IBM-852", "ISO-8859-2", "MacCE", "Windows-1250", "IBM-855", "ISO-8859-5", "ISO-IR-111", "KOI8-R", "MacCyrillic", "Windows-1251", "CP-866", "KOI-U", "MacUkranian", "GB2312", "GBK", "GB18030", "HZ", "ISO-2022-CN", "Big5", "Big5-HKSCS", "EUC-TW", "EUC-JP", "ISO-2022-JP", "Shift_JIS", "EUC-KR", "UHC", "JOHAB", "ISO-2022-KR"])
|
50
|
+
%p.help-block= t('admin.export.csv.encoding_to_help', :name => guessed_encoding)
|
51
51
|
|
52
|
-
|
53
|
-
.
|
54
|
-
|
52
|
+
.control-group
|
53
|
+
%label.control-label{:for => "csv_options_skip_header"}= t('admin.export.csv.skip_header')
|
54
|
+
.controls
|
55
55
|
= check_box_tag 'csv_options[skip_header]', 'true'
|
56
|
-
%
|
57
|
-
|
58
|
-
|
56
|
+
%p.help-block= t('admin.export.csv.skip_header_help')
|
57
|
+
|
58
|
+
.control-group
|
59
|
+
%label.control-label{:for => "csv_options_generator_col_sep"}= t('admin.export.csv.col_sep')
|
60
|
+
.controls
|
59
61
|
= select_tag 'csv_options[generator][col_sep]', options_for_select({ '' => t('admin.export.csv.default_col_sep'), "<comma> ','" => ',', "<semicolon> ';'" => ';', '<tabs>' => "'\t'" })
|
60
|
-
%
|
62
|
+
%p.help-block= t('admin.export.csv.col_sep_help', :value => t('admin.export.csv.default_col_sep'))
|
61
63
|
|
62
|
-
.actions
|
64
|
+
.form-actions
|
63
65
|
%input{:type => :hidden, :name => 'return_to', :value => (params[:return_to].presence || request.referer)}
|
64
|
-
%button.btn.primary{:type => "submit", :name => 'csv'}
|
66
|
+
%button.btn.btn-primary{:type => "submit", :name => 'csv'}
|
67
|
+
%i.icon-white.icon-ok
|
65
68
|
= t("admin.export.confirmation", :name => 'csv')
|
66
|
-
%button.btn.info{:type => "submit", :name => 'json'}
|
69
|
+
%button.btn.btn-info{:type => "submit", :name => 'json'}
|
67
70
|
= t("admin.export.confirmation", :name => 'json')
|
68
|
-
%button.btn.info{:type => "submit", :name => 'xml'}
|
71
|
+
%button.btn.btn-info{:type => "submit", :name => 'xml'}
|
69
72
|
= t("admin.export.confirmation", :name => 'xml')
|
70
73
|
%button.btn{:type => "submit", :name => "_continue"}
|
74
|
+
%i.icon-remove
|
71
75
|
= t("admin.form.cancel")
|
@@ -5,13 +5,13 @@
|
|
5
5
|
- sort_reverse = params[:sort_reverse]
|
6
6
|
- path_method = params[:id] ? "history_show_path" : "history_index_path"
|
7
7
|
|
8
|
-
= form_tag("", :method => "get", :class => "search") do
|
9
|
-
.
|
10
|
-
.
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
%table#history.
|
8
|
+
= form_tag("", :method => "get", :class => "search form-inline") do
|
9
|
+
.well
|
10
|
+
%input{:name => "query", :type => "search", :value => query, :placeholder => "#{t("admin.misc.filter")}", :class => 'input-small'}
|
11
|
+
%button.btn.btn-primary{:type => "submit", :'data-disable-with' => "<i class='icon-white icon-refresh'></i> ".html_safe + t("admin.misc.refresh")}
|
12
|
+
%i.icon-white.icon-refresh
|
13
|
+
= t("admin.misc.refresh")
|
14
|
+
%table#history.table.table-striped.table-condensed
|
15
15
|
%thead
|
16
16
|
%tr
|
17
17
|
- columns = []
|
@@ -25,7 +25,7 @@
|
|
25
25
|
- selected = (sort == property_name)
|
26
26
|
- sort_direction = selected ? (sort_reverse ? "headerSortUp" : "headerSortDown") : nil
|
27
27
|
- sort_location = send(path_method, params.except("sort_reverse").merge(:model_name => @abstract_model.to_param, :sort => property_name).merge(selected && sort_reverse != "true" ? {:sort_reverse => "true"} : {}))
|
28
|
-
%th{:class => "header #{column[:css_class]} #{sort_direction if selected}", :'data-
|
28
|
+
%th{:class => "header #{column[:css_class]} #{sort_direction if selected}", :'data-href' => sort_location}= column[:link_text]
|
29
29
|
%tbody
|
30
30
|
- @history.each_with_index do |object, index|
|
31
31
|
%tr
|
@@ -6,7 +6,7 @@
|
|
6
6
|
sort_reverse = params[:sort_reverse]
|
7
7
|
sort = params[:sort]
|
8
8
|
params.delete(:sort) if params[:sort] == @model_config.list.sort_by.to_s
|
9
|
-
|
9
|
+
|
10
10
|
export_action = RailsAdmin::Config::Actions.find(:export, { :controller => self.controller, :abstract_model => @abstract_model })
|
11
11
|
export_action = export_action && authorized?(export_action.authorization_key, @abstract_model) ? export_action : nil
|
12
12
|
|
@@ -38,7 +38,7 @@
|
|
38
38
|
field = @filterable_fields.find{ |field| field.name == filter_name.to_sym }
|
39
39
|
field_options = case field.type
|
40
40
|
when :enum
|
41
|
-
options_for_select(field.with(:object => @abstract_model.model.new).enum, filter_hash['
|
41
|
+
options_for_select(field.with(:object => @abstract_model.model.new).enum, filter_hash['v']).gsub("\n", '')
|
42
42
|
else
|
43
43
|
''
|
44
44
|
end
|
@@ -49,8 +49,10 @@
|
|
49
49
|
= content_for :contextual_tabs do
|
50
50
|
= bulk_menu
|
51
51
|
- if @filterable_fields.present?
|
52
|
-
%li.dropdown{:style => 'float:right'
|
53
|
-
%a.dropdown-toggle{:href => '#'
|
52
|
+
%li.dropdown{:style => 'float:right'}
|
53
|
+
%a.dropdown-toggle{:href => '#', :'data-toggle' => "dropdown"}
|
54
|
+
= t('admin.misc.add_filter')
|
55
|
+
%b.caret
|
54
56
|
%ul.dropdown-menu#filters
|
55
57
|
- @filterable_fields.each do |field|
|
56
58
|
- field_options = case field.type
|
@@ -70,25 +72,24 @@
|
|
70
72
|
- properties.select{ |p| p.column_width.present? }.each do |property|
|
71
73
|
= "#list th.#{property.css_class} { width: #{property.column_width}px; min-width: #{property.column_width}px; }"
|
72
74
|
= "#list td.#{property.css_class} { max-width: #{property.column_width}px; }"
|
73
|
-
= form_tag(index_path(params.except(*%w[page f query])), :method => :get, :class => "pjax-form") do
|
74
|
-
.
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
.
|
79
|
-
%
|
80
|
-
|
81
|
-
%button.btn.primary{:type => "submit", :'data-disable-with' => t("admin.misc.refresh")}= t("admin.misc.refresh")
|
75
|
+
= form_tag(index_path(params.except(*%w[page f query])), :method => :get, :class => "pjax-form form-inline") do
|
76
|
+
.well
|
77
|
+
%span#filters_box
|
78
|
+
%hr.filters_box{:style => "display:#{@ordered_filters.empty? ? 'none' : 'block'}"}
|
79
|
+
%input.input-small{:name => "query", :type => "search", :value => query, :placeholder => t("admin.misc.filter")}
|
80
|
+
%button.btn.btn-primary{:type => "submit", :'data-disable-with' => "<i class='icon-white icon-refresh'></i> ".html_safe + t("admin.misc.refresh")}
|
81
|
+
%i.icon-white.icon-refresh
|
82
|
+
= t("admin.misc.refresh")
|
82
83
|
- if export_action
|
83
|
-
%span{:style => 'float:right'}=link_to wording_for(:link, export_action), export_path(params.except('set').except('page')), :class => 'btn info'
|
84
|
+
%span{:style => 'float:right'}= link_to wording_for(:link, export_action), export_path(params.except('set').except('page')), :class => 'btn btn-info'
|
84
85
|
|
85
86
|
= form_tag bulk_action_path(:model_name => @abstract_model.to_param), :method => :post, :id => "bulk_form", :class => "form" do
|
86
87
|
= hidden_field_tag :bulk_action
|
87
|
-
%table.
|
88
|
+
%table.table.table-condensed.table-striped
|
88
89
|
%thead
|
89
90
|
%tr
|
90
|
-
%th.
|
91
|
-
%input.
|
91
|
+
%th.shrink
|
92
|
+
%input.toggle{:type => "checkbox"}
|
92
93
|
- if other_left
|
93
94
|
%th.other.left.shrink= "..."
|
94
95
|
- properties.each do |property|
|
@@ -96,15 +97,15 @@
|
|
96
97
|
- if property.sortable
|
97
98
|
- sort_location = index_path params.except('sort_reverse').except('page').merge(:sort => property.name).merge(selected && sort_reverse != "true" ? {:sort_reverse => "true"} : {})
|
98
99
|
- sort_direction = selected ? (sort_reverse == 'true' ? "headerSortUp" : "headerSortDown") : nil
|
99
|
-
%th{:class => "
|
100
|
+
%th{:class => "#{property.sortable && "header pjax" || nil} #{property.sortable && sort_direction ? sort_direction : nil} #{property.css_class} #{property.type_css_class}", :'data-href' => (property.sortable && sort_location)}= property.label
|
100
101
|
- if other_right
|
101
102
|
%th.other.right.shrink= "..."
|
102
103
|
%th.last.shrink
|
103
104
|
%tbody
|
104
105
|
- @objects.each do |object|
|
105
106
|
%tr
|
106
|
-
%td
|
107
|
-
= check_box_tag "bulk_ids[]", object.id, false
|
107
|
+
%td
|
108
|
+
= check_box_tag "bulk_ids[]", object.id, false
|
108
109
|
- if @other_left_link ||= other_left && index_path(params.except('set').merge(params[:set].to_i != 1 ? {:set => (params[:set].to_i - 1)} : {}))
|
109
110
|
%td.other.left= link_to "...", @other_left_link, :class => 'pjax'
|
110
111
|
- properties.map{ |property| property.bind(:object, object) }.each do |property|
|
@@ -113,7 +114,7 @@
|
|
113
114
|
- if @other_right_link ||= other_right && index_path(params.merge(:set => (params[:set].to_i + 1)))
|
114
115
|
%td.other.right= link_to "...", @other_right_link, :class => 'pjax'
|
115
116
|
%td.last.links
|
116
|
-
%ul.inline= menu_for :member, @abstract_model, object
|
117
|
+
%ul.inline= menu_for :member, @abstract_model, object, true
|
117
118
|
- unless params[:all]
|
118
119
|
- total_count = @objects.total_count
|
119
120
|
= paginate(@objects, :theme => 'twitter-bootstrap', :remote => true)
|
@@ -1,2 +1,2 @@
|
|
1
|
-
= rails_admin_form_for @object, :url => new_path(:model_name => @abstract_model.to_param, :id => @object.id), :as => @abstract_model.param_key, :html => { :multipart => true, :data => { :title => @page_name } } do |form|
|
1
|
+
= rails_admin_form_for @object, :url => new_path(:model_name => @abstract_model.to_param, :id => @object.id), :as => @abstract_model.param_key, :html => { :multipart => true, :class => "form-horizontal denser", :data => { :title => @page_name } } do |form|
|
2
2
|
= form.generate :action => :create
|
@@ -1,11 +1,11 @@
|
|
1
1
|
if defined?(::ActiveRecord)
|
2
2
|
class ActiveRecord::Base
|
3
3
|
def self.rails_admin(&block)
|
4
|
-
|
4
|
+
RailsAdmin::Config.model(self, &block)
|
5
5
|
end
|
6
6
|
|
7
7
|
def rails_admin_default_object_label_method
|
8
|
-
"#{self.class.to_s} ##{self.
|
8
|
+
self.new_record? ? "new #{self.class.to_s}" : "#{self.class.to_s} ##{self.id}"
|
9
9
|
end
|
10
10
|
|
11
11
|
def safe_send(value)
|
data/config/initializers/haml.rb
CHANGED
@@ -12,8 +12,8 @@ en:
|
|
12
12
|
filter: "Filter"
|
13
13
|
refresh: "Refresh"
|
14
14
|
show_all: "Show all"
|
15
|
-
add_filter: "Add filter
|
16
|
-
bulk_menu_title: "Selected items
|
15
|
+
add_filter: "Add filter"
|
16
|
+
bulk_menu_title: "Selected items"
|
17
17
|
remove: "Remove"
|
18
18
|
add_new: "Add new"
|
19
19
|
chosen: "Chosen %{name}"
|
@@ -78,7 +78,7 @@ en:
|
|
78
78
|
breadcrumb: "Multiple delete"
|
79
79
|
bulk_link: "Delete selected %{model_label_plural}"
|
80
80
|
export:
|
81
|
-
title: "Export %{
|
81
|
+
title: "Export %{model_label_plural}"
|
82
82
|
menu: "Export"
|
83
83
|
breadcrumb: "Export"
|
84
84
|
link: "Export found %{model_label_plural}"
|
@@ -106,9 +106,9 @@ en:
|
|
106
106
|
all_of_the_following_related_items_will_be_deleted: "? The following related items may be deleted or orphaned:"
|
107
107
|
are_you_sure_you_want_to_delete_the_object: "Are you sure you want to delete this %{model_name}"
|
108
108
|
confirmation: "Yes, I'm sure"
|
109
|
-
delete_confirmation: "Delete confirmation"
|
110
109
|
bulk_delete: "The following objects will be deleted, which may delete or orphan some of their related dependencies:"
|
111
|
-
|
110
|
+
new_model: "%{name} (new)"
|
111
|
+
export:
|
112
112
|
confirmation: "Export to %{name}"
|
113
113
|
select: "Select fields to export"
|
114
114
|
fields_from: "Fields from %{name}"
|
@@ -8,13 +8,13 @@ RailsAdmin.config do |config|
|
|
8
8
|
# I18n.default_locale = :de
|
9
9
|
|
10
10
|
config.current_user_method { current_<%= @model_name.underscore %> } # auto-generated
|
11
|
-
|
11
|
+
|
12
12
|
# If you want to track changes on your models:
|
13
13
|
# config.audit_with :history, <%= @model_name.classify %>
|
14
|
-
|
14
|
+
|
15
15
|
# Or with a PaperTrail: (you need to install it first)
|
16
16
|
# config.audit_with :paper_trail, <%= @model_name.classify %>
|
17
|
-
|
17
|
+
|
18
18
|
# Set the admin name here (optional second array element will appear in a beautiful RailsAdmin red ©)
|
19
19
|
config.main_app_name = ['<%= Rails.application.engine_name.titleize.chomp(' Application') %>', 'Admin']
|
20
20
|
# or for a dynamic name:
|
@@ -31,10 +31,10 @@ RailsAdmin.config do |config|
|
|
31
31
|
|
32
32
|
# ==> Included models
|
33
33
|
# Add all excluded models here:
|
34
|
-
# config.excluded_models = [<%= RailsAdmin::AbstractModel.
|
34
|
+
# config.excluded_models = [<%= RailsAdmin::AbstractModel.all.map{|am| am.model.to_s }.join(', ') %>]
|
35
35
|
|
36
36
|
# Add models here if you want to go 'whitelist mode':
|
37
|
-
# config.included_models = [<%= RailsAdmin::AbstractModel.
|
37
|
+
# config.included_models = [<%= RailsAdmin::AbstractModel.all.map{|am| am.model.to_s }.join(', ') %>]
|
38
38
|
|
39
39
|
# Application wide tried label methods for models' instances
|
40
40
|
# config.label_methods << :description # Default is [:name, :title]
|
@@ -82,11 +82,11 @@ RailsAdmin.config do |config|
|
|
82
82
|
<% RailsAdmin::AbstractModel.all.map do |abstract_model| -%>
|
83
83
|
# config.model <%= abstract_model.model.model_name %> do
|
84
84
|
# # Found associations:
|
85
|
-
<%=
|
85
|
+
<%= abstract_model.config.export.fields.select{|f| f.association?}.map do |field|
|
86
86
|
%{ # configure #{field.name.inspect}, #{field.type.inspect}#{" # Hidden" unless field.visible?} }
|
87
87
|
end.join("\n") -%>
|
88
88
|
# # Found columns:
|
89
|
-
<%=
|
89
|
+
<%= abstract_model.config.export.fields.select{|f| !f.association?}.map do |field|
|
90
90
|
%{ # configure #{field.name.inspect}, #{field.type.inspect}#{" # Hidden" unless field.visible?} }
|
91
91
|
end.join("\n") -%>
|
92
92
|
# # Sections:
|