opensteam 0.9.0 → 0.9.1
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/CHANGELOG +78 -0
- data/LICENSE +345 -0
- data/{README.txt → README.rdoc} +20 -17
- data/Rakefile +40 -0
- data/generators/opensteam/opensteam_generator.rb +95 -194
- data/generators/opensteam/templates/{controllers/administration → app/controllers/admin}/inventories_controller.rb +4 -4
- data/generators/opensteam/templates/app/controllers/admin/invoices_controller.rb +106 -0
- data/generators/opensteam/templates/app/controllers/admin/orders_controller.rb +113 -0
- data/generators/opensteam/templates/app/controllers/admin/search_controller.rb +17 -0
- data/generators/opensteam/templates/app/controllers/admin/shipments_controller.rb +106 -0
- data/generators/opensteam/templates/app/controllers/admin/users_controller.rb +99 -0
- data/generators/opensteam/templates/app/controllers/admin_controller.rb +40 -0
- data/generators/opensteam/templates/app/controllers/cart_controller.rb +94 -0
- data/generators/opensteam/templates/app/controllers/checkout_controller.rb +139 -0
- data/generators/opensteam/templates/app/controllers/profile/infos_controller.rb +52 -0
- data/generators/opensteam/templates/app/controllers/profile/orders_controller.rb +105 -0
- data/generators/opensteam/templates/app/controllers/profile_controller.rb +37 -0
- data/generators/opensteam/templates/app/controllers/searches_controller.rb +23 -0
- data/generators/opensteam/templates/app/controllers/user_sessions_controller.rb +38 -0
- data/generators/opensteam/templates/app/controllers/users_controller.rb +40 -0
- data/generators/opensteam/templates/{controllers → app/controllers}/webshop_controller.rb +35 -13
- data/generators/opensteam/templates/app/helpers/admin_helper.rb +40 -0
- data/generators/opensteam/templates/app/helpers/users_helper.rb +53 -0
- data/generators/opensteam/templates/app/helpers/webshop_helper.rb +91 -0
- data/generators/opensteam/templates/app/models/search.rb +36 -0
- data/generators/opensteam/templates/{views/administration → app/views/admin}/_address.html.erb +0 -0
- data/generators/opensteam/templates/app/views/admin/_nav.html.erb +5 -0
- data/generators/opensteam/templates/app/views/admin/catalog.html.erb +5 -0
- data/generators/opensteam/templates/app/views/admin/index.html.erb +21 -0
- data/generators/opensteam/templates/{views/administration → app/views/admin}/inventories/edit.html.erb +10 -9
- data/generators/opensteam/templates/{views/administration → app/views/admin}/inventories/index.html.erb +3 -3
- data/generators/opensteam/templates/{views/administration → app/views/admin}/inventories/new.html.erb +3 -3
- data/generators/opensteam/templates/app/views/admin/inventories/show.html.erb +46 -0
- data/generators/opensteam/templates/app/views/admin/invoices/_invoice.html.erb +12 -0
- data/generators/opensteam/templates/app/views/admin/invoices/_invoices.html.erb +11 -0
- data/generators/opensteam/templates/app/views/admin/invoices/index.html.erb +6 -0
- data/generators/opensteam/templates/app/views/admin/invoices/new.html.erb +54 -0
- data/generators/opensteam/templates/app/views/admin/invoices/show.html.erb +55 -0
- data/generators/opensteam/templates/app/views/admin/orders/_event.html.erb +5 -0
- data/generators/opensteam/templates/app/views/admin/orders/_order.html.erb +11 -0
- data/generators/opensteam/templates/app/views/admin/orders/_order_item.html.erb +10 -0
- data/generators/opensteam/templates/app/views/admin/orders/_orders.html.erb +19 -0
- data/generators/opensteam/templates/app/views/admin/orders/index.html.erb +14 -0
- data/generators/opensteam/templates/app/views/admin/orders/livesearch.rjs +6 -0
- data/generators/opensteam/templates/app/views/admin/orders/show.html.erb +58 -0
- data/generators/opensteam/templates/app/views/admin/products.html.erb +8 -0
- data/generators/opensteam/templates/app/views/admin/properties.html.erb +7 -0
- data/generators/opensteam/templates/app/views/admin/sales.html.erb +5 -0
- data/generators/opensteam/templates/app/views/admin/shipments/_shipment.erb +11 -0
- data/generators/opensteam/templates/app/views/admin/shipments/_shipments.html.erb +11 -0
- data/generators/opensteam/templates/app/views/admin/shipments/index.html.erb +6 -0
- data/generators/opensteam/templates/app/views/admin/shipments/new.html.erb +51 -0
- data/generators/opensteam/templates/app/views/admin/shipments/show.html.erb +55 -0
- data/generators/opensteam/templates/app/views/admin/users/_admins.html.erb +26 -0
- data/generators/opensteam/templates/app/views/admin/users/_admins_header.html.erb +10 -0
- data/generators/opensteam/templates/app/views/admin/users/_customer.html.erb +32 -0
- data/generators/opensteam/templates/app/views/admin/users/_customers.html.erb +29 -0
- data/generators/opensteam/templates/app/views/admin/users/_customers_header.html.erb +11 -0
- data/generators/opensteam/templates/app/views/admin/users/_user_fields.html.erb +9 -0
- data/generators/opensteam/templates/app/views/admin/users/_users.html.erb +29 -0
- data/generators/opensteam/templates/app/views/admin/users/_users_header.html.erb +11 -0
- data/generators/opensteam/templates/app/views/admin/users/edit.html.erb +6 -0
- data/generators/opensteam/templates/app/views/admin/users/index.html.erb +7 -0
- data/generators/opensteam/templates/app/views/admin/users/new.html.erb +6 -0
- data/generators/opensteam/templates/app/views/admin/users/show.html.erb +34 -0
- data/generators/opensteam/templates/app/views/admin/users.html.erb +4 -0
- data/generators/opensteam/templates/{views → app/views}/administration_mailer/order_admin.erb +0 -0
- data/generators/opensteam/templates/{views → app/views}/administration_mailer/order_customer.erb +0 -0
- data/generators/opensteam/templates/app/views/cart/_cart.html.erb +8 -0
- data/generators/opensteam/templates/{views/webshop → app/views/cart}/_cart_content.html.erb +7 -10
- data/generators/opensteam/templates/app/views/cart/index.html.erb +5 -0
- data/generators/opensteam/templates/app/views/cart/update.rjs +1 -0
- data/generators/opensteam/templates/app/views/checkout/intro.html.erb +18 -0
- data/generators/opensteam/templates/{views → app/views}/checkout/outro.html.erb +0 -1
- data/generators/opensteam/templates/{views → app/views}/checkout/payment.html.erb +0 -0
- data/generators/opensteam/templates/app/views/checkout/shipping.html.erb +45 -0
- data/generators/opensteam/templates/app/views/checkout/show_cart.html.erb +13 -0
- data/generators/opensteam/templates/{views → app/views}/checkout/update_cart_content.rjs +0 -0
- data/generators/opensteam/templates/{views → app/views}/common/_cart.html.erb +2 -2
- data/generators/opensteam/templates/{views → app/views}/common/_cart_content.html.erb +1 -1
- data/generators/opensteam/templates/app/views/common/_footer.html.erb +1 -0
- data/generators/opensteam/templates/app/views/common/_header.html.erb +4 -0
- data/generators/opensteam/templates/app/views/common/_header_flash.html.erb +3 -0
- data/generators/opensteam/templates/app/views/common/_signup_fields.html.erb +16 -0
- data/generators/opensteam/templates/app/views/common/_top_links.html.erb +10 -0
- data/generators/opensteam/templates/app/views/layouts/admin.html.erb +45 -0
- data/generators/opensteam/templates/app/views/layouts/profile.html.erb +45 -0
- data/generators/opensteam/templates/app/views/layouts/webshop.html.erb +51 -0
- data/generators/opensteam/templates/app/views/profile/_customer_sidebar.html.erb +12 -0
- data/generators/opensteam/templates/app/views/profile/index.html.erb +11 -0
- data/generators/opensteam/templates/app/views/profile/infos/_customer.html.erb +5 -0
- data/generators/opensteam/templates/app/views/profile/infos/edit.html.erb +25 -0
- data/generators/opensteam/templates/app/views/profile/infos/edit_password.html.erb +26 -0
- data/generators/opensteam/templates/app/views/profile/orders/_order.html.erb +11 -0
- data/generators/opensteam/templates/app/views/profile/orders/_order_item.html.erb +10 -0
- data/generators/opensteam/templates/app/views/profile/orders/_orders.html.erb +19 -0
- data/generators/opensteam/templates/app/views/profile/orders/index.html.erb +14 -0
- data/generators/opensteam/templates/app/views/profile/orders/show.html.erb +48 -0
- data/generators/opensteam/templates/app/views/searches/_search_bar.html.erb +5 -0
- data/generators/opensteam/templates/app/views/searches/new.html.erb +23 -0
- data/generators/opensteam/templates/app/views/searches/show.html.erb +1 -0
- data/generators/opensteam/templates/app/views/user_sessions/new.html.erb +14 -0
- data/generators/opensteam/templates/app/views/users/_user_bar.html.erb +5 -0
- data/generators/opensteam/templates/app/views/users/index.html.erb +27 -0
- data/generators/opensteam/templates/app/views/users/new.html.erb +7 -0
- data/generators/opensteam/templates/app/views/users/show.html.erb +5 -0
- data/generators/opensteam/templates/{views → app/views}/webshop/_inventory_content.html.erb +0 -0
- data/generators/opensteam/templates/app/views/webshop/_nav.html.erb +6 -0
- data/generators/opensteam/templates/{views → app/views}/webshop/add_inventory_to_cart.rjs +0 -0
- data/generators/opensteam/templates/{views → app/views}/webshop/add_to_cart_with_parameters.rjs +0 -0
- data/generators/opensteam/templates/{views → app/views}/webshop/del_item.rjs +0 -0
- data/generators/opensteam/templates/app/views/webshop/index.html.erb +11 -0
- data/generators/opensteam/templates/{views → app/views}/webshop/inventory.rjs +0 -0
- data/generators/opensteam/templates/{views → app/views}/webshop/show.html.erb +15 -15
- data/generators/opensteam/templates/config/initializers/init_states.rb +68 -0
- data/generators/opensteam/templates/{init → config/initializers}/opensteam.rb +6 -0
- data/generators/opensteam/templates/config/initializers/opensteam_model_tables.rb +57 -0
- data/generators/opensteam/templates/db/migrate/20080609095714_create_profiles.rb +14 -0
- data/generators/opensteam/templates/{migrations/create_sessions.rb → db/migrate/20080609095720_create_sessions.rb} +0 -0
- data/generators/opensteam/templates/db/migrate/20080609095721_create_users.rb +29 -0
- data/generators/opensteam/templates/{migrations/create_addresses.rb → db/migrate/20080609095723_create_addresses.rb} +0 -0
- data/generators/opensteam/templates/{migrations/create_customers.rb → db/migrate/20080609095724_create_customers.rb} +0 -0
- data/generators/opensteam/templates/db/migrate/20080609095725_create_dummy_users.rb +21 -0
- data/generators/opensteam/templates/{migrations/create_inventories.rb → db/migrate/20080609095726_create_inventories.rb} +0 -0
- data/generators/opensteam/templates/{migrations/create_inventories_properties.rb → db/migrate/20080609095727_create_inventories_properties.rb} +0 -0
- data/generators/opensteam/templates/{migrations/create_order_items.rb → db/migrate/20080609095728_create_order_items.rb} +5 -0
- data/generators/opensteam/templates/db/migrate/20080609095729_create_orders.rb +32 -0
- data/generators/opensteam/templates/{migrations/create_payment_types.rb → db/migrate/20080609095730_create_payment_types.rb} +0 -0
- data/generators/opensteam/templates/{migrations/create_properties.rb → db/migrate/20080609095731_create_properties.rb} +0 -0
- data/generators/opensteam/templates/db/migrate/20080623075613_create_states.rb +13 -0
- data/generators/opensteam/templates/db/migrate/20080624132807_create_searches.rb +20 -0
- data/generators/opensteam/templates/db/migrate/20080630114155_create_state_histories.rb +14 -0
- data/generators/opensteam/templates/db/migrate/20080714131513_create_invoices.rb +20 -0
- data/generators/opensteam/templates/db/migrate/20080714131650_create_shipments.rb +19 -0
- data/generators/opensteam/templates/lib/authenticated_system.rb +201 -0
- data/generators/opensteam/templates/lib/authentication/by_cookie_token.rb +90 -0
- data/generators/opensteam/templates/lib/authentication/by_password.rb +68 -0
- data/generators/opensteam/templates/lib/authentication.rb +46 -0
- data/generators/opensteam/templates/lib/states/invoice/finished.rb +6 -0
- data/generators/opensteam/templates/lib/states/invoice/payment_received.rb +8 -0
- data/generators/opensteam/templates/lib/states/invoice/pending.rb +6 -0
- data/generators/opensteam/templates/lib/states/invoice/waiting_for_payment.rb +5 -0
- data/generators/opensteam/templates/lib/states/order/finished.rb +6 -0
- data/generators/opensteam/templates/lib/states/order/pending.rb +19 -0
- data/generators/opensteam/templates/lib/states/order/processing.rb +11 -0
- data/generators/opensteam/templates/lib/states/shipment/finished.rb +6 -0
- data/generators/opensteam/templates/lib/states/shipment/pending.rb +5 -0
- data/generators/opensteam/templates/lib/tasks/opensteam.rake +114 -0
- data/generators/opensteam/templates/public/images/athmo_background.jpg +0 -0
- data/generators/opensteam/templates/public/images/bg.jpg +0 -0
- data/generators/opensteam/templates/public/images/cart_big.gif +0 -0
- data/generators/opensteam/templates/public/images/cross.png +0 -0
- data/generators/opensteam/templates/public/images/enter.gif +0 -0
- data/generators/opensteam/templates/public/images/menu_background.jpg +0 -0
- data/generators/opensteam/templates/public/images/opensteam_background.jpg +0 -0
- data/generators/opensteam/templates/public/images/opensteam_logo1.jpg +0 -0
- data/generators/opensteam/templates/public/images/opensteam_petstore_logo1.jpg +0 -0
- data/generators/opensteam/templates/public/images/opensteam_store_logo.jpg +0 -0
- data/generators/opensteam/templates/public/images/os_logo.gif +0 -0
- data/generators/opensteam/templates/public/images/slogan.png +0 -0
- data/generators/opensteam/templates/public/images/tick.png +0 -0
- data/generators/opensteam/templates/public/images/zoom.png +0 -0
- data/generators/opensteam/templates/public/index.html +19 -36
- data/generators/opensteam/templates/public/javascripts/opensteam.js +30 -0
- data/generators/opensteam/templates/public/stylesheets/opensteam_newdesign.css +188 -0
- data/generators/opensteam/templates/public/stylesheets/opensteam_white.css +168 -0
- data/generators/opensteam/templates/public/stylesheets/webshop.css +0 -1
- data/generators/opensteam/templates/tasks/opensteam.rake +1 -1
- data/generators/opensteam/templates/{fixtures → test/fixtures}/inventories.yml +0 -0
- data/generators/opensteam/templates/{fixtures → test/fixtures}/inventories_properties.yml +0 -0
- data/generators/opensteam/templates/{fixtures → test/fixtures}/product_animals.yml +0 -0
- data/generators/opensteam/templates/{fixtures → test/fixtures}/product_dog_foods.yml +0 -0
- data/generators/opensteam/templates/{fixtures → test/fixtures}/properties.yml +0 -0
- data/generators/opensteam_product/opensteam_product_generator.rb +25 -9
- data/generators/opensteam_product/templates/controllers/product_controller.rb +5 -4
- data/generators/opensteam_product/templates/migration.rb +2 -1
- data/generators/opensteam_product/templates/models/product.rb +1 -0
- data/generators/opensteam_product/templates/views/{administration → admin}/_attributes.html.erb +1 -1
- data/generators/opensteam_product/templates/views/{administration → admin}/_get_products.html.erb +0 -0
- data/generators/opensteam_product/templates/views/{administration → admin}/_inventories.html.erb +2 -2
- data/generators/opensteam_product/templates/views/admin/edit.html.erb +13 -0
- data/generators/opensteam_product/templates/views/{administration → admin}/index.html.erb +5 -5
- data/generators/opensteam_product/templates/views/admin/new.html.erb +16 -0
- data/generators/opensteam_product/templates/views/{administration → admin}/show.html.erb +2 -2
- data/generators/opensteam_property/opensteam_property_generator.rb +8 -8
- data/generators/opensteam_property/templates/controllers/property_controller.rb +6 -4
- data/generators/opensteam_property/templates/migration.rb +2 -1
- data/generators/opensteam_property/templates/models/property.rb +1 -0
- data/generators/opensteam_property/templates/views/{administration → admin}/edit.html.erb +3 -3
- data/generators/opensteam_property/templates/views/admin/index.html.erb +24 -0
- data/generators/opensteam_property/templates/views/{administration → admin}/new.html.erb +2 -2
- data/generators/opensteam_property/templates/views/admin/show.html.erb +10 -0
- data/lib/opensteam/base.rb +16 -0
- data/lib/opensteam/cart_base.rb +227 -0
- data/lib/opensteam/checkout.rb +30 -3
- data/lib/opensteam/config.rb +37 -0
- data/lib/opensteam/extension_base.rb +76 -0
- data/lib/opensteam/finder.rb +36 -5
- data/lib/opensteam/helper/configurable_table.rb +228 -0
- data/lib/opensteam/history.rb +56 -0
- data/lib/opensteam/initializer.rb +127 -0
- data/lib/opensteam/inventory_base.rb +24 -1
- data/lib/opensteam/invoice_base.rb +61 -0
- data/lib/opensteam/order_base.rb +105 -14
- data/lib/opensteam/product_base.rb +31 -3
- data/lib/opensteam/property_base.rb +16 -0
- data/lib/opensteam/shipment_base.rb +60 -0
- data/lib/opensteam/shopping_cart.rb +32 -14
- data/lib/opensteam/state_logic.rb +218 -0
- data/lib/opensteam/state_machine.rb +216 -0
- data/lib/opensteam/user_base.rb +115 -131
- data/lib/opensteam/version.rb +17 -1
- data/lib/opensteam.rb +30 -35
- metadata +245 -146
- data/History.txt +0 -0
- data/License.txt +0 -4
- data/Manifest.txt +0 -131
- data/Manifest.txt.bak +0 -132
- data/generators/opensteam/templates/controllers/administration/customers_controller.rb +0 -23
- data/generators/opensteam/templates/controllers/administration/orders_controller.rb +0 -61
- data/generators/opensteam/templates/controllers/administration_controller.rb +0 -80
- data/generators/opensteam/templates/controllers/checkout_controller.rb +0 -142
- data/generators/opensteam/templates/helpers/webshop_helper.rb +0 -29
- data/generators/opensteam/templates/migrations/create_dummy_users.rb +0 -16
- data/generators/opensteam/templates/migrations/create_orders.rb +0 -18
- data/generators/opensteam/templates/migrations/create_users.rb +0 -19
- data/generators/opensteam/templates/models/administration_mailer.rb +0 -18
- data/generators/opensteam/templates/models/inventories_property.rb +0 -10
- data/generators/opensteam/templates/models/inventory.rb +0 -57
- data/generators/opensteam/templates/public/images/rails.png +0 -0
- data/generators/opensteam/templates/views/administration/_nav.html.erb +0 -11
- data/generators/opensteam/templates/views/administration/_update_tree.html.erb +0 -18
- data/generators/opensteam/templates/views/administration/admin_info.html.erb +0 -12
- data/generators/opensteam/templates/views/administration/customers/index.html.erb +0 -27
- data/generators/opensteam/templates/views/administration/customers/show.html.erb +0 -27
- data/generators/opensteam/templates/views/administration/customers.html.erb +0 -44
- data/generators/opensteam/templates/views/administration/index.html.erb +0 -9
- data/generators/opensteam/templates/views/administration/inventories/show.html.erb +0 -45
- data/generators/opensteam/templates/views/administration/login.html.erb +0 -16
- data/generators/opensteam/templates/views/administration/order.html.erb +0 -22
- data/generators/opensteam/templates/views/administration/orders/_order_item.html.erb +0 -22
- data/generators/opensteam/templates/views/administration/orders/index.html.erb +0 -32
- data/generators/opensteam/templates/views/administration/orders/show.html.erb +0 -25
- data/generators/opensteam/templates/views/administration/orders.html.erb +0 -32
- data/generators/opensteam/templates/views/administration/products.html.erb +0 -7
- data/generators/opensteam/templates/views/administration/properties.html.erb +0 -7
- data/generators/opensteam/templates/views/administration/show_order_item.html.erb +0 -5
- data/generators/opensteam/templates/views/administration/signup.html.erb +0 -65
- data/generators/opensteam/templates/views/administration/tree.html.erb +0 -15
- data/generators/opensteam/templates/views/administration/update_products.html.erb +0 -5
- data/generators/opensteam/templates/views/administration/update_properties.html.erb +0 -5
- data/generators/opensteam/templates/views/administration/update_tree.rjs +0 -3
- data/generators/opensteam/templates/views/checkout/intro.html.erb +0 -5
- data/generators/opensteam/templates/views/checkout/shipping.html.erb +0 -39
- data/generators/opensteam/templates/views/checkout/show_cart.html.erb +0 -13
- data/generators/opensteam/templates/views/common/_header.html.erb +0 -15
- data/generators/opensteam/templates/views/layouts/administration.html.erb +0 -29
- data/generators/opensteam/templates/views/layouts/webshop.html.erb +0 -36
- data/generators/opensteam/templates/views/webshop/_cart.html.erb +0 -11
- data/generators/opensteam/templates/views/webshop/_header.html.erb +0 -15
- data/generators/opensteam/templates/views/webshop/index.html.erb +0 -12
- data/generators/opensteam_product/templates/views/administration/edit.html.erb +0 -13
- data/generators/opensteam_product/templates/views/administration/new.html.erb +0 -16
- data/generators/opensteam_property/templates/views/administration/index.html.erb +0 -24
- data/generators/opensteam_property/templates/views/administration/show.html.erb +0 -10
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
body {
|
|
2
|
+
background-image:url(../images/opensteam_background.jpg) ;
|
|
3
|
+
background-repeat: repeat-x ;
|
|
4
|
+
background-color: #ffffff ;
|
|
5
|
+
|
|
6
|
+
font-family:Verdana, Arial ;
|
|
7
|
+
font-size:9pt ;
|
|
8
|
+
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
#header {
|
|
12
|
+
margin-left:100px ;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
#page {
|
|
16
|
+
margin-top:120px ;
|
|
17
|
+
margin-left:100px ;
|
|
18
|
+
margin-right:100px ;
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
#logo_top {
|
|
24
|
+
float:left ;
|
|
25
|
+
margin-top:40px ;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
#menu {
|
|
29
|
+
background-image:url(../images/menu_background.jpg) ;
|
|
30
|
+
background-repeat: repeat-x ;
|
|
31
|
+
background-color: #be0a1b ;
|
|
32
|
+
height:60px ;
|
|
33
|
+
padding-left:70% ;
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
#menu a {
|
|
38
|
+
color: white ;
|
|
39
|
+
text-decoration:none ;
|
|
40
|
+
padding-top:20px ;
|
|
41
|
+
display:block ;
|
|
42
|
+
height:40px ;
|
|
43
|
+
float:left ;
|
|
44
|
+
margin-right:10px ;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
#menu a:hover {
|
|
48
|
+
color: white ;
|
|
49
|
+
text-decoration:none ;
|
|
50
|
+
display:block ;
|
|
51
|
+
float:left ;
|
|
52
|
+
margin-right:10px ;
|
|
53
|
+
background-color:#C94753 ;
|
|
54
|
+
background-image:none ;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
#menu_sub {
|
|
59
|
+
background-image:url(../images/athmo_background.jpg ) ;
|
|
60
|
+
background-repeat: repeat-x ;
|
|
61
|
+
background-color: #000000 ;
|
|
62
|
+
padding-left:70% ;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
#menu_sub a {
|
|
67
|
+
color: white ;
|
|
68
|
+
text-decoration:none ;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
#menu_sub a:hover {
|
|
73
|
+
color: white ;
|
|
74
|
+
text-decoration:none ;
|
|
75
|
+
background-color: #555555 ;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
.content {
|
|
80
|
+
padding:1em ;
|
|
81
|
+
background-color: #fff ;
|
|
82
|
+
}
|
|
83
|
+
#box1 {
|
|
84
|
+
float:left ;
|
|
85
|
+
width:50%;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
#box2 {
|
|
89
|
+
border-left: 1px solid #353535 ;
|
|
90
|
+
float:left ;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.header_element {
|
|
94
|
+
margin-top:-4px ;
|
|
95
|
+
background-color:#be0a1b ;
|
|
96
|
+
margin-left:50%;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
#search_bar {
|
|
100
|
+
height:30px ;
|
|
101
|
+
padding-left:5px ;
|
|
102
|
+
width:180px ;
|
|
103
|
+
|
|
104
|
+
float:clear;
|
|
105
|
+
|
|
106
|
+
-moz-border-radius-bottomleft: 6px ;
|
|
107
|
+
-moz-border-radius-bottomright: 6px ;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
.listing_1_odd {
|
|
112
|
+
background-color:#eee ;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.listing_1_even {
|
|
116
|
+
background-color:#fff ;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
table.order_table {
|
|
121
|
+
font-size:8pt;
|
|
122
|
+
border-collapse: collapse ;
|
|
123
|
+
border: 1px solid white ;
|
|
124
|
+
padding-left:5px;
|
|
125
|
+
padding-right:5px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
table.order_table th {
|
|
129
|
+
background-color:#ccc ;
|
|
130
|
+
border-left:1px solid black ;
|
|
131
|
+
padding-left:5px;
|
|
132
|
+
padding-right:5px;
|
|
133
|
+
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
table.order_table td {
|
|
138
|
+
border-left:1px solid black ;
|
|
139
|
+
padding-left:5px;
|
|
140
|
+
padding-right:5px;
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
tr.order_row1 {
|
|
146
|
+
background-color:#eee;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
.fieldWithErrors {
|
|
152
|
+
padding: 2px;
|
|
153
|
+
background-color: red;
|
|
154
|
+
display: table;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
#errorExplanation {
|
|
158
|
+
width: 400px;
|
|
159
|
+
border: 2px solid red;
|
|
160
|
+
padding: 7px;
|
|
161
|
+
padding-bottom: 12px;
|
|
162
|
+
margin-bottom: 20px;
|
|
163
|
+
background-color: #f0f0f0;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
#errorExplanation h2 {
|
|
167
|
+
text-align: left;
|
|
168
|
+
font-weight: bold;
|
|
169
|
+
padding: 5px 5px 5px 15px;
|
|
170
|
+
font-size: 12px;
|
|
171
|
+
margin: -7px;
|
|
172
|
+
background-color: #c00;
|
|
173
|
+
color: #fff;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
#errorExplanation p {
|
|
177
|
+
color: #333;
|
|
178
|
+
margin-bottom: 0;
|
|
179
|
+
padding: 5px;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
#errorExplanation ul li {
|
|
183
|
+
font-size: 12px;
|
|
184
|
+
list-style: square;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
body {
|
|
2
|
+
background-image:url(../images/bg.jpg) ;
|
|
3
|
+
background-repeat: repeat-x ;
|
|
4
|
+
background-color: #ffffff ;
|
|
5
|
+
|
|
6
|
+
font-family:Verdana, Arial ;
|
|
7
|
+
font-size:9pt ;
|
|
8
|
+
color:#333;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
#menu {
|
|
12
|
+
float:right;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
#page {
|
|
16
|
+
margin-top:30px;
|
|
17
|
+
margin-left:50px;
|
|
18
|
+
margin-right:50px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
#header {
|
|
23
|
+
padding-left:30px;
|
|
24
|
+
padding-top:30px;
|
|
25
|
+
padding-bottom:10px;
|
|
26
|
+
|
|
27
|
+
border-bottom:1px solid black;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
#content_box {
|
|
31
|
+
clear:both;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
#content_box div {
|
|
35
|
+
border-left: 1px solid #aaa;
|
|
36
|
+
padding:10px;
|
|
37
|
+
float:left
|
|
38
|
+
;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
#content_box div * {
|
|
42
|
+
clear:both;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
#content_box div .fieldWithErrors {
|
|
46
|
+
clear:both;
|
|
47
|
+
padding:3px ;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
#content_box div div {
|
|
52
|
+
border:none;
|
|
53
|
+
padding:10px;
|
|
54
|
+
clear:both;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
#sidebar {
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
#content {
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
#footer {
|
|
64
|
+
border-top: 1px solid black;
|
|
65
|
+
clear:both;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
#cart {
|
|
69
|
+
float:left ;
|
|
70
|
+
border-left: 1px solid #aaa;
|
|
71
|
+
padding:20px;
|
|
72
|
+
height:100%;
|
|
73
|
+
background-color:#eee;
|
|
74
|
+
width:30%;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.cart_item {
|
|
78
|
+
clear:both;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.configured_table table {
|
|
82
|
+
border-collapse: collapse ;
|
|
83
|
+
border-spacing: 1px;
|
|
84
|
+
font-size:8pt;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.configured_table table th a {
|
|
88
|
+
width:100%;
|
|
89
|
+
color:black;
|
|
90
|
+
text-decoration:none;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.configured_table table th a:hover {
|
|
94
|
+
background-color:#eee;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.configured_table table td {
|
|
98
|
+
border-left:1px solid black ;
|
|
99
|
+
padding:2px ;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.configured_table table th {
|
|
103
|
+
border-left:1px solid black ;
|
|
104
|
+
padding:s2px ;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
.even { background-color: #eee; }
|
|
109
|
+
.odd { background-color: #fff; }
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
.fieldWithErrors {
|
|
114
|
+
padding: 2px;
|
|
115
|
+
background-color: red;
|
|
116
|
+
display: table;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
#errorExplanation {
|
|
120
|
+
width: 400px;
|
|
121
|
+
border: 1px solid red;
|
|
122
|
+
padding: 7px;
|
|
123
|
+
padding-bottom: 12px;
|
|
124
|
+
margin-bottom: 20px;
|
|
125
|
+
background-color: #f0f0f0;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
#errorExplanation h2 {
|
|
129
|
+
text-align: left;
|
|
130
|
+
font-weight: bold;
|
|
131
|
+
padding: 5px 5px 5px 15px;
|
|
132
|
+
font-size: 12px;
|
|
133
|
+
margin: -7px;
|
|
134
|
+
background-color: #c00;
|
|
135
|
+
color: #fff;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
#errorExplanation p {
|
|
139
|
+
color: #333;
|
|
140
|
+
margin-bottom: 0;
|
|
141
|
+
padding: 5px;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
#errorExplanation ul li {
|
|
145
|
+
font-size: 12px;
|
|
146
|
+
list-style: square;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
div.uploadStatus {
|
|
150
|
+
margin: 5px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
div.progressBar {
|
|
154
|
+
margin: 5px;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
div.progressBar div.border {
|
|
158
|
+
background-color: #fff;
|
|
159
|
+
border: 1px solid gray;
|
|
160
|
+
width: 100%;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
div.progressBar div.background {
|
|
164
|
+
background-color: #333;
|
|
165
|
+
height: 18px;
|
|
166
|
+
width: 0%;
|
|
167
|
+
}
|
|
168
|
+
|
|
@@ -88,7 +88,7 @@ namespace :opensteam do
|
|
|
88
88
|
ANIMAL_CONTR
|
|
89
89
|
|
|
90
90
|
sentinel = "@animal = Animal.new(params[:animal])"
|
|
91
|
-
gsub_file "app/controllers/
|
|
91
|
+
gsub_file "app/controllers/admin/animals_controller.rb", /(#{Regexp.escape(sentinel)})/mi do |match|
|
|
92
92
|
"#{incl}\n\n"
|
|
93
93
|
end
|
|
94
94
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
# openSteam - http://www.opensteam.net
|
|
2
|
+
# Copyright (C) 2008 DiamondDogs Webconsulting
|
|
3
|
+
#
|
|
4
|
+
# This program is free software; you can redistribute it and/or modify
|
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
|
6
|
+
# the Free Software Foundation; version 2 of the License.
|
|
7
|
+
#
|
|
8
|
+
# This program is distributed in the hope that it will be useful,
|
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
11
|
+
# GNU General Public License for more details.
|
|
12
|
+
#
|
|
13
|
+
# You should have received a copy of the GNU General Public License along
|
|
14
|
+
# with this program; if not, write to the Free Software Foundation, Inc.,
|
|
15
|
+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
16
|
+
|
|
1
17
|
class OpensteamProductGenerator < Rails::Generator::NamedBase
|
|
2
18
|
|
|
3
19
|
def initialize(runtime_args, runtime_options = {})
|
|
@@ -12,10 +28,10 @@ class OpensteamProductGenerator < Rails::Generator::NamedBase
|
|
|
12
28
|
|
|
13
29
|
### Controllers ###
|
|
14
30
|
# direcotries
|
|
15
|
-
m.directory( File.join('app/controllers', '
|
|
31
|
+
m.directory( File.join('app/controllers', 'admin') )
|
|
16
32
|
|
|
17
33
|
# app/controllers/*
|
|
18
|
-
m.template("controllers/product_controller.rb", "app/controllers/
|
|
34
|
+
m.template("controllers/product_controller.rb", "app/controllers/admin/#{table_name}_controller.rb")
|
|
19
35
|
|
|
20
36
|
|
|
21
37
|
|
|
@@ -26,12 +42,12 @@ class OpensteamProductGenerator < Rails::Generator::NamedBase
|
|
|
26
42
|
|
|
27
43
|
|
|
28
44
|
### Views ###
|
|
29
|
-
m.directory( File.join('app/views', '
|
|
30
|
-
# app/views/
|
|
45
|
+
m.directory( File.join('app/views', 'admin', table_name ) )
|
|
46
|
+
# app/views/admin/<product>/* #
|
|
31
47
|
%w( _attributes edit _get_products new show index ).each { |f|
|
|
32
|
-
m.template("views/
|
|
48
|
+
m.template("views/admin/#{f}.html.erb", "app/views/admin/#{table_name}/#{f}.html.erb")
|
|
33
49
|
}
|
|
34
|
-
m.file( "views/
|
|
50
|
+
m.file( "views/admin/_inventories.html.erb", "app/views/admin/#{table_name}/_inventories.html.erb")
|
|
35
51
|
|
|
36
52
|
# app/views/<product>/*
|
|
37
53
|
m.directory( File.join('app/views', table_name ) )
|
|
@@ -62,12 +78,12 @@ class OpensteamProductGenerator < Rails::Generator::NamedBase
|
|
|
62
78
|
|
|
63
79
|
|
|
64
80
|
def map_add_namespace(str)
|
|
65
|
-
logger.route "add
|
|
66
|
-
sentinel = ' map.namespace :
|
|
81
|
+
logger.route "add admin namepsace for #{file_name}"
|
|
82
|
+
sentinel = ' map.namespace :admin do |admin|'
|
|
67
83
|
|
|
68
84
|
unless options[:pretend]
|
|
69
85
|
gsub_file 'config/routes.rb', /(#{Regexp.escape(sentinel)})/mi do |match|
|
|
70
|
-
"#{match}\n
|
|
86
|
+
"#{match}\n admin.resources :#{str}\n"
|
|
71
87
|
end
|
|
72
88
|
end
|
|
73
89
|
end
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
## TEMPLATE ##
|
|
2
|
+
class Admin<%= class_name.pluralize %>Controller < AdminController
|
|
2
3
|
include Opensteam::Finder
|
|
3
4
|
|
|
4
5
|
# GET /<%= table_name %>
|
|
@@ -61,7 +62,7 @@ class Administration::<%= class_name.pluralize %>Controller < AdministrationCont
|
|
|
61
62
|
respond_to do |format|
|
|
62
63
|
if @<%= file_name %>.save
|
|
63
64
|
flash[:notice] = '<%= class_name %> was successfully created.'
|
|
64
|
-
format.html { redirect_to( [:
|
|
65
|
+
format.html { redirect_to( [:admin, @<%= file_name %> ]) }
|
|
65
66
|
format.xml { render :xml => @<%= file_name %>, :status => :created, :location => @<%= file_name %> }
|
|
66
67
|
else
|
|
67
68
|
format.html { render :action => "new" }
|
|
@@ -81,7 +82,7 @@ class Administration::<%= class_name.pluralize %>Controller < AdministrationCont
|
|
|
81
82
|
respond_to do |format|
|
|
82
83
|
if @<%= file_name %>.update_attributes(params[:<%= file_name %>])
|
|
83
84
|
flash[:notice] = '<%= class_name %> was successfully updated.'
|
|
84
|
-
format.html { redirect_to( [:
|
|
85
|
+
format.html { redirect_to( [:admin, @<%= file_name %> ] ) }
|
|
85
86
|
format.xml { head :ok }
|
|
86
87
|
else
|
|
87
88
|
format.html { render :action => "edit" }
|
|
@@ -97,7 +98,7 @@ class Administration::<%= class_name.pluralize %>Controller < AdministrationCont
|
|
|
97
98
|
@<%= file_name %>.destroy
|
|
98
99
|
|
|
99
100
|
respond_to do |format|
|
|
100
|
-
format.html { redirect_to(
|
|
101
|
+
format.html { redirect_to(admin_<%= table_name %>_url) }
|
|
101
102
|
format.xml { head :ok }
|
|
102
103
|
end
|
|
103
104
|
end
|
data/generators/opensteam_product/templates/views/{administration → admin}/_get_products.html.erb
RENAMED
|
File without changes
|
data/generators/opensteam_product/templates/views/{administration → admin}/_inventories.html.erb
RENAMED
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
<td><%=h inventory.storage %></td>
|
|
17
17
|
<td><%=h inventory.back_ordered == 0 ? "false" : "true" %></td>
|
|
18
18
|
|
|
19
|
-
<td><%= link_to "show inventory",
|
|
20
|
-
<td><%= link_to "edit inventory",
|
|
19
|
+
<td><%= link_to "show inventory", admin_inventory_path( inventory) %></td>
|
|
20
|
+
<td><%= link_to "edit inventory", edit_admin_inventory_path( inventory ) %></td>
|
|
21
21
|
</tr>
|
|
22
22
|
<% end %>
|
|
23
23
|
</table>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<%% content_for :sub_nav do %>
|
|
2
|
+
<%%= link_to "<%= class_name %> Index", admin_<%= table_name %>_path %> ||
|
|
3
|
+
<%%= link_to "Show Current", [:admin, @<%= file_name %>] %>
|
|
4
|
+
<%% end %>
|
|
5
|
+
|
|
6
|
+
<h1>Editing <%= class_name %></h1>
|
|
7
|
+
|
|
8
|
+
<%%= error_messages_for :<%= file_name %> %>
|
|
9
|
+
|
|
10
|
+
<%% form_for :<%= file_name %>, @<%= file_name %>, :url => { :action => :update }, :html => { :method => "put" } do |f| %>
|
|
11
|
+
<%%= render :partial => "admin/<%= table_name %>/attributes", :locals => { :button_name => "Update", :f => f }%>
|
|
12
|
+
<%% end %>
|
|
13
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%% content_for :sub_nav do %>
|
|
2
|
-
<%%= link_to "<%= class_name.pluralize %> Index",
|
|
2
|
+
<%%= link_to "<%= class_name.pluralize %> Index", admin_<%= table_name %>_path %>
|
|
3
3
|
<%% end %>
|
|
4
4
|
|
|
5
5
|
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
<td><%%=h <%= singular_name %>.<%= attribute.name %> %></td>
|
|
25
25
|
<% end -%>
|
|
26
26
|
<% end -%>
|
|
27
|
-
<td><%%= link_to 'Show', [:
|
|
28
|
-
<td><%%= link_to 'Edit',
|
|
29
|
-
<td><%%= link_to 'Destroy', [:
|
|
27
|
+
<td><%%= link_to 'Show', [:admin, <%= file_name %>] %></td>
|
|
28
|
+
<td><%%= link_to 'Edit', edit_admin_<%= file_name %>_path( <%= file_name %> ) %></td>
|
|
29
|
+
<td><%%= link_to 'Destroy', [:admin, <%= file_name %>], :confirm => 'Are you sure?', :method => :delete %></td>
|
|
30
30
|
</tr>
|
|
31
31
|
<%% end %>
|
|
32
32
|
</table>
|
|
33
33
|
|
|
34
34
|
<br />
|
|
35
35
|
|
|
36
|
-
<%%= link_to 'New <%= class_name %>',
|
|
36
|
+
<%%= link_to 'New <%= class_name %>', new_admin_<%= file_name %>_path %>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<%% content_for :sub_nav do %>
|
|
2
|
+
<%%= link_to "<%= class_name.pluralize %> Index", admin_<%= table_name %>_path %>
|
|
3
|
+
<%% end %>
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
<h1>New <%= class_name %></h1>
|
|
7
|
+
|
|
8
|
+
<%%= error_messages_for :<%= file_name %> %>
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
<%% form_for :<%= file_name %>, @<%= file_name %>, :url => { :action => :create }, :html => { :method => "post" } do |f| %>
|
|
13
|
+
<%%= render :partial => "admin/<%= table_name %>/attributes", :locals => { :button_name => "Create", :f => f }%>
|
|
14
|
+
<%% end %>
|
|
15
|
+
|
|
16
|
+
<%%= link_to 'Back', admin_<%= table_name %>_path %>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
<%% content_for :sub_nav do %>
|
|
3
|
-
<%%= link_to "<%= class_name.pluralize %> Index",
|
|
4
|
-
<%%= link_to "Edit Current",
|
|
3
|
+
<%%= link_to "<%= class_name.pluralize %> Index", admin_<%= table_name %>_path %> ||
|
|
4
|
+
<%%= link_to "Edit Current", edit_admin_<%= file_name %>_path( @<%= file_name %> ) %>
|
|
5
5
|
<%% end %>
|
|
6
6
|
<% for attribute in attributes -%>
|
|
7
7
|
<p>
|
|
@@ -31,10 +31,10 @@ class OpensteamPropertyGenerator < Rails::Generator::NamedBase
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
### Controllers
|
|
34
|
-
m.directory( File.join('app/controllers', '
|
|
34
|
+
m.directory( File.join('app/controllers', 'admin') )
|
|
35
35
|
|
|
36
|
-
# app/controllers/
|
|
37
|
-
m.template("controllers/property_controller.rb", "app/controllers/
|
|
36
|
+
# app/controllers/admin/* #
|
|
37
|
+
m.template("controllers/property_controller.rb", "app/controllers/admin/#{table_name}_controller.rb")
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
@@ -46,9 +46,9 @@ class OpensteamPropertyGenerator < Rails::Generator::NamedBase
|
|
|
46
46
|
|
|
47
47
|
### Views ###
|
|
48
48
|
# app/views/administratino/<property>/* #
|
|
49
|
-
m.directory( File.join('app/views', '
|
|
49
|
+
m.directory( File.join('app/views', 'admin', table_name ) )
|
|
50
50
|
%w( edit show index new ).each { |f|
|
|
51
|
-
m.template("views/
|
|
51
|
+
m.template("views/admin/#{f}.html.erb", "app/views/admin/#{table_name}/#{f}.html.erb")
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
|
|
@@ -73,12 +73,12 @@ class OpensteamPropertyGenerator < Rails::Generator::NamedBase
|
|
|
73
73
|
|
|
74
74
|
|
|
75
75
|
def map_add_namespace(str)
|
|
76
|
-
logger.route "add
|
|
77
|
-
sentinel = ' map.namespace :
|
|
76
|
+
logger.route "add admin namepsace for #{file_name}"
|
|
77
|
+
sentinel = ' map.namespace :admin do |admin|'
|
|
78
78
|
|
|
79
79
|
unless options[:pretend]
|
|
80
80
|
gsub_file 'config/routes.rb', /(#{Regexp.escape(sentinel)})/mi do |match|
|
|
81
|
-
"#{match}\n
|
|
81
|
+
"#{match}\n admin.resources :#{str}\n"
|
|
82
82
|
end
|
|
83
83
|
end
|
|
84
84
|
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class Admin::<%= class_name.pluralize %>Controller < AdminController
|
|
2
2
|
|
|
3
3
|
# GET /<%= table_name %>
|
|
4
4
|
# GET /<%= table_name %>.xml
|
|
@@ -46,7 +46,7 @@ class Administration::<%= class_name.pluralize %>Controller < AdministrationCont
|
|
|
46
46
|
respond_to do |format|
|
|
47
47
|
if @<%= file_name %>.save
|
|
48
48
|
flash[:notice] = '<%= class_name %> was successfully created.'
|
|
49
|
-
format.html { redirect_to([:
|
|
49
|
+
format.html { redirect_to([:admin, @<%= file_name %>]) }
|
|
50
50
|
format.xml { render :xml => @<%= file_name %>, :status => :created, :location => @<%= file_name %> }
|
|
51
51
|
else
|
|
52
52
|
format.html { render :action => "new" }
|
|
@@ -63,7 +63,7 @@ class Administration::<%= class_name.pluralize %>Controller < AdministrationCont
|
|
|
63
63
|
respond_to do |format|
|
|
64
64
|
if @<%= file_name %>.update_attributes(params[:<%= file_name %>])
|
|
65
65
|
flash[:notice] = '<%= class_name %> was successfully updated.'
|
|
66
|
-
format.html { redirect_to([:
|
|
66
|
+
format.html { redirect_to([:admin, @<%= file_name %>]) }
|
|
67
67
|
format.xml { head :ok }
|
|
68
68
|
else
|
|
69
69
|
format.html { render :action => "edit" }
|
|
@@ -79,8 +79,10 @@ class Administration::<%= class_name.pluralize %>Controller < AdministrationCont
|
|
|
79
79
|
@<%= file_name %>.destroy
|
|
80
80
|
|
|
81
81
|
respond_to do |format|
|
|
82
|
-
format.html { redirect_to(
|
|
82
|
+
format.html { redirect_to(admin_<%= table_name %>_url) }
|
|
83
83
|
format.xml { head :ok }
|
|
84
84
|
end
|
|
85
85
|
end
|
|
86
86
|
end
|
|
87
|
+
|
|
88
|
+
## TEMPLATE ##
|