opensteam 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +0 -0
- data/License.txt +4 -0
- data/Manifest.txt +131 -0
- data/Manifest.txt.bak +132 -0
- data/README.txt +92 -0
- data/generators/opensteam/opensteam_generator.rb +295 -0
- data/generators/opensteam/templates/controllers/administration/customers_controller.rb +23 -0
- data/generators/opensteam/templates/controllers/administration/inventories_controller.rb +88 -0
- data/generators/opensteam/templates/controllers/administration/orders_controller.rb +61 -0
- data/generators/opensteam/templates/controllers/administration_controller.rb +80 -0
- data/generators/opensteam/templates/controllers/checkout_controller.rb +142 -0
- data/generators/opensteam/templates/controllers/webshop_controller.rb +68 -0
- data/generators/opensteam/templates/fixtures/inventories.yml +221 -0
- data/generators/opensteam/templates/fixtures/inventories_properties.yml +127 -0
- data/generators/opensteam/templates/fixtures/product_animals.yml +73 -0
- data/generators/opensteam/templates/fixtures/product_dog_foods.yml +7 -0
- data/generators/opensteam/templates/fixtures/properties.yml +42 -0
- data/generators/opensteam/templates/helpers/webshop_helper.rb +29 -0
- data/generators/opensteam/templates/init/opensteam.rb +30 -0
- data/generators/opensteam/templates/migrations/create_addresses.rb +17 -0
- data/generators/opensteam/templates/migrations/create_customers.rb +16 -0
- data/generators/opensteam/templates/migrations/create_dummy_users.rb +16 -0
- data/generators/opensteam/templates/migrations/create_inventories.rb +20 -0
- data/generators/opensteam/templates/migrations/create_inventories_properties.rb +14 -0
- data/generators/opensteam/templates/migrations/create_order_items.rb +16 -0
- data/generators/opensteam/templates/migrations/create_orders.rb +18 -0
- data/generators/opensteam/templates/migrations/create_payment_types.rb +13 -0
- data/generators/opensteam/templates/migrations/create_properties.rb +12 -0
- data/generators/opensteam/templates/migrations/create_sessions.rb +16 -0
- data/generators/opensteam/templates/migrations/create_users.rb +19 -0
- data/generators/opensteam/templates/models/administration_mailer.rb +18 -0
- data/generators/opensteam/templates/models/inventories_property.rb +10 -0
- data/generators/opensteam/templates/models/inventory.rb +57 -0
- data/generators/opensteam/templates/public/images/bullet_arrow_down.png +0 -0
- data/generators/opensteam/templates/public/images/bullet_arrow_up.png +0 -0
- data/generators/opensteam/templates/public/images/cancel.png +0 -0
- data/generators/opensteam/templates/public/images/folder_database.png +0 -0
- data/generators/opensteam/templates/public/images/indicator.gif +0 -0
- data/generators/opensteam/templates/public/images/indicator_big.gif +0 -0
- data/generators/opensteam/templates/public/images/minus.png +0 -0
- data/generators/opensteam/templates/public/images/opensteam_logo_small.jpg +0 -0
- data/generators/opensteam/templates/public/images/opensteam_logo_web.jpg +0 -0
- data/generators/opensteam/templates/public/images/palette.png +0 -0
- data/generators/opensteam/templates/public/images/plus.png +0 -0
- data/generators/opensteam/templates/public/images/rails.png +0 -0
- data/generators/opensteam/templates/public/index.html +297 -0
- data/generators/opensteam/templates/public/stylesheets/webshop.css +262 -0
- data/generators/opensteam/templates/tasks/opensteam.rake +114 -0
- data/generators/opensteam/templates/views/administration/_address.html.erb +4 -0
- data/generators/opensteam/templates/views/administration/_nav.html.erb +11 -0
- data/generators/opensteam/templates/views/administration/_update_tree.html.erb +18 -0
- data/generators/opensteam/templates/views/administration/admin_info.html.erb +12 -0
- data/generators/opensteam/templates/views/administration/customers.html.erb +44 -0
- data/generators/opensteam/templates/views/administration/customers/index.html.erb +27 -0
- data/generators/opensteam/templates/views/administration/customers/show.html.erb +27 -0
- data/generators/opensteam/templates/views/administration/index.html.erb +9 -0
- data/generators/opensteam/templates/views/administration/inventories/edit.html.erb +48 -0
- data/generators/opensteam/templates/views/administration/inventories/index.html.erb +27 -0
- data/generators/opensteam/templates/views/administration/inventories/new.html.erb +41 -0
- data/generators/opensteam/templates/views/administration/inventories/show.html.erb +45 -0
- data/generators/opensteam/templates/views/administration/login.html.erb +16 -0
- data/generators/opensteam/templates/views/administration/order.html.erb +22 -0
- data/generators/opensteam/templates/views/administration/orders.html.erb +32 -0
- data/generators/opensteam/templates/views/administration/orders/_order_item.html.erb +22 -0
- data/generators/opensteam/templates/views/administration/orders/index.html.erb +32 -0
- data/generators/opensteam/templates/views/administration/orders/show.html.erb +25 -0
- data/generators/opensteam/templates/views/administration/products.html.erb +7 -0
- data/generators/opensteam/templates/views/administration/properties.html.erb +7 -0
- data/generators/opensteam/templates/views/administration/show_order_item.html.erb +5 -0
- data/generators/opensteam/templates/views/administration/signup.html.erb +65 -0
- data/generators/opensteam/templates/views/administration/tree.html.erb +15 -0
- data/generators/opensteam/templates/views/administration/update_products.html.erb +5 -0
- data/generators/opensteam/templates/views/administration/update_properties.html.erb +5 -0
- data/generators/opensteam/templates/views/administration/update_tree.rjs +3 -0
- data/generators/opensteam/templates/views/administration_mailer/order_admin.erb +27 -0
- data/generators/opensteam/templates/views/administration_mailer/order_customer.erb +24 -0
- data/generators/opensteam/templates/views/checkout/intro.html.erb +5 -0
- data/generators/opensteam/templates/views/checkout/outro.html.erb +6 -0
- data/generators/opensteam/templates/views/checkout/payment.html.erb +8 -0
- data/generators/opensteam/templates/views/checkout/shipping.html.erb +39 -0
- data/generators/opensteam/templates/views/checkout/show_cart.html.erb +13 -0
- data/generators/opensteam/templates/views/checkout/update_cart_content.rjs +2 -0
- data/generators/opensteam/templates/views/common/_cart.html.erb +11 -0
- data/generators/opensteam/templates/views/common/_cart_content.html.erb +19 -0
- data/generators/opensteam/templates/views/common/_header.html.erb +15 -0
- data/generators/opensteam/templates/views/layouts/administration.html.erb +29 -0
- data/generators/opensteam/templates/views/layouts/webshop.html.erb +36 -0
- data/generators/opensteam/templates/views/webshop/_cart.html.erb +11 -0
- data/generators/opensteam/templates/views/webshop/_cart_content.html.erb +23 -0
- data/generators/opensteam/templates/views/webshop/_header.html.erb +15 -0
- data/generators/opensteam/templates/views/webshop/_inventory_content.html.erb +12 -0
- data/generators/opensteam/templates/views/webshop/add_inventory_to_cart.rjs +2 -0
- data/generators/opensteam/templates/views/webshop/add_to_cart_with_parameters.rjs +2 -0
- data/generators/opensteam/templates/views/webshop/del_item.rjs +1 -0
- data/generators/opensteam/templates/views/webshop/index.html.erb +12 -0
- data/generators/opensteam/templates/views/webshop/inventory.rjs +2 -0
- data/generators/opensteam/templates/views/webshop/show.html.erb +40 -0
- data/generators/opensteam_product/opensteam_product_generator.rb +115 -0
- data/generators/opensteam_product/templates/controllers/product_controller.rb +104 -0
- data/generators/opensteam_product/templates/migration.rb +16 -0
- data/generators/opensteam_product/templates/models/product.rb +3 -0
- data/generators/opensteam_product/templates/views/_attr_product.html.erb +8 -0
- data/generators/opensteam_product/templates/views/_attr_property.html.erb +9 -0
- data/generators/opensteam_product/templates/views/_details.html.erb +29 -0
- data/generators/opensteam_product/templates/views/administration/_attributes.html.erb +21 -0
- data/generators/opensteam_product/templates/views/administration/_get_products.html.erb +8 -0
- data/generators/opensteam_product/templates/views/administration/_inventories.html.erb +27 -0
- data/generators/opensteam_product/templates/views/administration/edit.html.erb +13 -0
- data/generators/opensteam_product/templates/views/administration/index.html.erb +36 -0
- data/generators/opensteam_product/templates/views/administration/new.html.erb +16 -0
- data/generators/opensteam_product/templates/views/administration/show.html.erb +15 -0
- data/generators/opensteam_property/opensteam_property_generator.rb +126 -0
- data/generators/opensteam_property/templates/controllers/property_controller.rb +86 -0
- data/generators/opensteam_property/templates/migration.rb +14 -0
- data/generators/opensteam_property/templates/models/property.rb +3 -0
- data/generators/opensteam_property/templates/views/administration/edit.html.erb +19 -0
- data/generators/opensteam_property/templates/views/administration/index.html.erb +24 -0
- data/generators/opensteam_property/templates/views/administration/new.html.erb +18 -0
- data/generators/opensteam_property/templates/views/administration/show.html.erb +10 -0
- data/lib/opensteam.rb +49 -0
- data/lib/opensteam/base.rb +121 -0
- data/lib/opensteam/checkout.rb +89 -0
- data/lib/opensteam/config.rb +31 -0
- data/lib/opensteam/finder.rb +145 -0
- data/lib/opensteam/inventory_base.rb +79 -0
- data/lib/opensteam/order_base.rb +58 -0
- data/lib/opensteam/product_base.rb +222 -0
- data/lib/opensteam/property_base.rb +63 -0
- data/lib/opensteam/shopping_cart.rb +343 -0
- data/lib/opensteam/user_base.rb +165 -0
- data/lib/opensteam/version.rb +9 -0
- data/test/test_helper.rb +2 -0
- data/test/test_opensteam.rb +11 -0
- metadata +189 -0
data/History.txt
ADDED
File without changes
|
data/License.txt
ADDED
data/Manifest.txt
ADDED
@@ -0,0 +1,131 @@
|
|
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
|
data/Manifest.txt.bak
ADDED
@@ -0,0 +1,132 @@
|
|
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
|
+
|
data/README.txt
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
= opensteam v0.9
|
2
|
+
|
3
|
+
* http://www.opensteam.net
|
4
|
+
* http://opensteam.rubyforge.org
|
5
|
+
* http://www.diamonddogs.cc
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
= AUTHOR:
|
10
|
+
|
11
|
+
Michael Schaerfer @ DiamondDogs Group
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
== DESCRIPTION:
|
16
|
+
|
17
|
+
An eCommerce Framework for RubyOnRails
|
18
|
+
|
19
|
+
== FEATURES
|
20
|
+
|
21
|
+
=== General Features
|
22
|
+
|
23
|
+
* Product Listing
|
24
|
+
* Details-Page for Products
|
25
|
+
* a Shopping-Cart (add, delete, increment/decrement quantity, checkout)
|
26
|
+
* a Checkout-Process
|
27
|
+
* an Admin-Backend to:
|
28
|
+
- create and configure Products
|
29
|
+
- create and configure Properties
|
30
|
+
- overview Order and Customer Information
|
31
|
+
|
32
|
+
|
33
|
+
=== Generators
|
34
|
+
|
35
|
+
openSteam offers three new generators (to use with script/generate):
|
36
|
+
|
37
|
+
* create a new webshop in no-time with
|
38
|
+
script/generate opensteam WebShopName
|
39
|
+
* create new products (like scaffold for models products)
|
40
|
+
script/generate opensteam_product ProductName [column:type]
|
41
|
+
* create new properties for products (like "color" for "Shirt") with
|
42
|
+
script/generate opensteam_property PropertyName [column:type]
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
=== Flexibility in Products
|
47
|
+
|
48
|
+
* create new Product-Models with a generator
|
49
|
+
* associate Products to Properties (a "Shirt" has_many "Colors")
|
50
|
+
* give the Product a price and a storage-quantity
|
51
|
+
* give specific configurations a price and a storage-quantity (a "blue-Shirt" is more expensive than a "yellow-Shirt")
|
52
|
+
* mark specific configurations as "Not-Active" or "Back-Ordered"
|
53
|
+
|
54
|
+
|
55
|
+
== SYNOPSIS:
|
56
|
+
|
57
|
+
Create an empty Rails Application
|
58
|
+
rails name_of_rails_application
|
59
|
+
|
60
|
+
Create the openSteam Framework
|
61
|
+
script/generate opensteam WebshopName
|
62
|
+
|
63
|
+
Create product models
|
64
|
+
script/generate opensteam_product ProductName [column:type]
|
65
|
+
|
66
|
+
Create property models
|
67
|
+
script/generate opensteam_property PropertyName [column:type]
|
68
|
+
|
69
|
+
Goto /administration and configure your products
|
70
|
+
usr: admin
|
71
|
+
pwd: admin
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
== REQUIREMENTS:
|
76
|
+
|
77
|
+
* rails (of course)
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
== INSTALL:
|
82
|
+
|
83
|
+
sudo gem install opensteam
|
84
|
+
|
85
|
+
|
86
|
+
== LICENSE:
|
87
|
+
|
88
|
+
Copyright 2008 DiamondDogs|Group
|
89
|
+
|
90
|
+
openSteam is distributed under the terms of the GNU General Public License
|
91
|
+
as published by the Free Software Foundation; either version 2 of the
|
92
|
+
License, or (at your option) any later version.
|
@@ -0,0 +1,295 @@
|
|
1
|
+
class OpensteamGenerator < Rails::Generator::NamedBase
|
2
|
+
|
3
|
+
|
4
|
+
attr_reader :controller_class_name, :controller_file_name
|
5
|
+
|
6
|
+
|
7
|
+
def initialize(runtime_args, runtime_options = {})
|
8
|
+
super
|
9
|
+
|
10
|
+
@controller_class_name = class_name + "Controller"
|
11
|
+
@controller_file_name = file_name + "_controller.rb"
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
def manifest
|
16
|
+
record do |m|
|
17
|
+
|
18
|
+
m.class_collisions class_path, class_name, "#{class_name}Test"
|
19
|
+
m.class_collisions class_path, "#{controller_class_name}"
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
### Controllers ###
|
24
|
+
|
25
|
+
## directories ##
|
26
|
+
m.directory( File.join('app/controllers', 'administration') )
|
27
|
+
|
28
|
+
# app/controllers/* #
|
29
|
+
%w(administration webshop checkout ).each { |f|
|
30
|
+
if f =~ /webshop/
|
31
|
+
m.template("controllers/#{f}_controller.rb", "app/controllers/#{file_name}_controller.rb" )
|
32
|
+
else
|
33
|
+
m.template("controllers/#{f}_controller.rb", "app/controllers/#{f}_controller.rb")
|
34
|
+
end
|
35
|
+
}
|
36
|
+
|
37
|
+
# app/controllers/administration/* #
|
38
|
+
%w( customers inventories orders ).each { |f|
|
39
|
+
m.file( "controllers/administration/#{f}_controller.rb", "app/controllers/administration/#{f}_controller.rb" )
|
40
|
+
}
|
41
|
+
|
42
|
+
|
43
|
+
### Helpers ###
|
44
|
+
m.template( "helpers/webshop_helper.rb", "app/helpers/#{file_name}_helper.rb")
|
45
|
+
|
46
|
+
|
47
|
+
### Initializers ###
|
48
|
+
m.directory( File.join('config', 'initializers') )
|
49
|
+
m.file('init/opensteam.rb', 'config/initializers/opensteam.rb')
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
### Views ###
|
54
|
+
|
55
|
+
## directories ##
|
56
|
+
%w( administration layouts checkout administration_mailer common ).each { |f|
|
57
|
+
m.directory( File.join('app/views',"#{f}") )
|
58
|
+
}
|
59
|
+
m.directory( File.join('app/views', file_name) )
|
60
|
+
|
61
|
+
# app/views/administration/* #
|
62
|
+
%w( _address orders admin_info _nav order show_order_item _update_tree index login products properties signup tree update_products update_properties ).each { |f|
|
63
|
+
m.file("views/administration/#{f}.html.erb", "app/views/administration/#{f}.html.erb" ) }
|
64
|
+
m.file("views/administration/update_tree.rjs", "app/views/administration/update_tree.rjs")
|
65
|
+
|
66
|
+
# app/views/layouts/* #
|
67
|
+
m.template("views/layouts/webshop.html.erb", "app/views/layouts/#{file_name}.html.erb" )
|
68
|
+
m.template("views/layouts/administration.html.erb", "app/views/layouts/administration.html.erb")
|
69
|
+
|
70
|
+
|
71
|
+
# app/views/administration_mailer/* #
|
72
|
+
%w( order_admin order_customer ).each { |f|
|
73
|
+
m.file( "views/administration_mailer/#{f}.erb", "app/views/administration_mailer/#{f}.erb")
|
74
|
+
}
|
75
|
+
|
76
|
+
# app/views/common/* #
|
77
|
+
%w( _cart _cart_content _header ).each { |f|
|
78
|
+
m.file( "views/common/#{f}.html.erb", "app/views/common/#{f}.html.erb" )
|
79
|
+
}
|
80
|
+
|
81
|
+
# app/views/webshop/* #
|
82
|
+
%w( _inventory_content ).each { |f|
|
83
|
+
m.file("views/webshop/#{f}.html.erb", "app/views/#{file_name}/#{f}.html.erb" )
|
84
|
+
}
|
85
|
+
%w( add_to_cart_with_parameters del_item inventory add_inventory_to_cart ).each { |f|
|
86
|
+
m.file("views/webshop/#{f}.rjs", "app/views/#{file_name}/#{f}.rjs" )
|
87
|
+
}
|
88
|
+
%w( index show ).each { |f|
|
89
|
+
m.template("views/webshop/#{f}.html.erb", "app/views/#{file_name}/#{f}.html.erb")
|
90
|
+
}
|
91
|
+
|
92
|
+
|
93
|
+
# app/views/checkout/* #
|
94
|
+
%w( intro outro shipping ).each { |f|
|
95
|
+
m.file("views/checkout/#{f}.html.erb", "app/views/checkout/#{f}.html.erb")
|
96
|
+
}
|
97
|
+
m.template("views/checkout/show_cart.html.erb", "app/views/checkout/show_cart.html.erb")
|
98
|
+
m.file( "views/checkout/update_cart_content.rjs", "app/views/checkout/update_cart_content.rjs")
|
99
|
+
|
100
|
+
|
101
|
+
## app/views/administration directories ##
|
102
|
+
%w( inventories customers orders).each do |d|
|
103
|
+
m.directory( File.join( 'app/views', 'administration', "#{d}") )
|
104
|
+
end
|
105
|
+
|
106
|
+
# app/views/administration/inventories/* #
|
107
|
+
%w( edit index new show ).each do |f|
|
108
|
+
m.file( "views/administration/inventories/#{f}.html.erb", "app/views/administration/inventories/#{f}.html.erb" )
|
109
|
+
end
|
110
|
+
|
111
|
+
|
112
|
+
# app/views/administration/orders/* #
|
113
|
+
%w( _order_item index show ).each { |f|
|
114
|
+
m.file( "views/administration/orders/#{f}.html.erb", "app/views/administration/orders/#{f}.html.erb")
|
115
|
+
}
|
116
|
+
|
117
|
+
# app/views/administration/customers/* #
|
118
|
+
%w( index show ).each { |f|
|
119
|
+
m.file( "views/administration/customers/#{f}.html.erb", "app/views/administration/customers/#{f}.html.erb" )
|
120
|
+
}
|
121
|
+
|
122
|
+
### Tasks ###
|
123
|
+
m.file("tasks/opensteam.rake", "lib/tasks/opensteam.rake")
|
124
|
+
|
125
|
+
|
126
|
+
### Fixtures ###
|
127
|
+
%w( inventories inventories_properties product_animals product_dog_foods properties ).each do |f|
|
128
|
+
m.file("fixtures/#{f}.yml", "test/fixtures/#{f}.yml")
|
129
|
+
end
|
130
|
+
|
131
|
+
|
132
|
+
### Public ###
|
133
|
+
m.directory("public/stylesheets")
|
134
|
+
m.file("public/stylesheets/webshop.css", "public/stylesheets/#{file_name}.css", :collision => :force )
|
135
|
+
m.directory("public/images")
|
136
|
+
%w( bullet_arrow_down bullet_arrow_up cancel minus plus palette folder_database).each { |f|
|
137
|
+
m.file("public/images/#{f}.png", "public/images/#{f}.png")
|
138
|
+
}
|
139
|
+
m.file("public/images/opensteam_logo_web.jpg", "public/images/opensteam_logo_web.jpg")
|
140
|
+
m.file("public/images/indicator.gif", "public/images/indicator.gif")
|
141
|
+
m.file("public/index.html", "public/index.html", :collision => :force )
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
### Migrations ###
|
146
|
+
unless options[:skip_migration]
|
147
|
+
%w( create_properties create_sessions create_orders create_order_items create_addresses
|
148
|
+
create_users create_payment_types create_customers create_dummy_users
|
149
|
+
create_inventories create_inventories_properties ).each { |f|
|
150
|
+
m.migration_template "migrations/#{f}.rb", "db/migrate", :assigns => {
|
151
|
+
:migration_name => "#{f.classify}" }, :migration_file_name => "#{f}.rb"
|
152
|
+
}
|
153
|
+
end
|
154
|
+
|
155
|
+
|
156
|
+
### Routes ###
|
157
|
+
map_namedroutes(file_name, "/#{file_name}", :controller => "#{file_name}", :action => "index" )
|
158
|
+
map_namedroutes("logout", "/logout", :controller => "administration", :action => "logout" )
|
159
|
+
map_namedroutes("login", "/login", :controller => "administration", :action => "login" )
|
160
|
+
map_namedroutes("signup", "/signup", :controller => "administration", :action => "signup" )
|
161
|
+
map_namedroutes("administration", "/administration", :controller => "administration", :action => "index" )
|
162
|
+
map_namedroutes("shop_index", "/#{file_name}", :controller => "#{file_name}", :action => "signup" )
|
163
|
+
map_namedroutes("#{file_name}_index", "/#{file_name}", :action => "index", :controller => "#{file_name}")
|
164
|
+
map_namedroutes("opensteam_index", "/#{file_name}", :action => "index", :controller => "#{file_name}")
|
165
|
+
map_namedroutes("connect", "/administration/:action", :controller => "administration" )
|
166
|
+
map_namedroutes("connect", "/checkout/:action", :controller => "checkout" )
|
167
|
+
map_namedroutes("connect", "/#{file_name}/:action", :controller => "#{file_name}" )
|
168
|
+
map_namedroutes("connect", "/#{file_name}/:action/:type/:id", :controller => "#{file_name}" )
|
169
|
+
map_namedroutes("connect", "/#{file_name}", :controller => "#{file_name}", :action => "index" )
|
170
|
+
|
171
|
+
administration_routes = <<END_ADMIN_ROUTES
|
172
|
+
require 'opensteam/finder'
|
173
|
+
map.namespace :administration do |administration|
|
174
|
+
|
175
|
+
administration.resources :inventories
|
176
|
+
administration.resources :customers
|
177
|
+
administration.resources :orders
|
178
|
+
|
179
|
+
Opensteam::Find.find_product_tables.collect(&:to_sym).each do |m|
|
180
|
+
if m.to_s.classify.constantize.column_names.include? m.to_s.classify.constantize.inheritance_column
|
181
|
+
m.to_s.classify.constantize.find(:all).collect(&:type).collect(&:tableize).uniq.collect(&:to_sym).each do |mm|
|
182
|
+
administration.resources mm, :controller => m
|
183
|
+
end
|
184
|
+
end
|
185
|
+
administration.resources m
|
186
|
+
end
|
187
|
+
|
188
|
+
Opensteam::Find.find_property_tables.collect(&:to_sym).each do |m|
|
189
|
+
administration.resources m
|
190
|
+
end
|
191
|
+
|
192
|
+
end
|
193
|
+
END_ADMIN_ROUTES
|
194
|
+
|
195
|
+
map_namespaceroutes( administration_routes )
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
### Patch application.rb ###
|
201
|
+
sentinel = 'class ApplicationController < ActionController::Base'
|
202
|
+
app_contr = 'app/controllers/application.rb'
|
203
|
+
incl = 'include Opensteam::UserBase::Helper'
|
204
|
+
gsub_file app_contr, /(#{Regexp.escape(sentinel)})/mi do |match|
|
205
|
+
"#{match}\n #{incl}"
|
206
|
+
end
|
207
|
+
|
208
|
+
|
209
|
+
### Patch environment.rb ###
|
210
|
+
sentinel = 'Rails::Initializer.run do |config|'
|
211
|
+
|
212
|
+
# incl = 'RAILS_DEFAULT_LOGGER = Logger.new("#{RAILS_ROOT}/log/#{RAILS_ENV}.log") unless defined? RAILS_DEFAULT_LOGGER'
|
213
|
+
# incl += "\nrequire 'has_many_polymorphs'"
|
214
|
+
incl = "require 'opensteam'"
|
215
|
+
|
216
|
+
incl2 = " config.after_initialize do"
|
217
|
+
incl2 += "\n require 'opensteam/user_base'"
|
218
|
+
incl2 += "\n require 'opensteam/shopping_cart'"
|
219
|
+
incl2 += "\n require 'opensteam/checkout'"
|
220
|
+
incl2 += "\n end\n\n"
|
221
|
+
|
222
|
+
gsub_file 'config/environment.rb', /(#{Regexp.escape(sentinel)})/mi do |match|
|
223
|
+
# "#{incl}\n\n#{match}\n\n#{incl2}"
|
224
|
+
"#{incl}\n\n#{match}\n"
|
225
|
+
end
|
226
|
+
|
227
|
+
|
228
|
+
end
|
229
|
+
end
|
230
|
+
|
231
|
+
protected
|
232
|
+
|
233
|
+
def gsub_file(relative_destination, regexp, *args, &block)
|
234
|
+
path = destination_path(relative_destination)
|
235
|
+
content = File.read(path).gsub(regexp, *args, &block)
|
236
|
+
File.open(path, 'wb') { |file| file.write(content) }
|
237
|
+
end
|
238
|
+
|
239
|
+
|
240
|
+
def map_namespaceroutes(str)
|
241
|
+
##
|
242
|
+
## just prints the str to routes.rb
|
243
|
+
## ToDo: implement actual namespace-method, like map_namspaceroutes( :space1 => { :space2 => "resourceA" } )
|
244
|
+
##
|
245
|
+
logger.route str
|
246
|
+
sentinel = 'ActionController::Routing::Routes.draw do |map|'
|
247
|
+
|
248
|
+
unless options[:pretend]
|
249
|
+
gsub_file 'config/routes.rb', /(#{Regexp.escape(sentinel)})/mi do |match|
|
250
|
+
"#{match}\n #{str}"
|
251
|
+
end
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
|
256
|
+
def map_namedroutes(name, path, *r)
|
257
|
+
route_list = r.inspect.gsub(/[\[\]{}]/, " ")
|
258
|
+
sentinel = 'ActionController::Routing::Routes.draw do |map|'
|
259
|
+
|
260
|
+
logger.route "map.#{name} \"#{path}\", #{route_list}"
|
261
|
+
unless options[:pretend]
|
262
|
+
gsub_file 'config/routes.rb', /(#{Regexp.escape(sentinel)})/mi do |match|
|
263
|
+
"#{match}\n map.#{name} \"#{path}\", #{route_list}\n"
|
264
|
+
end
|
265
|
+
end
|
266
|
+
end
|
267
|
+
|
268
|
+
def map_customroutes
|
269
|
+
end
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
# Override with your own usage banner.
|
275
|
+
def banner
|
276
|
+
"Usage: #{$0} opensteam ShopName"
|
277
|
+
end
|
278
|
+
|
279
|
+
def add_options!(opt)
|
280
|
+
opt.separator ''
|
281
|
+
opt.separator 'Options:'
|
282
|
+
opt.on("--skip-timestamps",
|
283
|
+
"Don't add timestamps to the migration files") { |v| options[:skip_timestamps] = v }
|
284
|
+
opt.on("--skip-migration",
|
285
|
+
"Don't generate a migration files") { |v| options[:skip_migration] = v }
|
286
|
+
end
|
287
|
+
|
288
|
+
def scaffold_views
|
289
|
+
%w[ index show new edit ]
|
290
|
+
end
|
291
|
+
|
292
|
+
def model_name
|
293
|
+
class_name.demodulize
|
294
|
+
end
|
295
|
+
end
|