active_scaffold 3.0.5 → 3.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. data/.document +5 -0
  2. data/Gemfile +11 -2
  3. data/Gemfile.lock +20 -0
  4. data/Rakefile +33 -4
  5. data/active_scaffold.gemspec +378 -17
  6. data/frontends/default/images/config.png +0 -0
  7. data/frontends/default/images/gears.png +0 -0
  8. data/frontends/default/javascripts/jquery/active_scaffold.js +34 -33
  9. data/frontends/default/javascripts/jquery/jquery.editinplace.js +21 -4
  10. data/frontends/default/javascripts/prototype/active_scaffold.js +43 -38
  11. data/frontends/default/stylesheets/stylesheet.css +110 -35
  12. data/frontends/default/views/_action_group.html.erb +20 -0
  13. data/frontends/default/views/_base_form.html.erb +7 -3
  14. data/frontends/default/views/_create_form.html.erb +5 -3
  15. data/frontends/default/views/_create_form_on_list.html.erb +2 -1
  16. data/frontends/default/views/_field_search.html.erb +2 -2
  17. data/frontends/default/views/_form.html.erb +2 -2
  18. data/frontends/default/views/_form_messages.html.erb +1 -1
  19. data/frontends/default/views/_horizontal_subform.html.erb +1 -1
  20. data/frontends/default/views/_list_actions.html.erb +6 -14
  21. data/frontends/default/views/_list_header.html.erb +4 -6
  22. data/frontends/default/views/_list_with_header.html.erb +2 -2
  23. data/frontends/default/views/_messages.html.erb +2 -2
  24. data/frontends/default/views/_search.html.erb +2 -2
  25. data/frontends/default/views/_show.html.erb +1 -1
  26. data/frontends/default/views/_update_form.html.erb +2 -1
  27. data/frontends/default/views/_vertical_subform.html.erb +1 -1
  28. data/frontends/default/views/action_confirmation.html.erb +13 -0
  29. data/frontends/default/views/add_existing.js.rjs +1 -1
  30. data/frontends/default/views/destroy.js.rjs +21 -3
  31. data/frontends/default/views/on_action_update.js.rjs +1 -1
  32. data/frontends/default/views/on_create.js.rjs +30 -13
  33. data/frontends/default/views/on_update.js.rjs +19 -6
  34. data/init.rb +6 -0
  35. data/lib/active_scaffold/actions/core.rb +32 -12
  36. data/lib/active_scaffold/actions/create.rb +4 -11
  37. data/lib/active_scaffold/actions/delete.rb +16 -13
  38. data/lib/active_scaffold/actions/list.rb +58 -2
  39. data/lib/active_scaffold/actions/mark.rb +1 -1
  40. data/lib/active_scaffold/actions/nested.rb +24 -15
  41. data/lib/active_scaffold/actions/show.rb +10 -3
  42. data/lib/active_scaffold/actions/update.rb +10 -3
  43. data/lib/{active_record_permissions.rb → active_scaffold/active_record_permissions.rb} +0 -0
  44. data/lib/active_scaffold/bridges/ancestry/lib/ancestry_bridge.rb +9 -8
  45. data/lib/active_scaffold/bridges/bridge.rb +1 -1
  46. data/lib/active_scaffold/bridges/calendar_date_select/lib/as_cds_bridge.rb +8 -4
  47. data/lib/active_scaffold/bridges/carrierwave/bridge.rb +1 -1
  48. data/lib/active_scaffold/bridges/paperclip/bridge.rb +1 -1
  49. data/lib/active_scaffold/bridges/paperclip/lib/list_ui.rb +1 -1
  50. data/lib/active_scaffold/config/base.rb +8 -0
  51. data/lib/active_scaffold/config/core.rb +2 -15
  52. data/lib/active_scaffold/config/create.rb +8 -0
  53. data/lib/active_scaffold/config/delete.rb +10 -1
  54. data/lib/active_scaffold/config/field_search.rb +1 -0
  55. data/lib/active_scaffold/config/form.rb +2 -1
  56. data/lib/active_scaffold/config/nested.rb +3 -2
  57. data/lib/active_scaffold/config/search.rb +1 -0
  58. data/lib/active_scaffold/config/show.rb +1 -0
  59. data/lib/active_scaffold/config/update.rb +8 -0
  60. data/lib/active_scaffold/constraints.rb +9 -4
  61. data/lib/active_scaffold/data_structures/action_columns.rb +1 -1
  62. data/lib/active_scaffold/data_structures/action_link.rb +10 -1
  63. data/lib/active_scaffold/data_structures/action_links.rb +62 -22
  64. data/lib/active_scaffold/data_structures/column.rb +17 -13
  65. data/lib/active_scaffold/data_structures/nested_info.rb +21 -6
  66. data/lib/active_scaffold/finder.rb +2 -1
  67. data/lib/active_scaffold/helpers/association_helpers.rb +2 -2
  68. data/lib/active_scaffold/helpers/controller_helpers.rb +57 -10
  69. data/lib/active_scaffold/helpers/form_column_helpers.rb +12 -8
  70. data/lib/active_scaffold/helpers/id_helpers.rb +5 -9
  71. data/lib/active_scaffold/helpers/list_column_helpers.rb +26 -28
  72. data/lib/active_scaffold/helpers/search_column_helpers.rb +8 -3
  73. data/lib/active_scaffold/helpers/view_helpers.rb +60 -19
  74. data/lib/active_scaffold/locale/de.rb +13 -6
  75. data/lib/active_scaffold/locale/en.rb +2 -1
  76. data/lib/active_scaffold/locale/es.yml +3 -0
  77. data/lib/active_scaffold/locale/fr.rb +5 -2
  78. data/lib/active_scaffold/locale/ru.yml +77 -20
  79. data/lib/active_scaffold/marked_model.rb +5 -5
  80. data/lib/{paginator.rb → active_scaffold/paginator.rb} +0 -0
  81. data/lib/{responds_to_parent.rb → active_scaffold/responds_to_parent.rb} +0 -0
  82. data/lib/active_scaffold/version.rb +9 -0
  83. data/lib/active_scaffold.rb +60 -84
  84. data/lib/active_scaffold_assets.rb +45 -0
  85. data/lib/active_scaffold_env.rb +14 -0
  86. data/lib/active_scaffold_vho.rb +2 -0
  87. data/lib/extensions/active_association_reflection.rb +13 -0
  88. data/lib/extensions/paginator_extensions.rb +1 -1
  89. data/lib/extensions/routing_mapper.rb +1 -1
  90. data/lib/generators/active_scaffold_setup/active_scaffold_setup_generator.rb +12 -4
  91. metadata +85 -68
  92. data/lib/dhtml_confirm.rb +0 -54
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_scaffold
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 3
8
8
  - 0
9
- - 5
10
- version: 3.0.5
9
+ - 11
10
+ version: 3.0.11
11
11
  platform: ruby
12
12
  authors:
13
13
  - Many, see README
@@ -15,13 +15,13 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-22 00:00:00 -05:00
18
+ date: 2011-02-01 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- name: render_component
23
22
  prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
23
+ name: shoulda
24
+ version_requirements: &id001 !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
27
  - - ">="
@@ -30,58 +30,72 @@ dependencies:
30
30
  segments:
31
31
  - 0
32
32
  version: "0"
33
- type: :runtime
34
- version_requirements: *id001
33
+ requirement: *id001
34
+ type: :development
35
35
  - !ruby/object:Gem::Dependency
36
- name: verification
37
36
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
37
+ name: bundler
38
+ version_requirements: &id002 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
- - - ">="
41
+ - - ~>
42
42
  - !ruby/object:Gem::Version
43
- hash: 3
43
+ hash: 23
44
44
  segments:
45
+ - 1
45
46
  - 0
46
- version: "0"
47
- type: :runtime
48
- version_requirements: *id002
47
+ - 0
48
+ version: 1.0.0
49
+ requirement: *id002
50
+ type: :development
49
51
  - !ruby/object:Gem::Dependency
50
- name: actionpack
51
52
  prerelease: false
52
- requirement: &id003 !ruby/object:Gem::Requirement
53
+ name: jeweler
54
+ version_requirements: &id003 !ruby/object:Gem::Requirement
53
55
  none: false
54
56
  requirements:
55
57
  - - ~>
56
58
  - !ruby/object:Gem::Version
57
59
  hash: 7
58
60
  segments:
59
- - 3
60
- - 0
61
- - 0
62
- version: 3.0.0
63
- type: :runtime
64
- version_requirements: *id003
61
+ - 1
62
+ - 5
63
+ - 2
64
+ version: 1.5.2
65
+ requirement: *id003
66
+ type: :development
65
67
  - !ruby/object:Gem::Dependency
66
- name: activerecord
67
68
  prerelease: false
68
- requirement: &id004 !ruby/object:Gem::Requirement
69
+ name: rcov
70
+ version_requirements: &id004 !ruby/object:Gem::Requirement
69
71
  none: false
70
72
  requirements:
71
- - - ~>
73
+ - - ">="
72
74
  - !ruby/object:Gem::Version
73
- hash: 7
75
+ hash: 3
74
76
  segments:
75
- - 3
76
77
  - 0
78
+ version: "0"
79
+ requirement: *id004
80
+ type: :development
81
+ - !ruby/object:Gem::Dependency
82
+ prerelease: false
83
+ name: render_component
84
+ version_requirements: &id005 !ruby/object:Gem::Requirement
85
+ none: false
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ hash: 3
90
+ segments:
77
91
  - 0
78
- version: 3.0.0
92
+ version: "0"
93
+ requirement: *id005
79
94
  type: :runtime
80
- version_requirements: *id004
81
95
  - !ruby/object:Gem::Dependency
82
- name: mocha
83
96
  prerelease: false
84
- requirement: &id005 !ruby/object:Gem::Requirement
97
+ name: verification
98
+ version_requirements: &id006 !ruby/object:Gem::Requirement
85
99
  none: false
86
100
  requirements:
87
101
  - - ">="
@@ -90,21 +104,38 @@ dependencies:
90
104
  segments:
91
105
  - 0
92
106
  version: "0"
93
- type: :development
94
- version_requirements: *id005
95
- description: Advanced scaffolding plugin for Rails
96
- email:
97
- - activescaffold@googlegroups.com
107
+ requirement: *id006
108
+ type: :runtime
109
+ - !ruby/object:Gem::Dependency
110
+ prerelease: false
111
+ name: rails
112
+ version_requirements: &id007 !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ~>
116
+ - !ruby/object:Gem::Version
117
+ hash: 7
118
+ segments:
119
+ - 3
120
+ - 0
121
+ - 0
122
+ version: 3.0.0
123
+ requirement: *id007
124
+ type: :runtime
125
+ description: Save time and headaches, and create a more easily maintainable set of pages, with ActiveScaffold. ActiveScaffold handles all your CRUD (create, read, update, delete) user interface needs, leaving you more time to focus on more challenging (and interesting!) problems.
126
+ email: activescaffold@googlegroups.com
98
127
  executables: []
99
128
 
100
129
  extensions: []
101
130
 
102
- extra_rdoc_files: []
103
-
131
+ extra_rdoc_files:
132
+ - README
104
133
  files:
105
134
  - .autotest
135
+ - .document
106
136
  - CHANGELOG
107
137
  - Gemfile
138
+ - Gemfile.lock
108
139
  - MIT-LICENSE
109
140
  - README
110
141
  - Rakefile
@@ -113,7 +144,9 @@ files:
113
144
  - frontends/default/images/arrow_down.gif
114
145
  - frontends/default/images/arrow_up.gif
115
146
  - frontends/default/images/close.gif
147
+ - frontends/default/images/config.png
116
148
  - frontends/default/images/cross.png
149
+ - frontends/default/images/gears.png
117
150
  - frontends/default/images/indicator-small.gif
118
151
  - frontends/default/images/indicator.gif
119
152
  - frontends/default/images/magnifier.png
@@ -125,6 +158,7 @@ files:
125
158
  - frontends/default/javascripts/prototype/rico_corner.js
126
159
  - frontends/default/stylesheets/stylesheet-ie.css
127
160
  - frontends/default/stylesheets/stylesheet.css
161
+ - frontends/default/views/_action_group.html.erb
128
162
  - frontends/default/views/_add_existing_form.html.erb
129
163
  - frontends/default/views/_base_form.html.erb
130
164
  - frontends/default/views/_create_form.html.erb
@@ -163,6 +197,7 @@ files:
163
197
  - frontends/default/views/_update_form.html.erb
164
198
  - frontends/default/views/_vertical_subform.html.erb
165
199
  - frontends/default/views/_vertical_subform_record.html.erb
200
+ - frontends/default/views/action_confirmation.html.erb
166
201
  - frontends/default/views/add_existing.js.rjs
167
202
  - frontends/default/views/add_existing_form.html.erb
168
203
  - frontends/default/views/create.html.erb
@@ -182,7 +217,6 @@ files:
182
217
  - frontends/default/views/update_column.js.rjs
183
218
  - frontends/default/views/update_row.js.rjs
184
219
  - init.rb
185
- - lib/active_record_permissions.rb
186
220
  - lib/active_scaffold.rb
187
221
  - lib/active_scaffold/actions/common_search.rb
188
222
  - lib/active_scaffold/actions/core.rb
@@ -196,6 +230,7 @@ files:
196
230
  - lib/active_scaffold/actions/show.rb
197
231
  - lib/active_scaffold/actions/subform.rb
198
232
  - lib/active_scaffold/actions/update.rb
233
+ - lib/active_scaffold/active_record_permissions.rb
199
234
  - lib/active_scaffold/attribute_params.rb
200
235
  - lib/active_scaffold/bridges/ancestry/bridge.rb
201
236
  - lib/active_scaffold/bridges/ancestry/lib/ancestry_bridge.rb
@@ -275,10 +310,16 @@ files:
275
310
  - lib/active_scaffold/locale/ja.yml
276
311
  - lib/active_scaffold/locale/ru.yml
277
312
  - lib/active_scaffold/marked_model.rb
278
- - lib/dhtml_confirm.rb
313
+ - lib/active_scaffold/paginator.rb
314
+ - lib/active_scaffold/responds_to_parent.rb
315
+ - lib/active_scaffold/version.rb
316
+ - lib/active_scaffold_assets.rb
317
+ - lib/active_scaffold_env.rb
318
+ - lib/active_scaffold_vho.rb
279
319
  - lib/extensions/action_controller_rendering.rb
280
320
  - lib/extensions/action_view_rendering.rb
281
321
  - lib/extensions/action_view_resolver.rb
322
+ - lib/extensions/active_association_reflection.rb
282
323
  - lib/extensions/active_record_offset.rb
283
324
  - lib/extensions/array.rb
284
325
  - lib/extensions/localize.rb
@@ -298,8 +339,6 @@ files:
298
339
  - lib/generators/active_scaffold_controller/templates/controller.rb
299
340
  - lib/generators/active_scaffold_setup/USAGE
300
341
  - lib/generators/active_scaffold_setup/active_scaffold_setup_generator.rb
301
- - lib/paginator.rb
302
- - lib/responds_to_parent.rb
303
342
  - public/blank.html
304
343
  - shoulda_macros/macros.rb
305
344
  - test/bridges/bridge_test.rb
@@ -372,9 +411,9 @@ files:
372
411
  - test/test_helper.rb
373
412
  - uninstall.rb
374
413
  has_rdoc: true
375
- homepage: https://github.com/vhochstein/active_scaffold
376
- licenses: []
377
-
414
+ homepage: http://github.com/vhochstein/active_scaffold
415
+ licenses:
416
+ - MIT
378
417
  post_install_message:
379
418
  rdoc_options: []
380
419
 
@@ -436,11 +475,9 @@ test_files:
436
475
  - test/misc/constraints_test.rb
437
476
  - test/misc/finder_test.rb
438
477
  - test/misc/lang_test.rb
439
- - test/mock_app/.gitignore
440
478
  - test/mock_app/app/controllers/application_controller.rb
441
479
  - test/mock_app/app/helpers/application_helper.rb
442
480
  - test/mock_app/config/boot.rb
443
- - test/mock_app/config/database.yml
444
481
  - test/mock_app/config/environment.rb
445
482
  - test/mock_app/config/environments/development.rb
446
483
  - test/mock_app/config/environments/production.rb
@@ -450,27 +487,7 @@ test_files:
450
487
  - test/mock_app/config/initializers/mime_types.rb
451
488
  - test/mock_app/config/initializers/new_rails_defaults.rb
452
489
  - test/mock_app/config/initializers/session_store.rb
453
- - test/mock_app/config/locales/en.yml
454
490
  - test/mock_app/config/routes.rb
455
- - test/mock_app/db/test.sqlite3
456
- - test/mock_app/public/blank.html
457
- - test/mock_app/public/images/active_scaffold/DO_NOT_EDIT
458
- - test/mock_app/public/images/active_scaffold/default/add.gif
459
- - test/mock_app/public/images/active_scaffold/default/arrow_down.gif
460
- - test/mock_app/public/images/active_scaffold/default/arrow_up.gif
461
- - test/mock_app/public/images/active_scaffold/default/close.gif
462
- - test/mock_app/public/images/active_scaffold/default/cross.png
463
- - test/mock_app/public/images/active_scaffold/default/indicator-small.gif
464
- - test/mock_app/public/images/active_scaffold/default/indicator.gif
465
- - test/mock_app/public/images/active_scaffold/default/magnifier.png
466
- - test/mock_app/public/javascripts/active_scaffold/DO_NOT_EDIT
467
- - test/mock_app/public/javascripts/active_scaffold/default/active_scaffold.js
468
- - test/mock_app/public/javascripts/active_scaffold/default/dhtml_history.js
469
- - test/mock_app/public/javascripts/active_scaffold/default/form_enhancements.js
470
- - test/mock_app/public/javascripts/active_scaffold/default/rico_corner.js
471
- - test/mock_app/public/stylesheets/active_scaffold/DO_NOT_EDIT
472
- - test/mock_app/public/stylesheets/active_scaffold/default/stylesheet-ie.css
473
- - test/mock_app/public/stylesheets/active_scaffold/default/stylesheet.css
474
491
  - test/model_stub.rb
475
492
  - test/run_all.rb
476
493
  - test/test_helper.rb
data/lib/dhtml_confirm.rb DELETED
@@ -1,54 +0,0 @@
1
- # Matt Mower <matt@cominded.com>
2
- #
3
- # A base class for creating DHTML confirmation types.
4
- #
5
- # The real work is done by the onclick_function and onclick_handler methods. In
6
- # general it should only be required to override the default onclick_handler
7
- # method and provide the specific Javascript required to invoke the DHTML confirm
8
- # dialog of your choice.
9
- #
10
- # It is up to this dialog, if the user confirms the intended action, to invoke
11
- # the function window.gFireModalLink() to trigger the intended action of the link.
12
- # For example, using the Modalbox library, you would use something like:
13
- #
14
- # Modalbox.hide( {
15
- # afterHide: function() {
16
- # window.gFireModalLink();
17
- # } } );
18
- #
19
- # By default the only action recognized is :value which is used to add a
20
- # dhtml_confirm attribute to the link <a> tag. This value is detected by the
21
- # ActiveScaffold link and triggers the DHTML confirmation logic.
22
- #
23
- class DHTMLConfirm
24
- attr_accessor :value, :message, :options
25
-
26
- def initialize( options = {} )
27
- @options = options
28
- @value = @options.delete(:value) { |key| "yes" }
29
- @message = @options.delete(:message) { |key| "Are you sure?" }
30
- end
31
-
32
- def onclick_function( controller, link_id )
33
- script = <<-END
34
- window.gFireModalLink = function() {
35
- var link = $('#{link_id}').action_link;
36
- link.open_action.call( link );
37
- };
38
- #{ensure_termination(onclick_handler(controller,link_id))}
39
- return false;
40
- END
41
- # script = "window.gModalLink = $('#{link_id}').action_link;#{onclick_handler(controller,link_id)}return false;"
42
- end
43
-
44
- def onclick_handler( controller, link_id )
45
- ""
46
- end
47
-
48
- protected
49
- def ensure_termination( expression )
50
- expression =~ /;$/ ? expression : "#{expression};"
51
- end
52
-
53
- end
54
-