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,262 @@
1
+ body {
2
+ padding:1em ;
3
+ background-color: #f0f0f0; color: #333;
4
+ }
5
+
6
+ body, p, ol, ul, td {
7
+
8
+ font-family: verdana, arial, helvetica, sans-serif;
9
+ font-size: 13px;
10
+ line-height: 18px;
11
+ }
12
+
13
+
14
+ #header {
15
+ background-color: #fff;
16
+ border: 1px solid black;
17
+ padding:1em ;
18
+ // background-image: url("../images/opensteam_logo_web.jpg");
19
+ // background-repeat: no-repeat;
20
+ // background-position: 10px 10px;
21
+ height: 64px;
22
+ // padding-left: 250px ;
23
+ }
24
+
25
+
26
+ div.box {
27
+ background-color: #fff;
28
+ border:1px solid black;
29
+ float:left ;
30
+ }
31
+
32
+ div.sub_box {
33
+ background-color: #fff;
34
+ border:1px solid black;
35
+ margin-bottom: 20px ;
36
+ padding:1em ;
37
+ }
38
+
39
+
40
+ #page {
41
+ background-color: #fff;
42
+ border: 1px solid black;
43
+ padding:1em ;
44
+ float:left;
45
+ margin-bottom:2em;
46
+ }
47
+
48
+
49
+ #page2 {
50
+ background-color: #fff;
51
+ border: 1px solid black;
52
+ padding:1em ;
53
+ float:left;
54
+ margin-left:2em;
55
+
56
+ }
57
+
58
+ #catalog_sidebar {
59
+ background-color: #fff;
60
+ border: 1px solid black;
61
+ padding:1em;
62
+ float:left;
63
+ margin-top: 10px ;
64
+
65
+ }
66
+
67
+ #catalog_content { margin-top: 10px ;float:left; }
68
+
69
+
70
+ #footer {
71
+ background-color: #fff;
72
+ border: 1px solid black;
73
+ padding:1em ;
74
+ clear:both;
75
+
76
+ }
77
+
78
+
79
+ #cart {
80
+ padding:2em ;
81
+ border: 1px solid black ;
82
+ float:right;
83
+ width:25%;
84
+ right: 3em ;
85
+ }
86
+
87
+
88
+ #product_content {
89
+ padding:1em;
90
+ background-color: #fff;
91
+ border: 1px solid black;
92
+ float:right;
93
+ }
94
+
95
+
96
+ div.cart_item {
97
+ display:block;
98
+ }
99
+
100
+ #selquantity {
101
+ display:block;
102
+ width:10px;
103
+ overflow:hidden;
104
+ position:relative;
105
+ }
106
+
107
+ td.prodtd0 {
108
+ vertical-align:top;
109
+ background-color: #fff ;
110
+ }
111
+ td.prodtd1 {
112
+ vertical-align:top;
113
+ background-color: #eee ;
114
+ }
115
+ td.prodtd2 {
116
+ vertical-align:top;
117
+ background-color: #eee ;
118
+ }
119
+ td.prodtd3 {
120
+ vertical-align:top;
121
+ background-color: #fff ;
122
+ }
123
+
124
+
125
+ pre {
126
+ background-color: #eee;
127
+ padding: 10px;
128
+ font-size: 11px;
129
+ }
130
+
131
+ #header_info {
132
+ border:1px solid black ;
133
+ font-family: Arial;
134
+ font-size: 13px ;
135
+ padding: 3px;
136
+ }
137
+
138
+
139
+ div.sub_box input
140
+ {
141
+ background-color:#fff;
142
+ border:1px solid;
143
+ padding-left:4px;
144
+
145
+ }
146
+
147
+
148
+ #quantity
149
+ {
150
+ color:#000;
151
+ // font-family:'trebuchet ms',helvetica,sans-serif;
152
+ font-size:84%;
153
+ // font-weight:bold;
154
+ background-color:#fff;
155
+ border:1px solid;
156
+ padding-left:4px;
157
+ }
158
+ #index {
159
+ margin-left:1em;
160
+ width:60%;
161
+ }
162
+
163
+ #details {
164
+ width: 50%;
165
+ }
166
+
167
+ #indicator_center {
168
+ position:absolute;
169
+ left:50%;
170
+ top:50%;
171
+ }
172
+
173
+
174
+ table.catalot_product_inventory {
175
+ border-collapse: collapse;
176
+ }
177
+
178
+
179
+ table.catalog_product_inventory td {
180
+ border-left:1px dotted #ccc ;
181
+ border-right:1px dotted #ccc ;
182
+ padding-left:5px ;
183
+ }
184
+
185
+ table.catalog_product_inventory input,select {
186
+ background-color:#fff ;
187
+ border:1px solid black ;
188
+ padding-left:5px ;
189
+ }
190
+
191
+ table.catalog_product_inventory input#submit {
192
+ background-color:#ccc ;
193
+ border:1px solid black ;
194
+ }
195
+
196
+
197
+
198
+ .even { background-color: #eee; }
199
+ .odd { background-color: #fff; }
200
+
201
+
202
+
203
+ a { color: #000; }
204
+ a:visited { color: #666; }
205
+ a:hover { color: #fff; background-color:#000; }
206
+
207
+ .fieldWithErrors {
208
+ padding: 2px;
209
+ background-color: red;
210
+ display: table;
211
+ }
212
+
213
+ #errorExplanation {
214
+ width: 400px;
215
+ border: 2px solid red;
216
+ padding: 7px;
217
+ padding-bottom: 12px;
218
+ margin-bottom: 20px;
219
+ background-color: #f0f0f0;
220
+ }
221
+
222
+ #errorExplanation h2 {
223
+ text-align: left;
224
+ font-weight: bold;
225
+ padding: 5px 5px 5px 15px;
226
+ font-size: 12px;
227
+ margin: -7px;
228
+ background-color: #c00;
229
+ color: #fff;
230
+ }
231
+
232
+ #errorExplanation p {
233
+ color: #333;
234
+ margin-bottom: 0;
235
+ padding: 5px;
236
+ }
237
+
238
+ #errorExplanation ul li {
239
+ font-size: 12px;
240
+ list-style: square;
241
+ }
242
+
243
+ div.uploadStatus {
244
+ margin: 5px;
245
+ }
246
+
247
+ div.progressBar {
248
+ margin: 5px;
249
+ }
250
+
251
+ div.progressBar div.border {
252
+ background-color: #fff;
253
+ border: 1px solid gray;
254
+ width: 100%;
255
+ }
256
+
257
+ div.progressBar div.background {
258
+ background-color: #333;
259
+ height: 18px;
260
+ width: 0%;
261
+ }
262
+
@@ -0,0 +1,114 @@
1
+ #
2
+ # To change this template, choose Tools | Templates
3
+ # and open the template in the editor.
4
+
5
+
6
+ require 'rake'
7
+ require 'rake/testtask'
8
+ require 'rake/rdoctask'
9
+ require 'fileutils'
10
+
11
+
12
+
13
+ RUBY_PATH = "c:\\ruby\\bin"
14
+
15
+
16
+
17
+ namespace :opensteam do
18
+
19
+ namespace :petstore do
20
+
21
+
22
+ task :create do
23
+
24
+
25
+ # begin
26
+ # require 'has_many_polymorphs'
27
+ # rescue LoadError
28
+ # puts '-' * 80
29
+ # puts
30
+ # puts "\tYour are missing the \'has_many_polymorphs' gem.\n\t1Please install it before proceeding"
31
+ # puts
32
+ # puts '-' * 80
33
+ # raise
34
+ # end
35
+
36
+
37
+ logger "welcome to the OpenSteam 'Petstore' sample application"
38
+
39
+ logger "creating opensteam petstore products"
40
+
41
+ system "ruby script/generate opensteam_product Animal name:string art:string type:string description:text picture:string"
42
+ system "ruby script/generate opensteam_product DogFood name:string description:text"
43
+
44
+ logger "creating opensteam petstore properties"
45
+ system "ruby script/generate opensteam_property Weight name:string"
46
+ system "ruby script/generate opensteam_property DogKind name:string"
47
+
48
+
49
+ %w(dog fish reptile).each do |f|
50
+ ff = File.open("app/models/#{f}.rb", 'w')
51
+ ff.puts "require 'animal.rb'\nclass #{f.capitalize} < Animal\nend\n"
52
+ ff.close
53
+ end
54
+ FileUtils.rm 'app/models/animal.rb', :force => true
55
+ ff = File.open('app/models/animal.rb', 'w' )
56
+ ff.puts "class Animal < ActiveRecord::Base\n opensteam :product\n\n def self.table_name() \"product_animals\" ; end\nend\n"
57
+ ff.close
58
+
59
+
60
+ logger "migrating"
61
+
62
+ Rake::Task["db:migrate"].invoke
63
+
64
+ logger "loading fixtures"
65
+
66
+ require 'active_record'
67
+ require 'active_record/fixtures'
68
+ ActiveRecord::Base.establish_connection( YAML.load_file("config/database.yml")["#{RAILS_ENV}"] )
69
+ (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(RAILS_ROOT, 'test', 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
70
+ Fixtures.create_fixtures('test/fixtures', File.basename(fixture_file, '.*'))
71
+ end
72
+
73
+
74
+
75
+ # incl = "require 'has_many_polymorphs'"
76
+ # sentinel = "Rails::Initializer.run do |config|"
77
+ # gsub_file "config/environment.rb", /(#{Regexp.escape(sentinel)})/mi do |match|
78
+ # "#{incl}\n\n#{match}"
79
+ # end
80
+
81
+
82
+ incl = <<ANIMAL_CONTR
83
+ if params[:animal][:type] && ( params[:animal][:type].constantize.superclass == Animal)
84
+ @animal = params[:animal][:type].classify.constantize.new( params[:animal] )
85
+ else
86
+ @animal = Animal.new(params[:animal])
87
+ end
88
+ ANIMAL_CONTR
89
+
90
+ sentinel = "@animal = Animal.new(params[:animal])"
91
+ gsub_file "app/controllers/administration/animals_controller.rb", /(#{Regexp.escape(sentinel)})/mi do |match|
92
+ "#{incl}\n\n"
93
+ end
94
+
95
+ logger "finished ... have fun !!"
96
+
97
+
98
+ end
99
+ end
100
+
101
+
102
+ end
103
+
104
+
105
+
106
+ def gsub_file(path, regexp, *args, &block)
107
+ content = File.read(path).gsub(regexp, *args, &block)
108
+ File.open(path, 'wb') { |file| file.write(content) }
109
+ end
110
+
111
+
112
+ def logger(str)
113
+ puts "\n\t*** #{str} ****\n"
114
+ end
@@ -0,0 +1,4 @@
1
+ <u>Street:</u> <%=h address.street %><br />
2
+ <u>Postal:</u> <%=h address.postal %><br />
3
+ <u>City:</u> <%=h address.city %><br />
4
+ <u>Land:</u> <%=h address.land %><br />
@@ -0,0 +1,11 @@
1
+ <div id="nav">
2
+ <%= link_to "Products", :controller => "/administration", :action => :products %> |
3
+ <%= link_to "Properties", :controller => "/administration", :action => :properties %> |
4
+ <%= link_to "Orders", administration_orders_path %> |
5
+ <%= link_to "Customers", administration_customers_path %> |
6
+ <%= link_to "Admin Info", :controller => "/administration", :action => :admin_info %>
7
+
8
+ <div id="sub_nav" style="margin-left:20px;margin-top:10px;">
9
+ <%= yield(:sub_nav) || "" %>
10
+ </div>
11
+ </div>
@@ -0,0 +1,18 @@
1
+ <% for product in @products %>
2
+ <%= link_to_remote (image_tag "/images/palette.png", :align => "top", :border => "0"),
3
+ :url => { :action => :update_properties, :class => product.class.to_s, :id => product.id },
4
+ :update => "#{product.class.to_s}_#{product.name}_properties" %>
5
+ <%= link_to_remote (image_tag "/images/folder_database.png", :align => "top", :border => "0"),
6
+ :url => { :action => :update_products, :class => product.class.to_s, :id => product.id },
7
+ :update => "#{product.class.to_s}_#{product.name}_products" %>
8
+ <%= product.name %>
9
+ [<%= link_to "show", :controller => "administration/#{product.class.to_s.tableize}", :action => :show, :id => product.id %>]
10
+ [<%= link_to "edit", :controller => "administration/#{product.class.to_s.tableize}", :action => :edit, :id => product.id %>]
11
+ [<%= link_to "delete", [:administration, product], :method => :delete %>]
12
+
13
+ <div style="padding-left:42px;" id="<%=product.class.to_s%>_<%=product.name%>_properties">
14
+ </div>
15
+ <div style="padding-left:42px;" id="<%=product.class.to_s%>_<%=product.name%>_products">
16
+ </div>
17
+ <% end %>
18
+
@@ -0,0 +1,12 @@
1
+ <b> Change Email </b>
2
+ <br />
3
+ <br />
4
+ <%= error_messages_for :admin %>
5
+
6
+ <% form_for :admin, @admuin, :url => { :action => :change_admin_email }, :html => { :method => 'put' } do |f| %>
7
+ <%= f.label :email %> <%= f.text_field :email, :id => "test_field" %><br /><br />
8
+ <%= f.label :password %> <%= f.password_field :password, :id => "test_field" %>
9
+ <%= f.label :password_confirmation %> <%= f.password_field :password_confirmation, :id => "test_field" %><br />
10
+ <br /><br />
11
+ <%= f.submit "update" %>
12
+ <% end %>
@@ -0,0 +1,44 @@
1
+ <b>Show Customers</b>
2
+ <% for u in @users %>
3
+ <div id="<%= cycle('odd','even') %>" >
4
+ <table>
5
+ <tr style="text-decoration:underline;">
6
+ <td>IP</td><td>Email</td><td>Firstname</td><td>Lastname</td><td>Created</td><td>Addresses</td><td>Orders</td>
7
+ </tr>
8
+ <tr>
9
+ <tr>
10
+ <td><%=h u.ip %></td>
11
+ <td><%=h u.email %></td>
12
+ <td><%=h u.firstname %></td>
13
+ <td><%=h u.lastname %></td>
14
+ <td><%=h u.created_at %></td>
15
+ <td><%=h u.orders.size %></td>
16
+ <td><%=h u.addresses.size %></td>
17
+ </tr>
18
+ </tr>
19
+ </table>
20
+ <br /><br />
21
+ <b>Orders</b>
22
+ <br />
23
+ <div id="orders">
24
+ <% for o in u.orders %>
25
+ Created at <%= o.created_at %><br />
26
+ <ul>
27
+ <% for oi in o.order_items %>
28
+ <li><%= oi.itemid %> | Quantity: <%= oi.quantity %></li>
29
+ <% end %>
30
+ </ul>
31
+ <% end %>
32
+ </div >
33
+ <br /><br />
34
+ <b>Addresses</b>
35
+ <br />
36
+ <div id="addresses">
37
+ <% for o in u.addresses %>
38
+ <u>street</u>: <%=h o.street %> | <u>zip</u>: <%=h o.postal %> | <u>country</u>: <%=h o.land %> | <u>city</u>: <%=h o.city %>
39
+ <br />
40
+ <% end %>
41
+ </div >
42
+ </div>
43
+ <br /><br /><br />
44
+ <% end %>