active_scaffold 4.2.3 → 4.3.1

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.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.rdoc +19 -1
  3. data/README.md +115 -12
  4. data/app/assets/javascripts/{jquery → active_scaffold}/active_scaffold.js +759 -762
  5. data/app/assets/javascripts/{jquery/date_picker_bridge.js.erb → active_scaffold/date_picker_bridge.js} +0 -3
  6. data/app/assets/javascripts/active_scaffold/load.js +102 -0
  7. data/app/assets/javascripts/active_scaffold.js.erb +3 -27
  8. data/app/assets/stylesheets/active_scaffold/_colours.scss +330 -0
  9. data/app/assets/stylesheets/active_scaffold/_images.scss +65 -0
  10. data/app/assets/stylesheets/{active_scaffold_layout.scss → active_scaffold/_layout.scss} +14 -0
  11. data/app/assets/stylesheets/active_scaffold/_variables.scss +194 -0
  12. data/app/assets/stylesheets/active_scaffold/core.scss +15 -0
  13. data/app/assets/stylesheets/active_scaffold.scss.erb +16 -0
  14. data/app/views/active_scaffold_overrides/_field_search_columns.html.erb +8 -0
  15. data/app/views/active_scaffold_overrides/_form.html.erb +8 -0
  16. data/app/views/active_scaffold_overrides/_form_association.html.erb +3 -1
  17. data/app/views/active_scaffold_overrides/_form_association_record.html.erb +4 -2
  18. data/app/views/active_scaffold_overrides/_new_record.js.erb +2 -2
  19. data/app/views/active_scaffold_overrides/_refresh_list.js.erb +1 -1
  20. data/app/views/active_scaffold_overrides/_show_association.html.erb +2 -1
  21. data/app/views/active_scaffold_overrides/_show_association_horizontal.html.erb +2 -2
  22. data/app/views/active_scaffold_overrides/_show_association_vertical.html.erb +1 -1
  23. data/app/views/active_scaffold_overrides/destroy.js.erb +2 -2
  24. data/app/views/active_scaffold_overrides/edit_associated.js.erb +10 -8
  25. data/app/views/active_scaffold_overrides/on_update.js.erb +1 -1
  26. data/config/locales/de.yml +19 -15
  27. data/config/locales/en.yml +5 -4
  28. data/config/locales/es.yml +16 -8
  29. data/config/locales/fr.yml +27 -20
  30. data/config/locales/hu.yml +35 -31
  31. data/config/locales/ja.yml +39 -38
  32. data/config/locales/ru.yml +37 -36
  33. data/config/locales/ta.yml +165 -0
  34. data/config/locales/zh_Hans.yml +163 -0
  35. data/lib/active_scaffold/actions/core.rb +34 -3
  36. data/lib/active_scaffold/assets/css_deps_generator.rb +42 -0
  37. data/lib/active_scaffold/assets/jquery_ui_manifest.rb +77 -0
  38. data/lib/active_scaffold/assets/jquery_ui_theme_generator.rb +102 -0
  39. data/lib/active_scaffold/assets.rb +109 -0
  40. data/lib/active_scaffold/attribute_params.rb +11 -2
  41. data/lib/active_scaffold/bridges/active_storage/form_ui.rb +1 -1
  42. data/lib/active_scaffold/bridges/carrierwave/form_ui.rb +1 -1
  43. data/lib/active_scaffold/bridges/chosen.rb +1 -1
  44. data/lib/active_scaffold/bridges/date_picker/helper.rb +12 -1
  45. data/lib/active_scaffold/bridges/dragonfly/form_ui.rb +1 -1
  46. data/lib/active_scaffold/bridges/file_column/form_ui.rb +1 -1
  47. data/lib/active_scaffold/bridges/paperclip/form_ui.rb +1 -1
  48. data/lib/active_scaffold/bridges/record_select/helpers.rb +1 -1
  49. data/lib/active_scaffold/bridges/tiny_mce/helpers.rb +1 -0
  50. data/lib/active_scaffold/bridges/tiny_mce.rb +6 -1
  51. data/lib/active_scaffold/bridges.rb +7 -0
  52. data/lib/active_scaffold/config/core.rb +7 -3
  53. data/lib/active_scaffold/constraints.rb +1 -1
  54. data/lib/active_scaffold/data_structures/action_columns.rb +66 -0
  55. data/lib/active_scaffold/data_structures/bridge.rb +2 -0
  56. data/lib/active_scaffold/data_structures/column.rb +3 -0
  57. data/lib/active_scaffold/engine.rb +40 -0
  58. data/lib/active_scaffold/finder.rb +1 -1
  59. data/lib/active_scaffold/helpers/assets_helpers.rb +39 -0
  60. data/lib/active_scaffold/helpers/controller_helpers.rb +1 -1
  61. data/lib/active_scaffold/helpers/form_column_helpers.rb +57 -532
  62. data/lib/active_scaffold/helpers/form_ui_helpers.rb +530 -0
  63. data/lib/active_scaffold/helpers/human_condition_helpers.rb +1 -0
  64. data/lib/active_scaffold/helpers/list_column_helpers.rb +31 -11
  65. data/lib/active_scaffold/helpers/search_column_helpers.rb +5 -12
  66. data/lib/active_scaffold/helpers/show_column_helpers.rb +4 -2
  67. data/lib/active_scaffold/helpers/view_helpers.rb +12 -0
  68. data/lib/active_scaffold/railties/tasks.rake +10 -0
  69. data/lib/active_scaffold/tableless.rb +1 -1
  70. data/lib/active_scaffold/testing/assert_embedded_load.rb +33 -0
  71. data/lib/active_scaffold/version.rb +2 -2
  72. data/lib/active_scaffold.rb +7 -2
  73. data/lib/tasks/active_scaffold/assets.rake +42 -0
  74. data/lib/tasks/bundle.rake +25 -0
  75. data/vendor/assets/stylesheets/{jquery-ui-theme.css.erb → jquery-ui-theme.css} +17 -17
  76. metadata +28 -28
  77. data/app/assets/stylesheets/active_scaffold.scss +0 -424
  78. data/app/assets/stylesheets/active_scaffold_extensions.css.erb +0 -2
  79. data/app/assets/stylesheets/active_scaffold_images.scss +0 -65
  80. data/app/assets/stylesheets/active_scaffold_jquery_ui.css.erb +0 -13
  81. /data/app/assets/javascripts/{jquery → active_scaffold}/active_scaffold_chosen.js +0 -0
  82. /data/app/assets/javascripts/{jquery → active_scaffold}/draggable_lists.js +0 -0
  83. /data/app/assets/javascripts/{jquery → active_scaffold}/jquery.editinplace.js +0 -0
  84. /data/app/assets/javascripts/{jquery → active_scaffold}/tiny_mce_bridge.js +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d279597d030fea168fba4fbcc8cd44c99d02f44b4596c774ec4476db04d53cd1
4
- data.tar.gz: 48fd530b7990ec28454a1b3adebd5da80ca1d833727b22563a85cef1e140747f
3
+ metadata.gz: 8426370774f998d440d6ba62749ce0debb8b5caf5a050330b21c77eb34849e17
4
+ data.tar.gz: 60f8897a05d79cc248c5059321b42152361f5f79b24069586e46b2bd209e738e
5
5
  SHA512:
6
- metadata.gz: 1317103cf2e2344d0340f76f020a7df076f7aedff8f07b1c0a19499338d2d7941e762c51b33757cbcf3cd039d0d9f8bc8b57653282098f23fadfc069fd631bf0
7
- data.tar.gz: 1300926c2397ea724f788a2b9899397e6c1e0ec6ca5a55a77677edf93dc98e5ed70e1b742c9a6ee8618067e4c378e58899d18e0fba9514e41cbde943c5589c01
6
+ metadata.gz: be457e4b9bc57e9e4f657642912ff5396bad888107ef9a9e27ee3cf0457e5cf8e872f2d20ee08379fa1c42105e223f8e4fd9ae43d64c6f7eececa1c6212250e4
7
+ data.tar.gz: 7c764c174e950240a3da87b096ed7891ed571c81880e7f42161744a591c3de626f5b14914ddb0d7b7c9500b12e48d2be2b06bd11d071f3174467da42d3627cbf
data/CHANGELOG.rdoc CHANGED
@@ -1,8 +1,26 @@
1
+ - Fix escaping URL in JS response, fixing auto paginate and response for actions with render_parent
2
+
3
+ = 4.3.0
4
+ - Support translating enums (or options for :select form_ui on any column) nested in the pluralized name of the column, activerecord.attributes.model_name.pluralized_column.enum_value, defaults to old way activerecord.attributes.model_name.enum_value
5
+ - Support :subform_columns option in column form_ui_options, or column's options, when the column is rendered as subform
6
+ - Use :subform_columns option in :horizontal and :vertical show_ui too
7
+ - Add layout multiple support to ActionColumns, so forms can have columns
8
+ - Better exception handling when error is raised rendering a column, no more empty backtraces
9
+ - Fix render field on subform for polymorphic association, or nested subforms in some cases
10
+ - Add clear_form_column_if, works like hide_form_column_if but sends the column empty, to clear it
11
+ - Add checkboxes form UI, like select form UI in collection associations but supporting DB columns (e.g. columns using serialize)
12
+ - Support draggable form UI in non-association columns, like checkboxes (e.g. columns using serialize)
13
+ - Add list UI for select_multiple, draggable, checkboxes, select and radio. Select and radio were handled by format_column_value, but the list UI works better
14
+ - Support propshaft with dartsass-rails, so it doesn't depend on dartsass-sprockets and one dartsass gem must be added to the Gemfile
15
+
16
+ = 4.2.4
17
+ - Fix creating records with constraints on collection associations (broken on 4.2.2 on some cases)
18
+
1
19
  = 4.2.3
2
20
  - Make simplified searches on LogicalQueryParser bridge working with upstream gem, no need for my fork
3
21
  - Styles for radio form_ui
4
22
  - Fix style for checkbox list in subform
5
- - Fix constraints (broken on 4.2.2 on some cases)
23
+ - Fix creating records with constraints on through associations (broken on 4.2.2 on some cases)
6
24
 
7
25
  = 4.2.2
8
26
  - Support setting form_ui_options with nil, for subforms
data/README.md CHANGED
@@ -1,21 +1,22 @@
1
1
 
2
- Overview
3
- ========
2
+ # Overview
4
3
  [![Build status](https://github.com/activescaffold/active_scaffold/actions/workflows/ci.yml/badge.svg)](https://github.com/activescaffold/active_scaffold/actions/workflows/ci.yml)
5
4
  [![Maintainability](https://qlty.sh/gh/activescaffold/projects/active_scaffold/maintainability.svg)](https://qlty.sh/gh/activescaffold/projects/active_scaffold)
6
5
  [![Code Coverage](https://qlty.sh/gh/activescaffold/projects/active_scaffold/coverage.svg)](https://qlty.sh/gh/activescaffold/projects/active_scaffold)
7
6
  [![Gem Version](https://badge.fury.io/rb/active_scaffold.svg)](https://badge.fury.io/rb/active_scaffold)
7
+ [![Translation Status](https://hosted.weblate.org/widget/activescaffold/svg-badge.svg)](https://hosted.weblate.org/engage/activescaffold/)
8
8
  [![Inline docs](https://inch-ci.org/github/activescaffold/active_scaffold.svg?branch=master)](https://inch-ci.org/github/activescaffold/active_scaffold)
9
9
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
10
10
 
11
- 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 >= 6.1.0 is supported, ruby >= 3.0 required.
11
+ 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 >= 7.2.0 is supported, ruby >= 3.2 required.
12
+
13
+ ## Branch Details
12
14
 
13
- Branch Details
14
- --------------
15
15
  master supports rails >= 7.2.x and ruby >= 3.2.0
16
- 4-2-stable supports rails >= 7.2.x and ruby >= 3.2.0
16
+ 4-3-stable supports rails >= 7.2.x and <= 8.1.x, and ruby >= 3.2.0
17
17
 
18
18
  These versions are not supported anymore:
19
+ 4-2-stable supports rails >= 7.2.x and <= 8.1.x, and ruby >= 3.2.0
19
20
  4-1-stable supports rails >= 7.0.x and <= 7.2.x, and ruby >= 3.1.0
20
21
  4-0-stable supports rails >= 6.1.x and <= 7.2.x, and ruby >= 2.5.0
21
22
  3-7-stable supports rails >= 5.2.x and <= 7.1.x, and ruby >= 2.5.0
@@ -25,8 +26,7 @@ These versions are not supported anymore:
25
26
  3-3-stable supports rails 3.2.x and ruby >= 1.8
26
27
  rails-3.2 supports Rails 3.1 & 3.2, and is the current source of the 3.2.x line of gems.
27
28
 
28
- Quick Start
29
- -----------
29
+ ## Quick Start
30
30
  To get started with a new Rails project
31
31
 
32
32
  Added to Gemfile
@@ -45,6 +45,8 @@ For rails 7.x, install generator will add `active_scaffold` to `config/importmap
45
45
 
46
46
  For rails 6.1, install generator will create `app/assets/javascripts/application.js`, add it, and `active_scaffold/manifest.js`, to `app/assets/config/manifest.js` and add `javascript_include_tag` in the layout, as ActiveScaffold doesn't work with webpack. It will add `jquery` to `app/assets/javascripts/application.js` too if query-rails gem is available, although Jquery may be loaded by packs too and it will work, it won't add `jquery_ujs` or `@rails/ujs` as it's added to `app/javascript/packs/application.js` by default.
47
47
 
48
+ -- TODO: Add notes about dartsass-rails for propshaft or dartsass-sprockets for sprockets.
49
+
48
50
  Run the following commands
49
51
 
50
52
  ```console
@@ -59,6 +61,107 @@ Run the app and visit localhost:3000/<plural_model>
59
61
 
60
62
  It's recommended to call `clear_helpers` in ApplicationController, as some helpers defined by ActiveScaffold, such as active_scaffold_enum_options, options_for_association_conditions, association_klass_scoped, are usually overrided for different controllers, and it may cause issues when all helper modules are available to every controller, specially when models have associations or columns with the same name but need different code for those overrided helper methods.
61
63
 
64
+ ## Stylesheet Loading
65
+
66
+ ActiveScaffold provides flexible stylesheet loading to work with both Sprockets and Propshaft, choose which want you want adding `dartsass-sprockets` or `dartsass-rails` to your Gemfile.
67
+ ActiveScaffold has SASS variables to define the colours, but, from version 4.3, the values are moved to CSS variables. It's still possible to change the colours with the old SASS variables, but they may be removed in the future.
68
+
69
+ ### With Propshaft + dartsass-rails
70
+
71
+ Traditionally, ActiveScaffold loaded all CSS needed, from itself and other ActiveScaffold plugins, and every other library integrated with bridges, such as RecordSelect, Chosen or TinyMCE. It was done using css.erb files, but with propshaft erb is not supported, so a SCSS file is generated when app boots in development and running `rake assets:precompile` on the deployment. There is a task to generate them, `active_scaffold:assets:generate`.
72
+
73
+ Also, when using jquery-ui-rails gem, the CSS is generated from the erb in the gem in the same way.
74
+
75
+ ```scss
76
+ // In application.scss
77
+ @use 'active_scaffold/core' with (
78
+ // set values to variables
79
+ );
80
+ ```
81
+
82
+
83
+ ### With Sprockets + dartsass-sprockets
84
+
85
+ Add `@use` to application.scss, it will load all CSS needed, jQuery UI if jquery-ui-rails gem is installed, and CSS for other ActiveScaffold plugins and bridges.
86
+
87
+ ```scss
88
+ @use 'active_scaffold' with (
89
+ // set values to variables
90
+ );
91
+ ```
92
+
93
+ In this case, if you want more flexibility, you have to use `@use` with each individual CSS file that ActiveScaffold provides:
94
+
95
+ ```scss
96
+ @use 'active_scaffold/variables' with (
97
+ // set values to variables
98
+ );
99
+ @use 'active_scaffold/colours';
100
+ @use 'active_scaffold/layout';
101
+ @use 'active_scaffold/images';
102
+ // load CSS for other ActiveScaffold plugins and bridges
103
+ ```
104
+
105
+ ## Javascript Loading
106
+
107
+ There are 2 options to load JS with propshaft, using importmaps or loading the files individually.
108
+
109
+ ### Propshaft + importmaps
110
+
111
+ When using importmaps, add active_scaffold to importmap, it should have jquery and jquery_ujs or rails_ujs too:
112
+
113
+ ```ruby
114
+ pin 'active_scaffold', to: 'active_scaffold/load.js'
115
+ pin 'jquery'
116
+ pin 'jquery_ujs'
117
+ ```
118
+
119
+ In the app/javascript/application.js, import jquery, jquery_ujs or rails_ujs and active_scaffold:
120
+
121
+ ```js
122
+ import 'jquery'
123
+ import 'jquery_ujs'
124
+ import 'active_scaffold'
125
+ ```
126
+
127
+ In the layout, load the importmap modules and call active_scaffold_javascript_tag, that includes some script tags which was in js.erb when using sprockets, so JS ActiveScaffold dependencies are loaded (jquery UI if using jquery-ui-rails, and JS for other ActiveScaffold plugins and bridges):
128
+
129
+ ```erb
130
+ <%= javascript_importmap_tags %>
131
+ <%= active_scaffold_javascript_tag %>
132
+ ```
133
+
134
+ ### Propshaft
135
+
136
+ If you're not using importmaps, then you can load the JS files individually, but you only need to load jquery and jquery_ujs or rails_ujs, and then call active_scaffold_javascript_tag:
137
+
138
+ ```erb
139
+ <%= javascript_include_tag 'jquery', 'jquery_ujs' %>
140
+ <%= active_scaffold_javascript_tag %>
141
+ ```
142
+
143
+ ### With Sprockets
144
+
145
+ For the JS, you can keep using `//= require active_scaffold` in your application.js
146
+
147
+ It's possible to use importmaps too, add active_scaffold to importmap, that should have jquery and jquery_ujs or rails_ujs too:
148
+
149
+ ```ruby
150
+ pin 'active_scaffold'
151
+ pin 'jquery'
152
+ pin 'jquery_ujs'
153
+ ```
154
+
155
+ In the app/javascript/application.js, import jquery, jquery_ujs or rails_ujs and active_scaffold:
156
+
157
+ ```js
158
+ import 'jquery'
159
+ import 'jquery_ujs'
160
+ import 'active_scaffold'
161
+ ```
162
+
163
+ In the layout, load the importmap modules, in this case we are not using `to` in the importmap, so the js.erb file will be used, that include some generated code, and calling active_scaffold_javascript_tag is not needed.
164
+
62
165
  Threadsafe
63
166
  ----------
64
167
 
@@ -106,15 +209,15 @@ Released under the MIT license (included)
106
209
 
107
210
  ---
108
211
 
109
- A ruby translation project managed on [Locale](http://www.localeapp.com/) that's open to all!
212
+ A ruby translation project managed on [Weblate](http://weblate.org/) that's open to all!
110
213
 
111
214
  ## Contributing to ActiveScaffold
112
215
 
113
- - Edit the translations directly on the [active_scaffold](http://www.localeapp.com/projects/public?search=active_scaffold) project on Locale.
216
+ - Edit the translations directly on the [active_scaffold](https://hosted.weblate.org/engage/activescaffold/) project on Weblate.
114
217
  - **That's it!**
115
- - The maintainer will then pull translations from the Locale project and push to Github.
218
+ - Weblate will send a PR to Github.
116
219
 
117
220
  Happy translating!
118
221
 
119
222
  ### Powered by
120
- [![RubyMine logo](https://resources.jetbrains.com/storage/products/company/brand/logos/RubyMine.png)](https://jb.gg/OpenSource)
223
+ [![RubyMine logo](https://resources.jetbrains.com/storage/products/company/brand/logos/RubyMine.png)](https://jb.gg/OpenSource)