active_scaffold 3.6.19 → 3.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.rdoc +30 -0
  3. data/README.md +27 -16
  4. data/app/assets/javascripts/jquery/active_scaffold.js +38 -6
  5. data/app/assets/javascripts/jquery/active_scaffold_chosen.js +6 -5
  6. data/app/assets/javascripts/jquery/tiny_mce_bridge.js +18 -4
  7. data/app/assets/stylesheets/active_scaffold_layout.css +12 -1
  8. data/app/views/active_scaffold_overrides/_base_form.html.erb +5 -1
  9. data/app/views/active_scaffold_overrides/_field_search.html.erb +1 -0
  10. data/app/views/active_scaffold_overrides/_render_field.js.erb +19 -11
  11. data/config/locales/ja.yml +59 -59
  12. data/lib/active_scaffold/actions/common_search.rb +2 -2
  13. data/lib/active_scaffold/actions/core.rb +30 -10
  14. data/lib/active_scaffold/actions/field_search.rb +9 -6
  15. data/lib/active_scaffold/actions/nested.rb +7 -7
  16. data/lib/active_scaffold/attribute_params.rb +19 -57
  17. data/lib/active_scaffold/bridges/active_storage/active_storage_helpers.rb +0 -3
  18. data/lib/active_scaffold/bridges/active_storage/list_ui.rb +1 -1
  19. data/lib/active_scaffold/bridges/active_storage.rb +3 -0
  20. data/lib/active_scaffold/bridges/bitfields/bitfields_bridge.rb +2 -2
  21. data/lib/active_scaffold/bridges/date_picker/helper.rb +4 -4
  22. data/lib/active_scaffold/bridges/paper_trail/actions.rb +4 -1
  23. data/lib/active_scaffold/bridges/record_select/helpers.rb +2 -2
  24. data/lib/active_scaffold/bridges/tiny_mce.rb +1 -1
  25. data/lib/active_scaffold/bridges/usa_state_select/usa_state_select_helper.rb +1 -6
  26. data/lib/active_scaffold/config/core.rb +1 -1
  27. data/lib/active_scaffold/config/field_search.rb +9 -1
  28. data/lib/active_scaffold/config/form.rb +9 -1
  29. data/lib/active_scaffold/core.rb +2 -8
  30. data/lib/active_scaffold/data_structures/action_columns.rb +0 -25
  31. data/lib/active_scaffold/data_structures/action_links.rb +1 -1
  32. data/lib/active_scaffold/data_structures/association/abstract.rb +8 -0
  33. data/lib/active_scaffold/data_structures/association/active_mongoid.rb +8 -0
  34. data/lib/active_scaffold/data_structures/association/active_record.rb +1 -13
  35. data/lib/active_scaffold/data_structures/association/mongoid.rb +21 -8
  36. data/lib/active_scaffold/data_structures/column.rb +31 -5
  37. data/lib/active_scaffold/data_structures/columns.rb +12 -12
  38. data/lib/active_scaffold/data_structures/nested_info.rb +12 -0
  39. data/lib/active_scaffold/data_structures/sorting.rb +1 -1
  40. data/lib/active_scaffold/engine.rb +0 -1
  41. data/lib/active_scaffold/extensions/action_view_rendering.rb +13 -5
  42. data/lib/active_scaffold/extensions/cow_proxy.rb +1 -1
  43. data/lib/active_scaffold/extensions/unsaved_record.rb +9 -3
  44. data/lib/active_scaffold/finder.rb +6 -2
  45. data/lib/active_scaffold/helpers/action_link_helpers.rb +1 -1
  46. data/lib/active_scaffold/helpers/form_column_helpers.rb +48 -22
  47. data/lib/active_scaffold/helpers/list_column_helpers.rb +3 -2
  48. data/lib/active_scaffold/helpers/search_column_helpers.rb +8 -2
  49. data/lib/active_scaffold/helpers/view_helpers.rb +1 -1
  50. data/lib/active_scaffold/registry.rb +10 -15
  51. data/lib/active_scaffold/tableless.rb +10 -79
  52. data/lib/active_scaffold/version.rb +2 -2
  53. data/lib/active_scaffold.rb +0 -7
  54. data/lib/generators/active_scaffold/install_generator.rb +2 -2
  55. data/test/bridges/bridge_test.rb +1 -1
  56. data/test/bridges/paperclip_test.rb +16 -13
  57. data/test/bridges/tiny_mce_test.rb +1 -1
  58. data/test/config/base_test.rb +1 -1
  59. data/test/config/core_test.rb +1 -1
  60. data/test/config/create_test.rb +1 -1
  61. data/test/config/delete_test.rb +1 -1
  62. data/test/config/field_search_test.rb +1 -1
  63. data/test/config/list_test.rb +1 -1
  64. data/test/config/nested_test.rb +1 -1
  65. data/test/config/search_test.rb +1 -1
  66. data/test/config/show_test.rb +1 -1
  67. data/test/config/subform_test.rb +1 -1
  68. data/test/config/update_test.rb +1 -1
  69. data/test/data_structures/action_columns_test.rb +1 -1
  70. data/test/data_structures/action_link_test.rb +1 -1
  71. data/test/data_structures/action_links_test.rb +1 -1
  72. data/test/data_structures/actions_test.rb +1 -1
  73. data/test/data_structures/association_column_test.rb +1 -1
  74. data/test/data_structures/column_test.rb +1 -1
  75. data/test/data_structures/columns_test.rb +1 -1
  76. data/test/data_structures/set_test.rb +1 -1
  77. data/test/data_structures/sorting_test.rb +1 -1
  78. data/test/data_structures/standard_column_test.rb +1 -1
  79. data/test/data_structures/validation_reflection_test.rb +1 -1
  80. data/test/data_structures/virtual_column_test.rb +1 -1
  81. data/test/extensions/active_record_test.rb +1 -1
  82. data/test/helpers/pagination_helpers_test.rb +1 -1
  83. data/test/misc/active_record_permissions_test.rb +1 -1
  84. data/test/misc/attribute_params_test.rb +1 -1
  85. data/test/misc/calculation_test.rb +1 -1
  86. data/test/misc/configurable_test.rb +1 -1
  87. data/test/misc/constraints_test.rb +1 -1
  88. data/test/misc/convert_numbers_format_test.rb +1 -1
  89. data/test/misc/finder_test.rb +1 -1
  90. data/test/misc/lang_test.rb +1 -1
  91. data/test/misc/parse_datetime_test.rb +1 -1
  92. data/test/misc/tableless_test.rb +1 -1
  93. data/test/test_helper.rb +4 -4
  94. metadata +6 -14
  95. data/lib/active_scaffold/delayed_setup.rb +0 -41
  96. data/lib/active_scaffold/extensions/left_outer_joins.rb +0 -43
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f3e15dbddabba45c8d0c75e9cd91a00b805c2f8d9f229e8c4fc1a9bfa08136dd
4
- data.tar.gz: 8be97ebe3447c4f77b55e69ee6e6d501c62f342ab49379303a9071c664590a5c
3
+ metadata.gz: 26ce6ce8562249c43e685b6b8bbdf14f7ecb13d245b83431145e7cae5c56ac37
4
+ data.tar.gz: 51e9f055da4ebda5bb2c91ece952095dcb179d263218e510abc94029bc2cc47b
5
5
  SHA512:
6
- metadata.gz: c351ddf8bbd11a8a2540a6f589197f68a9a520eaba6f446b2f53934dc1c100df14ebe99894d40a97f489a132002645c80db8aa4122bbf09e952f3f6f367a84ea
7
- data.tar.gz: 35b42d0d6f2d8ffae123b046ede6b5761dfe9910f4922c3dbdf985899c30fbf36fc6696d774d486c888fae774a1c7e390a761fe4f97f8c804b3df1d9b57b95c2
6
+ metadata.gz: 4f93b85f2714ce8f6d845c704a455de9c3d0fa70aa5225d02d106cf190d75942030804cc2a1f13268e658270ca9a6b734fb2c9c2fdb550bf3ef933ae207d8c55
7
+ data.tar.gz: 7a6b39eaf2b2b0f83a809c5bbb98884d9e39373a69fef9a28faf29eeb29d30632cd0fc887024d95d76902a87521edb0289201bcf2014d289d4289087bd235b85
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,33 @@
1
+ = 3.7.0
2
+ - Drop support for rails < 5.2 and ruby < 2.5
3
+ - Support adding settings for chosen and tinyMCE in initializer (ActiveScaffold.js_config) or JavaScript code (ActiveScaffold.config, needed for callbacks)
4
+ - Support ruby 3.0 and 3.1
5
+ - Check action link security method in process_action_link_action with no id
6
+ - Add thumbnail_variant setting to ActiveStorage bridge
7
+ - Support Postgres citext column type
8
+ - Fix date picker bridge for ruby >= 2.7
9
+ - Fix keeping_errors for rails >= 6.1
10
+ - Fix usage of field_error_proc on record_select bridge for rails 7
11
+ - Support TinyMCE 6
12
+ - Add hide_form_column_if to columns
13
+ - Re-enable form which is sent to iframe when response is received, e.g. if form is downloading a file
14
+ - Use hash order for bitfields value instead of bit order, so options can be re-ordered as `2**1 => opt1, 2**0 => opt0, 2**2 => opt2`
15
+ - Remove delayed_setup, as it didn't work since rails 5.2
16
+ - Support Turbo
17
+ - Fix detecting when form submit to iframe has ended, for downloads too (using cookie)
18
+ - Fix list deleted records on nested listings using JSON column or serializer in PaperTrail versions table
19
+ - Support procs in description of columns, passing record, column, and scope to the proc
20
+ - Fix displaying errors in forms in rails 7.1
21
+ - Support for mongoid 7
22
+ - Support update_columns in field_search, so cascading behaviour is available to field search as in create or update forms
23
+ - Support floating footer in field_search, create and update, so footer may float to keep it visible when form is too long to fit
24
+ - Support hide/show link in form columns with option :collapsible
25
+ - Improve support for three-state boolean (nullable boolean columns), allowing to change the label for NULL
26
+ - Improve support for nullable boolean columns in field search, allowing to search for NULL
27
+
28
+ = 3.6.20
29
+ - Fix numeric search on field search for rails >= 5.0
30
+
1
31
  = 3.6.19
2
32
  - Improve create action in has_many through singular association, supporting more cases
3
33
 
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  Overview
3
3
  ========
4
- [![Build status](https://travis-ci.com/activescaffold/active_scaffold.svg?branch=master)](https://travis-ci.com/activescaffold/active_scaffold)
4
+ [![Build status](https://api.travis-ci.com/activescaffold/active_scaffold.svg?branch=master)](https://app.travis-ci.com/activescaffold/active_scaffold)
5
5
  [![Code Climate](https://codeclimate.com/github/activescaffold/active_scaffold/badges/gpa.svg)](https://codeclimate.com/github/activescaffold/active_scaffold)
6
6
  [![Test Coverage](https://codeclimate.com/github/activescaffold/active_scaffold/badges/coverage.svg)](https://codeclimate.com/github/activescaffold/active_scaffold)
7
7
  [![Dependency Status](https://gemnasium.com/activescaffold/active_scaffold.svg)](https://gemnasium.com/activescaffold/active_scaffold)
@@ -9,10 +9,14 @@ Overview
9
9
  [![Inline docs](https://inch-ci.org/github/activescaffold/active_scaffold.svg?branch=master)](https://inch-ci.org/github/activescaffold/active_scaffold)
10
10
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
11
11
 
12
- ActiveScaffold provides a quick and powerful user interfaces for CRUD (create, read, update, delete) operations for Rails applications. It offers additonal features including searching, pagination & layout control. Rails >= 4.2.0 and Rails <= 6.1 is supported, ruby >= 2.3 required.
12
+ ActiveScaffold provides a quick and powerful user interfaces for CRUD (create, read, update, delete) operations for Rails applications. It offers additonal features including searching, pagination & layout control. Rails >= 5.2.0 is supported, ruby >= 2.5 required.
13
13
 
14
14
  Branch Details
15
15
  --------------
16
+ 3-7-stable supports rails >= 5.2.x and <= 7.1.x, and ruby >= 2.5.0
17
+
18
+ These versions are not supported anymore:
19
+ 3-6-stable supports rails >= 4.2.x and <= 6.1.x, and ruby >= 2.3.0
16
20
  3-5-stable supports rails >= 4.0.x and <= 5.1.x, and ruby >= 2.0.0
17
21
  3-4-stable supports rails >= 3.2.x and <= 4.2.x, and ruby >= 1.9.3
18
22
  3-3-stable supports rails 3.2.x and ruby >= 1.8
@@ -24,30 +28,37 @@ To get started with a new Rails project
24
28
 
25
29
  Added to Gemfile
26
30
 
27
- gem 'active_scaffold'
31
+ ```ruby
32
+ gem 'active_scaffold'
33
+ ```
28
34
 
29
35
  For rails >= 5.1, add jquery-rails to Gemfile, and install generator will jquery to application.js before rails-ujs. Also it's possible to load jquery in your layout before application.js using CDN (e.g. jquery-rails-cdn). You can replace rails-ujs with jquery_ujs, although rails-ujs should work (never load both).
30
36
 
31
- gem 'jquery-rails'
37
+ ```ruby
38
+ gem 'jquery-rails'
39
+ ```
32
40
 
33
41
  For rails >= 6.0, installer generator will create app/assets/javascripts/application.js, add it to assets.precompile array and add javascript_include_tag in layout, as ActiveScaffold doesn't work with webpack yet. Jquery may be loaded by packs or assets pipeline.
34
42
 
35
43
  Run the following commands, for rails 4.2
36
44
 
37
- bundle install
38
- rails g active_scaffold:install
39
- bundle exec rake db:create
40
- rails g active_scaffold:resource Model [attrs]
41
- bundle exec rake db:migrate
42
-
45
+ ```console
46
+ bundle install
47
+ rails g active_scaffold:install
48
+ bundle exec rake db:create
49
+ rails g active_scaffold:resource Model [attrs]
50
+ bundle exec rake db:migrate
51
+ ```
52
+
43
53
  Or run the following commands, for rails >= 5
44
54
 
45
- bundle install
46
- rails g active_scaffold:install
47
- rails db:create
48
- rails g active_scaffold:resource Model [attrs]
49
- rails db:migrate
50
-
55
+ ```console
56
+ bundle install
57
+ rails g active_scaffold:install
58
+ rails db:create
59
+ rails g active_scaffold:resource Model [attrs]
60
+ rails db:migrate
61
+ ```
51
62
 
52
63
  Run the app and visit localhost:3000/<plural_model>
53
64
 
@@ -72,9 +72,26 @@ jQuery(document).ready(function($) {
72
72
  }
73
73
  });
74
74
  jQuery(document).on('submit', 'form.as_form:not([data-remote])', function(event) {
75
- var as_form = jQuery(this).closest("form");
75
+ var as_form = jQuery(this).closest("form"), form_id = as_form.attr('id'), iframe, interval, doc, cookie;
76
76
  if (as_form.data('loading') == true) {
77
- setTimeout("ActiveScaffold.disable_form('" + as_form.attr('id') + "')", 10);
77
+ setTimeout(function() { ActiveScaffold.disable_form(form_id); }, 10);
78
+ if (as_form.attr('target')) {
79
+ cookie = 'as_dl_' + new Date().getTime();
80
+ as_form.append($('<input>', {type: 'hidden', name: '_dl_cookie', value: cookie}));
81
+ iframe = jQuery('iframe[name="' + jQuery(this).attr('target') + '"]')[0];
82
+ interval = setInterval(function() {
83
+ doc = iframe.contentDocument || (iframe.contentWindow && iframe.contentWindow.document);
84
+ if (doc && doc.readyState !== 'loading' && (doc.location.href !== 'about:blank' || document.cookie.split(cookie+'=').length == 2)) {
85
+ ActiveScaffold.enable_form(form_id);
86
+ clearInterval(interval);
87
+ doc.location.replace('about:blank');
88
+ document.cookie = cookie + '=; path=/; expires=' + new Date().toUTCString();
89
+ } else if (!doc) {
90
+ clearInterval(interval);
91
+ document.cookie = cookie + '=; path=/; expires=' + new Date().toUTCString();
92
+ }
93
+ }, 1000);
94
+ }
78
95
  }
79
96
  return true;
80
97
  });
@@ -358,7 +375,7 @@ jQuery(document).ready(function($) {
358
375
  jQuery(this).parent().find('[type=submit]').click();
359
376
  }));
360
377
 
361
- jQuery(document).on('turbolinks:before-visit', function() {
378
+ jQuery(document).on('turbolinks:before-visit turbo:before-visit', function() {
362
379
  if (history.state.active_scaffold) {
363
380
  history.replaceState({turbolinks: true, url: document.location.href}, '', document.location.href);
364
381
  }
@@ -377,7 +394,7 @@ jQuery(document).ready(function($) {
377
394
  });
378
395
 
379
396
  // call setup on document.ready if Turbolinks not enabled
380
- if (typeof(Turbolinks) == 'undefined' || !Turbolinks.supported) {
397
+ if ((typeof(Turbolinks) == 'undefined' || !Turbolinks.supported) && typeof(Turbo) == 'undefined') {
381
398
  ActiveScaffold.setup_history_state();
382
399
  ActiveScaffold.setup(document);
383
400
  }
@@ -385,6 +402,9 @@ jQuery(document).ready(function($) {
385
402
  jQuery(document).on('as:element_updated as:element_created', function(e, action_link) {
386
403
  ActiveScaffold.setup(e.target);
387
404
  });
405
+ jQuery(document).on('as:element_removed', function(e, action_link) {
406
+ setTimeout(ActiveScaffold.update_floating_form_footer); // delay so form is already removed
407
+ });
388
408
  jQuery(document).on('as:action_success', 'a.as_action', function(e, action_link) {
389
409
  ActiveScaffold.setup(action_link.adapter);
390
410
  });
@@ -395,7 +415,7 @@ jQuery(document).ready(function($) {
395
415
  });
396
416
  });
397
417
 
398
- jQuery(document).on('turbolinks:load', function($) {
418
+ jQuery(document).on('turbolinks:load turbo:load', function($) {
399
419
  ActiveScaffold.setup(document);
400
420
  });
401
421
 
@@ -477,6 +497,7 @@ var ActiveScaffold = {
477
497
  ActiveScaffold.draggable_lists('.draggable-lists', container);
478
498
  ActiveScaffold.sliders(container);
479
499
  ActiveScaffold.disable_optional_subforms(container);
500
+ ActiveScaffold.update_floating_form_footer(); // check other forms too, state may change
480
501
  },
481
502
  setup_history_state: function() {
482
503
  if (!jQuery('.active-scaffold').length) return;
@@ -1134,15 +1155,26 @@ var ActiveScaffold = {
1134
1155
  window.onbeforeunload = function() {
1135
1156
  if (jQuery('form.need-confirm').length) return unload_message;
1136
1157
  };
1137
- jQuery(document).on('turbolinks:before-visit', function(e) {
1158
+ jQuery(document).on('turbolinks:before-visit turbolinks:before-visit', function(e) {
1138
1159
  if (jQuery('form.need-confirm').length) {
1139
1160
  if (!window.confirm(unload_message)) e.preventDefault();
1140
1161
  }
1141
1162
  });
1163
+ },
1164
+
1165
+ update_floating_form_footer: function() {
1166
+ jQuery('.active-scaffold form.floating-footer .form-footer').each(function () {
1167
+ var $footer = jQuery(this), $form = $footer.closest('form.floating-footer');
1168
+ $footer.removeClass('floating');
1169
+ if ($form.visible(true) && !$footer.visible(true)) $footer.addClass('floating');
1170
+ });
1142
1171
  }
1172
+
1143
1173
  }
1144
1174
 
1145
1175
 
1176
+ jQuery(window).on('scroll resize', ActiveScaffold.update_floating_form_footer);
1177
+
1146
1178
  /*
1147
1179
  * URL modification support. Incomplete functionality.
1148
1180
  */
@@ -1,14 +1,15 @@
1
1
  jQuery(document).ready(function() {
2
+ var chosen_options = ActiveScaffold.config.chosen_options || {};
2
3
  jQuery(document).on('as:element_updated as:element_created', function(event) {
3
- jQuery('select.chosen', event.target).chosen();
4
+ jQuery('select.chosen', event.target).chosen(chosen_options);
4
5
  });
5
6
  jQuery(document).on('as:action_success', 'a.as_action', function(event, action_link) {
6
7
  if (action_link.adapter) {
7
- jQuery('select.chosen', action_link.adapter).chosen();
8
+ jQuery('select.chosen', action_link.adapter).chosen(chosen_options);
8
9
  }
9
10
  });
10
- jQuery('select.chosen').chosen();
11
- jQuery(document).on('turbolinks:load', function($) {
12
- jQuery('select.chosen').chosen();
11
+ jQuery('select.chosen').chosen(chosen_options);
12
+ jQuery(document).on('turbolinks:load turbo:load', function($) {
13
+ jQuery('select.chosen').chosen(chosen_options);
13
14
  });
14
15
  });
@@ -8,9 +8,23 @@
8
8
  };
9
9
 
10
10
  function loadTinyMCE() {
11
- var settings = jQuery(this).data('tinymce');
12
- if (settings) tinyMCE.settings = settings;
13
- tinyMCE.execCommand('mceAddEditor', false, jQuery(this).attr('id'));
11
+ var global_settings = ActiveScaffold.config.tiny_mce_settings || {};
12
+ var local_settings = jQuery(this).data('tinymce');
13
+ var settings = {};
14
+ for (key in global_settings) {
15
+ settings[key] = global_settings[key];
16
+ }
17
+ for (key in local_settings) {
18
+ settings[key] = local_settings[key];
19
+ }
20
+ var id = jQuery(this).attr('id');
21
+ if (tinymce && tinymce.majorVersion >= 6) {
22
+ settings.selector = '#' + id;
23
+ tinymce.init(settings);
24
+ } else { // tinyMCE.majorVersion < 6
25
+ tinyMCE.settings = settings;
26
+ tinyMCE.execCommand('mceAddEditor', false, id);
27
+ }
14
28
  }
15
29
 
16
30
  jQuery(document).on('submit', 'form.as_form', function() {
@@ -28,4 +42,4 @@
28
42
  jQuery(action_link.adapter).find('textarea.mceEditor').each(loadTinyMCE);
29
43
  }
30
44
  });
31
- })();
45
+ })();
@@ -672,6 +672,17 @@ clear: both;
672
672
  .active-scaffold p.form-footer {
673
673
  clear: both;
674
674
  }
675
+ .active-scaffold .form-footer.floating {
676
+ position: fixed;
677
+ bottom: 10px;
678
+ z-index: 10;
679
+ top: auto;
680
+ left: auto;
681
+ border: none;
682
+ padding: 10px;
683
+ background: white;
684
+ }
685
+
675
686
 
676
687
  .active-scaffold a.as_cancel,
677
688
  .active-scaffold p.form-footer a {
@@ -694,7 +705,7 @@ letter-spacing: 0;
694
705
  clear: both;
695
706
  }
696
707
 
697
- .active-scaffold label {
708
+ .active-scaffold label, .active-scaffold label + a.visibility-toggle {
698
709
  font-weight: normal;
699
710
  font-size: 11px;
700
711
  }
@@ -7,11 +7,15 @@
7
7
  multipart ||= action_config.multipart? unless local_assigns.has_key? :multipart
8
8
  columns ||= action_config.columns unless local_assigns.has_key? :columns
9
9
  persistent ||= action_config.persistent unless local_assigns.has_key? :persistent
10
+ unless local_assigns.has_key? :floating_footer
11
+ floating_footer ||= action_config.floating_footer if action_config.respond_to? :floating_footer
12
+ end
10
13
  else
11
14
  multipart ||= false
12
15
  columns ||= nil
13
16
  persistent ||= false
14
17
  end
18
+ floating_footer ||= false
15
19
  method ||= :post
16
20
  cancel_link = true if cancel_link.nil?
17
21
  submit_text ||= form_action
@@ -26,7 +30,7 @@ options = {:id => form_id,
26
30
  :method => method,
27
31
  'data-loading' => defined?(loading) ? loading : true}
28
32
  cancel_options = {:class => 'as_cancel'}
29
-
33
+ options[:class] << ' floating-footer' if floating_footer
30
34
  cancel_options[:remote] = true if xhr #cancel link does nt have to care about multipart forms
31
35
  if xhr && multipart # file_uploads
32
36
  form_remote_upload_tag url_options.merge({:iframe => true}), options
@@ -9,6 +9,7 @@
9
9
  data: {loading: true},
10
10
  method: :get
11
11
  }
12
+ options[:class] << ' floating-footer' if active_scaffold_config.field_search.floating_footer
12
13
 
13
14
  hidden_params = url_options.except(:controller, :action, :id, :search).to_query.split(Rack::Utils::DEFAULT_SEP)
14
15
  -%>
@@ -8,23 +8,31 @@
8
8
  @rendered ||= Set.new
9
9
  return if @rendered.include? column.name
10
10
  @rendered << column.name
11
- renders_as = column_renders_as(column)
12
- if renders_as == :subform
13
- options = {:is_subform => true, :field_class => "#{column.name}-sub-form"}
11
+ if @form_action == :field_search
12
+ form_ui = column.search_ui
14
13
  else
15
- options = {:is_subform => false, :field_class => "#{column.name}-input", :hidden => column.form_ui == :hidden}
14
+ renders_as = column_renders_as(column)
15
+ form_ui = column.form_ui
16
16
  end
17
- html = if scope
18
- readonly = @record.readonly? || !@record.authorized_for?(:crud_type => :update)
19
- crud_type = @record.new_record? ? :create : (readonly ? :read : :update)
20
- # subform.columns.to_a.include? so it doesn't check inside subgroups
21
- active_scaffold_render_subform_column(column, scope, crud_type, readonly, !active_scaffold_config.subform.columns.to_a.include?(column.name), @record)
17
+ if renders_as == :subform
18
+ options = {is_subform: true, field_class: "#{column.name}-sub-form"}
22
19
  else
23
- render_column(column, @record, renders_as, scope)
20
+ options = {is_subform: false, field_class: "#{column.name}-input", hidden: form_ui == :hidden}
24
21
  end
22
+ html =
23
+ if scope
24
+ readonly = @record.readonly? || !@record.authorized_for?(:crud_type => :update)
25
+ crud_type = @record.new_record? ? :create : (readonly ? :read : :update)
26
+ # subform.columns.to_a.include? so it doesn't check inside subgroups
27
+ active_scaffold_render_subform_column(column, scope, crud_type, readonly, !active_scaffold_config.subform.columns.to_a.include?(column.name), @record)
28
+ elsif @form_action == :field_search
29
+ search_attribute(column, @record)
30
+ else
31
+ render_column(column, @record, renders_as, scope)
32
+ end
25
33
  -%>
26
34
 
27
35
  ActiveScaffold.render_form_field('<%= source_id %>','<%= escape_javascript(html) %>', <%= options.to_json.html_safe %>);
28
36
  <%if column.update_columns && !column.update_columns.empty?%>
29
- <%= render(:partial => "render_field", :collection => column.update_columns, :locals => {:source_id => source_id, :scope => scope})%>
37
+ <%= render(partial: "render_field", collection: column.update_columns, locals: {source_id: source_id, scope: scope})%>
30
38
  <%end%>
@@ -11,20 +11,20 @@ ja:
11
11
  add: 追加
12
12
  add_existing: 既存のものを追加
13
13
  add_existing_model: 既存の%{model}を追加
14
- apply: Apply
15
- are_you_sure_to_delete: Are you sure you want to delete %{label}?
16
- average: Average
17
- begins_with: Begins with
18
- between: Between
14
+ apply: 適用
15
+ are_you_sure_to_delete: "%{label}を消去してもよろしいですか?"
16
+ average: 平均
17
+ begins_with: 開始時間
18
+ between: 範囲指定
19
19
  cancel: キャンセル
20
- cant_destroy_record: "%{record}を削除で来ません"
21
- changes:
20
+ cant_destroy_record: "%{record}を削除できません"
21
+ changes: 差分
22
22
  click_to_edit: クリックして編集
23
- click_to_reset: Click to reset
23
+ click_to_reset: クリックしてリセット
24
24
  close: 閉じる
25
25
  config_list: Configure
26
26
  config_list_model: Configure Columns for %{model}
27
- contains: Contains
27
+ contains: 部分一致検索
28
28
  create: 作成
29
29
  create_another: Create Another %{model}
30
30
  create_apply:
@@ -36,36 +36,36 @@ ja:
36
36
  firstDay: 0
37
37
  isRTL: false
38
38
  showMonthAfterYear: false
39
- weekHeader: Wk
39
+ weekHeader:
40
40
  datetime_picker_options:
41
- closeText:
42
- currentText:
43
- timeText:
44
- timezoneText: Timezone
45
- days: Days
41
+ closeText: 閉じる
42
+ currentText: 現在時刻
43
+ timeText: 時間
44
+ timezoneText: 時間帯
45
+ days: 日分
46
46
  delete: 削除
47
47
  deleted_model: "%{model}を削除しました"
48
48
  deleted_records:
49
- delimiter: Delimiter
49
+ delimiter: 区切り文字
50
50
  download: ダウンロード
51
51
  edit: 編集
52
- ends_with: Ends with
53
- error_500: "(コード500: 内部エラー)"
52
+ ends_with: 終了時間
53
+ error_500: "(コード500:内部エラー)"
54
54
  errors:
55
55
  template:
56
- body: 'There were problems with the following fields:'
56
+ body: '次のフィールドに問題がありました:'
57
57
  header:
58
- one: 1 error prohibited this %{model} from being saved.
59
- other: "%{count} errors prohibited this %{model} from being saved"
60
- export: Export
58
+ one: 1件のエラーにより、この%{model}が保存できませんでした
59
+ other: "%{count}件のエラーにより、この%{model}が保存できませんでした"
60
+ export: エクスポート
61
61
  'false': 'False'
62
62
  filtered: "(フィルタ中)"
63
63
  found: 個ありました
64
- future: Future
64
+ future: 未来
65
65
  group_by:
66
66
  grouped_by:
67
- hide: "(隠す)"
68
- hours: Hours
67
+ hide: "(隠す)"
68
+ hours: 時間分
69
69
  human_conditions:
70
70
  association: "%{column} = %{value}"
71
71
  boolean: "%{column} = %{value}"
@@ -73,17 +73,17 @@ ja:
73
73
  internal_error: リクエストが失敗しました
74
74
  live_search: その場で検索
75
75
  loading: 読み込み中…
76
- mark_all_records: Mark all
77
- maximum: Maximum
78
- minimum: Minimum
79
- minutes: Minutes
80
- months: Months
76
+ mark_all_records: すべて選択
77
+ maximum: 最大値
78
+ minimum: 最小値
79
+ minutes: 分間
80
+ months: か月分
81
81
  nested_for_model: "%{parent_model}の%{nested_model}"
82
82
  nested_of_model: "%{nested_model} of %{parent_model}"
83
83
  next: 次
84
- next_month: Next Month
85
- next_week: Next Week
86
- next_year: Next Year
84
+ next_month: 来月
85
+ next_week: 来週
86
+ next_year: 来年
87
87
  no_authorization_for_action: No Authorization for action %{action}
88
88
  no_color:
89
89
  no_entries: 見つかりませんでした
@@ -94,19 +94,19 @@ ja:
94
94
  omit_header: Omit Header
95
95
  optional_attributes: Further Options
96
96
  options: オプション
97
- past: Past
97
+ past: 過去
98
98
  pdf: PDF
99
- prev_month: Last Month
100
- prev_week: Last Week
101
- prev_year: Last Year
99
+ prev_month: 先月
100
+ prev_week: 先週
101
+ prev_year: 去年
102
102
  previous: 前
103
103
  print: 印刷
104
- range: Range
105
- record_not_saved: Failed to save record cause of an unknown error
104
+ range: 範囲検索
105
+ record_not_saved: 不明なエラーによって保存できませんでした
106
106
  records_marked:
107
- one: 1 marked %{model}
108
- other: "%{count} marked %{model}"
109
- refresh: Refresh
107
+ one: "%{model}を1件選択"
108
+ other: "%{model}を%{count}件選択"
109
+ refresh: 更新
110
110
  remove: 削除
111
111
  remove_file: ファイルを削除または置換
112
112
  remove_files: ファイルを削除または追加する
@@ -117,32 +117,32 @@ ja:
117
117
  saving: 保存中…
118
118
  search: 検索
119
119
  search_terms: 検索単語
120
- seconds: Seconds
120
+ seconds: 秒分
121
121
  show: 表示
122
- show_block: "(表示)"
122
+ show_block: "(表示)"
123
123
  show_model: "%{model}を表示"
124
- sum: Sum
125
- this_month: This Month
126
- this_week: This Week
127
- this_year: This Year
128
- today: Today
129
- tomorrow: Tomorrow
124
+ sum: 合計値
125
+ this_month: 今月
126
+ this_week: 今週
127
+ this_year: 今年
128
+ today: 今日
129
+ tomorrow: 明日
130
130
  'true': 'True'
131
131
  update: 更新
132
132
  update_apply:
133
133
  update_model: "%{model}を更新"
134
134
  updated_model: "%{model}を更新しました"
135
135
  version_inconsistency: バージョンが一致しません - あなたが編集している間にこのレコードが変更されました。
136
- weeks: Weeks
137
- years: Years
138
- yesterday: Yesterday
136
+ weeks: 週間分
137
+ years: 年分
138
+ yesterday: 昨日
139
139
  date:
140
140
  formats:
141
- month:
142
- quarter:
143
- week:
144
- year_month:
145
- year_quarter:
141
+ month: "%m月"
142
+ quarter: 第%{quarter}四半期
143
+ week:
144
+ year_month: "%Y年%m月"
145
+ year_quarter: "%{year}年第%{quarter}四半期"
146
146
  time:
147
147
  formats:
148
- picker: "%a, %d %b %Y %H:%M:%S"
148
+ picker: "%Y年%m月%d日(%a %H:%M:%S"
@@ -31,11 +31,11 @@ module ActiveScaffold::Actions
31
31
  params_hash params[:search]
32
32
  end
33
33
 
34
- def set_outer_joins_for_search(columns)
34
+ def set_outer_joins_for_search(columns) # rubocop:disable Naming/AccessorMethodName
35
35
  references = []
36
36
  outer_joins = []
37
37
  columns.each do |column|
38
- next unless column.search_joins.present?
38
+ next if column.search_joins.blank?
39
39
  if column.includes.present? && list_columns.include?(column)
40
40
  references << (column.search_joins & column.includes)
41
41
  outer_joins << (column.search_joins - column.includes)