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.
Files changed (134) hide show
  1. data/History.txt +0 -0
  2. data/License.txt +4 -0
  3. data/Manifest.txt +131 -0
  4. data/Manifest.txt.bak +132 -0
  5. data/README.txt +92 -0
  6. data/generators/opensteam/opensteam_generator.rb +295 -0
  7. data/generators/opensteam/templates/controllers/administration/customers_controller.rb +23 -0
  8. data/generators/opensteam/templates/controllers/administration/inventories_controller.rb +88 -0
  9. data/generators/opensteam/templates/controllers/administration/orders_controller.rb +61 -0
  10. data/generators/opensteam/templates/controllers/administration_controller.rb +80 -0
  11. data/generators/opensteam/templates/controllers/checkout_controller.rb +142 -0
  12. data/generators/opensteam/templates/controllers/webshop_controller.rb +68 -0
  13. data/generators/opensteam/templates/fixtures/inventories.yml +221 -0
  14. data/generators/opensteam/templates/fixtures/inventories_properties.yml +127 -0
  15. data/generators/opensteam/templates/fixtures/product_animals.yml +73 -0
  16. data/generators/opensteam/templates/fixtures/product_dog_foods.yml +7 -0
  17. data/generators/opensteam/templates/fixtures/properties.yml +42 -0
  18. data/generators/opensteam/templates/helpers/webshop_helper.rb +29 -0
  19. data/generators/opensteam/templates/init/opensteam.rb +30 -0
  20. data/generators/opensteam/templates/migrations/create_addresses.rb +17 -0
  21. data/generators/opensteam/templates/migrations/create_customers.rb +16 -0
  22. data/generators/opensteam/templates/migrations/create_dummy_users.rb +16 -0
  23. data/generators/opensteam/templates/migrations/create_inventories.rb +20 -0
  24. data/generators/opensteam/templates/migrations/create_inventories_properties.rb +14 -0
  25. data/generators/opensteam/templates/migrations/create_order_items.rb +16 -0
  26. data/generators/opensteam/templates/migrations/create_orders.rb +18 -0
  27. data/generators/opensteam/templates/migrations/create_payment_types.rb +13 -0
  28. data/generators/opensteam/templates/migrations/create_properties.rb +12 -0
  29. data/generators/opensteam/templates/migrations/create_sessions.rb +16 -0
  30. data/generators/opensteam/templates/migrations/create_users.rb +19 -0
  31. data/generators/opensteam/templates/models/administration_mailer.rb +18 -0
  32. data/generators/opensteam/templates/models/inventories_property.rb +10 -0
  33. data/generators/opensteam/templates/models/inventory.rb +57 -0
  34. data/generators/opensteam/templates/public/images/bullet_arrow_down.png +0 -0
  35. data/generators/opensteam/templates/public/images/bullet_arrow_up.png +0 -0
  36. data/generators/opensteam/templates/public/images/cancel.png +0 -0
  37. data/generators/opensteam/templates/public/images/folder_database.png +0 -0
  38. data/generators/opensteam/templates/public/images/indicator.gif +0 -0
  39. data/generators/opensteam/templates/public/images/indicator_big.gif +0 -0
  40. data/generators/opensteam/templates/public/images/minus.png +0 -0
  41. data/generators/opensteam/templates/public/images/opensteam_logo_small.jpg +0 -0
  42. data/generators/opensteam/templates/public/images/opensteam_logo_web.jpg +0 -0
  43. data/generators/opensteam/templates/public/images/palette.png +0 -0
  44. data/generators/opensteam/templates/public/images/plus.png +0 -0
  45. data/generators/opensteam/templates/public/images/rails.png +0 -0
  46. data/generators/opensteam/templates/public/index.html +297 -0
  47. data/generators/opensteam/templates/public/stylesheets/webshop.css +262 -0
  48. data/generators/opensteam/templates/tasks/opensteam.rake +114 -0
  49. data/generators/opensteam/templates/views/administration/_address.html.erb +4 -0
  50. data/generators/opensteam/templates/views/administration/_nav.html.erb +11 -0
  51. data/generators/opensteam/templates/views/administration/_update_tree.html.erb +18 -0
  52. data/generators/opensteam/templates/views/administration/admin_info.html.erb +12 -0
  53. data/generators/opensteam/templates/views/administration/customers.html.erb +44 -0
  54. data/generators/opensteam/templates/views/administration/customers/index.html.erb +27 -0
  55. data/generators/opensteam/templates/views/administration/customers/show.html.erb +27 -0
  56. data/generators/opensteam/templates/views/administration/index.html.erb +9 -0
  57. data/generators/opensteam/templates/views/administration/inventories/edit.html.erb +48 -0
  58. data/generators/opensteam/templates/views/administration/inventories/index.html.erb +27 -0
  59. data/generators/opensteam/templates/views/administration/inventories/new.html.erb +41 -0
  60. data/generators/opensteam/templates/views/administration/inventories/show.html.erb +45 -0
  61. data/generators/opensteam/templates/views/administration/login.html.erb +16 -0
  62. data/generators/opensteam/templates/views/administration/order.html.erb +22 -0
  63. data/generators/opensteam/templates/views/administration/orders.html.erb +32 -0
  64. data/generators/opensteam/templates/views/administration/orders/_order_item.html.erb +22 -0
  65. data/generators/opensteam/templates/views/administration/orders/index.html.erb +32 -0
  66. data/generators/opensteam/templates/views/administration/orders/show.html.erb +25 -0
  67. data/generators/opensteam/templates/views/administration/products.html.erb +7 -0
  68. data/generators/opensteam/templates/views/administration/properties.html.erb +7 -0
  69. data/generators/opensteam/templates/views/administration/show_order_item.html.erb +5 -0
  70. data/generators/opensteam/templates/views/administration/signup.html.erb +65 -0
  71. data/generators/opensteam/templates/views/administration/tree.html.erb +15 -0
  72. data/generators/opensteam/templates/views/administration/update_products.html.erb +5 -0
  73. data/generators/opensteam/templates/views/administration/update_properties.html.erb +5 -0
  74. data/generators/opensteam/templates/views/administration/update_tree.rjs +3 -0
  75. data/generators/opensteam/templates/views/administration_mailer/order_admin.erb +27 -0
  76. data/generators/opensteam/templates/views/administration_mailer/order_customer.erb +24 -0
  77. data/generators/opensteam/templates/views/checkout/intro.html.erb +5 -0
  78. data/generators/opensteam/templates/views/checkout/outro.html.erb +6 -0
  79. data/generators/opensteam/templates/views/checkout/payment.html.erb +8 -0
  80. data/generators/opensteam/templates/views/checkout/shipping.html.erb +39 -0
  81. data/generators/opensteam/templates/views/checkout/show_cart.html.erb +13 -0
  82. data/generators/opensteam/templates/views/checkout/update_cart_content.rjs +2 -0
  83. data/generators/opensteam/templates/views/common/_cart.html.erb +11 -0
  84. data/generators/opensteam/templates/views/common/_cart_content.html.erb +19 -0
  85. data/generators/opensteam/templates/views/common/_header.html.erb +15 -0
  86. data/generators/opensteam/templates/views/layouts/administration.html.erb +29 -0
  87. data/generators/opensteam/templates/views/layouts/webshop.html.erb +36 -0
  88. data/generators/opensteam/templates/views/webshop/_cart.html.erb +11 -0
  89. data/generators/opensteam/templates/views/webshop/_cart_content.html.erb +23 -0
  90. data/generators/opensteam/templates/views/webshop/_header.html.erb +15 -0
  91. data/generators/opensteam/templates/views/webshop/_inventory_content.html.erb +12 -0
  92. data/generators/opensteam/templates/views/webshop/add_inventory_to_cart.rjs +2 -0
  93. data/generators/opensteam/templates/views/webshop/add_to_cart_with_parameters.rjs +2 -0
  94. data/generators/opensteam/templates/views/webshop/del_item.rjs +1 -0
  95. data/generators/opensteam/templates/views/webshop/index.html.erb +12 -0
  96. data/generators/opensteam/templates/views/webshop/inventory.rjs +2 -0
  97. data/generators/opensteam/templates/views/webshop/show.html.erb +40 -0
  98. data/generators/opensteam_product/opensteam_product_generator.rb +115 -0
  99. data/generators/opensteam_product/templates/controllers/product_controller.rb +104 -0
  100. data/generators/opensteam_product/templates/migration.rb +16 -0
  101. data/generators/opensteam_product/templates/models/product.rb +3 -0
  102. data/generators/opensteam_product/templates/views/_attr_product.html.erb +8 -0
  103. data/generators/opensteam_product/templates/views/_attr_property.html.erb +9 -0
  104. data/generators/opensteam_product/templates/views/_details.html.erb +29 -0
  105. data/generators/opensteam_product/templates/views/administration/_attributes.html.erb +21 -0
  106. data/generators/opensteam_product/templates/views/administration/_get_products.html.erb +8 -0
  107. data/generators/opensteam_product/templates/views/administration/_inventories.html.erb +27 -0
  108. data/generators/opensteam_product/templates/views/administration/edit.html.erb +13 -0
  109. data/generators/opensteam_product/templates/views/administration/index.html.erb +36 -0
  110. data/generators/opensteam_product/templates/views/administration/new.html.erb +16 -0
  111. data/generators/opensteam_product/templates/views/administration/show.html.erb +15 -0
  112. data/generators/opensteam_property/opensteam_property_generator.rb +126 -0
  113. data/generators/opensteam_property/templates/controllers/property_controller.rb +86 -0
  114. data/generators/opensteam_property/templates/migration.rb +14 -0
  115. data/generators/opensteam_property/templates/models/property.rb +3 -0
  116. data/generators/opensteam_property/templates/views/administration/edit.html.erb +19 -0
  117. data/generators/opensteam_property/templates/views/administration/index.html.erb +24 -0
  118. data/generators/opensteam_property/templates/views/administration/new.html.erb +18 -0
  119. data/generators/opensteam_property/templates/views/administration/show.html.erb +10 -0
  120. data/lib/opensteam.rb +49 -0
  121. data/lib/opensteam/base.rb +121 -0
  122. data/lib/opensteam/checkout.rb +89 -0
  123. data/lib/opensteam/config.rb +31 -0
  124. data/lib/opensteam/finder.rb +145 -0
  125. data/lib/opensteam/inventory_base.rb +79 -0
  126. data/lib/opensteam/order_base.rb +58 -0
  127. data/lib/opensteam/product_base.rb +222 -0
  128. data/lib/opensteam/property_base.rb +63 -0
  129. data/lib/opensteam/shopping_cart.rb +343 -0
  130. data/lib/opensteam/user_base.rb +165 -0
  131. data/lib/opensteam/version.rb +9 -0
  132. data/test/test_helper.rb +2 -0
  133. data/test/test_opensteam.rb +11 -0
  134. metadata +189 -0
@@ -0,0 +1,27 @@
1
+ <h3>Customers</h3>
2
+ <br />
3
+ <br />
4
+ <table>
5
+ <tr>
6
+ <th>IP</th>
7
+ <th>Email</th>
8
+ <th>Firstname</th>
9
+ <th>Lastname</th>
10
+ <th>Created</th>
11
+ <th>Addresses</th>
12
+ <th>Orders</th>
13
+ <th />
14
+ </tr>
15
+ <% for customer in @customers %>
16
+ <tr>
17
+ <td><%=h customer.ip %></td>
18
+ <td><%=h customer.email %></td>
19
+ <td><%=h customer.firstname %></td>
20
+ <td><%=h customer.lastname %></td>
21
+ <td><%=h customer.created_at %></td>
22
+ <td><%=h customer.addresses.size %></td>
23
+ <td><%=h customer.orders.size %> <%= link_to "show orders", :controller => :orders, :action => :index, :customer_id => customer.id %> </td>
24
+ <td><%= link_to "show", administration_customer_path( customer ) %></td>
25
+ </tr>
26
+ <% end %>
27
+ </table>
@@ -0,0 +1,27 @@
1
+ <h3>Customer Info</h3>
2
+ <br />
3
+ <b>Email:</b> <%= @customer.email %><br /><br />
4
+ <b>Firstname:</b> <%=h @customer.firstname %><br />
5
+ <b>Lastname:</b> <%=h @customer.lastname %><br />
6
+ <br />
7
+ <b>Orders: </b> <%=h @customer.orders.size %> <%= link_to "show orders", :controller => :orders, :action => :index, :customer_id => @customer.id %><br />
8
+ <br />
9
+ <b>Addresses</b>
10
+ <table>
11
+ <tr>
12
+ <th>#</th>
13
+ <th>ZIP</th>
14
+ <th>Street</th>
15
+ <th>City</th>
16
+ <th>Land</th>
17
+ </tr>
18
+ <% for address in @customer.addresses %>
19
+ <tr>
20
+ <td><%= address.id %></td>
21
+ <td><%= address.postal %></td>
22
+ <td><%= address.street%></td>
23
+ <td><%= address.city %></td>
24
+ <td><%= address.land %></td>
25
+ </tr>
26
+ <% end %>
27
+ </table>
@@ -0,0 +1,9 @@
1
+ <b>Administration - Section</b><br />
2
+ <br />
3
+ <ul>
4
+ <li><%= link_to "Products", :action => :products %></li>
5
+ <li><%= link_to "Properties", :action => :properties %></li>
6
+ <li><%= link_to "Orders", :action => :orders %></li>
7
+ <li><%= link_to "Users", :action => :users %></li>
8
+ </ul>
9
+
@@ -0,0 +1,48 @@
1
+
2
+ <% content_for :sub_nav do %>
3
+ <%= link_to "#{@inventory.product.class.to_s.pluralize} Index", :controller => @inventory.product.class.to_s.tableize, :action => :index %> ||
4
+ <%= link_to "Show Product", [:administration, @inventory.product ] %>
5
+ <%= link_to "Edit Product", [:edit, :administration, @inventory.product ] %>
6
+ <%= link_to "Show Inventory", administration_inventory_path( @inventory ) %>
7
+
8
+ <% end %>
9
+
10
+
11
+
12
+ <h3>Editing Inventory for <%=h @inventory.product.class %> '<%=h @inventory.product.name %>'</h3>
13
+ <h4>Configuration: <%=h @inventory.properties.collect(&:name) * "," %></h4>
14
+
15
+
16
+ <%= error_messages_for :inventory %>
17
+
18
+ <% form_for :inventory, @inventory, :url => { :controller => "inventories", :action => :update }, :html => { :method => "put" } do |f| %>
19
+ <p>
20
+ <b>Price</b><br />
21
+ <%= f.text_field :price %>
22
+ </p>
23
+
24
+ <p>
25
+ <b>Storage</b><br />
26
+ <%= f.text_field :storage %>
27
+ </p>
28
+ <p>
29
+ <b>Description</b><br />
30
+ <%= f.text_area :description %>
31
+ </p>
32
+ <p>
33
+ <b>Active</b><br />
34
+ <%= f.select :active, [["true",1],["false",0]] %>
35
+ </p>
36
+ <p>
37
+ <b>Back ordered</b><br />
38
+ <%= f.select :back_ordered, [["true",1],["false",0]] %>
39
+ </p>
40
+
41
+ <p>
42
+ <%= f.submit "Update" %>
43
+ </p>
44
+ <% end %>
45
+
46
+ <%= link_to 'Show', administration_inventory_path( @inventory )%> |
47
+ <%= link_to 'Back', [:administration, @inventory.product ] %> |
48
+ <%= link_to 'Index', administration_inventories_path %>
@@ -0,0 +1,27 @@
1
+ <h1>Listing inventories</h1>
2
+
3
+ <table>
4
+ <tr>
5
+ <th>Price</th>
6
+ <th>Storage</th>
7
+ <th>Active</th>
8
+ <th>Description</th>
9
+ <th>Back ordered</th>
10
+ </tr>
11
+
12
+ <% for inventory in @inventories %>
13
+ <tr>
14
+ <td><%=h inventory.price %></td>
15
+ <td><%=h inventory.storage %></td>
16
+ <td><%=h inventory.active %></td>
17
+ <td><%=h inventory.description %></td>
18
+ <td><%=h inventory.back_ordered %></td>
19
+ <td><%= link_to 'Show', administration_inventory_path( inventory ) %></td>
20
+ <td><%= link_to 'Edit', edit_administration_inventory_path(inventory) %></td>
21
+ <td><%= link_to 'Destroy', administration_inventory_path( inventory ), :confirm => 'Are you sure?', :method => :delete %></td>
22
+ </tr>
23
+ <% end %>
24
+ </table>
25
+
26
+ <br />
27
+
@@ -0,0 +1,41 @@
1
+ <h1>New inventory</h1>
2
+
3
+ <%= error_messages_for :inventory %>
4
+
5
+ <% form_for([:administration, @inventory]) do |f| %>
6
+ <p>
7
+ <b>Price</b><br />
8
+ <%= f.text_field :price %>
9
+ </p>
10
+
11
+ <p>
12
+ <b>Storage</b><br />
13
+ <%= f.text_field :storage %>
14
+ </p>
15
+
16
+ <p>
17
+ <b>Active</b><br />
18
+ <%= f.text_field :active %>
19
+ </p>
20
+
21
+ <p>
22
+ <b>Description</b><br />
23
+ <%= f.text_area :description %>
24
+ </p>
25
+
26
+ <p>
27
+ <b>Back ordered</b><br />
28
+ <%= f.text_field :back_ordered %>
29
+ </p>
30
+
31
+ <p>
32
+ <%= f.submit "Create" %>
33
+ </p>
34
+ <% end %>
35
+
36
+
37
+ <%= link_to 'Back', [:administration, @inventory.product ] %> |
38
+ <%= link_to 'Inventory Index', administration_inventories_path %>
39
+
40
+
41
+
@@ -0,0 +1,45 @@
1
+
2
+ <% content_for :sub_nav do %>
3
+ <%= link_to "#{@inventory.product.class.to_s.pluralize} Index", :controller => @inventory.product.class.to_s.tableize, :action => :index %> ||
4
+ <%= link_to "Show Product", [:administration, @inventory.product ] %> |
5
+ <%= link_to "Edit Product", [:edit, :administration, @inventory.product ] %> |
6
+ <%= link_to "Edit Inventory", edit_administration_inventory_path( @inventory ) %>
7
+
8
+ <% end %>
9
+
10
+
11
+
12
+ <h3>Showing Inventory for <%=h @inventory.product.class %> '<%=h @inventory.product.name %>'</h3>
13
+ <h4>Configuration: <%=h @inventory.properties.collect(&:name) * "," %></h4>
14
+
15
+ <p>
16
+ <b>Price:</b>
17
+ <%=h @inventory.price %>
18
+ </p>
19
+
20
+ <p>
21
+ <b>Storage:</b>
22
+ <%=h @inventory.storage %>
23
+ </p>
24
+
25
+ <p>
26
+ <b>Active:</b>
27
+ <%=h @inventory.active == 1 ? "true" : "false"%>
28
+ </p>
29
+
30
+ <p>
31
+ <b>Back ordered:</b>
32
+ <%=h @inventory.back_ordered == 1 ? "true" : "false" %>
33
+ </p>
34
+
35
+ <p>
36
+ <b>Description:</b>
37
+ <%=h @inventory.description %>
38
+ </p>
39
+
40
+
41
+
42
+
43
+ <%= link_to 'Edit', edit_administration_inventory_path(@inventory) %> |
44
+ <%= link_to 'Back', [:administration, @inventory.product ] %> |
45
+ <%= link_to 'Inventory Index', administration_inventories_path %>
@@ -0,0 +1,16 @@
1
+ <div style="width:100%;height:100%;text-align:center;">
2
+
3
+ <% form_tag :action=> "login" do %>
4
+
5
+ <h3>Login</h3>
6
+ <label for="user_login">Login:</label><br/>
7
+ <%= text_field "user", "login", :size => 20 %><br/>
8
+ <br />
9
+ <label for="user_password">Password:</label><br/>
10
+ <%= password_field "user", "password", :size => 20 %><br/>
11
+ <br />
12
+ <%= submit_tag "log in" %>
13
+
14
+ <% end %>
15
+
16
+ </div>
@@ -0,0 +1,22 @@
1
+ <h2>Order No. <%= @order.id %></h2>
2
+
3
+ <h3>Customer Info</h3>
4
+ <br />
5
+ <b>Email:</b> <%=h @order.customer.email %><br />
6
+ <b>Firstname:</b> <%=h @order.customer.firstname %><br />
7
+ <b>Lastname:</b> <%=h @order.customer.lastname %><br />
8
+ <br />
9
+ <table>
10
+ <tr><td><b>Shipping Address</b></td><td style="border-left:1px dotted black;padding-left:1em;"><b>Payment Address</b></td></tr>
11
+ <tr>
12
+ <td><%= render :partial => "address", :object => @order.shipping_address %></td>
13
+ <td style="border-left:1px dotted black;padding-left:1em;"><%= render :partial => "address", :object => @order.payment_address %></td>
14
+ </tr>
15
+ </table>
16
+ <br /><br />
17
+ <h3>Order Items</h3>
18
+ <b>Total Price</b>: <%=h @order.order_items.collect(&:inventory).collect(&:price).sum %>
19
+ <br /><br />
20
+ <%= render :partial => "order_item", :collection => @order.order_items %>
21
+
22
+
@@ -0,0 +1,32 @@
1
+ <h2> Orders </h2>
2
+ <br />
3
+ <br />
4
+ <table>
5
+ <tr>
6
+ <td>Order Id</td>
7
+ <td>Order Items</td>
8
+ <td>Submitted by</td>
9
+ <td>Submitted at</td>
10
+ <td>Shipped</td>
11
+ <td>Paid</td>
12
+ <td />
13
+ <td />
14
+ <td />
15
+ </tr>
16
+ <% for order in @orders %>
17
+ <tr>
18
+ <td><%=h order.id %></td>
19
+ <td><%=h order.order_items.size %></td>
20
+ <td><%=h order.customer.email %></td>
21
+ <td><%=h order.created_at %></td>
22
+ <td><%=h order.shipped == 1 ? "yes" : "no" %></td>
23
+ <td><%=h order.paid == 1 ? "yes" : "no" %></td>
24
+ <td><%= link_to "toggle shipped", { :action => :toggle_shipped, :id => order.id } %></td>
25
+ <td><%= link_to "toggle paid", { :action => :toggle_paid, :id => order.id } %></td>
26
+ <td><%= link_to "show details", { :action => :order, :id => order.id } %></td>
27
+ </tr>
28
+ <% end %>
29
+ </table>
30
+
31
+
32
+
@@ -0,0 +1,22 @@
1
+ <div class="order_item" style="border-bottom:1px dotted black;">
2
+ <b>Raw Item Data</b> <%= link_to_remote "show",
3
+ :url => { :action => :show_order_item, :order_id => @order.id, :order_item_id => order_item.id },
4
+ :update => :page2,
5
+ :loading => 'Element.show("indicator");',
6
+ :complete => 'Element.hide("indicator");' %> <span id="indicator" style="margin-top:0px; display:none"><%= image_tag "indicator.gif" %>loading...</span>
7
+
8
+ <br />
9
+ <%= debug Inventory.find( order_item.itemid ) %><br />
10
+ <%= debug Inventory.find( order_item.itemid ).product %><br />
11
+ <%= debug Inventory.find( order_item.itemid ).properties %><br />
12
+
13
+
14
+ <b>Quantity:</b> <%=h order_item.quantity %>
15
+ <b>Price:</b> <%=h order_item.quantity * order_item.inventory.price %>
16
+ <br /><br />
17
+
18
+ </div>
19
+
20
+
21
+
22
+
@@ -0,0 +1,32 @@
1
+ <h2> Orders </h2>
2
+ <br />
3
+ <%= link_to "show all", administration_orders_path %> |
4
+ <%= link_to "show not-paid", :action => "index", :filter => :unpaid %>
5
+ <%= link_to "show not-shipped", :action => "index", :filter => :unshipped %>
6
+ <br />
7
+ <br />
8
+ <table>
9
+ <tr>
10
+ <th>Order Id</th>
11
+ <th>Order Items</th>
12
+ <th>Submitted by</th>
13
+ <th>Submitted at</th>
14
+ <th>Shipped</th>
15
+ <th>Paid</th>
16
+ <td />
17
+ </tr>
18
+ <% for order in @orders %>
19
+ <tr>
20
+ <td><%=h order.id %></td>
21
+ <td><%=h order.order_items.size %></td>
22
+ <td><%= link_to order.customer.email, administration_customer_path( order.customer ) %></td>
23
+ <td><%=h order.created_at %></td>
24
+ <td><%=h order.shipped == 1 ? "yes" : "no" %></td>
25
+ <td><%=h order.paid == 1 ? "yes" : "no" %></td>
26
+ <td><%= link_to "show", administration_order_path( order ) %></td>
27
+ </tr>
28
+ <% end %>
29
+ </table>
30
+
31
+
32
+
@@ -0,0 +1,25 @@
1
+ <h2>Order No. <%= @order.id %></h2>
2
+
3
+ <h3>Customer Info</h3>
4
+ <br />
5
+ <b>Email:</b> <%=h @order.customer.email %><br />
6
+ <b>Firstname:</b> <%=h @order.customer.firstname %><br />
7
+ <b>Lastname:</b> <%=h @order.customer.lastname %><br />
8
+ <br />
9
+ <b>Paid</b> <%=h @order.paid == 1 ? "true" : "false" %> <%= link_to "toggle", :action => :toggle, :id => @order.id, :toggle => "paid" %> <br />
10
+ <b>Shipped</b> <%=h @order.shipped == 1 ? "true" : "false" %> <%= link_to "toggle", :action => :toggle, :id => @order.id, :toggle => "shipped" %> <br />
11
+ <br />
12
+ <table>
13
+ <tr><td><b>Shipping Address</b></td><td style="border-left:1px dotted black;padding-left:1em;"><b>Payment Address</b></td></tr>
14
+ <tr>
15
+ <td><%= render :partial => "administration/address", :object => @order.shipping_address %></td>
16
+ <td style="border-left:1px dotted black;padding-left:1em;"><%= render :partial => "administration/address", :object => @order.payment_address %></td>
17
+ </tr>
18
+ </table>
19
+ <br /><br />
20
+ <h3>Order Items</h3>
21
+ <b>Total Price</b>: <%=h @order.order_items.collect(&:inventory).collect(&:price).sum %>
22
+ <br /><br />
23
+ <%= render :partial => "order_item", :collection => @order.order_items %>
24
+
25
+
@@ -0,0 +1,7 @@
1
+ <b>Products</b>
2
+ <ul>
3
+ <% for product in @products %>
4
+ <li> <%= link_to product, product.to_s.tableize %>
5
+ <% end %>
6
+ </ul>
7
+
@@ -0,0 +1,7 @@
1
+ <b>Properties</b>
2
+ <ul>
3
+ <% for property in @properties %>
4
+ <li> <%= link_to property, property.to_s.tableize %>
5
+ <% end %>
6
+ </ul>
7
+
@@ -0,0 +1,5 @@
1
+ <% form_for :product do |f| %>
2
+ <%= render :partial => existing_partial( "#{@product.class.to_s.tableize}/details",
3
+ "#{@product.class.superclass.to_s.tableize}/details"), :object => @product, :locals => { :f => f } %>
4
+ <% end %>
5
+
@@ -0,0 +1,65 @@
1
+ <b>Signup</b>
2
+ <br />
3
+ <%= error_messages_for :user %>
4
+
5
+ <% form_for @user, :url => { :action => "signup" } do |f| %>
6
+ <p>
7
+ <b>login</b><br />
8
+ <%= f.text_field :login %>
9
+ </p>
10
+
11
+ <p>
12
+ <b>firstname<br />
13
+ <%= f.text_field :firstname %>
14
+ </p>
15
+
16
+ <p>
17
+ <b>lastname</b><br />
18
+ <%= f.text_field :lastname %>
19
+ </p>
20
+
21
+ <p>
22
+ <b>email</b><br />
23
+ <%= f.text_field :email %>
24
+ </p>
25
+
26
+ <p>
27
+ <b>password</b><br />
28
+ <%= f.password_field :password %>
29
+ </p>
30
+
31
+ <p>
32
+ <b>password confirmation<br />
33
+ <%= f.password_field :password_confirmation %>
34
+ </p>
35
+
36
+
37
+ <br /><br />
38
+ <p><b><u>Address</u></b><br />
39
+ <% for address in @user.addresses %>
40
+
41
+ <% fields_for "customer[address_attributes][]", address do |a| %>
42
+ <p>
43
+ <b>street</b><br />
44
+ <%= a.text_field :street %><br />
45
+ </p>
46
+ <p>
47
+ <b>zip</b><br />
48
+ <%= a.text_field :postal %><br />
49
+ </p>
50
+ <p>
51
+ <b>city</b><br />
52
+ <%= a.text_field :city %><br />
53
+ </p>
54
+ <p>
55
+ <b>land</b><br />
56
+ <%= a.text_field :land %><br />
57
+ </p>
58
+ <% end %>
59
+ <% end %>
60
+ </p>
61
+
62
+ <p>
63
+ <%= f.submit "signup" %>
64
+ </p>
65
+ <% end %>