opensteam 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (265) hide show
  1. data/CHANGELOG +78 -0
  2. data/LICENSE +345 -0
  3. data/{README.txt → README.rdoc} +20 -17
  4. data/Rakefile +40 -0
  5. data/generators/opensteam/opensteam_generator.rb +95 -194
  6. data/generators/opensteam/templates/{controllers/administration → app/controllers/admin}/inventories_controller.rb +4 -4
  7. data/generators/opensteam/templates/app/controllers/admin/invoices_controller.rb +106 -0
  8. data/generators/opensteam/templates/app/controllers/admin/orders_controller.rb +113 -0
  9. data/generators/opensteam/templates/app/controllers/admin/search_controller.rb +17 -0
  10. data/generators/opensteam/templates/app/controllers/admin/shipments_controller.rb +106 -0
  11. data/generators/opensteam/templates/app/controllers/admin/users_controller.rb +99 -0
  12. data/generators/opensteam/templates/app/controllers/admin_controller.rb +40 -0
  13. data/generators/opensteam/templates/app/controllers/cart_controller.rb +94 -0
  14. data/generators/opensteam/templates/app/controllers/checkout_controller.rb +139 -0
  15. data/generators/opensteam/templates/app/controllers/profile/infos_controller.rb +52 -0
  16. data/generators/opensteam/templates/app/controllers/profile/orders_controller.rb +105 -0
  17. data/generators/opensteam/templates/app/controllers/profile_controller.rb +37 -0
  18. data/generators/opensteam/templates/app/controllers/searches_controller.rb +23 -0
  19. data/generators/opensteam/templates/app/controllers/user_sessions_controller.rb +38 -0
  20. data/generators/opensteam/templates/app/controllers/users_controller.rb +40 -0
  21. data/generators/opensteam/templates/{controllers → app/controllers}/webshop_controller.rb +35 -13
  22. data/generators/opensteam/templates/app/helpers/admin_helper.rb +40 -0
  23. data/generators/opensteam/templates/app/helpers/users_helper.rb +53 -0
  24. data/generators/opensteam/templates/app/helpers/webshop_helper.rb +91 -0
  25. data/generators/opensteam/templates/app/models/search.rb +36 -0
  26. data/generators/opensteam/templates/{views/administration → app/views/admin}/_address.html.erb +0 -0
  27. data/generators/opensteam/templates/app/views/admin/_nav.html.erb +5 -0
  28. data/generators/opensteam/templates/app/views/admin/catalog.html.erb +5 -0
  29. data/generators/opensteam/templates/app/views/admin/index.html.erb +21 -0
  30. data/generators/opensteam/templates/{views/administration → app/views/admin}/inventories/edit.html.erb +10 -9
  31. data/generators/opensteam/templates/{views/administration → app/views/admin}/inventories/index.html.erb +3 -3
  32. data/generators/opensteam/templates/{views/administration → app/views/admin}/inventories/new.html.erb +3 -3
  33. data/generators/opensteam/templates/app/views/admin/inventories/show.html.erb +46 -0
  34. data/generators/opensteam/templates/app/views/admin/invoices/_invoice.html.erb +12 -0
  35. data/generators/opensteam/templates/app/views/admin/invoices/_invoices.html.erb +11 -0
  36. data/generators/opensteam/templates/app/views/admin/invoices/index.html.erb +6 -0
  37. data/generators/opensteam/templates/app/views/admin/invoices/new.html.erb +54 -0
  38. data/generators/opensteam/templates/app/views/admin/invoices/show.html.erb +55 -0
  39. data/generators/opensteam/templates/app/views/admin/orders/_event.html.erb +5 -0
  40. data/generators/opensteam/templates/app/views/admin/orders/_order.html.erb +11 -0
  41. data/generators/opensteam/templates/app/views/admin/orders/_order_item.html.erb +10 -0
  42. data/generators/opensteam/templates/app/views/admin/orders/_orders.html.erb +19 -0
  43. data/generators/opensteam/templates/app/views/admin/orders/index.html.erb +14 -0
  44. data/generators/opensteam/templates/app/views/admin/orders/livesearch.rjs +6 -0
  45. data/generators/opensteam/templates/app/views/admin/orders/show.html.erb +58 -0
  46. data/generators/opensteam/templates/app/views/admin/products.html.erb +8 -0
  47. data/generators/opensteam/templates/app/views/admin/properties.html.erb +7 -0
  48. data/generators/opensteam/templates/app/views/admin/sales.html.erb +5 -0
  49. data/generators/opensteam/templates/app/views/admin/shipments/_shipment.erb +11 -0
  50. data/generators/opensteam/templates/app/views/admin/shipments/_shipments.html.erb +11 -0
  51. data/generators/opensteam/templates/app/views/admin/shipments/index.html.erb +6 -0
  52. data/generators/opensteam/templates/app/views/admin/shipments/new.html.erb +51 -0
  53. data/generators/opensteam/templates/app/views/admin/shipments/show.html.erb +55 -0
  54. data/generators/opensteam/templates/app/views/admin/users/_admins.html.erb +26 -0
  55. data/generators/opensteam/templates/app/views/admin/users/_admins_header.html.erb +10 -0
  56. data/generators/opensteam/templates/app/views/admin/users/_customer.html.erb +32 -0
  57. data/generators/opensteam/templates/app/views/admin/users/_customers.html.erb +29 -0
  58. data/generators/opensteam/templates/app/views/admin/users/_customers_header.html.erb +11 -0
  59. data/generators/opensteam/templates/app/views/admin/users/_user_fields.html.erb +9 -0
  60. data/generators/opensteam/templates/app/views/admin/users/_users.html.erb +29 -0
  61. data/generators/opensteam/templates/app/views/admin/users/_users_header.html.erb +11 -0
  62. data/generators/opensteam/templates/app/views/admin/users/edit.html.erb +6 -0
  63. data/generators/opensteam/templates/app/views/admin/users/index.html.erb +7 -0
  64. data/generators/opensteam/templates/app/views/admin/users/new.html.erb +6 -0
  65. data/generators/opensteam/templates/app/views/admin/users/show.html.erb +34 -0
  66. data/generators/opensteam/templates/app/views/admin/users.html.erb +4 -0
  67. data/generators/opensteam/templates/{views → app/views}/administration_mailer/order_admin.erb +0 -0
  68. data/generators/opensteam/templates/{views → app/views}/administration_mailer/order_customer.erb +0 -0
  69. data/generators/opensteam/templates/app/views/cart/_cart.html.erb +8 -0
  70. data/generators/opensteam/templates/{views/webshop → app/views/cart}/_cart_content.html.erb +7 -10
  71. data/generators/opensteam/templates/app/views/cart/index.html.erb +5 -0
  72. data/generators/opensteam/templates/app/views/cart/update.rjs +1 -0
  73. data/generators/opensteam/templates/app/views/checkout/intro.html.erb +18 -0
  74. data/generators/opensteam/templates/{views → app/views}/checkout/outro.html.erb +0 -1
  75. data/generators/opensteam/templates/{views → app/views}/checkout/payment.html.erb +0 -0
  76. data/generators/opensteam/templates/app/views/checkout/shipping.html.erb +45 -0
  77. data/generators/opensteam/templates/app/views/checkout/show_cart.html.erb +13 -0
  78. data/generators/opensteam/templates/{views → app/views}/checkout/update_cart_content.rjs +0 -0
  79. data/generators/opensteam/templates/{views → app/views}/common/_cart.html.erb +2 -2
  80. data/generators/opensteam/templates/{views → app/views}/common/_cart_content.html.erb +1 -1
  81. data/generators/opensteam/templates/app/views/common/_footer.html.erb +1 -0
  82. data/generators/opensteam/templates/app/views/common/_header.html.erb +4 -0
  83. data/generators/opensteam/templates/app/views/common/_header_flash.html.erb +3 -0
  84. data/generators/opensteam/templates/app/views/common/_signup_fields.html.erb +16 -0
  85. data/generators/opensteam/templates/app/views/common/_top_links.html.erb +10 -0
  86. data/generators/opensteam/templates/app/views/layouts/admin.html.erb +45 -0
  87. data/generators/opensteam/templates/app/views/layouts/profile.html.erb +45 -0
  88. data/generators/opensteam/templates/app/views/layouts/webshop.html.erb +51 -0
  89. data/generators/opensteam/templates/app/views/profile/_customer_sidebar.html.erb +12 -0
  90. data/generators/opensteam/templates/app/views/profile/index.html.erb +11 -0
  91. data/generators/opensteam/templates/app/views/profile/infos/_customer.html.erb +5 -0
  92. data/generators/opensteam/templates/app/views/profile/infos/edit.html.erb +25 -0
  93. data/generators/opensteam/templates/app/views/profile/infos/edit_password.html.erb +26 -0
  94. data/generators/opensteam/templates/app/views/profile/orders/_order.html.erb +11 -0
  95. data/generators/opensteam/templates/app/views/profile/orders/_order_item.html.erb +10 -0
  96. data/generators/opensteam/templates/app/views/profile/orders/_orders.html.erb +19 -0
  97. data/generators/opensteam/templates/app/views/profile/orders/index.html.erb +14 -0
  98. data/generators/opensteam/templates/app/views/profile/orders/show.html.erb +48 -0
  99. data/generators/opensteam/templates/app/views/searches/_search_bar.html.erb +5 -0
  100. data/generators/opensteam/templates/app/views/searches/new.html.erb +23 -0
  101. data/generators/opensteam/templates/app/views/searches/show.html.erb +1 -0
  102. data/generators/opensteam/templates/app/views/user_sessions/new.html.erb +14 -0
  103. data/generators/opensteam/templates/app/views/users/_user_bar.html.erb +5 -0
  104. data/generators/opensteam/templates/app/views/users/index.html.erb +27 -0
  105. data/generators/opensteam/templates/app/views/users/new.html.erb +7 -0
  106. data/generators/opensteam/templates/app/views/users/show.html.erb +5 -0
  107. data/generators/opensteam/templates/{views → app/views}/webshop/_inventory_content.html.erb +0 -0
  108. data/generators/opensteam/templates/app/views/webshop/_nav.html.erb +6 -0
  109. data/generators/opensteam/templates/{views → app/views}/webshop/add_inventory_to_cart.rjs +0 -0
  110. data/generators/opensteam/templates/{views → app/views}/webshop/add_to_cart_with_parameters.rjs +0 -0
  111. data/generators/opensteam/templates/{views → app/views}/webshop/del_item.rjs +0 -0
  112. data/generators/opensteam/templates/app/views/webshop/index.html.erb +11 -0
  113. data/generators/opensteam/templates/{views → app/views}/webshop/inventory.rjs +0 -0
  114. data/generators/opensteam/templates/{views → app/views}/webshop/show.html.erb +15 -15
  115. data/generators/opensteam/templates/config/initializers/init_states.rb +68 -0
  116. data/generators/opensteam/templates/{init → config/initializers}/opensteam.rb +6 -0
  117. data/generators/opensteam/templates/config/initializers/opensteam_model_tables.rb +57 -0
  118. data/generators/opensteam/templates/db/migrate/20080609095714_create_profiles.rb +14 -0
  119. data/generators/opensteam/templates/{migrations/create_sessions.rb → db/migrate/20080609095720_create_sessions.rb} +0 -0
  120. data/generators/opensteam/templates/db/migrate/20080609095721_create_users.rb +29 -0
  121. data/generators/opensteam/templates/{migrations/create_addresses.rb → db/migrate/20080609095723_create_addresses.rb} +0 -0
  122. data/generators/opensteam/templates/{migrations/create_customers.rb → db/migrate/20080609095724_create_customers.rb} +0 -0
  123. data/generators/opensteam/templates/db/migrate/20080609095725_create_dummy_users.rb +21 -0
  124. data/generators/opensteam/templates/{migrations/create_inventories.rb → db/migrate/20080609095726_create_inventories.rb} +0 -0
  125. data/generators/opensteam/templates/{migrations/create_inventories_properties.rb → db/migrate/20080609095727_create_inventories_properties.rb} +0 -0
  126. data/generators/opensteam/templates/{migrations/create_order_items.rb → db/migrate/20080609095728_create_order_items.rb} +5 -0
  127. data/generators/opensteam/templates/db/migrate/20080609095729_create_orders.rb +32 -0
  128. data/generators/opensteam/templates/{migrations/create_payment_types.rb → db/migrate/20080609095730_create_payment_types.rb} +0 -0
  129. data/generators/opensteam/templates/{migrations/create_properties.rb → db/migrate/20080609095731_create_properties.rb} +0 -0
  130. data/generators/opensteam/templates/db/migrate/20080623075613_create_states.rb +13 -0
  131. data/generators/opensteam/templates/db/migrate/20080624132807_create_searches.rb +20 -0
  132. data/generators/opensteam/templates/db/migrate/20080630114155_create_state_histories.rb +14 -0
  133. data/generators/opensteam/templates/db/migrate/20080714131513_create_invoices.rb +20 -0
  134. data/generators/opensteam/templates/db/migrate/20080714131650_create_shipments.rb +19 -0
  135. data/generators/opensteam/templates/lib/authenticated_system.rb +201 -0
  136. data/generators/opensteam/templates/lib/authentication/by_cookie_token.rb +90 -0
  137. data/generators/opensteam/templates/lib/authentication/by_password.rb +68 -0
  138. data/generators/opensteam/templates/lib/authentication.rb +46 -0
  139. data/generators/opensteam/templates/lib/states/invoice/finished.rb +6 -0
  140. data/generators/opensteam/templates/lib/states/invoice/payment_received.rb +8 -0
  141. data/generators/opensteam/templates/lib/states/invoice/pending.rb +6 -0
  142. data/generators/opensteam/templates/lib/states/invoice/waiting_for_payment.rb +5 -0
  143. data/generators/opensteam/templates/lib/states/order/finished.rb +6 -0
  144. data/generators/opensteam/templates/lib/states/order/pending.rb +19 -0
  145. data/generators/opensteam/templates/lib/states/order/processing.rb +11 -0
  146. data/generators/opensteam/templates/lib/states/shipment/finished.rb +6 -0
  147. data/generators/opensteam/templates/lib/states/shipment/pending.rb +5 -0
  148. data/generators/opensteam/templates/lib/tasks/opensteam.rake +114 -0
  149. data/generators/opensteam/templates/public/images/athmo_background.jpg +0 -0
  150. data/generators/opensteam/templates/public/images/bg.jpg +0 -0
  151. data/generators/opensteam/templates/public/images/cart_big.gif +0 -0
  152. data/generators/opensteam/templates/public/images/cross.png +0 -0
  153. data/generators/opensteam/templates/public/images/enter.gif +0 -0
  154. data/generators/opensteam/templates/public/images/menu_background.jpg +0 -0
  155. data/generators/opensteam/templates/public/images/opensteam_background.jpg +0 -0
  156. data/generators/opensteam/templates/public/images/opensteam_logo1.jpg +0 -0
  157. data/generators/opensteam/templates/public/images/opensteam_petstore_logo1.jpg +0 -0
  158. data/generators/opensteam/templates/public/images/opensteam_store_logo.jpg +0 -0
  159. data/generators/opensteam/templates/public/images/os_logo.gif +0 -0
  160. data/generators/opensteam/templates/public/images/slogan.png +0 -0
  161. data/generators/opensteam/templates/public/images/tick.png +0 -0
  162. data/generators/opensteam/templates/public/images/zoom.png +0 -0
  163. data/generators/opensteam/templates/public/index.html +19 -36
  164. data/generators/opensteam/templates/public/javascripts/opensteam.js +30 -0
  165. data/generators/opensteam/templates/public/stylesheets/opensteam_newdesign.css +188 -0
  166. data/generators/opensteam/templates/public/stylesheets/opensteam_white.css +168 -0
  167. data/generators/opensteam/templates/public/stylesheets/webshop.css +0 -1
  168. data/generators/opensteam/templates/tasks/opensteam.rake +1 -1
  169. data/generators/opensteam/templates/{fixtures → test/fixtures}/inventories.yml +0 -0
  170. data/generators/opensteam/templates/{fixtures → test/fixtures}/inventories_properties.yml +0 -0
  171. data/generators/opensteam/templates/{fixtures → test/fixtures}/product_animals.yml +0 -0
  172. data/generators/opensteam/templates/{fixtures → test/fixtures}/product_dog_foods.yml +0 -0
  173. data/generators/opensteam/templates/{fixtures → test/fixtures}/properties.yml +0 -0
  174. data/generators/opensteam_product/opensteam_product_generator.rb +25 -9
  175. data/generators/opensteam_product/templates/controllers/product_controller.rb +5 -4
  176. data/generators/opensteam_product/templates/migration.rb +2 -1
  177. data/generators/opensteam_product/templates/models/product.rb +1 -0
  178. data/generators/opensteam_product/templates/views/{administration → admin}/_attributes.html.erb +1 -1
  179. data/generators/opensteam_product/templates/views/{administration → admin}/_get_products.html.erb +0 -0
  180. data/generators/opensteam_product/templates/views/{administration → admin}/_inventories.html.erb +2 -2
  181. data/generators/opensteam_product/templates/views/admin/edit.html.erb +13 -0
  182. data/generators/opensteam_product/templates/views/{administration → admin}/index.html.erb +5 -5
  183. data/generators/opensteam_product/templates/views/admin/new.html.erb +16 -0
  184. data/generators/opensteam_product/templates/views/{administration → admin}/show.html.erb +2 -2
  185. data/generators/opensteam_property/opensteam_property_generator.rb +8 -8
  186. data/generators/opensteam_property/templates/controllers/property_controller.rb +6 -4
  187. data/generators/opensteam_property/templates/migration.rb +2 -1
  188. data/generators/opensteam_property/templates/models/property.rb +1 -0
  189. data/generators/opensteam_property/templates/views/{administration → admin}/edit.html.erb +3 -3
  190. data/generators/opensteam_property/templates/views/admin/index.html.erb +24 -0
  191. data/generators/opensteam_property/templates/views/{administration → admin}/new.html.erb +2 -2
  192. data/generators/opensteam_property/templates/views/admin/show.html.erb +10 -0
  193. data/lib/opensteam/base.rb +16 -0
  194. data/lib/opensteam/cart_base.rb +227 -0
  195. data/lib/opensteam/checkout.rb +30 -3
  196. data/lib/opensteam/config.rb +37 -0
  197. data/lib/opensteam/extension_base.rb +76 -0
  198. data/lib/opensteam/finder.rb +36 -5
  199. data/lib/opensteam/helper/configurable_table.rb +228 -0
  200. data/lib/opensteam/history.rb +56 -0
  201. data/lib/opensteam/initializer.rb +127 -0
  202. data/lib/opensteam/inventory_base.rb +24 -1
  203. data/lib/opensteam/invoice_base.rb +61 -0
  204. data/lib/opensteam/order_base.rb +105 -14
  205. data/lib/opensteam/product_base.rb +31 -3
  206. data/lib/opensteam/property_base.rb +16 -0
  207. data/lib/opensteam/shipment_base.rb +60 -0
  208. data/lib/opensteam/shopping_cart.rb +32 -14
  209. data/lib/opensteam/state_logic.rb +218 -0
  210. data/lib/opensteam/state_machine.rb +216 -0
  211. data/lib/opensteam/user_base.rb +115 -131
  212. data/lib/opensteam/version.rb +17 -1
  213. data/lib/opensteam.rb +30 -35
  214. metadata +245 -146
  215. data/History.txt +0 -0
  216. data/License.txt +0 -4
  217. data/Manifest.txt +0 -131
  218. data/Manifest.txt.bak +0 -132
  219. data/generators/opensteam/templates/controllers/administration/customers_controller.rb +0 -23
  220. data/generators/opensteam/templates/controllers/administration/orders_controller.rb +0 -61
  221. data/generators/opensteam/templates/controllers/administration_controller.rb +0 -80
  222. data/generators/opensteam/templates/controllers/checkout_controller.rb +0 -142
  223. data/generators/opensteam/templates/helpers/webshop_helper.rb +0 -29
  224. data/generators/opensteam/templates/migrations/create_dummy_users.rb +0 -16
  225. data/generators/opensteam/templates/migrations/create_orders.rb +0 -18
  226. data/generators/opensteam/templates/migrations/create_users.rb +0 -19
  227. data/generators/opensteam/templates/models/administration_mailer.rb +0 -18
  228. data/generators/opensteam/templates/models/inventories_property.rb +0 -10
  229. data/generators/opensteam/templates/models/inventory.rb +0 -57
  230. data/generators/opensteam/templates/public/images/rails.png +0 -0
  231. data/generators/opensteam/templates/views/administration/_nav.html.erb +0 -11
  232. data/generators/opensteam/templates/views/administration/_update_tree.html.erb +0 -18
  233. data/generators/opensteam/templates/views/administration/admin_info.html.erb +0 -12
  234. data/generators/opensteam/templates/views/administration/customers/index.html.erb +0 -27
  235. data/generators/opensteam/templates/views/administration/customers/show.html.erb +0 -27
  236. data/generators/opensteam/templates/views/administration/customers.html.erb +0 -44
  237. data/generators/opensteam/templates/views/administration/index.html.erb +0 -9
  238. data/generators/opensteam/templates/views/administration/inventories/show.html.erb +0 -45
  239. data/generators/opensteam/templates/views/administration/login.html.erb +0 -16
  240. data/generators/opensteam/templates/views/administration/order.html.erb +0 -22
  241. data/generators/opensteam/templates/views/administration/orders/_order_item.html.erb +0 -22
  242. data/generators/opensteam/templates/views/administration/orders/index.html.erb +0 -32
  243. data/generators/opensteam/templates/views/administration/orders/show.html.erb +0 -25
  244. data/generators/opensteam/templates/views/administration/orders.html.erb +0 -32
  245. data/generators/opensteam/templates/views/administration/products.html.erb +0 -7
  246. data/generators/opensteam/templates/views/administration/properties.html.erb +0 -7
  247. data/generators/opensteam/templates/views/administration/show_order_item.html.erb +0 -5
  248. data/generators/opensteam/templates/views/administration/signup.html.erb +0 -65
  249. data/generators/opensteam/templates/views/administration/tree.html.erb +0 -15
  250. data/generators/opensteam/templates/views/administration/update_products.html.erb +0 -5
  251. data/generators/opensteam/templates/views/administration/update_properties.html.erb +0 -5
  252. data/generators/opensteam/templates/views/administration/update_tree.rjs +0 -3
  253. data/generators/opensteam/templates/views/checkout/intro.html.erb +0 -5
  254. data/generators/opensteam/templates/views/checkout/shipping.html.erb +0 -39
  255. data/generators/opensteam/templates/views/checkout/show_cart.html.erb +0 -13
  256. data/generators/opensteam/templates/views/common/_header.html.erb +0 -15
  257. data/generators/opensteam/templates/views/layouts/administration.html.erb +0 -29
  258. data/generators/opensteam/templates/views/layouts/webshop.html.erb +0 -36
  259. data/generators/opensteam/templates/views/webshop/_cart.html.erb +0 -11
  260. data/generators/opensteam/templates/views/webshop/_header.html.erb +0 -15
  261. data/generators/opensteam/templates/views/webshop/index.html.erb +0 -12
  262. data/generators/opensteam_product/templates/views/administration/edit.html.erb +0 -13
  263. data/generators/opensteam_product/templates/views/administration/new.html.erb +0 -16
  264. data/generators/opensteam_property/templates/views/administration/index.html.erb +0 -24
  265. data/generators/opensteam_property/templates/views/administration/show.html.erb +0 -10
data/Manifest.txt.bak DELETED
@@ -1,132 +0,0 @@
1
- History.txt
2
- License.txt
3
- Manifest.txt
4
- Manifest.txt.bak
5
- README.txt
6
- generators/opensteam/opensteam_generator.rb
7
- generators/opensteam/templates/controllers/administration/customers_controller.rb
8
- generators/opensteam/templates/controllers/administration/inventories_controller.rb
9
- generators/opensteam/templates/controllers/administration/orders_controller.rb
10
- generators/opensteam/templates/controllers/administration_controller.rb
11
- generators/opensteam/templates/controllers/checkout_controller.rb
12
- generators/opensteam/templates/controllers/webshop_controller.rb
13
- generators/opensteam/templates/fixtures/inventories.yml
14
- generators/opensteam/templates/fixtures/inventories_properties.yml
15
- generators/opensteam/templates/fixtures/product_animals.yml
16
- generators/opensteam/templates/fixtures/product_dog_foods.yml
17
- generators/opensteam/templates/fixtures/properties.yml
18
- generators/opensteam/templates/helpers/webshop_helper.rb
19
- generators/opensteam/templates/init/opensteam.rb
20
- generators/opensteam/templates/migrations/create_addresses.rb
21
- generators/opensteam/templates/migrations/create_customers.rb
22
- generators/opensteam/templates/migrations/create_dummy_users.rb
23
- generators/opensteam/templates/migrations/create_inventories.rb
24
- generators/opensteam/templates/migrations/create_inventories_properties.rb
25
- generators/opensteam/templates/migrations/create_order_items.rb
26
- generators/opensteam/templates/migrations/create_orders.rb
27
- generators/opensteam/templates/migrations/create_payment_types.rb
28
- generators/opensteam/templates/migrations/create_properties.rb
29
- generators/opensteam/templates/migrations/create_sessions.rb
30
- generators/opensteam/templates/migrations/create_users.rb
31
- generators/opensteam/templates/models/administration_mailer.rb
32
- generators/opensteam/templates/models/inventories_property.rb
33
- generators/opensteam/templates/models/inventory.rb
34
- generators/opensteam/templates/public/images/bullet_arrow_down.png
35
- generators/opensteam/templates/public/images/bullet_arrow_up.png
36
- generators/opensteam/templates/public/images/cancel.png
37
- generators/opensteam/templates/public/images/folder_database.png
38
- generators/opensteam/templates/public/images/indicator.gif
39
- generators/opensteam/templates/public/images/indicator_big.gif
40
- generators/opensteam/templates/public/images/minus.png
41
- generators/opensteam/templates/public/images/opensteam_logo_small.jpg
42
- generators/opensteam/templates/public/images/opensteam_logo_web.jpg
43
- generators/opensteam/templates/public/images/palette.png
44
- generators/opensteam/templates/public/images/plus.png
45
- generators/opensteam/templates/public/images/rails.png
46
- generators/opensteam/templates/public/index.html
47
- generators/opensteam/templates/public/stylesheets/webshop.css
48
- generators/opensteam/templates/tasks/opensteam.rake
49
- generators/opensteam/templates/views/administration/_address.html.erb
50
- generators/opensteam/templates/views/administration/_nav.html.erb
51
- generators/opensteam/templates/views/administration/_update_tree.html.erb
52
- generators/opensteam/templates/views/administration/admin_info.html.erb
53
- generators/opensteam/templates/views/administration/customers.html.erb
54
- generators/opensteam/templates/views/administration/customers/index.html.erb
55
- generators/opensteam/templates/views/administration/customers/show.html.erb
56
- generators/opensteam/templates/views/administration/index.html.erb
57
- generators/opensteam/templates/views/administration/inventories/edit.html.erb
58
- generators/opensteam/templates/views/administration/inventories/index.html.erb
59
- generators/opensteam/templates/views/administration/inventories/new.html.erb
60
- generators/opensteam/templates/views/administration/inventories/show.html.erb
61
- generators/opensteam/templates/views/administration/login.html.erb
62
- generators/opensteam/templates/views/administration/order.html.erb
63
- generators/opensteam/templates/views/administration/orders.html.erb
64
- generators/opensteam/templates/views/administration/orders/_order_item.html.erb
65
- generators/opensteam/templates/views/administration/orders/index.html.erb
66
- generators/opensteam/templates/views/administration/orders/show.html.erb
67
- generators/opensteam/templates/views/administration/products.html.erb
68
- generators/opensteam/templates/views/administration/properties.html.erb
69
- generators/opensteam/templates/views/administration/show_order_item.html.erb
70
- generators/opensteam/templates/views/administration/signup.html.erb
71
- generators/opensteam/templates/views/administration/tree.html.erb
72
- generators/opensteam/templates/views/administration/update_products.html.erb
73
- generators/opensteam/templates/views/administration/update_properties.html.erb
74
- generators/opensteam/templates/views/administration/update_tree.rjs
75
- generators/opensteam/templates/views/administration_mailer/order_admin.erb
76
- generators/opensteam/templates/views/administration_mailer/order_customer.erb
77
- generators/opensteam/templates/views/checkout/intro.html.erb
78
- generators/opensteam/templates/views/checkout/outro.html.erb
79
- generators/opensteam/templates/views/checkout/payment.html.erb
80
- generators/opensteam/templates/views/checkout/shipping.html.erb
81
- generators/opensteam/templates/views/checkout/show_cart.html.erb
82
- generators/opensteam/templates/views/checkout/update_cart_content.rjs
83
- generators/opensteam/templates/views/common/_cart.html.erb
84
- generators/opensteam/templates/views/common/_cart_content.html.erb
85
- generators/opensteam/templates/views/common/_header.html.erb
86
- generators/opensteam/templates/views/layouts/administration.html.erb
87
- generators/opensteam/templates/views/layouts/webshop.html.erb
88
- generators/opensteam/templates/views/webshop/_cart.html.erb
89
- generators/opensteam/templates/views/webshop/_cart_content.html.erb
90
- generators/opensteam/templates/views/webshop/_header.html.erb
91
- generators/opensteam/templates/views/webshop/_inventory_content.html.erb
92
- generators/opensteam/templates/views/webshop/add_inventory_to_cart.rjs
93
- generators/opensteam/templates/views/webshop/add_to_cart_with_parameters.rjs
94
- generators/opensteam/templates/views/webshop/del_item.rjs
95
- generators/opensteam/templates/views/webshop/index.html.erb
96
- generators/opensteam/templates/views/webshop/inventory.rjs
97
- generators/opensteam/templates/views/webshop/show.html.erb
98
- generators/opensteam_product/opensteam_product_generator.rb
99
- generators/opensteam_product/templates/controllers/product_controller.rb
100
- generators/opensteam_product/templates/migration.rb
101
- generators/opensteam_product/templates/models/product.rb
102
- generators/opensteam_product/templates/views/_attr_product.html.erb
103
- generators/opensteam_product/templates/views/_attr_property.html.erb
104
- generators/opensteam_product/templates/views/_details.html.erb
105
- generators/opensteam_product/templates/views/administration/_attributes.html.erb
106
- generators/opensteam_product/templates/views/administration/_get_products.html.erb
107
- generators/opensteam_product/templates/views/administration/_inventories.html.erb
108
- generators/opensteam_product/templates/views/administration/edit.html.erb
109
- generators/opensteam_product/templates/views/administration/index.html.erb
110
- generators/opensteam_product/templates/views/administration/new.html.erb
111
- generators/opensteam_product/templates/views/administration/show.html.erb
112
- generators/opensteam_property/opensteam_property_generator.rb
113
- generators/opensteam_property/templates/controllers/property_controller.rb
114
- generators/opensteam_property/templates/migration.rb
115
- generators/opensteam_property/templates/models/property.rb
116
- generators/opensteam_property/templates/views/administration/edit.html.erb
117
- generators/opensteam_property/templates/views/administration/index.html.erb
118
- generators/opensteam_property/templates/views/administration/new.html.erb
119
- generators/opensteam_property/templates/views/administration/show.html.erb
120
- lib/opensteam.rb
121
- lib/opensteam/base.rb
122
- lib/opensteam/checkout.rb
123
- lib/opensteam/config.rb
124
- lib/opensteam/finder.rb
125
- lib/opensteam/inventory_base.rb
126
- lib/opensteam/order_base.rb
127
- lib/opensteam/product_base.rb
128
- lib/opensteam/property_base.rb
129
- lib/opensteam/shopping_cart.rb
130
- lib/opensteam/user_base.rb
131
- lib/opensteam/version.rb
132
-
@@ -1,23 +0,0 @@
1
- class Administration::CustomersController < AdministrationController
2
-
3
-
4
- def index
5
- @customers = Opensteam::UserBase::Customer.find(:all)
6
-
7
- respond_to do |format|
8
- format.html # index.html.erb
9
- format.xml { render :xml => @customers }
10
- end
11
- end
12
-
13
-
14
- def show
15
- @customer = Opensteam::UserBase::Customer.find( params[:id], :include => :orders )
16
-
17
- respond_to do |format|
18
- format.html # show.html.erb
19
- format.xml { render :xml => @inventory }
20
- end
21
- end
22
-
23
- end
@@ -1,61 +0,0 @@
1
- class Administration::OrdersController < AdministrationController
2
-
3
- def index
4
- conditions =
5
- if params[:customer_id]
6
- [ "customer_id = ?", params[:customer_id] ]
7
- elsif params[:filter] == "unpaid"
8
- ["paid = 0"]
9
- elsif params[:filter] == "unshipped"
10
- ["shipped = 0"]
11
- else
12
- []
13
- end
14
- @orders = Opensteam::OrderBase::Order.find(:all, :conditions => conditions, :include => :customer )
15
-
16
- respond_to do |format|
17
- format.html # index.html.erb
18
- format.xml { render :xml => @orders }
19
- end
20
- end
21
-
22
-
23
-
24
- def show
25
- @order = Opensteam::OrderBase::Order.find(params[:id], :include => [ :order_items, :customer, :shipping_address, :payment_address] )
26
-
27
- respond_to do |format|
28
- format.html # show.html.erb
29
- format.xml { render :xml => @order }
30
- end
31
- end
32
-
33
-
34
-
35
- def toggle
36
- if params[:toggle] =~ /shipped|paid/
37
- @order = Opensteam::OrderBase::Order.find( params[:id] )
38
- @order.send("#{params[:toggle]}=", @order.send("#{params[:toggle]}") == 1 ? 0 : 1 )
39
- @order.save
40
- end
41
-
42
- redirect_to administration_order_path( @order )
43
-
44
- end
45
-
46
-
47
-
48
- def show_order_item
49
- @inventories = [ Inventory.find( Opensteam::OrderBase::OrderItem.find( params[:order_item_id] ).itemid ) ]
50
- @product = @inventories.first.product
51
- @product.selected_inventory = @inventories
52
- @properties = @inventories.first.properties.to_h2 { |x| x.class.to_s.tableize }
53
- @cart_details = true
54
- render :action => :show_order_item, :layout => false
55
- end
56
-
57
-
58
-
59
-
60
-
61
- end
@@ -1,80 +0,0 @@
1
-
2
- class AdministrationController < ApplicationController
3
- layout 'administration'
4
- before_filter :admin_required, :except => [ :login, :logout ]
5
-
6
-
7
- include Opensteam::Finder
8
-
9
-
10
- # show product classes
11
- def products
12
- @products = AdministrationController.find_product_tables #AdministrationController.find_products.collect(&:class).uniq
13
- end
14
-
15
- # show property classes
16
- def properties
17
- @properties = AdministrationController.find_property_tables #AdministrationController.find_properties.collect(&:class).uniq
18
- end
19
-
20
-
21
-
22
- def signup ## with address (virtual..)
23
- @user = Opensteam::UserBase::Customer.new(params[:customer])
24
- if request.get?
25
- @user.addresses.build
26
- elsif request.post?
27
- if @user.save
28
- session[:user_login] = Opensteam::UserBase::User.authenticate(@user.login, @user.password)
29
- flash[:notice] = "Signup successfull"
30
- redirect_to :action => :index
31
- else
32
- flash[:warning] = "signup un-successfull"
33
- end
34
- end
35
- end
36
-
37
-
38
-
39
-
40
- def login
41
- if request.post?
42
- if session[:user_login] = Opensteam::UserBase::User.authenticate(params[:user][:login], params[:user][:password])
43
- flash[:notice] = "login successfull"
44
- redirect_to_stored
45
- else
46
- flash[:warning] = "login un-successfull"
47
- end
48
- end
49
- end
50
-
51
-
52
- def customers
53
- @users = Opensteam::UserBase::Customer.find(:all)
54
- end
55
-
56
-
57
- # show admin info
58
- def admin_info
59
- @admin = Opensteam::UserBase::User.find_by_login("admin")
60
- redirect_to_stored unless @admin.is_admin?
61
- if request.put?
62
- if @admin.update_attributes( params[:admin] )
63
- flash[:notice] = 'Email was successfully changed.'
64
- redirect_to :action => :index
65
- else
66
- render :action => :change_admin_email
67
- end
68
- end
69
-
70
- end
71
-
72
-
73
- def logout
74
- session[:user_login] = nil
75
- flash[:notice] = "logout successfull"
76
- redirect_to :controller => "<%= file_name %>", :action => "index"
77
- end
78
-
79
- end
80
-
@@ -1,142 +0,0 @@
1
- # CheckoutController
2
- #
3
- # Controller to handle the checkout-process
4
- #
5
- require 'opensteam/shopping_cart'
6
- require 'opensteam/checkout'
7
- class CheckoutController < Opensteam::Checkout::CheckoutFlowController
8
- layout "<%= file_name %>"
9
-
10
-
11
- # initialize checkout-flow
12
- #
13
- def initialize
14
- create_checkout_flow do |c|
15
- c.on :start, :intro
16
- c.on :finish, :controller => "<%= file_name %>", :action => "index"
17
- end
18
- end
19
-
20
-
21
- # checkout intro
22
- #
23
- # dummy page
24
- def intro
25
- @user = get_user
26
- @cart = get_cart
27
- order = Opensteam::OrderBase::Order.create
28
- session[:active_order] = order.id
29
- end
30
-
31
-
32
-
33
-
34
- # checkout outro
35
- #
36
- # dummy page
37
- def outro
38
- session[:cart] = nil
39
- @cart = get_cart
40
- @user = get_user
41
- session[:active_order] = nil
42
- end
43
-
44
-
45
-
46
-
47
- # checkout shipping
48
- # [POST] + [GET]
49
- #
50
- # saves customer-information, shipping/payment-address
51
- #
52
- # if customer is in the database (find_by_email), the information is updated.
53
- # (for addresses, all fields have to match)
54
- #
55
- # the order is associated with the customer and the addresses.
56
- #
57
- # TODO : MOVE THIS INTO MODEL !!!
58
- #
59
-
60
- def shipping
61
- @order = Opensteam::OrderBase::Order.find( session[:active_order] )
62
- @cart = get_cart
63
-
64
- @customer = Opensteam::UserBase::Customer.new
65
- @shipping_address = Opensteam::UserBase::Address.new
66
- @payment_address = Opensteam::UserBase::Address.new
67
-
68
- #saving the form
69
- if request.post?
70
- params[:customer][:ip] = request.remote_addr
71
-
72
- @customer = Opensteam::UserBase::Customer.find_or_initialize_by_email( params[:customer][:email] )
73
-
74
- @payment_address = Opensteam::UserBase::Address.find( :first, :conditions => params[:payment_address].update( { :user_id => @customer.id } ) ) rescue nil
75
- @payment_address = Opensteam::UserBase::Address.new( params[:payment_address]) if @payment_address.nil?
76
-
77
- @shipping_address = Opensteam::UserBase::Address.find( :first, :conditions => params[:shipping_address].update( { :user_id => @customer.id } ) ) rescue nil
78
- @shipping_address = Opensteam::UserBase::Address.new( params[:shipping_address]) if @shipping_address.nil?
79
-
80
- status = [ @payment_address, @shipping_address, @customer].collect(&:save).inject(true) { |r,v| r && v }
81
-
82
- if status # if form is valild
83
- @customer.addresses << @payment_address unless @customer.addresses.exists?( @payment_address.id )
84
- @customer.addresses << @shipping_address unless @customer.addresses.exists?( @shipping_address.id )
85
-
86
- @order.shipping_address = @shipping_address
87
- @order.payment_address = @payment_address
88
-
89
- @customer.save
90
- @order.customer = @customer
91
- @order.save
92
-
93
-
94
- @order.order_items.each do |oi|
95
- returning(oi.inventory) do |i|
96
- i.storage -= oi.quantity
97
- i.save
98
- end
99
- end
100
-
101
- redirect_to :action => :outro
102
- else
103
- render :action => :shipping
104
- end
105
-
106
- end
107
-
108
- end
109
-
110
-
111
- # show cart
112
- # [GET]
113
- #
114
- # show the shopping cart again
115
- def show_cart
116
- @cart = get_cart
117
- @user = get_user
118
- end
119
-
120
-
121
-
122
-
123
-
124
- # place order
125
- # [POST]
126
- #
127
- def place_order
128
- if request.post?
129
-
130
- @order = Opensteam::OrderBase::Order.find( session[:active_order] )
131
- @order.copy_from_cart( get_cart )
132
- @order.save
133
- session[:active_order] = @order.id
134
-
135
- redirect_to :action => :shipping
136
- end
137
- end
138
-
139
-
140
-
141
-
142
- end
@@ -1,29 +0,0 @@
1
- # Methods added to this helper will be available to all templates in the application.
2
- module <%= file_name.classify %>Helper
3
-
4
- # return first partial-file that exist in *a
5
- def existing_partial( *a )
6
- a.each { |v| return v if File.exist?( "#{RAILS_ROOT}/app/views/#{File.split(v)[0]}/_#{File.split(v)[1]}.html.erb" ) }
7
- end
8
-
9
- def ordinalized_time(time = Time.now)
10
- time.strftime("%d-%m-%Y %H:%M:%S")
11
- end
12
-
13
- def error_messages_for_product( product )
14
- unless product.property_errors.empty?
15
- html = {}
16
- error_properties = product.property_errors.map do |property|
17
- content_tag( :li, property )
18
- end
19
- content_tag( :div,
20
- content_tag(:p, "Please select a ..") <<
21
- content_tag( :ul, error_properties ), html )
22
- end
23
-
24
-
25
- end
26
-
27
-
28
-
29
- end
@@ -1,16 +0,0 @@
1
- class CreateDummyUsers < ActiveRecord::Migration
2
- def self.up
3
- c = "admin"
4
- Opensteam::UserBase::Admin.create :firstname => c, :lastname => c, :salt => "qwert",
5
- :email => "#{c}@shop.com", :password => c,
6
- :password_confirmation => c, :login => c
7
-
8
-
9
- end
10
-
11
- def self.down
12
- Opensteam::UserBase::Admin.find_by_firstname("admin").destroy rescue nil
13
-
14
- end
15
-
16
- end
@@ -1,18 +0,0 @@
1
- class CreateOrders < ActiveRecord::Migration
2
- def self.up
3
- create_table :orders do |t|
4
- t.references :customer
5
- t.references :payment_type
6
- t.references :shipping_address
7
- t.references :payment_address
8
- t.integer :shipped, :default => 0
9
- t.integer :paid, :default => 0
10
-
11
- t.timestamps
12
- end
13
- end
14
-
15
- def self.down
16
- drop_table :orders
17
- end
18
- end
@@ -1,19 +0,0 @@
1
- class CreateUsers < ActiveRecord::Migration
2
- def self.up
3
- create_table :users do |t|
4
- t.string :type
5
- t.string :firstname
6
- t.string :lastname
7
- t.string :login
8
- t.string :salt
9
- t.string :hashed_password
10
- t.string :email
11
-
12
- t.timestamps
13
- end
14
- end
15
-
16
- def self.down
17
- drop_table :users
18
- end
19
- end
@@ -1,18 +0,0 @@
1
- class AdministrationMailer < ActionMailer::Base
2
-
3
- def order_customer(order, sent_at = Time.now )
4
- recipients order.customer.email
5
- subject "your order @ opensteam-petstore"
6
- body :order => order
7
- from 'petstore@opensteam.net'
8
- sent_on sent_at
9
- end
10
-
11
- def order_admin(order, sent_at = Time.now)
12
- recipients "m.schaerfer@diamonddogs.cc"
13
- subject "new order @ opensteam petstore"
14
- body :order => order
15
- from 'petstore@opensteam.net'
16
- sent_on sent_at
17
- end
18
- end
@@ -1,10 +0,0 @@
1
- class InventoriesProperty < ActiveRecord::Base
2
- belongs_to :inventory
3
- belongs_to :property, :polymorphic => true
4
-
5
- alias :real_property :property
6
- def property() return !property_type ? nil : !property_id ? property_type.constantize.find(:all) : real_property ; end
7
-
8
-
9
-
10
- end
@@ -1,57 +0,0 @@
1
-
2
-
3
-
4
-
5
- class Inventory < ActiveRecord::Base
6
-
7
- def self.property_tables
8
- @@property_tables ||= Opensteam::Find.find_property_tables
9
- end
10
-
11
- #has_many :inventories_products_properties, :dependent => :destroy
12
- #has_many :products_properties, :through => :inventories_products_properties
13
- has_many :order_items, :class_name => "Opensteam::OrderBase::OrderItem"
14
-
15
- belongs_to :product, :polymorphic => true
16
- has_many_polymorphs :properties, :from => Inventory.property_tables
17
-
18
- validates_presence_of :price, :storage
19
-
20
-
21
-
22
-
23
-
24
-
25
- # alias :real_properties :properties
26
- # def properties
27
- # inventories_properties.collect(&:property).flatten
28
- # end
29
-
30
- # def properties() inventories_properties.collect { |x| x.property }.flatten ; end
31
-
32
- def self.override_property_accessors
33
- Opensteam::Find.find_property_tables.each { |accessor|
34
- new_accessor = ("real_" + accessor.to_s).to_sym
35
- self.class_eval do
36
- alias_method new_accessor, accessor
37
- define_method( accessor ) do
38
- InventoriesProperty.find(:all, :conditions => { :inventory_id => self.id, :property_id => nil,
39
- :property_type => accessor.to_s.classify } ).empty? ? self.send( new_accessor ) : accessor.to_s.classify.constantize.find(:all)
40
- end
41
- end
42
- }
43
-
44
- end
45
-
46
-
47
- def is_active?() active == 1 ; end
48
- def is_available?() storage > 0 && is_active? ; end
49
-
50
- def self.find_by_properties( p )
51
- find( :all ).collect(&:properties).each { |pp| return (pp - p == [] ) ? true : false }
52
- end
53
-
54
-
55
- #Inventory.override_property_accessors
56
-
57
- end
@@ -1,11 +0,0 @@
1
- <div id="nav">
2
- <%= link_to "Products", :controller => "/administration", :action => :products %> |
3
- <%= link_to "Properties", :controller => "/administration", :action => :properties %> |
4
- <%= link_to "Orders", administration_orders_path %> |
5
- <%= link_to "Customers", administration_customers_path %> |
6
- <%= link_to "Admin Info", :controller => "/administration", :action => :admin_info %>
7
-
8
- <div id="sub_nav" style="margin-left:20px;margin-top:10px;">
9
- <%= yield(:sub_nav) || "" %>
10
- </div>
11
- </div>
@@ -1,18 +0,0 @@
1
- <% for product in @products %>
2
- <%= link_to_remote (image_tag "/images/palette.png", :align => "top", :border => "0"),
3
- :url => { :action => :update_properties, :class => product.class.to_s, :id => product.id },
4
- :update => "#{product.class.to_s}_#{product.name}_properties" %>
5
- <%= link_to_remote (image_tag "/images/folder_database.png", :align => "top", :border => "0"),
6
- :url => { :action => :update_products, :class => product.class.to_s, :id => product.id },
7
- :update => "#{product.class.to_s}_#{product.name}_products" %>
8
- <%= product.name %>
9
- [<%= link_to "show", :controller => "administration/#{product.class.to_s.tableize}", :action => :show, :id => product.id %>]
10
- [<%= link_to "edit", :controller => "administration/#{product.class.to_s.tableize}", :action => :edit, :id => product.id %>]
11
- [<%= link_to "delete", [:administration, product], :method => :delete %>]
12
-
13
- <div style="padding-left:42px;" id="<%=product.class.to_s%>_<%=product.name%>_properties">
14
- </div>
15
- <div style="padding-left:42px;" id="<%=product.class.to_s%>_<%=product.name%>_products">
16
- </div>
17
- <% end %>
18
-
@@ -1,12 +0,0 @@
1
- <b> Change Email </b>
2
- <br />
3
- <br />
4
- <%= error_messages_for :admin %>
5
-
6
- <% form_for :admin, @admuin, :url => { :action => :change_admin_email }, :html => { :method => 'put' } do |f| %>
7
- <%= f.label :email %> <%= f.text_field :email, :id => "test_field" %><br /><br />
8
- <%= f.label :password %> <%= f.password_field :password, :id => "test_field" %>
9
- <%= f.label :password_confirmation %> <%= f.password_field :password_confirmation, :id => "test_field" %><br />
10
- <br /><br />
11
- <%= f.submit "update" %>
12
- <% end %>