netzke-basepack-zh 0.7.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (268) hide show
  1. data/.autotest +1 -0
  2. data/.travis.yml +11 -0
  3. data/CHANGELOG.rdoc +445 -0
  4. data/LICENSE +1 -0
  5. data/README.md +94 -0
  6. data/Rakefile +44 -0
  7. data/TODO.rdoc +8 -0
  8. data/config/ci/before-travis.sh +28 -0
  9. data/init.rb +1 -0
  10. data/install.rb +1 -0
  11. data/javascripts/basepack.js +139 -0
  12. data/javascripts/xdatetime.js +196 -0
  13. data/lib/generators/netzke/basepack_generator.rb +10 -0
  14. data/lib/generators/netzke/templates/assets/ts-checkbox.gif +0 -0
  15. data/lib/generators/netzke/templates/create_netzke_field_lists.rb +18 -0
  16. data/lib/netzke-basepack.rb +26 -0
  17. data/lib/netzke/active_record.rb +20 -0
  18. data/lib/netzke/active_record/attributes.rb +256 -0
  19. data/lib/netzke/active_record/combobox_options.rb +16 -0
  20. data/lib/netzke/active_record/relation_extensions.rb +37 -0
  21. data/lib/netzke/basepack.rb +45 -0
  22. data/lib/netzke/basepack/accordion_panel.rb +39 -0
  23. data/lib/netzke/basepack/action_column.rb +68 -0
  24. data/lib/netzke/basepack/action_column/javascripts/action_column.js +61 -0
  25. data/lib/netzke/basepack/auth_app.rb +159 -0
  26. data/lib/netzke/basepack/basic_app.rb +7 -0
  27. data/lib/netzke/basepack/border_layout_panel.rb +53 -0
  28. data/lib/netzke/basepack/border_layout_panel/javascripts/border_layout_panel.js +40 -0
  29. data/lib/netzke/basepack/data_accessor.rb +53 -0
  30. data/lib/netzke/basepack/data_adapters/abstract_adapter.rb +164 -0
  31. data/lib/netzke/basepack/data_adapters/active_record_adapter.rb +279 -0
  32. data/lib/netzke/basepack/data_adapters/data_mapper_adapter.rb +264 -0
  33. data/lib/netzke/basepack/data_adapters/sequel_adapter.rb +260 -0
  34. data/lib/netzke/basepack/form_panel.rb +144 -0
  35. data/lib/netzke/basepack/form_panel/fields.rb +208 -0
  36. data/lib/netzke/basepack/form_panel/javascripts/comma_list_cbg.js +51 -0
  37. data/lib/netzke/basepack/form_panel/javascripts/form_panel.js +225 -0
  38. data/lib/netzke/basepack/form_panel/javascripts/misc.js +4 -0
  39. data/lib/netzke/basepack/form_panel/javascripts/n_radio_group.js +43 -0
  40. data/lib/netzke/basepack/form_panel/javascripts/readonly_mode.js +35 -0
  41. data/lib/netzke/basepack/form_panel/services.rb +142 -0
  42. data/lib/netzke/basepack/form_panel/stylesheets/readonly_mode.css +14 -0
  43. data/lib/netzke/basepack/grid_panel.rb +440 -0
  44. data/lib/netzke/basepack/grid_panel/columns.rb +394 -0
  45. data/lib/netzke/basepack/grid_panel/javascripts/advanced_search.js +27 -0
  46. data/lib/netzke/basepack/grid_panel/javascripts/check_column_fix.js +6 -0
  47. data/lib/netzke/basepack/grid_panel/javascripts/edit_in_form.js +51 -0
  48. data/lib/netzke/basepack/grid_panel/javascripts/event_handling.js +179 -0
  49. data/lib/netzke/basepack/grid_panel/javascripts/grid_panel.js +438 -0
  50. data/lib/netzke/basepack/grid_panel/javascripts/misc.js +4 -0
  51. data/lib/netzke/basepack/grid_panel/javascripts/rows-dd.js +281 -0
  52. data/lib/netzke/basepack/grid_panel/record_form_window.rb +41 -0
  53. data/lib/netzke/basepack/grid_panel/services.rb +235 -0
  54. data/lib/netzke/basepack/paging_form_panel.rb +72 -0
  55. data/lib/netzke/basepack/paging_form_panel/javascripts/paging_form_panel.js +76 -0
  56. data/lib/netzke/basepack/panel.rb +11 -0
  57. data/lib/netzke/basepack/query_builder.rb +107 -0
  58. data/lib/netzke/basepack/query_builder/javascripts/query_builder.js +153 -0
  59. data/lib/netzke/basepack/search_panel.rb +79 -0
  60. data/lib/netzke/basepack/search_panel/javascripts/condition_field.js +160 -0
  61. data/lib/netzke/basepack/search_panel/javascripts/search_panel.js +65 -0
  62. data/lib/netzke/basepack/search_window.rb +66 -0
  63. data/lib/netzke/basepack/simple_app.rb +104 -0
  64. data/lib/netzke/basepack/simple_app/javascripts/simple_app.js +64 -0
  65. data/lib/netzke/basepack/simple_app/javascripts/statusbar_ext.js +8 -0
  66. data/lib/netzke/basepack/tab_panel.rb +21 -0
  67. data/lib/netzke/basepack/tab_panel/javascripts/tab_panel.js +11 -0
  68. data/lib/netzke/basepack/version.rb +11 -0
  69. data/lib/netzke/basepack/window.rb +29 -0
  70. data/lib/netzke/basepack/window/javascripts/window.js +20 -0
  71. data/lib/netzke/basepack/wrap_lazy_loaded.rb +28 -0
  72. data/lib/netzke/basepack/wrapper.rb +28 -0
  73. data/lib/netzke/data_mapper.rb +18 -0
  74. data/lib/netzke/data_mapper/attributes.rb +273 -0
  75. data/lib/netzke/data_mapper/combobox_options.rb +11 -0
  76. data/lib/netzke/data_mapper/relation_extensions.rb +38 -0
  77. data/lib/netzke/sequel.rb +18 -0
  78. data/lib/netzke/sequel/attributes.rb +274 -0
  79. data/lib/netzke/sequel/combobox_options.rb +10 -0
  80. data/lib/netzke/sequel/relation_extensions.rb +40 -0
  81. data/lib/tasks/netzke_basepack_tasks.rake +4 -0
  82. data/locales/de.yml +79 -0
  83. data/locales/en.yml +79 -0
  84. data/netzke-basepack.gemspec +306 -0
  85. data/stylesheets/basepack.css +72 -0
  86. data/stylesheets/datetimefield.css +54 -0
  87. data/test/basepack_test_app/.gitignore +6 -0
  88. data/test/basepack_test_app/.rvmrc +1 -0
  89. data/test/basepack_test_app/Gemfile +59 -0
  90. data/test/basepack_test_app/Gemfile.lock +196 -0
  91. data/test/basepack_test_app/Guardfile +46 -0
  92. data/test/basepack_test_app/README +1 -0
  93. data/test/basepack_test_app/Rakefile +7 -0
  94. data/test/basepack_test_app/app/components/author_form.rb +32 -0
  95. data/test/basepack_test_app/app/components/author_grid.rb +3 -0
  96. data/test/basepack_test_app/app/components/book_form.rb +38 -0
  97. data/test/basepack_test_app/app/components/book_form_with_custom_fields.rb +21 -0
  98. data/test/basepack_test_app/app/components/book_form_with_defaults.rb +8 -0
  99. data/test/basepack_test_app/app/components/book_form_with_nested_attributes.rb +18 -0
  100. data/test/basepack_test_app/app/components/book_grid.rb +12 -0
  101. data/test/basepack_test_app/app/components/book_grid_filtering.rb +10 -0
  102. data/test/basepack_test_app/app/components/book_grid_loader.rb +24 -0
  103. data/test/basepack_test_app/app/components/book_grid_with_column_actions.rb +15 -0
  104. data/test/basepack_test_app/app/components/book_grid_with_custom_columns.rb +27 -0
  105. data/test/basepack_test_app/app/components/book_grid_with_default_values.rb +9 -0
  106. data/test/basepack_test_app/app/components/book_grid_with_extra_feedback.rb +8 -0
  107. data/test/basepack_test_app/app/components/book_grid_with_extra_filters.rb +14 -0
  108. data/test/basepack_test_app/app/components/book_grid_with_nested_attributes.rb +13 -0
  109. data/test/basepack_test_app/app/components/book_grid_with_overridden_columns.rb +15 -0
  110. data/test/basepack_test_app/app/components/book_grid_with_paging.rb +10 -0
  111. data/test/basepack_test_app/app/components/book_grid_with_persistence.rb +8 -0
  112. data/test/basepack_test_app/app/components/book_grid_with_scoped_authors.rb +8 -0
  113. data/test/basepack_test_app/app/components/book_grid_with_virtual_attributes.rb +21 -0
  114. data/test/basepack_test_app/app/components/book_paging_form_panel.rb +22 -0
  115. data/test/basepack_test_app/app/components/book_query_builder.rb +8 -0
  116. data/test/basepack_test_app/app/components/book_search_panel.rb +5 -0
  117. data/test/basepack_test_app/app/components/book_search_panel/javascripts/i18n_de.js +6 -0
  118. data/test/basepack_test_app/app/components/book_with_custom_primary_key_grid.rb +10 -0
  119. data/test/basepack_test_app/app/components/books_bound_to_author.rb +10 -0
  120. data/test/basepack_test_app/app/components/double_book_grid.rb +18 -0
  121. data/test/basepack_test_app/app/components/extras/book_presentation.rb +27 -0
  122. data/test/basepack_test_app/app/components/form_without_model.rb +21 -0
  123. data/test/basepack_test_app/app/components/generic_user_form.rb +12 -0
  124. data/test/basepack_test_app/app/components/lockable_book_form.rb +17 -0
  125. data/test/basepack_test_app/app/components/lockable_user_form.rb +7 -0
  126. data/test/basepack_test_app/app/components/paging_form_with_search.rb +40 -0
  127. data/test/basepack_test_app/app/components/simple_accordion.rb +11 -0
  128. data/test/basepack_test_app/app/components/simple_panel.rb +17 -0
  129. data/test/basepack_test_app/app/components/simple_tab_panel.rb +11 -0
  130. data/test/basepack_test_app/app/components/simple_window.rb +10 -0
  131. data/test/basepack_test_app/app/components/simple_wrapper.rb +7 -0
  132. data/test/basepack_test_app/app/components/some_accordion_panel.rb +22 -0
  133. data/test/basepack_test_app/app/components/some_auth_app.rb +32 -0
  134. data/test/basepack_test_app/app/components/some_border_layout.rb +28 -0
  135. data/test/basepack_test_app/app/components/some_simple_app.rb +35 -0
  136. data/test/basepack_test_app/app/components/some_tab_panel.rb +20 -0
  137. data/test/basepack_test_app/app/components/user_form.rb +25 -0
  138. data/test/basepack_test_app/app/components/user_form_with_default_fields.rb +8 -0
  139. data/test/basepack_test_app/app/components/user_grid.rb +8 -0
  140. data/test/basepack_test_app/app/components/user_grid_with_customized_form_fields.rb +18 -0
  141. data/test/basepack_test_app/app/components/window_component_loader.rb +27 -0
  142. data/test/basepack_test_app/app/controllers/application_controller.rb +9 -0
  143. data/test/basepack_test_app/app/controllers/components_controller.rb +10 -0
  144. data/test/basepack_test_app/app/controllers/welcome_controller.rb +9 -0
  145. data/test/basepack_test_app/app/helpers/application_helper.rb +8 -0
  146. data/test/basepack_test_app/app/helpers/embedded_components_helper.rb +2 -0
  147. data/test/basepack_test_app/app/models/address.rb +29 -0
  148. data/test/basepack_test_app/app/models/author.rb +38 -0
  149. data/test/basepack_test_app/app/models/book.rb +49 -0
  150. data/test/basepack_test_app/app/models/book_with_custom_primary_key.rb +26 -0
  151. data/test/basepack_test_app/app/models/role.rb +24 -0
  152. data/test/basepack_test_app/app/models/user.rb +29 -0
  153. data/test/basepack_test_app/app/presenters/forms/generic_user.rb +6 -0
  154. data/test/basepack_test_app/app/views/components/loadable_window.html.erb +9 -0
  155. data/test/basepack_test_app/app/views/components/simple_panel.html.erb +1 -0
  156. data/test/basepack_test_app/app/views/layouts/application.html.erb +12 -0
  157. data/test/basepack_test_app/app/views/layouts/components.html.erb +13 -0
  158. data/test/basepack_test_app/app/views/layouts/nested.html.erb +5 -0
  159. data/test/basepack_test_app/app/views/welcome/index.html.erb +10 -0
  160. data/test/basepack_test_app/config.ru +4 -0
  161. data/test/basepack_test_app/config/application.rb +57 -0
  162. data/test/basepack_test_app/config/boot.rb +13 -0
  163. data/test/basepack_test_app/config/cucumber.yml +8 -0
  164. data/test/basepack_test_app/config/database.yml.sample +41 -0
  165. data/test/basepack_test_app/config/database.yml.travis +15 -0
  166. data/test/basepack_test_app/config/environment.rb +6 -0
  167. data/test/basepack_test_app/config/environments/development.rb +22 -0
  168. data/test/basepack_test_app/config/environments/production.rb +49 -0
  169. data/test/basepack_test_app/config/environments/test.rb +35 -0
  170. data/test/basepack_test_app/config/initializers/backtrace_silencers.rb +7 -0
  171. data/test/basepack_test_app/config/initializers/data_mapper_logging.rb +3 -0
  172. data/test/basepack_test_app/config/initializers/inflections.rb +10 -0
  173. data/test/basepack_test_app/config/initializers/mime_types.rb +5 -0
  174. data/test/basepack_test_app/config/initializers/netzke.rb +9 -0
  175. data/test/basepack_test_app/config/initializers/secret_token.rb +7 -0
  176. data/test/basepack_test_app/config/initializers/sequel.rb +26 -0
  177. data/test/basepack_test_app/config/initializers/session_store.rb +8 -0
  178. data/test/basepack_test_app/config/locales/de.yml +35 -0
  179. data/test/basepack_test_app/config/locales/es.yml +96 -0
  180. data/test/basepack_test_app/config/routes.rb +68 -0
  181. data/test/basepack_test_app/db/development_structure.sql +88 -0
  182. data/test/basepack_test_app/db/migrate/20100914104207_create_users.rb +15 -0
  183. data/test/basepack_test_app/db/migrate/20100914104236_create_roles.rb +13 -0
  184. data/test/basepack_test_app/db/migrate/20101026185816_create_authors.rb +14 -0
  185. data/test/basepack_test_app/db/migrate/20101026190021_create_books.rb +19 -0
  186. data/test/basepack_test_app/db/migrate/20110101143818_create_addresses.rb +17 -0
  187. data/test/basepack_test_app/db/migrate/20110213213050_create_netzke_component_states.rb +20 -0
  188. data/test/basepack_test_app/db/migrate/20110701070052_create_book_with_custom_primary_keys.rb +15 -0
  189. data/test/basepack_test_app/db/migrate/20110901114016_add_last_read_at_to_books.rb +9 -0
  190. data/test/basepack_test_app/db/migrate/20110909071740_add_published_on_to_books.rb +5 -0
  191. data/test/basepack_test_app/db/schema.rb +81 -0
  192. data/test/basepack_test_app/db/seeds.rb +44 -0
  193. data/test/basepack_test_app/features/accordion_panel.feature +12 -0
  194. data/test/basepack_test_app/features/components_in_view.feature +11 -0
  195. data/test/basepack_test_app/features/form_panel.feature +142 -0
  196. data/test/basepack_test_app/features/grid_panel.feature +277 -0
  197. data/test/basepack_test_app/features/grid_panel_filters.feature +73 -0
  198. data/test/basepack_test_app/features/grid_panel_with_custom_primary_key.feature +15 -0
  199. data/test/basepack_test_app/features/grid_sorting.feature +47 -0
  200. data/test/basepack_test_app/features/i18n.feature +18 -0
  201. data/test/basepack_test_app/features/nested_attributes.feature +26 -0
  202. data/test/basepack_test_app/features/paging_form_panel.feature +43 -0
  203. data/test/basepack_test_app/features/search_in_grid.feature +49 -0
  204. data/test/basepack_test_app/features/simple_app.feature +15 -0
  205. data/test/basepack_test_app/features/simple_panel.feature +11 -0
  206. data/test/basepack_test_app/features/step_definitions/accordion_steps.rb +5 -0
  207. data/test/basepack_test_app/features/step_definitions/ext_steps.rb +16 -0
  208. data/test/basepack_test_app/features/step_definitions/form_panel_steps.rb +46 -0
  209. data/test/basepack_test_app/features/step_definitions/generic_steps.rb +44 -0
  210. data/test/basepack_test_app/features/step_definitions/grid_panel_steps.rb +186 -0
  211. data/test/basepack_test_app/features/step_definitions/pickle_steps.rb +100 -0
  212. data/test/basepack_test_app/features/step_definitions/web_steps.rb +219 -0
  213. data/test/basepack_test_app/features/support/env.rb +81 -0
  214. data/test/basepack_test_app/features/support/paths.rb +65 -0
  215. data/test/basepack_test_app/features/support/pickle.rb +24 -0
  216. data/test/basepack_test_app/features/support/selectors.rb +39 -0
  217. data/test/basepack_test_app/features/tab_panel.feature +12 -0
  218. data/test/basepack_test_app/features/validations_in_grid.feature +13 -0
  219. data/test/basepack_test_app/features/virtual_attributes.feature +16 -0
  220. data/test/basepack_test_app/features/window.feature +11 -0
  221. data/test/basepack_test_app/lib/tasks/.gitkeep +0 -0
  222. data/test/basepack_test_app/lib/tasks/cucumber.rake +71 -0
  223. data/test/basepack_test_app/lib/tasks/travis.rake +7 -0
  224. data/test/basepack_test_app/public/404.html +26 -0
  225. data/test/basepack_test_app/public/422.html +26 -0
  226. data/test/basepack_test_app/public/500.html +26 -0
  227. data/test/basepack_test_app/public/favicon.ico +0 -0
  228. data/test/basepack_test_app/public/images/header-deco.gif +0 -0
  229. data/test/basepack_test_app/public/images/rails.png +0 -0
  230. data/test/basepack_test_app/public/javascripts/application.js +2 -0
  231. data/test/basepack_test_app/public/javascripts/controls.js +965 -0
  232. data/test/basepack_test_app/public/javascripts/dragdrop.js +974 -0
  233. data/test/basepack_test_app/public/javascripts/effects.js +1123 -0
  234. data/test/basepack_test_app/public/javascripts/prototype.js +6001 -0
  235. data/test/basepack_test_app/public/javascripts/rails.js +175 -0
  236. data/test/basepack_test_app/public/robots.txt +5 -0
  237. data/test/basepack_test_app/public/stylesheets/.gitkeep +0 -0
  238. data/test/basepack_test_app/script/cucumber +10 -0
  239. data/test/basepack_test_app/script/rails +6 -0
  240. data/test/basepack_test_app/spec/components/form_panel_spec.rb +53 -0
  241. data/test/basepack_test_app/spec/components/grid_panel_spec.rb +10 -0
  242. data/test/basepack_test_app/spec/data_adapter/adapter_spec.rb +68 -0
  243. data/test/basepack_test_app/spec/data_adapter/attributes_spec.rb +56 -0
  244. data/test/basepack_test_app/spec/data_adapter/relation_extensions_spec.rb +125 -0
  245. data/test/basepack_test_app/spec/factories.rb +28 -0
  246. data/test/basepack_test_app/spec/spec_helper.rb +39 -0
  247. data/test/basepack_test_app/test/performance/browsing_test.rb +9 -0
  248. data/test/basepack_test_app/test/test_helper.rb +13 -0
  249. data/test/basepack_test_app/vendor/plugins/.gitkeep +0 -0
  250. data/test/console_with_fixtures.rb +4 -0
  251. data/test/fixtures/books.yml +11 -0
  252. data/test/fixtures/categories.yml +7 -0
  253. data/test/fixtures/cities.yml +21 -0
  254. data/test/fixtures/continents.yml +7 -0
  255. data/test/fixtures/countries.yml +9 -0
  256. data/test/fixtures/genres.yml +9 -0
  257. data/test/fixtures/roles.yml +8 -0
  258. data/test/fixtures/users.yml +11 -0
  259. data/test/schema.rb +10 -0
  260. data/test/test_helper.rb +21 -0
  261. data/test/unit/accordion_panel_test.rb +20 -0
  262. data/test/unit/active_record_basepack_test.rb +54 -0
  263. data/test/unit/fields_configuration_test.rb +18 -0
  264. data/test/unit/grid_panel_test.rb +52 -0
  265. data/test/unit/netzke_basepack_test.rb +4 -0
  266. data/test/unit/tab_panel_test.rb +21 -0
  267. data/uninstall.rb +1 -0
  268. metadata +332 -0
@@ -0,0 +1,17 @@
1
+ class CreateAddresses < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :addresses do |t|
4
+ t.integer :user_id
5
+ t.string :street
6
+ t.string :city
7
+ t.string :postcode
8
+ t.integer :country_id
9
+
10
+ t.timestamps
11
+ end
12
+ end
13
+
14
+ def self.down
15
+ drop_table :addresses
16
+ end
17
+ end
@@ -0,0 +1,20 @@
1
+ class CreateNetzkeComponentStates < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :netzke_component_states do |t|
4
+ t.string :component
5
+ t.integer :user_id
6
+ t.integer :role_id
7
+ t.text :value
8
+
9
+ t.timestamps
10
+ end
11
+
12
+ add_index :netzke_component_states, :component
13
+ add_index :netzke_component_states, :user_id
14
+ add_index :netzke_component_states, :role_id
15
+ end
16
+
17
+ def self.down
18
+ drop_table :netzke_component_states
19
+ end
20
+ end
@@ -0,0 +1,15 @@
1
+ class CreateBookWithCustomPrimaryKeys < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :book_with_custom_primary_keys, :primary_key => :uid do |t|
4
+ t.integer :uid
5
+ t.string :title
6
+ t.integer :author_id
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+
12
+ def self.down
13
+ drop_table :book_with_custom_primary_keys
14
+ end
15
+ end
@@ -0,0 +1,9 @@
1
+ class AddLastReadAtToBooks < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :books, :last_read_at, :datetime
4
+ end
5
+
6
+ def self.down
7
+ remove_column :books, :last_read_at
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ class AddPublishedOnToBooks < ActiveRecord::Migration
2
+ def change
3
+ add_column :books, :published_on, :date
4
+ end
5
+ end
@@ -0,0 +1,81 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(:version => 20110909071740) do
15
+
16
+ create_table "addresses", :force => true do |t|
17
+ t.integer "user_id"
18
+ t.string "street"
19
+ t.string "city"
20
+ t.string "postcode"
21
+ t.integer "country_id"
22
+ t.datetime "created_at"
23
+ t.datetime "updated_at"
24
+ end
25
+
26
+ create_table "authors", :force => true do |t|
27
+ t.string "first_name"
28
+ t.string "last_name"
29
+ t.datetime "created_at"
30
+ t.datetime "updated_at"
31
+ end
32
+
33
+ create_table "book_with_custom_primary_keys", :primary_key => "uid", :force => true do |t|
34
+ t.string "title"
35
+ t.integer "author_id"
36
+ t.datetime "created_at"
37
+ t.datetime "updated_at"
38
+ end
39
+
40
+ create_table "books", :force => true do |t|
41
+ t.integer "author_id"
42
+ t.string "title"
43
+ t.integer "exemplars"
44
+ t.boolean "digitized", :default => false
45
+ t.text "notes"
46
+ t.string "tags"
47
+ t.integer "rating"
48
+ t.datetime "created_at"
49
+ t.datetime "updated_at"
50
+ t.datetime "last_read_at"
51
+ t.date "published_on"
52
+ end
53
+
54
+ create_table "netzke_component_states", :force => true do |t|
55
+ t.string "component"
56
+ t.integer "user_id"
57
+ t.integer "role_id"
58
+ t.text "value"
59
+ t.datetime "created_at"
60
+ t.datetime "updated_at"
61
+ end
62
+
63
+ add_index "netzke_component_states", ["component"], :name => "index_netzke_component_states_on_component"
64
+ add_index "netzke_component_states", ["role_id"], :name => "index_netzke_component_states_on_role_id"
65
+ add_index "netzke_component_states", ["user_id"], :name => "index_netzke_component_states_on_user_id"
66
+
67
+ create_table "roles", :force => true do |t|
68
+ t.string "name"
69
+ t.datetime "created_at"
70
+ t.datetime "updated_at"
71
+ end
72
+
73
+ create_table "users", :force => true do |t|
74
+ t.string "first_name"
75
+ t.string "last_name"
76
+ t.integer "role_id"
77
+ t.datetime "created_at"
78
+ t.datetime "updated_at"
79
+ end
80
+
81
+ end
@@ -0,0 +1,44 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
7
+ # Mayor.create(:name => 'Daley', :city => cities.first)
8
+
9
+ Role.delete_all
10
+ puts "Creating roles..."
11
+ Role.create([
12
+ {:name => "writer"},
13
+ {:name => "reader"}
14
+ ])
15
+
16
+ User.delete_all
17
+ puts "Creating users..."
18
+ User.create([
19
+ {:first_name => "Mark", :last_name => "Twain", :role => Role.find_by_name("writer")},
20
+ {:first_name => "Carlos", :last_name => "Castaneda", :role => Role.find_by_name("writer")},
21
+ {:first_name => "Sergei", :last_name => "Kozlov", :role => Role.find_by_name("reader")},
22
+ {:first_name => "Paul", :last_name => "Schyska", :role => Role.find_by_name("reader")}
23
+ ])
24
+
25
+ Author.delete_all
26
+ puts "Creating authors..."
27
+ Author.create([
28
+ {:first_name => "Carlos", :last_name => "Castaneda"},
29
+ {:first_name => "Herman", :last_name => "Hesse"}
30
+ ])
31
+
32
+ Book.delete_all
33
+
34
+ hesse = Author.find_by_last_name("Hesse")
35
+ castaneda = Author.find_by_last_name("Castaneda")
36
+ puts "Creating books..."
37
+ Book.create([
38
+ {:title => "Journey to Ixtlan", :author => castaneda},
39
+ {:title => "The Tales of Power", :author => castaneda},
40
+ {:title => "The Art of Dreaming", :author => castaneda},
41
+ {:title => "Steppenwolf", :author => hesse},
42
+ {:title => "Demian", :author => hesse},
43
+ {:title => "Narciss and Goldmund", :author => hesse}
44
+ ])
@@ -0,0 +1,12 @@
1
+ Feature: Accordion panel
2
+ In order to value
3
+ As a role
4
+ I want feature
5
+
6
+ @javascript
7
+ Scenario: Lazy loading of a component into a panel when the latter gets expanded
8
+ Given I am on the SimpleAccordion test page
9
+ When I expand "Panel Two"
10
+ Then I should see "Original HTML"
11
+ When I press "Update html"
12
+ Then I should see "Update for Panel Two"
@@ -0,0 +1,11 @@
1
+ Feature: Components in view
2
+ In order to value
3
+ As a role
4
+ I want feature
5
+
6
+ @javascript
7
+ Scenario: Components configured in the view should render properly
8
+ When I go to the "simple panel" view
9
+ Then I should see "Simple Panel content"
10
+ When I press "Update html"
11
+ Then I should see "HTML received from server"
@@ -0,0 +1,142 @@
1
+ Feature: Form panel
2
+ In order to value
3
+ As a role
4
+ I want feature
5
+
6
+ Scenario: UserForm should be rendered properly along with the data for the first user
7
+ Given a role exists with name: "writer"
8
+ And a user exists with first_name: "Carlos", last_name: "Castaneda", role: that role
9
+ When I go to the UserForm test page
10
+ Then I should see "Carlos"
11
+ And I should see "Castaneda"
12
+ And I should see "writer"
13
+
14
+ @javascript
15
+ Scenario: A form should be rendered properly along with the data for the specified record
16
+ Given a book exists with title: "Great Book", last_read_at: "2005-01-23 11:12:13"
17
+ When I go to the BookFormWithDefaults test page
18
+ Then the form should show title: "Great Book", last_read_at: "2005-01-23 11:12:13"
19
+
20
+ @javascript
21
+ Scenario: Editing the record
22
+ Given a role exists with name: "musician"
23
+ And a user exists with first_name: "Paul", last_name: "Bley", role: that role
24
+ And a role exists with name: "painter"
25
+ When I go to the UserForm test page
26
+ And I fill in "First name:" with "Salvador"
27
+ And I fill in "Last name:" with "Dali"
28
+ And I expand combobox "Role name"
29
+ And I select "painter" from combobox "Role name"
30
+ And I press "Apply"
31
+ And I go to the UserForm test page
32
+ Then I should see "Salvador"
33
+ And I should see "Dali"
34
+ And I should see "painter"
35
+
36
+ But I should not see "Maxim"
37
+ And I should not see "Osminogov"
38
+ And I should not see "musician"
39
+
40
+ @javascript
41
+ Scenario: Resetting an association
42
+ Given a role exists with name: "musician"
43
+ And a user exists with first_name: "Paul", last_name: "Bley", role: that role
44
+ When I go to the UserForm test page
45
+ And I expand combobox "Role name"
46
+ And I select "---" from combobox "Role name"
47
+ And I press "Apply"
48
+ And I go to the UserForm test page
49
+ Then I should see "---"
50
+ But I should not see "musician"
51
+
52
+ Scenario: UserFormWithDefaultFields should render properly
53
+ Given a role exists with name: "writer"
54
+ And a user exists with first_name: "Carlos", last_name: "Castaneda", role: that role
55
+ When I go to the UserFormWithDefaultFields test page
56
+ Then I should see "Carlos"
57
+ And I should see "Castaneda"
58
+ And I should see "writer"
59
+
60
+ @javascript
61
+ Scenario: FormPanel should be functional without model provided
62
+ Given I am on the FormWithoutModel test page
63
+ When I fill in "Text field:" with "Some text"
64
+ And I fill in "Number field:" with "42"
65
+ And I expand combobox "Combobox field"
66
+ And I select "Two" from combobox "Combobox field"
67
+ And I check ext checkbox "Boolean field"
68
+ And I press "Apply"
69
+
70
+ Then I should see "Text field: Some text"
71
+ And I should see "Number field: 42"
72
+ And I should see "Boolean field: true"
73
+ And I should see "Combobox field: 2"
74
+
75
+ @javascript
76
+ Scenario: Checkbox field should work properly
77
+ Given an author exists with first_name: "Carlos"
78
+ And a book exists with author: that author, digitized: false, exemplars: 2, title: "Some Title"
79
+ When I go to the BookForm test page
80
+ And I fill in "Exemplars:" with "4"
81
+ And I check ext checkbox "Digitized"
82
+ And I press "Apply"
83
+ Then I should see "YES"
84
+ And a book should exist with digitized: true, author: that author, exemplars: 4
85
+ And a book should not exist with digitized: false, author: that author
86
+
87
+ @javascript
88
+ Scenario: Editing and immediately submitting the form
89
+ Given an author exists with first_name: "Carlos", last_name: "Castaneda"
90
+ And a book exists with title: "Journey to Ixtlan", author: that author
91
+ When I go to the BookForm test page
92
+ Then the form should show author__name: "Castaneda, Carlos"
93
+
94
+ When I press "Apply"
95
+ And I wait for the response from the server
96
+ Then the form should show author__name: "Castaneda, Carlos"
97
+
98
+ # @javascript
99
+ # Scenario: Checkbox group for tags should work properly
100
+ # Given a book exists with title: "Some Title"
101
+ # When I go to the BookForm test page
102
+ # And I check ext checkbox "recommend"
103
+ # And I check ext checkbox "cool"
104
+ # And I press "Apply"
105
+ # And I wait for the response from the server
106
+ # Then ext "cool" checkbox should be checked
107
+ # And ext "recommend" checkbox should be checked
108
+ # But ext "read" checkbox should not be checked
109
+ # And a book should exist with tags: "cool,recommend"
110
+
111
+ @javascript
112
+ Scenario: Validations
113
+ Given a book exists with title: "Some Title"
114
+ When I go to the BookForm test page
115
+ And I fill in "Title:" with ""
116
+ And I press "Apply"
117
+ And I wait for the response from the server
118
+ Then I should see "Title can't be blank"
119
+ But I should not see "Success!"
120
+ When I fill in "Title:" with "Not Blank"
121
+ And I press "Apply"
122
+ And I wait for the response from the server
123
+ Then I should not see "Title can't be blank"
124
+ But I should see "Success!"
125
+
126
+ @javascript
127
+ Scenario: Setting date
128
+ Given a book exists with title: "Some Title"
129
+ When I go to the BookFormWithDefaults test page
130
+ Then I fill in "Published on" with "2005-01-23"
131
+ And I press "Apply"
132
+ And I wait for the response from the server
133
+ Then a book should exist with published_on: "2005-01-23"
134
+
135
+ @javascript
136
+ Scenario: Setting datetime
137
+ Given a book exists with title: "Some Title"
138
+ When I go to the BookFormWithDefaults test page
139
+ Then I fill in Ext field "Last read at" with "2005-01-23 11:12:13"
140
+ And I press "Apply"
141
+ And I wait for the response from the server
142
+ Then a book should exist with last_read_at: "2005-01-23 11:12:13"
@@ -0,0 +1,277 @@
1
+ Feature: Grid panel
2
+ In order to value
3
+ As a role
4
+ I want feature
5
+
6
+ @javascript
7
+ Scenario: BookGrid should correctly display data
8
+ Given an author exists with first_name: "Vladimir", last_name: "Nabokov"
9
+ And a book exists with author: that author, title: "Lolita", last_read_at: "2011-12-13 11:12:13", published_on: "2005-01-30"
10
+
11
+ When I go to the BookGrid test page
12
+ Then I should see "Nabokov, Vladimir"
13
+ And I should see "2011-12-13 11:12:13"
14
+ And I should see "01/30/2005"
15
+
16
+ @javascript
17
+ Scenario: Adding a record via "Add in form"
18
+ Given I am on the UserGrid test page
19
+ When I press "Add in form"
20
+ Then I should see "Add User"
21
+ When I fill in "First name:" with "Herman"
22
+ And I fill in "Last name:" with "Hesse"
23
+ And I press "OK"
24
+ Then I should see "Herman"
25
+ And I should see "Hesse"
26
+
27
+ @javascript
28
+ Scenario: Updating a record via "Edit in form"
29
+ Given a user exists with first_name: "Carlos", last_name: "Castaneda"
30
+ When I go to the UserGrid test page
31
+ And I select first row in the grid
32
+ And I press "Edit in form"
33
+ And I fill in "First name:" with "Maxim"
34
+ And I fill in "Last name:" with "Osminogov"
35
+ And I press "OK"
36
+ And I wait for the response from the server
37
+ Then I should see "Maxim"
38
+ And I should see "Osminogov"
39
+ And a user should not exist with first_name: "Carlos"
40
+
41
+ @javascript
42
+ Scenario: Deleting a record
43
+ Given a user exists with first_name: "Anton", last_name: "Chekhov"
44
+ And a user exists with first_name: "Maxim", last_name: "Osminogov"
45
+ When I go to the UserGrid test page
46
+ And I select all rows in the grid
47
+ And I press "Delete"
48
+ Then I should see "Are you sure?"
49
+ When I press "Yes"
50
+ Then I should see "Deleted 2 record(s)"
51
+ Then a user should not exist with first_name: "Anton"
52
+ And a user should not exist with first_name: "Maxim"
53
+
54
+ @javascript
55
+ Scenario: Multi-editing records
56
+ Given a user exists with first_name: "Carlos", last_name: "Castaneda"
57
+ And a user exists with first_name: "Herman", last_name: "Hesse"
58
+ When I go to the UserGrid test page
59
+ And I select all rows in the grid
60
+ And I press "Edit in form"
61
+ And I fill in "First name:" with "Maxim"
62
+ And I press "OK"
63
+ And I wait for the response from the server
64
+ Then the following users should exist:
65
+ | first_name | last_name |
66
+ | Maxim | Castaneda |
67
+ | Maxim | Hesse |
68
+ But a user should not exist with first_name: "Carlos"
69
+
70
+ @javascript
71
+ Scenario: Filling out association column with association's virtual method
72
+ Given an author exists with first_name: "Vladimir", last_name: "Nabokov"
73
+ And a book exists with title: "Lolita", author: that author
74
+ When I go to the BookGrid test page
75
+ Then I should see "Nabokov, Vladimir"
76
+ And I should see "Lolita"
77
+
78
+ @javascript
79
+ Scenario: Grid with strong_default_attrs
80
+ Given an author exists with first_name: "Vladimir", last_name: "Nabokov"
81
+ And a book exists with title: "Lolita", author: that author
82
+ And a book exists with title: "Unknown"
83
+ When I go to the BooksBoundToAuthor test page
84
+ And I press "Add in form"
85
+ And I fill in "Title:" with "The Luzhin Defence"
86
+ And I press "OK"
87
+ And I should see "The Luzhin Defence"
88
+ And I should see "Lolita"
89
+ But I should not see "Unknown"
90
+
91
+ @javascript
92
+ Scenario: Grid with columns with default values
93
+ Given an author exists with last_name: "Nabokov"
94
+ And I am on the BookGridWithDefaultValues test page
95
+ When I press "Add"
96
+ Then I should see "Nabokov"
97
+ And I press "Apply"
98
+ And I wait for the response from the server
99
+ Then a book should exist with title: "Lolita", exemplars: 100, digitized: true, author: that author
100
+
101
+ When I press "Add in form"
102
+ And I press "OK"
103
+ And I wait for the response from the server
104
+ Then 2 books should exist with title: "Lolita", exemplars: 100, digitized: true, author: that author
105
+
106
+ @javascript
107
+ Scenario: Inline editing
108
+ Given a book exists with title: "Magus", exemplars: 100
109
+ When I go to the BookGrid test page
110
+ And I edit row 1 of the grid with title: "Collector", exemplars: 200
111
+ And I press "Apply"
112
+ And I wait for the response from the server
113
+ Then the grid should have 0 modified records
114
+ And a book should exist with title: "Collector", exemplars: 200
115
+ But a book should not exist with title: "Magus"
116
+
117
+ @javascript
118
+ Scenario: Inline editing of association
119
+ Given an author exists with first_name: "Vladimir", last_name: "Nabokov"
120
+ And a book exists with title: "Lolita", author: that author
121
+ And an author exists with first_name: "Herman", last_name: "Hesse"
122
+ When I go to the BookGrid test page
123
+ And I expand combobox "author__name" in row 1 of the grid
124
+ And I wait for the response from the server
125
+ And I select "Hesse, Herman" in combobox "author__name" in row 1 of the grid
126
+ And I edit row 1 of the grid with title: "Demian"
127
+ And I stop editing the grid
128
+ Then I should see "Hesse, Herman" within "#book_grid"
129
+
130
+ When I press "Apply"
131
+ And I wait for the response from the server
132
+ Then a book should exist with title: "Demian", author: that author
133
+ But a book should not exist with title: "Lolita"
134
+
135
+ @javascript
136
+ Scenario: Inline adding of records
137
+ Given an author: "Nabokov" exists with first_name: "Vladimir", last_name: "Nabokov"
138
+ And an author: "Hesse" exists with first_name: "Herman", last_name: "Hesse"
139
+
140
+ When I go to the BookGrid test page
141
+ And I press "Add"
142
+ And I expand combobox "author__name" in row 1 of the grid
143
+ And I wait for the response from the server
144
+ And I select "Hesse, Herman" in combobox "author__name" in row 1 of the grid
145
+ And I edit row 1 of the grid with title: "Demian"
146
+
147
+ And I press "Add"
148
+ And I expand combobox "author__name" in row 2 of the grid
149
+ And I wait for the response from the server
150
+ And I select "Nabokov, Vladimir" in combobox "author__name" in row 2 of the grid
151
+ And I edit row 2 of the grid with title: "Lolita"
152
+
153
+ And I stop editing the grid
154
+ And I press "Apply"
155
+ And I wait for the response from the server
156
+ Then a book should exist with title: "Lolita", author: author "Nabokov"
157
+ And a book should exist with title: "Demian", author: author "Hesse"
158
+
159
+ @javascript
160
+ Scenario: Inline adding of records in GridPanel with default values
161
+ Given an author: "Nabokov" exists with first_name: "Vladimir", last_name: "Nabokov"
162
+ And an author: "Hesse" exists with first_name: "Herman", last_name: "Hesse"
163
+
164
+ When I go to the BookGridWithDefaultValues test page
165
+ And I press "Add"
166
+ And I expand combobox "author__last_name" in row 1 of the grid
167
+ And I wait for the response from the server
168
+ And I select "Hesse" in combobox "author__last_name" in row 1 of the grid
169
+ And I edit row 1 of the grid with title: "Demian"
170
+
171
+ And I stop editing the grid
172
+ And I press "Apply"
173
+ And I wait for the response from the server
174
+ Then a book should exist with title: "Demian", author: author "Hesse"
175
+
176
+ @javascript
177
+ Scenario: Renderers for association columns should take effect
178
+ Given an author exists with first_name: "Vladimir", last_name: "Nabokov"
179
+ And a book exists with title: "Lolita", author: that author
180
+ When I go to the BookGridWithCustomColumns test page
181
+ Then I should see "NABOKOV"
182
+ And I should see "*Vladimir*"
183
+
184
+ @javascript
185
+ Scenario: Reloading grid data
186
+ Given a book exists with title: "Magus"
187
+ When I go to the BookGrid test page
188
+ And I reload the grid
189
+ And I reload the grid
190
+ Then I should not see "Internal Server Error"
191
+
192
+ @javascript
193
+ Scenario: Advanced search window should be hidable after loading grid panel dynamically second time
194
+ Given I am on the BookGridLoader test page
195
+ When I press "Load one"
196
+ And I wait for the response from the server
197
+ And I press "Search"
198
+ And I press "Cancel"
199
+
200
+ When I press "Load two"
201
+ And I wait for the response from the server
202
+
203
+ When I press "Load one"
204
+ And I wait for the response from the server
205
+
206
+ And I press "Search" within "#book_grid_loader__book_grid_one"
207
+ And I wait for the response from the server
208
+ And I press "Cancel" within "#book_grid_loader__book_grid_one__search_form"
209
+ Then the "book_grid_loader__book_grid_one__search_form" component should be hidden
210
+
211
+ @javascript
212
+ Scenario: Column order should be saved across page reloads
213
+ Given I am on the BookGridWithPersistence test page
214
+ When I drag "Digitized" column before "Title"
215
+ And I wait for the response from the server
216
+ And I go to the BookGridWithPersistence test page
217
+ Then I should see columns in order: "Digitized", "Title", "Exemplars"
218
+
219
+ @javascript
220
+ Scenario: I must see total records value
221
+ Given the following books exist:
222
+ | title |
223
+ | Journey to Ixtlan |
224
+ | Lolita |
225
+ | Getting Things Done |
226
+ | Magus |
227
+
228
+ When I go to the BookGridWithPaging test page
229
+ Then I should see "of 2" within paging toolbar
230
+
231
+ @javascript
232
+ Scenario: GridPanel with overridden columns
233
+ Given an author exists with first_name: "Vladimir", last_name: "Nabokov"
234
+ And a book exists with title: "Lolita", author: that author
235
+ When I go to the BookGridWithOverriddenColumns test page
236
+ Then I should see "LOLITA"
237
+ And I should see "Nabokov, Vladimir"
238
+
239
+ @javascript
240
+ Scenario: Virtual attributes should not be sortable
241
+ Given a book exists with title: "Some Title"
242
+ When I go to the BookGridWithVirtualAttributes test page
243
+ Then the grid's column "In abundance" should not be sortable
244
+
245
+ @javascript
246
+ Scenario: Virtual attributes should not be editable
247
+ Given a book exists with title: "Some Title"
248
+ When I go to the BookGridWithVirtualAttributes test page
249
+ Then the grid's column "In abundance" should not be editable
250
+
251
+ @javascript
252
+ Scenario: Delete record via an column action
253
+ Given a book exists with title: "Some Title"
254
+ When I go to the BookGridWithColumnActions test page
255
+ And I click the "Delete row" action icon
256
+ And I press "Yes"
257
+ Then I should see "Deleted 1 record(s)"
258
+ And a book should not exist with title: "Some Title"
259
+
260
+ @javascript
261
+ Scenario: Pagination in grid panel
262
+ Given the following books exist:
263
+ | title |
264
+ | Journey to Ixtlan |
265
+ | Lolita |
266
+ | Getting Things Done |
267
+ | Magus |
268
+ When I go to the BookGridWithPaging test page
269
+ Then I should see "Journey to Ixtlan"
270
+ And I should see "Lolita"
271
+ But I should not see "Getting Things Done"
272
+ And the grid should show 2 records
273
+
274
+ When I go forward one page
275
+ And I wait for the response from the server
276
+ Then I should see "Getting Things Done"
277
+ And I should see "Magus"