netzke-basepack 0.7.7 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (192) hide show
  1. data/.travis.yml +15 -10
  2. data/{CHANGELOG.rdoc → CHANGELOG.md} +146 -110
  3. data/LICENSE +7 -1
  4. data/README.md +47 -56
  5. data/Rakefile +5 -5
  6. data/config/before-travis.sh +10 -0
  7. data/javascripts/basepack.js +0 -130
  8. data/javascripts/netzkeremotecombo.js +59 -0
  9. data/lib/netzke/basepack.rb +9 -14
  10. data/lib/netzke/basepack/accordion.rb +45 -0
  11. data/lib/netzke/basepack/active_record.rb +12 -0
  12. data/lib/netzke/basepack/active_record/relation_extensions.rb +27 -0
  13. data/lib/netzke/basepack/columns.rb +309 -0
  14. data/lib/netzke/basepack/data_accessor.rb +22 -12
  15. data/lib/netzke/basepack/data_adapters/abstract_adapter.rb +75 -11
  16. data/lib/netzke/basepack/data_adapters/active_record_adapter.rb +154 -49
  17. data/lib/netzke/basepack/fields.rb +162 -0
  18. data/lib/netzke/basepack/form.rb +136 -0
  19. data/lib/netzke/basepack/{form_panel → form}/javascripts/comma_list_cbg.js +0 -1
  20. data/lib/netzke/basepack/{form_panel/javascripts/form_panel.js → form/javascripts/form.js} +20 -26
  21. data/lib/netzke/basepack/{form_panel → form}/javascripts/n_radio_group.js +0 -1
  22. data/lib/netzke/basepack/{form_panel → form}/javascripts/readonly_mode.js +0 -0
  23. data/lib/netzke/basepack/form/services.rb +115 -0
  24. data/lib/netzke/basepack/{form_panel → form}/stylesheets/readonly_mode.css +0 -0
  25. data/lib/netzke/basepack/grid.rb +355 -0
  26. data/lib/netzke/basepack/{grid_panel → grid}/javascripts/advanced_search.js +1 -1
  27. data/lib/netzke/basepack/{grid_panel → grid}/javascripts/check_column_fix.js +0 -0
  28. data/lib/netzke/basepack/{grid_panel → grid}/javascripts/edit_in_form.js +3 -3
  29. data/lib/netzke/basepack/{grid_panel → grid}/javascripts/event_handling.js +5 -2
  30. data/lib/netzke/basepack/{grid_panel/javascripts/grid_panel.js → grid/javascripts/grid.js} +120 -132
  31. data/lib/netzke/basepack/{grid_panel → grid}/javascripts/misc.js +0 -0
  32. data/lib/netzke/basepack/grid/services.rb +216 -0
  33. data/lib/netzke/basepack/item_persistence.rb +44 -0
  34. data/lib/netzke/basepack/item_persistence/events_plugin.rb +47 -0
  35. data/lib/netzke/basepack/{paging_form_panel.rb → paging_form.rb} +24 -30
  36. data/lib/netzke/basepack/{paging_form_panel/javascripts/paging_form_panel.js → paging_form/javascripts/paging_form.js} +2 -4
  37. data/lib/netzke/basepack/query_builder.rb +44 -73
  38. data/lib/netzke/basepack/query_builder/javascripts/query_builder.js +16 -2
  39. data/lib/netzke/basepack/record_form_window.rb +67 -0
  40. data/lib/netzke/basepack/search_panel.rb +22 -24
  41. data/lib/netzke/basepack/search_panel/javascripts/condition_field.js +2 -2
  42. data/lib/netzke/basepack/search_window.rb +47 -53
  43. data/lib/netzke/basepack/simple_app.rb +10 -13
  44. data/lib/netzke/basepack/simple_app/javascripts/simple_app.js +2 -8
  45. data/lib/netzke/basepack/tab_panel.rb +5 -4
  46. data/lib/netzke/basepack/tab_panel/javascripts/tab_panel.js +5 -5
  47. data/lib/netzke/basepack/version.rb +2 -2
  48. data/lib/netzke/basepack/viewport.rb +16 -0
  49. data/lib/netzke/basepack/window.rb +27 -18
  50. data/lib/netzke/basepack/window/javascripts/window.js +7 -1
  51. data/lib/netzke/basepack/wrap_lazy_loaded.rb +18 -18
  52. data/locales/en.yml +40 -24
  53. data/netzke-basepack.gemspec +51 -82
  54. data/stylesheets/basepack.css +0 -41
  55. data/test/basepack_test_app/Gemfile +9 -46
  56. data/test/basepack_test_app/Gemfile.lock +61 -96
  57. data/test/basepack_test_app/app/components/author_form.rb +8 -5
  58. data/test/basepack_test_app/app/components/author_grid.rb +2 -2
  59. data/test/basepack_test_app/app/components/book_form.rb +34 -31
  60. data/test/basepack_test_app/app/components/book_form_with_defaults.rb +6 -7
  61. data/test/basepack_test_app/app/components/book_form_with_file_upload.rb +10 -0
  62. data/test/basepack_test_app/app/components/book_form_with_nested_attributes.rb +5 -6
  63. data/test/basepack_test_app/app/components/book_grid.rb +19 -8
  64. data/test/basepack_test_app/app/components/book_grid_filtering.rb +4 -7
  65. data/test/basepack_test_app/app/components/book_grid_loader.rb +28 -15
  66. data/test/basepack_test_app/app/components/book_grid_with_custom_columns.rb +45 -21
  67. data/test/basepack_test_app/app/components/book_grid_with_default_values.rb +26 -8
  68. data/test/basepack_test_app/app/components/book_grid_with_excluded_columns.rb +11 -0
  69. data/test/basepack_test_app/app/components/book_grid_with_extra_feedback.rb +2 -2
  70. data/test/basepack_test_app/app/components/book_grid_with_extra_filters.rb +7 -6
  71. data/test/basepack_test_app/app/components/book_grid_with_mass_assignment_security.rb +9 -0
  72. data/test/basepack_test_app/app/components/book_grid_with_nested_attributes.rb +9 -9
  73. data/test/basepack_test_app/app/components/book_grid_with_overridden_columns.rb +5 -3
  74. data/test/basepack_test_app/app/components/book_grid_with_paging.rb +6 -8
  75. data/test/basepack_test_app/app/components/book_grid_with_persistence.rb +6 -4
  76. data/test/basepack_test_app/app/components/book_grid_with_scope.rb +6 -0
  77. data/test/basepack_test_app/app/components/book_grid_with_scoped_authors.rb +10 -7
  78. data/test/basepack_test_app/app/components/book_grid_with_virtual_attributes.rb +21 -13
  79. data/test/basepack_test_app/app/components/book_paging_form.rb +21 -0
  80. data/test/basepack_test_app/app/components/book_query_builder.rb +7 -6
  81. data/test/basepack_test_app/app/components/book_with_custom_primary_key_grid.rb +6 -7
  82. data/test/basepack_test_app/app/components/books_bound_to_author.rb +9 -7
  83. data/test/basepack_test_app/app/components/border_layout_panel_with_persistence.rb +12 -0
  84. data/test/basepack_test_app/app/components/double_book_grid.rb +19 -14
  85. data/test/basepack_test_app/app/components/form_without_model.rb +15 -16
  86. data/test/basepack_test_app/app/components/grid_with_initial_sorting.rb +7 -0
  87. data/test/basepack_test_app/app/components/grid_with_inline_data.rb +7 -0
  88. data/test/basepack_test_app/app/components/paging_form_with_search.rb +2 -2
  89. data/test/basepack_test_app/app/components/panel_with_persistent_regions.rb +35 -0
  90. data/test/basepack_test_app/app/components/query_builder.rb +7 -0
  91. data/test/basepack_test_app/app/components/simple_panel.rb +16 -11
  92. data/test/basepack_test_app/app/components/simple_window.rb +7 -6
  93. data/test/basepack_test_app/app/components/some_accordion.rb +18 -0
  94. data/test/basepack_test_app/app/components/some_auth_app.rb +5 -5
  95. data/test/basepack_test_app/app/components/some_border_layout.rb +20 -20
  96. data/test/basepack_test_app/app/components/some_search_panel.rb +6 -0
  97. data/test/basepack_test_app/app/components/some_simple_app.rb +30 -16
  98. data/test/basepack_test_app/app/components/some_tab_panel.rb +18 -15
  99. data/test/basepack_test_app/app/components/user_form.rb +18 -16
  100. data/test/basepack_test_app/app/components/user_form_with_default_fields.rb +5 -6
  101. data/test/basepack_test_app/app/components/user_grid.rb +11 -6
  102. data/test/basepack_test_app/app/components/user_grid_with_customized_form_fields.rb +5 -3
  103. data/test/basepack_test_app/app/components/window_component_loader.rb +25 -21
  104. data/test/basepack_test_app/app/models/address.rb +0 -26
  105. data/test/basepack_test_app/app/models/author.rb +0 -31
  106. data/test/basepack_test_app/app/models/book.rb +1 -42
  107. data/test/basepack_test_app/app/models/book_with_custom_primary_key.rb +1 -23
  108. data/test/basepack_test_app/app/models/role.rb +0 -21
  109. data/test/basepack_test_app/app/models/user.rb +0 -24
  110. data/test/basepack_test_app/app/views/layouts/components.html.erb +1 -1
  111. data/test/basepack_test_app/config/application.rb +1 -1
  112. data/test/basepack_test_app/config/database.yml.travis +2 -6
  113. data/test/basepack_test_app/config/initializers/netzke.rb +1 -6
  114. data/test/basepack_test_app/db/schema.rb +14 -14
  115. data/test/basepack_test_app/features/accordion_panel.feature +2 -2
  116. data/test/basepack_test_app/features/form_panel.feature +7 -7
  117. data/test/basepack_test_app/features/grid_panel.feature +93 -39
  118. data/test/basepack_test_app/features/grid_panel_with_custom_primary_key.feature +2 -1
  119. data/test/basepack_test_app/features/grid_sorting.feature +30 -6
  120. data/test/basepack_test_app/features/paging_form_panel.feature +7 -7
  121. data/test/basepack_test_app/features/persistent_regions.feature +30 -0
  122. data/test/basepack_test_app/features/search_in_grid.feature +5 -5
  123. data/test/basepack_test_app/features/simple_app.feature +6 -7
  124. data/test/basepack_test_app/features/step_definitions/form_panel_steps.rb +1 -1
  125. data/test/basepack_test_app/features/step_definitions/generic_steps.rb +109 -4
  126. data/test/basepack_test_app/features/step_definitions/grid_panel_steps.rb +8 -10
  127. data/test/basepack_test_app/features/step_definitions/window_steps.rb +27 -0
  128. data/test/basepack_test_app/features/tab_panel.feature +1 -1
  129. data/test/basepack_test_app/features/window.feature +17 -0
  130. data/test/unit/accordion_panel_test.rb +2 -2
  131. data/test/unit/grid_panel_test.rb +4 -4
  132. metadata +57 -83
  133. data/TODO.rdoc +0 -8
  134. data/lib/generators/netzke/basepack_generator.rb +0 -10
  135. data/lib/generators/netzke/templates/assets/ts-checkbox.gif +0 -0
  136. data/lib/generators/netzke/templates/create_netzke_field_lists.rb +0 -18
  137. data/lib/netzke/active_record.rb +0 -20
  138. data/lib/netzke/active_record/attributes.rb +0 -259
  139. data/lib/netzke/active_record/combobox_options.rb +0 -16
  140. data/lib/netzke/active_record/relation_extensions.rb +0 -37
  141. data/lib/netzke/basepack/accordion_panel.rb +0 -39
  142. data/lib/netzke/basepack/action_column.rb +0 -68
  143. data/lib/netzke/basepack/action_column/javascripts/action_column.js +0 -61
  144. data/lib/netzke/basepack/auth_app.rb +0 -159
  145. data/lib/netzke/basepack/basic_app.rb +0 -7
  146. data/lib/netzke/basepack/border_layout_panel.rb +0 -53
  147. data/lib/netzke/basepack/border_layout_panel/javascripts/border_layout_panel.js +0 -40
  148. data/lib/netzke/basepack/data_adapters/data_mapper_adapter.rb +0 -264
  149. data/lib/netzke/basepack/data_adapters/sequel_adapter.rb +0 -260
  150. data/lib/netzke/basepack/form_panel.rb +0 -144
  151. data/lib/netzke/basepack/form_panel/fields.rb +0 -208
  152. data/lib/netzke/basepack/form_panel/javascripts/misc.js +0 -4
  153. data/lib/netzke/basepack/form_panel/services.rb +0 -142
  154. data/lib/netzke/basepack/grid_panel.rb +0 -441
  155. data/lib/netzke/basepack/grid_panel/columns.rb +0 -400
  156. data/lib/netzke/basepack/grid_panel/javascripts/rows-dd.js +0 -281
  157. data/lib/netzke/basepack/grid_panel/record_form_window.rb +0 -41
  158. data/lib/netzke/basepack/grid_panel/services.rb +0 -235
  159. data/lib/netzke/basepack/panel.rb +0 -11
  160. data/lib/netzke/basepack/wrapper.rb +0 -28
  161. data/lib/netzke/data_mapper.rb +0 -18
  162. data/lib/netzke/data_mapper/attributes.rb +0 -273
  163. data/lib/netzke/data_mapper/combobox_options.rb +0 -11
  164. data/lib/netzke/data_mapper/relation_extensions.rb +0 -38
  165. data/lib/netzke/sequel.rb +0 -18
  166. data/lib/netzke/sequel/attributes.rb +0 -274
  167. data/lib/netzke/sequel/combobox_options.rb +0 -10
  168. data/lib/netzke/sequel/relation_extensions.rb +0 -40
  169. data/locales/zh-cn.yml +0 -79
  170. data/test/basepack_test_app/app/components/book_form_with_custom_fields.rb +0 -21
  171. data/test/basepack_test_app/app/components/book_grid_with_column_actions.rb +0 -15
  172. data/test/basepack_test_app/app/components/book_grid_with_defaults.rb +0 -6
  173. data/test/basepack_test_app/app/components/book_paging_form_panel.rb +0 -22
  174. data/test/basepack_test_app/app/components/generic_user_form.rb +0 -12
  175. data/test/basepack_test_app/app/components/simple_accordion.rb +0 -11
  176. data/test/basepack_test_app/app/components/simple_tab_panel.rb +0 -11
  177. data/test/basepack_test_app/app/components/simple_wrapper.rb +0 -7
  178. data/test/basepack_test_app/app/components/some_accordion_panel.rb +0 -22
  179. data/test/basepack_test_app/app/presenters/forms/generic_user.rb +0 -6
  180. data/test/basepack_test_app/app/views/components/loadable_window.html.erb +0 -9
  181. data/test/basepack_test_app/app/views/components/simple_panel.html.erb +0 -1
  182. data/test/basepack_test_app/features/components_in_view.feature +0 -11
  183. data/test/basepack_test_app/features/simple_panel.feature +0 -11
  184. data/test/basepack_test_app/features/validations_in_grid.feature +0 -13
  185. data/test/basepack_test_app/features/virtual_attributes.feature +0 -16
  186. data/test/basepack_test_app/spec/components/form_panel_spec.rb +0 -53
  187. data/test/basepack_test_app/spec/components/grid_panel_spec.rb +0 -10
  188. data/test/basepack_test_app/spec/data_adapter/adapter_spec.rb +0 -68
  189. data/test/basepack_test_app/spec/data_adapter/attributes_spec.rb +0 -56
  190. data/test/basepack_test_app/spec/data_adapter/relation_extensions_spec.rb +0 -125
  191. data/test/basepack_test_app/spec/factories.rb +0 -28
  192. data/test/basepack_test_app/spec/spec_helper.rb +0 -39
@@ -1,69 +1,52 @@
1
1
  GIT
2
- remote: git://github.com/NZX/pickle.git
3
- revision: 71421eb9de6aaa81268fb9aa73682c05d3b4cb74
2
+ remote: git://github.com/nomadcoder/netzke-core.git
3
+ revision: 74e19672cd7c270415714f1805f09b3262e577bc
4
4
  specs:
5
- pickle (0.4.4)
6
- cucumber (>= 0.8)
7
- rake
8
- rspec (>= 1.3)
9
- yard
10
-
11
- PATH
12
- remote: vendor/gems/netzke-core
13
- specs:
14
- netzke-core (0.7.6)
5
+ netzke-core (0.8.0)
15
6
  activesupport (>= 3.0.0)
16
7
 
17
- PATH
18
- remote: vendor/gems/netzke-persistence
19
- specs:
20
- netzke-persistence (0.1.0)
21
-
22
8
  GEM
23
9
  remote: http://rubygems.org/
24
10
  specs:
25
- actionmailer (3.2.1)
26
- actionpack (= 3.2.1)
27
- mail (~> 2.4.0)
28
- actionpack (3.2.1)
29
- activemodel (= 3.2.1)
30
- activesupport (= 3.2.1)
11
+ actionmailer (3.2.9)
12
+ actionpack (= 3.2.9)
13
+ mail (~> 2.4.4)
14
+ actionpack (3.2.9)
15
+ activemodel (= 3.2.9)
16
+ activesupport (= 3.2.9)
31
17
  builder (~> 3.0.0)
32
18
  erubis (~> 2.7.0)
33
- journey (~> 1.0.1)
19
+ journey (~> 1.0.4)
34
20
  rack (~> 1.4.0)
35
- rack-cache (~> 1.1)
21
+ rack-cache (~> 1.2)
36
22
  rack-test (~> 0.6.1)
37
- sprockets (~> 2.1.2)
38
- activemodel (3.2.1)
39
- activesupport (= 3.2.1)
23
+ sprockets (~> 2.2.1)
24
+ activemodel (3.2.9)
25
+ activesupport (= 3.2.9)
40
26
  builder (~> 3.0.0)
41
- activerecord (3.2.1)
42
- activemodel (= 3.2.1)
43
- activesupport (= 3.2.1)
44
- arel (~> 3.0.0)
27
+ activerecord (3.2.9)
28
+ activemodel (= 3.2.9)
29
+ activesupport (= 3.2.9)
30
+ arel (~> 3.0.2)
45
31
  tzinfo (~> 0.3.29)
46
- activeresource (3.2.1)
47
- activemodel (= 3.2.1)
48
- activesupport (= 3.2.1)
49
- activesupport (3.2.1)
32
+ activeresource (3.2.9)
33
+ activemodel (= 3.2.9)
34
+ activesupport (= 3.2.9)
35
+ activesupport (3.2.9)
50
36
  i18n (~> 0.6)
51
37
  multi_json (~> 1.0)
52
38
  addressable (2.3.2)
53
39
  arel (3.0.2)
54
- builder (3.0.3)
55
- capybara (1.1.2)
40
+ builder (3.0.4)
41
+ capybara (1.1.4)
56
42
  mime-types (>= 1.16)
57
43
  nokogiri (>= 1.3.3)
58
44
  rack (>= 1.0.0)
59
45
  rack-test (>= 0.5.4)
60
46
  selenium-webdriver (~> 2.0)
61
47
  xpath (~> 0.1.4)
62
- capybara-screenshot (0.2.2)
63
- capybara (>= 1.0)
64
- childprocess (0.3.5)
48
+ childprocess (0.3.6)
65
49
  ffi (~> 1.0, >= 1.0.6)
66
- coderay (1.0.8)
67
50
  cucumber (1.2.1)
68
51
  builder (>= 2.1.2)
69
52
  diff-lcs (>= 1.1.3)
@@ -73,14 +56,12 @@ GEM
73
56
  capybara (>= 1.1.2)
74
57
  cucumber (>= 1.1.8)
75
58
  nokogiri (>= 1.5.0)
76
- daemons (1.1.9)
77
59
  database_cleaner (0.9.1)
78
60
  diff-lcs (1.1.3)
79
61
  erubis (2.7.0)
80
- eventmachine (1.0.0)
81
62
  factory_girl (4.1.0)
82
63
  activesupport (>= 3.0.0)
83
- ffi (1.1.5)
64
+ ffi (1.2.0)
84
65
  gherkin (2.11.5)
85
66
  json (>= 1.4.6)
86
67
  hike (1.2.1)
@@ -89,22 +70,20 @@ GEM
89
70
  json (1.7.5)
90
71
  launchy (2.1.2)
91
72
  addressable (~> 2.3)
92
- libwebsocket (0.1.5)
93
- addressable
73
+ libwebsocket (0.1.6.1)
74
+ websocket
94
75
  mail (2.4.4)
95
76
  i18n (>= 0.4.0)
96
77
  mime-types (~> 1.16)
97
78
  treetop (~> 1.4.8)
98
- method_source (0.8)
99
79
  mime-types (1.19)
100
- multi_json (1.3.6)
80
+ multi_json (1.3.7)
101
81
  mysql2 (0.3.11)
102
82
  nokogiri (1.5.5)
83
+ pickle (0.4.11)
84
+ cucumber (>= 0.8)
85
+ rake
103
86
  polyglot (0.3.3)
104
- pry (0.9.10)
105
- coderay (~> 1.0.5)
106
- method_source (~> 0.8)
107
- slop (~> 3.3.1)
108
87
  rack (1.4.1)
109
88
  rack-cache (1.2)
110
89
  rack (>= 0.4)
@@ -112,72 +91,62 @@ GEM
112
91
  rack
113
92
  rack-test (0.6.2)
114
93
  rack (>= 1.0)
115
- rails (3.2.1)
116
- actionmailer (= 3.2.1)
117
- actionpack (= 3.2.1)
118
- activerecord (= 3.2.1)
119
- activeresource (= 3.2.1)
120
- activesupport (= 3.2.1)
94
+ rails (3.2.9)
95
+ actionmailer (= 3.2.9)
96
+ actionpack (= 3.2.9)
97
+ activerecord (= 3.2.9)
98
+ activeresource (= 3.2.9)
99
+ activesupport (= 3.2.9)
121
100
  bundler (~> 1.0)
122
- railties (= 3.2.1)
123
- railties (3.2.1)
124
- actionpack (= 3.2.1)
125
- activesupport (= 3.2.1)
101
+ railties (= 3.2.9)
102
+ railties (3.2.9)
103
+ actionpack (= 3.2.9)
104
+ activesupport (= 3.2.9)
126
105
  rack-ssl (~> 1.3.2)
127
106
  rake (>= 0.8.7)
128
107
  rdoc (~> 3.4)
129
- thor (~> 0.14.6)
130
- rake (0.9.2.2)
108
+ thor (>= 0.14.6, < 2.0)
109
+ rake (10.0.2)
131
110
  rdoc (3.12)
132
111
  json (~> 1.4)
133
- rspec (2.11.0)
134
- rspec-core (~> 2.11.0)
135
- rspec-expectations (~> 2.11.0)
136
- rspec-mocks (~> 2.11.0)
137
- rspec-core (2.11.1)
138
- rspec-expectations (2.11.3)
112
+ rspec-core (2.12.0)
113
+ rspec-expectations (2.12.0)
139
114
  diff-lcs (~> 1.1.3)
140
- rspec-mocks (2.11.3)
141
- rspec-rails (2.11.4)
115
+ rspec-mocks (2.12.0)
116
+ rspec-rails (2.12.0)
142
117
  actionpack (>= 3.0)
143
118
  activesupport (>= 3.0)
144
119
  railties (>= 3.0)
145
- rspec (~> 2.11.0)
120
+ rspec-core (~> 2.12.0)
121
+ rspec-expectations (~> 2.12.0)
122
+ rspec-mocks (~> 2.12.0)
146
123
  rubyzip (0.9.9)
147
- selenium-webdriver (2.25.0)
124
+ selenium-webdriver (2.26.0)
148
125
  childprocess (>= 0.2.5)
149
126
  libwebsocket (~> 0.1.3)
150
127
  multi_json (~> 1.0)
151
128
  rubyzip
152
- slop (3.3.3)
153
129
  spork (0.9.2)
154
- sprockets (2.1.3)
130
+ sprockets (2.2.2)
155
131
  hike (~> 1.2)
132
+ multi_json (~> 1.0)
156
133
  rack (~> 1.0)
157
134
  tilt (~> 1.1, != 1.3.0)
158
- sqlite3 (1.3.6)
159
- sqlite3-ruby (1.3.3)
160
- sqlite3 (>= 1.3.3)
161
- thin (1.5.0)
162
- daemons (>= 1.0.9)
163
- eventmachine (>= 0.12.6)
164
- rack (>= 1.0.0)
165
- thor (0.14.6)
135
+ thor (0.16.0)
166
136
  tilt (1.3.3)
167
- treetop (1.4.11)
137
+ treetop (1.4.12)
168
138
  polyglot
169
139
  polyglot (>= 0.3.1)
170
- tzinfo (0.3.33)
140
+ tzinfo (0.3.35)
141
+ websocket (1.0.4)
171
142
  xpath (0.1.4)
172
143
  nokogiri (~> 1.3)
173
- yard (0.8.3)
174
144
 
175
145
  PLATFORMS
176
146
  ruby
177
147
 
178
148
  DEPENDENCIES
179
- capybara
180
- capybara-screenshot
149
+ capybara (~> 1)
181
150
  cucumber
182
151
  cucumber-rails
183
152
  database_cleaner
@@ -185,12 +154,8 @@ DEPENDENCIES
185
154
  launchy
186
155
  mysql2
187
156
  netzke-core!
188
- netzke-persistence!
189
- pickle!
190
- pry
191
- rails (= 3.2.1)
157
+ pickle
158
+ rails (~> 3.2.0)
192
159
  rspec-rails
193
160
  selenium-webdriver
194
161
  spork
195
- sqlite3-ruby
196
- thin
@@ -1,9 +1,12 @@
1
1
  # Warning: this component participates in i18n.feature, careful with adding new fields!
2
- class AuthorForm < Netzke::Basepack::FormPanel
3
- js_property :title, Author.model_name.human
2
+ class AuthorForm < Netzke::Basepack::Form
3
+ js_configure do |c|
4
+ c.title = Author.model_name.human
5
+ end
4
6
 
5
- def configuration
6
- super.merge(
7
+ def configure(c)
8
+ super
9
+ c.merge!(
7
10
  :model => "Author",
8
11
  # :record => Author.first,
9
12
  # :items => [
@@ -22,7 +25,7 @@ class AuthorForm < Netzke::Basepack::FormPanel
22
25
 
23
26
  # js_method :init_component, <<-JS
24
27
  # function(){
25
- # Netzke.classes.AuthorForm.superclass.initComponent.call(this);
28
+ # this.callParent();
26
29
 
27
30
  # this.on('submitsuccess', function(){ this.feedback('Suc'+'cess!')}, this);
28
31
  # }
@@ -1,3 +1,3 @@
1
- class AuthorGrid < Netzke::Basepack::GridPanel
1
+ class AuthorGrid < Netzke::Basepack::Grid
2
2
  model "Author"
3
- end
3
+ end
@@ -1,38 +1,41 @@
1
1
  # Warning: this component participates in i18n.feature, careful with adding new fields!
2
- class BookForm < Netzke::Basepack::FormPanel
3
- extend Extras::BookPresentation
2
+ class BookForm < Netzke::Basepack::Form
3
+ include Extras::BookPresentation
4
4
 
5
- title Book.model_name.human
5
+ def configure(c)
6
+ c.record = Book.first
6
7
 
7
- model "Book"
8
+ super
8
9
 
9
- record_id Book.first.try(:id)
10
+ c.model = "Book"
11
+ c.title Book.model_name.human
12
+ c.items = [
13
+ :title,
14
+ {:name => :author__first_name, :setter => author_first_name_setter},
15
+ :author__name,
16
+ {:name => :author__last_name, :xtype => :displayfield},
17
+ {:name => :rating, :xtype => :combo, :store => [[1, "Good"], [2, "Average"], [3, "Poor"]]},
18
+ {:name => :author__updated_at, :editable => false},
19
+ :digitized,
20
+ :exemplars,
21
+ {:name => :in_abundance, :getter => in_abundance_getter, :xtype => :displayfield},
22
+ {:name => :updated_at},
23
+ :last_read_at,
24
+ :published_on
10
25
 
11
- items [
12
- :title,
13
- {:name => :author__first_name, :setter => author_first_name_setter},
14
- :author__name,
15
- {:name => :author__last_name, :xtype => :displayfield},
16
- {:name => :rating, :xtype => :combo, :store => [[1, "Good"], [2, "Average"], [3, "Poor"]]},
17
- {:name => :author__updated_at, :editable => false},
18
- :digitized,
19
- :exemplars,
20
- {:name => :in_abundance, :getter => in_abundance_getter, :xtype => :displayfield},
21
- {:name => :updated_at},
22
- :last_read_at,
23
- :published_on
24
-
25
- # WIP: commalistcbg is kind of broken, giving an Ext error
26
- # {:name => :tags, :xtype => :commalistcbg, :options => %w(read cool recommend buy)},
27
- # WIP: waithing on nradiogroup
28
- # {:name => :rating, :xtype => :nradiogroup, :options => [[1, "Good"], [2, "Average"], [3, "Poor"]]}
29
- ]
30
-
31
- js_method :init_component, <<-JS
32
- function(){
33
- this.callParent();
34
- this.on('submitsuccess', function(){ this.netzkeFeedback('Suc'+'cess!')}, this);
35
- }
36
- JS
26
+ # WIP: commalistcbg is kind of broken, giving an Ext error
27
+ # {:name => :tags, :xtype => :commalistcbg, :options => %w(read cool recommend buy)},
28
+ # WIP: waithing on nradiogroup
29
+ # {:name => :rating, :xtype => :nradiogroup, :options => [[1, "Good"], [2, "Average"], [3, "Poor"]]}
30
+ ]
31
+ end
37
32
 
33
+ js_configure do |c|
34
+ c.on_submit_success = <<-JS
35
+ function(){
36
+ this.callParent();
37
+ this.netzkeFeedback('Suc'+'cess!');
38
+ }
39
+ JS
40
+ end
38
41
  end
@@ -1,8 +1,7 @@
1
- class BookFormWithDefaults < Netzke::Basepack::FormPanel
2
- def configuration
3
- super.tap do |c|
4
- c[:model] = "Book"
5
- c[:record_id] = Book.first.id
6
- end
1
+ class BookFormWithDefaults < Netzke::Basepack::Form
2
+ def configure(c)
3
+ c.record = Book.first
4
+ super
5
+ c.model = "Book"
7
6
  end
8
- end
7
+ end
@@ -0,0 +1,10 @@
1
+ class BookFormWithFileUpload < Netzke::Basepack::Form
2
+ def configure(c)
3
+ super
4
+ c.model = "Book"
5
+ end
6
+
7
+ def items
8
+ [{name: 'cover', xtype: :filefield}, *super]
9
+ end
10
+ end
@@ -1,8 +1,8 @@
1
- class BookFormWithNestedAttributes < Netzke::Basepack::FormPanel
2
- js_property :title, Book.model_name.human
3
-
4
- def default_config
5
- super.merge(
1
+ # TODO: not used atm
2
+ class BookFormWithNestedAttributes < Netzke::Basepack::Form
3
+ def configure(c)
4
+ c.merge!(
5
+ :title => Book.model_name.human,
6
6
  :model => "Book",
7
7
  :record => Book.first,
8
8
  :items => [
@@ -14,5 +14,4 @@ class BookFormWithNestedAttributes < Netzke::Basepack::FormPanel
14
14
  ]
15
15
  )
16
16
  end
17
-
18
17
  end
@@ -1,12 +1,23 @@
1
- class BookGrid < Netzke::Basepack::GridPanel
2
- title I18n.t('books', :default => "Books")
1
+ class BookGrid < Netzke::Basepack::Grid
2
+ def configure(c)
3
+ c.model = "Book"
4
+ c.title = I18n.t('books', :default => "Books")
3
5
 
4
- model "Book"
6
+ super
7
+ end
5
8
 
6
- add_form_config :class_name => "BookForm"
7
- edit_form_config :class_name => "BookForm"
8
- multi_edit_form_config :class_name => "BookForm"
9
+ column :author__name do |c|
10
+ c.sorting_scope = :sorted_by_author_name
11
+ end
9
12
 
10
- # We need to specify how we want to sort on this virtual column:
11
- override_column :author__name, :sorting_scope => :sorted_by_author_name
13
+ # crafting a static combobox column; TODO: include a prebuilt one in Basepack
14
+ column :rating do |c|
15
+ c.editor = {
16
+ :trigger_action => :all,
17
+ :xtype => :combo,
18
+ :store => [[0, "---"], [1, "Good"], [2, "Average"], [3, "Poor"]]
19
+ }
20
+
21
+ c.renderer = "function(v){return ['', 'Good', 'Average', 'Poor'][v];}"
22
+ end
12
23
  end
@@ -1,10 +1,7 @@
1
- class BookGridFiltering < Netzke::Basepack::GridPanel
1
+ class BookGridFiltering < Netzke::Basepack::Grid
2
2
  model "Book"
3
3
 
4
- column :title
5
- column :author__first_name
6
- column :exemplars
7
- column :notes
8
- column :last_read_at
9
- column :digitized
4
+ def columns
5
+ [ :title, :author__first_name, :exemplars, :notes, :last_read_at, :digitized ]
6
+ end
10
7
  end