netzke-basepack 0.5.14 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (196) hide show
  1. data/.gitignore +3 -2
  2. data/CHANGELOG.rdoc +15 -0
  3. data/README.rdoc +45 -50
  4. data/Rakefile +8 -8
  5. data/TODO.rdoc +1 -6
  6. data/app/components/netzke/basepack/accordion_panel.rb +37 -0
  7. data/app/components/netzke/basepack/basic_app.rb +267 -0
  8. data/{lib/netzke → app/components/netzke/basepack}/basic_app/statusbar_ext.js +0 -0
  9. data/app/components/netzke/basepack/border_layout_panel.rb +39 -0
  10. data/app/components/netzke/basepack/form_panel.rb +102 -0
  11. data/app/components/netzke/basepack/form_panel/fields.rb +206 -0
  12. data/{lib/netzke → app/components/netzke/basepack}/form_panel/javascripts/netzkefileupload.js +0 -0
  13. data/app/components/netzke/basepack/form_panel/javascripts/pre.js +76 -0
  14. data/{lib/netzke → app/components/netzke/basepack}/form_panel/javascripts/xcheckbox.js +0 -0
  15. data/app/components/netzke/basepack/form_panel/services.rb +99 -0
  16. data/app/components/netzke/basepack/grid_panel.rb +374 -0
  17. data/app/components/netzke/basepack/grid_panel/columns.rb +233 -0
  18. data/app/components/netzke/basepack/grid_panel/javascript.rb +69 -0
  19. data/app/components/netzke/basepack/grid_panel/javascripts/advanced_search.js +96 -0
  20. data/{lib/netzke → app/components/netzke/basepack}/grid_panel/javascripts/edit_in_form.js +5 -4
  21. data/{lib/netzke/grid_panel/javascripts/grid_panel_pre.js → app/components/netzke/basepack/grid_panel/javascripts/pre.js} +17 -37
  22. data/{lib/netzke → app/components/netzke/basepack}/grid_panel/javascripts/rows-dd.js +0 -0
  23. data/app/components/netzke/basepack/grid_panel/multi_edit_form.rb +16 -0
  24. data/app/components/netzke/basepack/grid_panel/record_form_window.rb +36 -0
  25. data/app/components/netzke/basepack/grid_panel/search_window.rb +56 -0
  26. data/app/components/netzke/basepack/grid_panel/services.rb +356 -0
  27. data/app/components/netzke/basepack/panel.rb +11 -0
  28. data/app/components/netzke/basepack/search_panel.rb +59 -0
  29. data/app/components/netzke/basepack/tab_panel.rb +32 -0
  30. data/app/components/netzke/basepack/window.rb +73 -0
  31. data/app/components/netzke/basepack/wrapper.rb +28 -0
  32. data/{lib/app → app}/models/netzke_field_list.rb +1 -1
  33. data/{lib/app → app}/models/netzke_model_attr_list.rb +0 -0
  34. data/{lib/app → app}/models/netzke_persistent_array_auto_model.rb +0 -0
  35. data/config/database.yml +35 -0
  36. data/features/accordion_panel.feature +15 -0
  37. data/features/basic_app.feature +12 -0
  38. data/features/form_panel.feature +40 -0
  39. data/features/grid_panel.feature +62 -0
  40. data/features/search_in_grid.feature +35 -0
  41. data/features/simple_panel.feature +15 -0
  42. data/features/step_definitions/accordion_steps.rb +9 -0
  43. data/features/step_definitions/generic_steps.rb +15 -0
  44. data/features/step_definitions/grid_panel_steps.rb +26 -0
  45. data/features/step_definitions/pickle_steps.rb +100 -0
  46. data/features/step_definitions/web_steps.rb +219 -0
  47. data/features/support/env.rb +66 -0
  48. data/features/support/paths.rb +59 -0
  49. data/features/support/pickle.rb +25 -0
  50. data/features/tab_panel.feature +15 -0
  51. data/features/window.feature +11 -0
  52. data/from_05_to_06.rdoc +2 -0
  53. data/javascripts/basepack.js +54 -2
  54. data/lib/netzke-basepack.rb +38 -25
  55. data/lib/netzke/active_record.rb +12 -4
  56. data/lib/netzke/active_record/attributes.rb +60 -5
  57. data/lib/netzke/active_record/combobox_options.rb +3 -2
  58. data/lib/netzke/active_record/relation_extensions.rb +35 -0
  59. data/lib/netzke/basepack.rb +27 -0
  60. data/lib/netzke/basepack/version.rb +11 -0
  61. data/lib/netzke/basepack/wrap_lazy_loaded.rb +26 -0
  62. data/lib/netzke/data_accessor.rb +60 -32
  63. data/lib/netzke/fields_configurator.rb +5 -9
  64. data/lib/netzke/masquerade_selector.rb +1 -1
  65. data/locale/en.yml +16 -0
  66. data/netzke-basepack.gemspec +298 -0
  67. data/spec/active_record/attributes_spec.rb +14 -0
  68. data/spec/active_record/relation_extensions_spec.rb +44 -0
  69. data/spec/components/form_panel_spec.rb +70 -0
  70. data/spec/components/grid_panel_spec.rb +10 -0
  71. data/spec/factories.rb +9 -0
  72. data/spec/spec_helper.rb +35 -0
  73. data/test/rails_app/.gitignore +4 -0
  74. data/test/rails_app/Gemfile +32 -0
  75. data/test/rails_app/Gemfile.lock +171 -0
  76. data/test/rails_app/README +256 -0
  77. data/test/rails_app/Rakefile +7 -0
  78. data/test/rails_app/app/components/generic_user_form.rb +12 -0
  79. data/test/rails_app/app/components/simple_accordion.rb +11 -0
  80. data/test/rails_app/app/components/simple_basic_app.rb +32 -0
  81. data/test/rails_app/app/components/simple_panel.rb +17 -0
  82. data/test/rails_app/app/components/simple_tab_panel.rb +11 -0
  83. data/test/rails_app/app/components/simple_wrapper.rb +7 -0
  84. data/test/rails_app/app/components/some_border_layout.rb +24 -0
  85. data/test/rails_app/app/components/some_search_panel.rb +34 -0
  86. data/test/rails_app/app/components/some_tab_panel.rb +15 -0
  87. data/test/rails_app/app/components/user_form.rb +21 -0
  88. data/test/rails_app/app/components/user_form_with_default_fields.rb +8 -0
  89. data/test/rails_app/app/components/user_grid.rb +4 -0
  90. data/test/rails_app/app/components/window_component_loader.rb +17 -0
  91. data/test/{app_root/app/controllers/application.rb → rails_app/app/controllers/application_controller.rb} +1 -0
  92. data/test/rails_app/app/controllers/components_controller.rb +6 -0
  93. data/test/rails_app/app/controllers/welcome_controller.rb +5 -0
  94. data/test/rails_app/app/helpers/application_helper.rb +2 -0
  95. data/test/{app_root → rails_app}/app/models/role.rb +0 -0
  96. data/test/rails_app/app/models/user.rb +6 -0
  97. data/test/rails_app/app/presenters/forms/generic_user.rb +6 -0
  98. data/test/rails_app/app/views/layouts/application.html.erb +13 -0
  99. data/test/rails_app/config.ru +4 -0
  100. data/test/rails_app/config/application.rb +45 -0
  101. data/test/rails_app/config/boot.rb +13 -0
  102. data/test/rails_app/config/database.yml +35 -0
  103. data/test/rails_app/config/environment.rb +6 -0
  104. data/test/rails_app/config/environments/development.rb +22 -0
  105. data/test/rails_app/config/environments/production.rb +49 -0
  106. data/test/rails_app/config/environments/test.rb +35 -0
  107. data/test/rails_app/config/initializers/backtrace_silencers.rb +8 -0
  108. data/test/rails_app/config/initializers/inflections.rb +10 -0
  109. data/test/rails_app/config/initializers/mime_types.rb +5 -0
  110. data/test/rails_app/config/initializers/netzke.rb +7 -0
  111. data/test/rails_app/config/initializers/secret_token.rb +7 -0
  112. data/test/rails_app/config/initializers/session_store.rb +8 -0
  113. data/test/rails_app/config/locales/es.yml +12 -0
  114. data/test/rails_app/config/routes.rb +65 -0
  115. data/test/rails_app/db/development_structure.sql +39 -0
  116. data/test/{app_root/db/migrate/20081222035855_create_netzke_preferences.rb → rails_app/db/migrate/20100905214933_create_netzke_preferences.rb} +2 -4
  117. data/test/{app_root/db/migrate/20090423222114_create_users.rb → rails_app/db/migrate/20100914104207_create_users.rb} +4 -1
  118. data/test/{app_root/db/migrate/20090423214303_create_roles.rb → rails_app/db/migrate/20100914104236_create_roles.rb} +2 -0
  119. data/test/rails_app/db/schema.rb +38 -0
  120. data/test/rails_app/db/seeds.rb +20 -0
  121. data/test/rails_app/features/support/paths.rb +47 -0
  122. data/test/{app_root/config/environments/in_memory.rb → rails_app/lib/tasks/.gitkeep} +0 -0
  123. data/test/rails_app/public/404.html +26 -0
  124. data/test/rails_app/public/422.html +26 -0
  125. data/test/rails_app/public/500.html +26 -0
  126. data/test/{app_root/config/environments/mysql.rb → rails_app/public/favicon.ico} +0 -0
  127. data/test/rails_app/public/images/header-deco.gif +0 -0
  128. data/test/rails_app/public/images/rails.png +0 -0
  129. data/test/rails_app/public/javascripts/application.js +2 -0
  130. data/test/rails_app/public/javascripts/controls.js +965 -0
  131. data/test/rails_app/public/javascripts/dragdrop.js +974 -0
  132. data/test/rails_app/public/javascripts/effects.js +1123 -0
  133. data/test/rails_app/public/javascripts/prototype.js +6001 -0
  134. data/test/rails_app/public/javascripts/rails.js +175 -0
  135. data/test/rails_app/public/robots.txt +5 -0
  136. data/test/{app_root/config/environments/postgresql.rb → rails_app/public/stylesheets/.gitkeep} +0 -0
  137. data/test/rails_app/script/rails +6 -0
  138. data/test/rails_app/spec/models/role_spec.rb +5 -0
  139. data/test/rails_app/spec/models/user_spec.rb +5 -0
  140. data/test/rails_app/test/performance/browsing_test.rb +9 -0
  141. data/test/rails_app/test/test_helper.rb +13 -0
  142. data/test/{app_root/config/environments/sqlite.rb → rails_app/vendor/plugins/.gitkeep} +0 -0
  143. data/test/unit/accordion_panel_test.rb +3 -3
  144. data/test/unit/active_record_basepack_test.rb +4 -4
  145. data/test/unit/tab_panel_test.rb +4 -4
  146. metadata +199 -119
  147. data/lib/netzke/accordion_panel.rb +0 -115
  148. data/lib/netzke/active_record/data_accessor.rb +0 -25
  149. data/lib/netzke/attributes_configurator.rb +0 -195
  150. data/lib/netzke/basic_app.rb +0 -368
  151. data/lib/netzke/border_layout_panel.rb +0 -130
  152. data/lib/netzke/configuration_panel.rb +0 -24
  153. data/lib/netzke/form_panel.rb +0 -138
  154. data/lib/netzke/form_panel/form_panel_api.rb +0 -81
  155. data/lib/netzke/form_panel/form_panel_fields.rb +0 -149
  156. data/lib/netzke/form_panel/form_panel_js.rb +0 -163
  157. data/lib/netzke/grid_panel.rb +0 -367
  158. data/lib/netzke/grid_panel/grid_panel_api.rb +0 -364
  159. data/lib/netzke/grid_panel/grid_panel_columns.rb +0 -232
  160. data/lib/netzke/grid_panel/grid_panel_js.rb +0 -73
  161. data/lib/netzke/grid_panel/javascripts/advanced_search.js +0 -65
  162. data/lib/netzke/grid_panel/multi_edit_form.rb +0 -14
  163. data/lib/netzke/grid_panel/record_form_window.rb +0 -50
  164. data/lib/netzke/panel.rb +0 -11
  165. data/lib/netzke/plugins/configuration_tool.rb +0 -121
  166. data/lib/netzke/property_editor.rb +0 -111
  167. data/lib/netzke/property_editor/helper_model.rb +0 -122
  168. data/lib/netzke/search_panel.rb +0 -199
  169. data/lib/netzke/tab_panel.rb +0 -174
  170. data/lib/netzke/table_editor.rb +0 -118
  171. data/lib/netzke/tree_panel.rb +0 -25
  172. data/lib/netzke/window.rb +0 -82
  173. data/lib/netzke/wrapper.rb +0 -42
  174. data/test/app_root/app/models/book.rb +0 -9
  175. data/test/app_root/app/models/category.rb +0 -2
  176. data/test/app_root/app/models/city.rb +0 -3
  177. data/test/app_root/app/models/continent.rb +0 -2
  178. data/test/app_root/app/models/country.rb +0 -3
  179. data/test/app_root/app/models/genre.rb +0 -3
  180. data/test/app_root/app/models/user.rb +0 -3
  181. data/test/app_root/config/boot.rb +0 -114
  182. data/test/app_root/config/database.yml +0 -21
  183. data/test/app_root/config/environment.rb +0 -14
  184. data/test/app_root/config/environments/sqlite3.rb +0 -0
  185. data/test/app_root/config/routes.rb +0 -4
  186. data/test/app_root/db/migrate/20081222033343_create_books.rb +0 -15
  187. data/test/app_root/db/migrate/20081222033440_create_genres.rb +0 -15
  188. data/test/app_root/db/migrate/20081223024935_create_categories.rb +0 -13
  189. data/test/app_root/db/migrate/20081223025635_create_countries.rb +0 -14
  190. data/test/app_root/db/migrate/20081223025653_create_continents.rb +0 -13
  191. data/test/app_root/db/migrate/20081223025732_create_cities.rb +0 -15
  192. data/test/app_root/db/migrate/20090102223630_create_netzke_field_lists.rb +0 -18
  193. data/test/app_root/script/console +0 -7
  194. data/test/app_root/vendor/plugins/acts_as_list/README +0 -23
  195. data/test/app_root/vendor/plugins/acts_as_list/init.rb +0 -3
  196. data/test/app_root/vendor/plugins/acts_as_list/lib/active_record/acts/list.rb +0 -256
@@ -2,7 +2,7 @@ module Netzke
2
2
  # == FieldsConfigurator
3
3
  # Provides dynamic configuring columns/fields for GridPanel and FormPanel.
4
4
  # Configuration parameters:
5
- # * <tt>:widget</tt> - widget to configure columns/fields for
5
+ # * <tt>:component</tt> - component to configure columns/fields for
6
6
  class FieldsConfigurator < JsonArrayEditor
7
7
  api :load_defaults
8
8
 
@@ -14,20 +14,16 @@ module Netzke
14
14
  :header => false,
15
15
  :enable_extended_search => false,
16
16
  :enable_edit_in_form => false,
17
- :enable_rows_reordering => GridPanel.config[:rows_reordering_available],
17
+ :enable_rows_reordering => GridPanel.rows_reordering_available,
18
18
  :enable_pagination => false
19
19
  }
20
20
  })
21
21
  end
22
22
 
23
- def actions
24
- super.merge(
25
- :defaults => {:text => 'Restore defaults', :icon => Netzke::Base.config[:with_icons] && (Netzke::Base.config[:icons_uri] + "wand.png")}
26
- )
27
- end
23
+ action :defaults, {:text => 'Restore defaults', :icon => :wand}
28
24
 
29
25
  def default_bbar
30
- %w{ add edit apply del - defaults }
26
+ %w{ add edit apply del }.map(&:action) + "-" + [:defaults.action]
31
27
  end
32
28
 
33
29
  # Default columns for the configurator
@@ -40,7 +36,7 @@ module Netzke
40
36
  ]
41
37
  end
42
38
 
43
- def self.js_extend_properties
39
+ def self.js_properties
44
40
  {
45
41
  :init_component => <<-END_OF_JAVASCRIPT.l,
46
42
  function(){
@@ -26,7 +26,7 @@ module Netzke
26
26
  }]
27
27
  end
28
28
 
29
- def self.js_extend_properties
29
+ def self.js_properties
30
30
  {
31
31
  :after_constructor => <<-END_OF_JAVASCRIPT.l,
32
32
  function(){
data/locale/en.yml ADDED
@@ -0,0 +1,16 @@
1
+ en:
2
+ netzke:
3
+ basepack:
4
+ grid_panel:
5
+ add: Add
6
+ edit: Edit
7
+ delete: Delete
8
+ apply: Apply
9
+ add_in_form: Add in form
10
+ edit_in_form: Edit in form
11
+ search: Search
12
+
13
+ formats:
14
+ date: Y-m-d
15
+ datetime: Y-m-d H:i:s
16
+ time: H:i:s
@@ -0,0 +1,298 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{netzke-basepack}
8
+ s.version = "0.6.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Sergei Kozlov"]
12
+ s.date = %q{2010-10-24}
13
+ s.description = %q{A set of full-featured extendible Netzke components (such as FormPanel, GridPanel, Window, BorderLayoutPanel, etc) which can be used as building block for your RIA}
14
+ s.email = %q{sergei@playcode.nl}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".autotest",
21
+ ".gitignore",
22
+ "CHANGELOG.rdoc",
23
+ "LICENSE",
24
+ "README.rdoc",
25
+ "Rakefile",
26
+ "TODO.rdoc",
27
+ "app/components/netzke/basepack/accordion_panel.rb",
28
+ "app/components/netzke/basepack/basic_app.rb",
29
+ "app/components/netzke/basepack/basic_app/statusbar_ext.js",
30
+ "app/components/netzke/basepack/border_layout_panel.rb",
31
+ "app/components/netzke/basepack/form_panel.rb",
32
+ "app/components/netzke/basepack/form_panel/fields.rb",
33
+ "app/components/netzke/basepack/form_panel/javascripts/netzkefileupload.js",
34
+ "app/components/netzke/basepack/form_panel/javascripts/pre.js",
35
+ "app/components/netzke/basepack/form_panel/javascripts/xcheckbox.js",
36
+ "app/components/netzke/basepack/form_panel/services.rb",
37
+ "app/components/netzke/basepack/grid_panel.rb",
38
+ "app/components/netzke/basepack/grid_panel/columns.rb",
39
+ "app/components/netzke/basepack/grid_panel/javascript.rb",
40
+ "app/components/netzke/basepack/grid_panel/javascripts/advanced_search.js",
41
+ "app/components/netzke/basepack/grid_panel/javascripts/edit_in_form.js",
42
+ "app/components/netzke/basepack/grid_panel/javascripts/pre.js",
43
+ "app/components/netzke/basepack/grid_panel/javascripts/rows-dd.js",
44
+ "app/components/netzke/basepack/grid_panel/multi_edit_form.rb",
45
+ "app/components/netzke/basepack/grid_panel/record_form_window.rb",
46
+ "app/components/netzke/basepack/grid_panel/search_window.rb",
47
+ "app/components/netzke/basepack/grid_panel/services.rb",
48
+ "app/components/netzke/basepack/panel.rb",
49
+ "app/components/netzke/basepack/search_panel.rb",
50
+ "app/components/netzke/basepack/tab_panel.rb",
51
+ "app/components/netzke/basepack/window.rb",
52
+ "app/components/netzke/basepack/wrapper.rb",
53
+ "app/models/netzke_field_list.rb",
54
+ "app/models/netzke_model_attr_list.rb",
55
+ "app/models/netzke_persistent_array_auto_model.rb",
56
+ "autotest/discover.rb",
57
+ "config/database.yml",
58
+ "features/accordion_panel.feature",
59
+ "features/basic_app.feature",
60
+ "features/form_panel.feature",
61
+ "features/grid_panel.feature",
62
+ "features/search_in_grid.feature",
63
+ "features/simple_panel.feature",
64
+ "features/step_definitions/accordion_steps.rb",
65
+ "features/step_definitions/generic_steps.rb",
66
+ "features/step_definitions/grid_panel_steps.rb",
67
+ "features/step_definitions/pickle_steps.rb",
68
+ "features/step_definitions/web_steps.rb",
69
+ "features/support/env.rb",
70
+ "features/support/paths.rb",
71
+ "features/support/pickle.rb",
72
+ "features/tab_panel.feature",
73
+ "features/window.feature",
74
+ "from_05_to_06.rdoc",
75
+ "generators/netzke_basepack/netzke_basepack_generator.rb",
76
+ "generators/netzke_basepack/templates/create_netzke_field_lists.rb",
77
+ "generators/netzke_basepack/templates/public_assets/ts-checkbox.gif",
78
+ "init.rb",
79
+ "install.rb",
80
+ "javascripts/basepack.js",
81
+ "lib/netzke-basepack.rb",
82
+ "lib/netzke/active_record.rb",
83
+ "lib/netzke/active_record/association_attributes.rb",
84
+ "lib/netzke/active_record/attributes.rb",
85
+ "lib/netzke/active_record/combobox_options.rb",
86
+ "lib/netzke/active_record/relation_extensions.rb",
87
+ "lib/netzke/basepack.rb",
88
+ "lib/netzke/basepack/version.rb",
89
+ "lib/netzke/basepack/wrap_lazy_loaded.rb",
90
+ "lib/netzke/data_accessor.rb",
91
+ "lib/netzke/ext.rb",
92
+ "lib/netzke/fields_configurator.rb",
93
+ "lib/netzke/json_array_editor.rb",
94
+ "lib/netzke/masquerade_selector.rb",
95
+ "lib/tasks/netzke_basepack_tasks.rake",
96
+ "locale/en.yml",
97
+ "netzke-basepack.gemspec",
98
+ "spec/active_record/attributes_spec.rb",
99
+ "spec/active_record/relation_extensions_spec.rb",
100
+ "spec/components/form_panel_spec.rb",
101
+ "spec/components/grid_panel_spec.rb",
102
+ "spec/factories.rb",
103
+ "spec/spec_helper.rb",
104
+ "stylesheets/basepack.css",
105
+ "test/console_with_fixtures.rb",
106
+ "test/fixtures/books.yml",
107
+ "test/fixtures/categories.yml",
108
+ "test/fixtures/cities.yml",
109
+ "test/fixtures/continents.yml",
110
+ "test/fixtures/countries.yml",
111
+ "test/fixtures/genres.yml",
112
+ "test/fixtures/roles.yml",
113
+ "test/fixtures/users.yml",
114
+ "test/rails_app/.gitignore",
115
+ "test/rails_app/Gemfile",
116
+ "test/rails_app/Gemfile.lock",
117
+ "test/rails_app/README",
118
+ "test/rails_app/Rakefile",
119
+ "test/rails_app/app/components/generic_user_form.rb",
120
+ "test/rails_app/app/components/simple_accordion.rb",
121
+ "test/rails_app/app/components/simple_basic_app.rb",
122
+ "test/rails_app/app/components/simple_panel.rb",
123
+ "test/rails_app/app/components/simple_tab_panel.rb",
124
+ "test/rails_app/app/components/simple_wrapper.rb",
125
+ "test/rails_app/app/components/some_border_layout.rb",
126
+ "test/rails_app/app/components/some_search_panel.rb",
127
+ "test/rails_app/app/components/some_tab_panel.rb",
128
+ "test/rails_app/app/components/user_form.rb",
129
+ "test/rails_app/app/components/user_form_with_default_fields.rb",
130
+ "test/rails_app/app/components/user_grid.rb",
131
+ "test/rails_app/app/components/window_component_loader.rb",
132
+ "test/rails_app/app/controllers/application_controller.rb",
133
+ "test/rails_app/app/controllers/components_controller.rb",
134
+ "test/rails_app/app/controllers/welcome_controller.rb",
135
+ "test/rails_app/app/helpers/application_helper.rb",
136
+ "test/rails_app/app/models/role.rb",
137
+ "test/rails_app/app/models/user.rb",
138
+ "test/rails_app/app/presenters/forms/generic_user.rb",
139
+ "test/rails_app/app/views/layouts/application.html.erb",
140
+ "test/rails_app/config.ru",
141
+ "test/rails_app/config/application.rb",
142
+ "test/rails_app/config/boot.rb",
143
+ "test/rails_app/config/database.yml",
144
+ "test/rails_app/config/environment.rb",
145
+ "test/rails_app/config/environments/development.rb",
146
+ "test/rails_app/config/environments/production.rb",
147
+ "test/rails_app/config/environments/test.rb",
148
+ "test/rails_app/config/initializers/backtrace_silencers.rb",
149
+ "test/rails_app/config/initializers/inflections.rb",
150
+ "test/rails_app/config/initializers/mime_types.rb",
151
+ "test/rails_app/config/initializers/netzke.rb",
152
+ "test/rails_app/config/initializers/secret_token.rb",
153
+ "test/rails_app/config/initializers/session_store.rb",
154
+ "test/rails_app/config/locales/es.yml",
155
+ "test/rails_app/config/routes.rb",
156
+ "test/rails_app/db/development_structure.sql",
157
+ "test/rails_app/db/migrate/20100905214933_create_netzke_preferences.rb",
158
+ "test/rails_app/db/migrate/20100914104207_create_users.rb",
159
+ "test/rails_app/db/migrate/20100914104236_create_roles.rb",
160
+ "test/rails_app/db/schema.rb",
161
+ "test/rails_app/db/seeds.rb",
162
+ "test/rails_app/features/support/paths.rb",
163
+ "test/rails_app/lib/tasks/.gitkeep",
164
+ "test/rails_app/public/404.html",
165
+ "test/rails_app/public/422.html",
166
+ "test/rails_app/public/500.html",
167
+ "test/rails_app/public/favicon.ico",
168
+ "test/rails_app/public/images/header-deco.gif",
169
+ "test/rails_app/public/images/rails.png",
170
+ "test/rails_app/public/javascripts/application.js",
171
+ "test/rails_app/public/javascripts/controls.js",
172
+ "test/rails_app/public/javascripts/dragdrop.js",
173
+ "test/rails_app/public/javascripts/effects.js",
174
+ "test/rails_app/public/javascripts/prototype.js",
175
+ "test/rails_app/public/javascripts/rails.js",
176
+ "test/rails_app/public/robots.txt",
177
+ "test/rails_app/public/stylesheets/.gitkeep",
178
+ "test/rails_app/script/rails",
179
+ "test/rails_app/spec/models/role_spec.rb",
180
+ "test/rails_app/spec/models/user_spec.rb",
181
+ "test/rails_app/test/performance/browsing_test.rb",
182
+ "test/rails_app/test/test_helper.rb",
183
+ "test/rails_app/tmp/restart.txt",
184
+ "test/rails_app/vendor/plugins/.gitkeep",
185
+ "test/schema.rb",
186
+ "test/test_helper.rb",
187
+ "test/unit/accordion_panel_test.rb",
188
+ "test/unit/active_record_basepack_test.rb",
189
+ "test/unit/fields_configuration_test.rb",
190
+ "test/unit/grid_panel_test.rb",
191
+ "test/unit/netzke_basepack_test.rb",
192
+ "test/unit/tab_panel_test.rb",
193
+ "uninstall.rb"
194
+ ]
195
+ s.homepage = %q{http://github.com/skozlov/netzke-basepack}
196
+ s.post_install_message = %q{
197
+ ========================================================================
198
+
199
+ Thanks for installing Netzke Basepack!
200
+
201
+ Don't forget to run "./script/generate netzke_basepack" for each
202
+ Rails app that will be using this gem.
203
+
204
+ Netzke home page: http://netzke.org
205
+ Netzke Google Groups: http://groups.google.com/group/netzke
206
+ Netzke tutorials: http://blog.writelesscode.com
207
+
208
+ ========================================================================
209
+
210
+ }
211
+ s.rdoc_options = ["--charset=UTF-8"]
212
+ s.require_paths = ["lib"]
213
+ s.rubygems_version = %q{1.3.7}
214
+ s.summary = %q{Pre-built Rails + ExtJS components for your RIA}
215
+ s.test_files = [
216
+ "spec/active_record/attributes_spec.rb",
217
+ "spec/active_record/relation_extensions_spec.rb",
218
+ "spec/components/form_panel_spec.rb",
219
+ "spec/components/grid_panel_spec.rb",
220
+ "spec/factories.rb",
221
+ "spec/spec_helper.rb",
222
+ "test/console_with_fixtures.rb",
223
+ "test/rails_app/app/components/generic_user_form.rb",
224
+ "test/rails_app/app/components/simple_accordion.rb",
225
+ "test/rails_app/app/components/simple_basic_app.rb",
226
+ "test/rails_app/app/components/simple_panel.rb",
227
+ "test/rails_app/app/components/simple_tab_panel.rb",
228
+ "test/rails_app/app/components/simple_wrapper.rb",
229
+ "test/rails_app/app/components/some_border_layout.rb",
230
+ "test/rails_app/app/components/some_search_panel.rb",
231
+ "test/rails_app/app/components/some_tab_panel.rb",
232
+ "test/rails_app/app/components/user_form.rb",
233
+ "test/rails_app/app/components/user_form_with_default_fields.rb",
234
+ "test/rails_app/app/components/user_grid.rb",
235
+ "test/rails_app/app/components/window_component_loader.rb",
236
+ "test/rails_app/app/controllers/application_controller.rb",
237
+ "test/rails_app/app/controllers/components_controller.rb",
238
+ "test/rails_app/app/controllers/welcome_controller.rb",
239
+ "test/rails_app/app/helpers/application_helper.rb",
240
+ "test/rails_app/app/models/role.rb",
241
+ "test/rails_app/app/models/user.rb",
242
+ "test/rails_app/app/presenters/forms/generic_user.rb",
243
+ "test/rails_app/config/application.rb",
244
+ "test/rails_app/config/boot.rb",
245
+ "test/rails_app/config/environment.rb",
246
+ "test/rails_app/config/environments/development.rb",
247
+ "test/rails_app/config/environments/production.rb",
248
+ "test/rails_app/config/environments/test.rb",
249
+ "test/rails_app/config/initializers/backtrace_silencers.rb",
250
+ "test/rails_app/config/initializers/inflections.rb",
251
+ "test/rails_app/config/initializers/mime_types.rb",
252
+ "test/rails_app/config/initializers/netzke.rb",
253
+ "test/rails_app/config/initializers/secret_token.rb",
254
+ "test/rails_app/config/initializers/session_store.rb",
255
+ "test/rails_app/config/routes.rb",
256
+ "test/rails_app/db/migrate/20100905214933_create_netzke_preferences.rb",
257
+ "test/rails_app/db/migrate/20100914104207_create_users.rb",
258
+ "test/rails_app/db/migrate/20100914104236_create_roles.rb",
259
+ "test/rails_app/db/schema.rb",
260
+ "test/rails_app/db/seeds.rb",
261
+ "test/rails_app/features/support/paths.rb",
262
+ "test/rails_app/spec/models/role_spec.rb",
263
+ "test/rails_app/spec/models/user_spec.rb",
264
+ "test/rails_app/test/performance/browsing_test.rb",
265
+ "test/rails_app/test/test_helper.rb",
266
+ "test/schema.rb",
267
+ "test/test_helper.rb",
268
+ "test/unit/accordion_panel_test.rb",
269
+ "test/unit/active_record_basepack_test.rb",
270
+ "test/unit/fields_configuration_test.rb",
271
+ "test/unit/grid_panel_test.rb",
272
+ "test/unit/netzke_basepack_test.rb",
273
+ "test/unit/tab_panel_test.rb"
274
+ ]
275
+
276
+ if s.respond_to? :specification_version then
277
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
278
+ s.specification_version = 3
279
+
280
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
281
+ s.add_runtime_dependency(%q<netzke-core>, ["~> 0.6.0"])
282
+ s.add_runtime_dependency(%q<meta_where>, [">= 0.9.3"])
283
+ s.add_runtime_dependency(%q<will_paginate>, ["~> 3.0.pre2"])
284
+ s.add_runtime_dependency(%q<acts_as_list>, [">= 0"])
285
+ else
286
+ s.add_dependency(%q<netzke-core>, ["~> 0.6.0"])
287
+ s.add_dependency(%q<meta_where>, [">= 0.9.3"])
288
+ s.add_dependency(%q<will_paginate>, ["~> 3.0.pre2"])
289
+ s.add_dependency(%q<acts_as_list>, [">= 0"])
290
+ end
291
+ else
292
+ s.add_dependency(%q<netzke-core>, ["~> 0.6.0"])
293
+ s.add_dependency(%q<meta_where>, [">= 0.9.3"])
294
+ s.add_dependency(%q<will_paginate>, ["~> 3.0.pre2"])
295
+ s.add_dependency(%q<acts_as_list>, [">= 0"])
296
+ end
297
+ end
298
+
@@ -0,0 +1,14 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ describe Netzke::ActiveRecord::Attributes do
4
+ it "should return Netzke attributes in natural order" do
5
+ User.send(:netzke_attrs_in_natural_order).map{ |a| a[:name] }.should == %w(id first_name last_name role__name created_at updated_at)
6
+ end
7
+
8
+ it "should return exposed Netzke attributes" do
9
+ class UserExt < User
10
+ netzke_expose_attributes :first_name, :created_at
11
+ end
12
+ UserExt.netzke_attributes.map{ |a| a[:name] }.should == %w(id first_name created_at)
13
+ end
14
+ end
@@ -0,0 +1,44 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ describe Netzke::ActiveRecord::RelationExtensions do
4
+ it "should accept different options in extend_with" do
5
+ # Preparations
6
+ 10.times do |i|
7
+ Factory(:user, :first_name => "First Name #{i}", :role_id => i)
8
+ end
9
+
10
+ User.scope(:role_id_gt_7, User.where(["role_id > ?", 7]))
11
+ User.scope(:role_id_gt, lambda{ |param| User.where(["role_id > ?", param]) })
12
+
13
+ # Tests
14
+ User.where({}).extend_with(["role_id >= ?", 5]).count.should == 5
15
+
16
+ User.where({}).extend_with(:role_id_gt_7).count.should == 2
17
+
18
+ User.where({}).extend_with(:role_id_gt, 2).count.should == 7
19
+
20
+ User.where({}).extend_with([:role_id_gt, 3]).count.should == 6
21
+
22
+ User.where({}).extend_with(:role_id => 5).first.first_name.should == "First Name 5"
23
+
24
+ User.where(["role_id < ?", 7]).extend_with(lambda{ |relation| relation.where(["role_id > ?", 4]) }).count.should == 2
25
+
26
+ # User.where({}).extend_with("select * from users where role_id > 6").all.size.should == 3
27
+
28
+ end
29
+
30
+ it "should be extendable with extend_with_netzke_conditions" do
31
+ # Preparations
32
+ roles = [Factory(:role, :name => "admin"), Factory(:role, :name => "user"), Factory(:role, :name => "superadmin")]
33
+
34
+ # 3 users of each role
35
+ 9.times do |i|
36
+ Factory(:user, :role_id => roles[i%3].id)
37
+ end
38
+
39
+ # Tests
40
+ User.where({}).extend_with_netzke_conditions(:role_id__eq => roles.last.id).count.should == 3
41
+ User.where({}).extend_with_netzke_conditions(:role__name__eq => "admin").count.should == 3
42
+ User.where({}).extend_with_netzke_conditions(:role__name__like => "%admin%").count.should == 6
43
+ end
44
+ end
@@ -0,0 +1,70 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ describe Netzke::Basepack::FormPanel do
4
+ it "should have correct fields" do
5
+ form = Netzke::Basepack::FormPanel.new(:model => 'User')
6
+ form.fields_from_model.keys.map(&:to_s).sort.should == %w(created_at first_name id last_name role__name updated_at)
7
+ end
8
+
9
+ it "should extract fields from config" do
10
+ form = Netzke::Basepack::FormPanel.new(:model => 'User', :items => [{:xtype => 'fieldset', :items => [:first_name, {:name => "last_name"}]}, :created_at, {:name => :updated_at}])
11
+
12
+ form.fields_from_config.keys.map(&:to_s).sort.should == %w(created_at first_name id last_name updated_at)
13
+ end
14
+
15
+ it "should set correct xtype for columns" do
16
+ form = Netzke::Basepack::FormPanel.new(:model => 'User', :items => [:first_name, :created_at, :role__name])
17
+
18
+ form.fields[:first_name][:xtype].should == :textfield
19
+ form.fields[:created_at][:xtype].should == :xdatetime
20
+ form.fields[:role__name][:xtype].should == :combobox
21
+ end
22
+
23
+ it "should set correct default field labels" do
24
+ form = Netzke::Basepack::FormPanel.new(:model => 'User', :items => [:first_name, :created_at, :role__name])
25
+
26
+ form.fields[:first_name][:field_label].should == "First name"
27
+ form.fields[:created_at][:field_label].should == "Created at"
28
+ form.fields[:role__name][:field_label].should == "Role name"
29
+ end
30
+
31
+ it "should set correct field values" do
32
+ role = Factory(:role, :name => "warrior")
33
+ user = Factory(:user, :first_name => "Carlos", :last_name => "Castaneda", :role => role)
34
+
35
+ form = Netzke::Basepack::FormPanel.new(:model => 'User', :record => user, :items => [:first_name, :last_name, :role__name])
36
+
37
+ form.fields[:first_name][:value].should == "Carlos"
38
+ form.fields[:last_name][:value].should == "Castaneda"
39
+ form.fields[:role__name][:value].should == "warrior"
40
+ end
41
+
42
+ it "should add primary key field automatically when omitted" do
43
+ form = Netzke::Basepack::FormPanel.new(:model => 'User', :items => [:first_name, :last_name, :role__name])
44
+ form.fields[:id].should_not be_nil
45
+ end
46
+
47
+ it "should pass normalized items to JS" do
48
+ form = Netzke::Basepack::FormPanel.new(:model => 'User', :items => [
49
+ {:xtype => 'fieldset', :items => [
50
+ :first_name,
51
+ {:name => "last_name"}
52
+ ]},
53
+ :created_at,
54
+ {:name => :updated_at}
55
+ ])
56
+
57
+ form.items[0][:name].should == "id"
58
+ form.items[1][:items][0][:name].should == "first_name"
59
+ form.items[1][:items][1][:name].should == "last_name"
60
+ form.items[2][:name].should == "created_at"
61
+ form.items[3][:name].should == "updated_at"
62
+ end
63
+
64
+ it "should detect association column" do
65
+ form = Netzke::Basepack::FormPanel.new(:model => 'User', :items => [:role_id])
66
+
67
+ form.items[1][:name].should == "role__name"
68
+ end
69
+
70
+ end