office_clerk 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (259) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +73 -0
  3. data/.rubocop.yml +6 -0
  4. data/.travis.yml +9 -0
  5. data/Gemfile +63 -0
  6. data/Gemfile.lock +367 -0
  7. data/Guardfile +28 -0
  8. data/README.md +44 -0
  9. data/Rakefile +6 -0
  10. data/app/assets/images/admin/baskets-2.jpg +0 -0
  11. data/app/assets/images/admin/baskets.jpg +0 -0
  12. data/app/assets/images/admin/categories-2.jpg +0 -0
  13. data/app/assets/images/admin/categories.jpg +0 -0
  14. data/app/assets/images/admin/clerks-2.jpg +0 -0
  15. data/app/assets/images/admin/clerks.jpg +0 -0
  16. data/app/assets/images/admin/orders-2.jpg +0 -0
  17. data/app/assets/images/admin/orders.jpg +0 -0
  18. data/app/assets/images/admin/products-2.jpg +0 -0
  19. data/app/assets/images/admin/products.jpg +0 -0
  20. data/app/assets/images/admin/purchases-2.jpg +0 -0
  21. data/app/assets/images/admin/purchases.jpg +0 -0
  22. data/app/assets/images/admin/suppliers-2.jpg +0 -0
  23. data/app/assets/images/admin/suppliers.jpg +0 -0
  24. data/app/assets/images/alpha.png +0 -0
  25. data/app/assets/images/down-icon.png +0 -0
  26. data/app/assets/images/header.gif +0 -0
  27. data/app/assets/images/hihih.jpg +0 -0
  28. data/app/assets/images/hue.png +0 -0
  29. data/app/assets/images/koe.jpg +0 -0
  30. data/app/assets/images/missing.png +0 -0
  31. data/app/assets/images/saturation.png +0 -0
  32. data/app/assets/images/shop/basket.jpg +0 -0
  33. data/app/assets/images/shop/farfalla-logo.jpg +0 -0
  34. data/app/assets/images/shop/header.gif +0 -0
  35. data/app/assets/images/shop/header.jpg +0 -0
  36. data/app/assets/images/shop/header.png +0 -0
  37. data/app/assets/images/shop/kansi.jpg +0 -0
  38. data/app/assets/images/shop/kansi.png +0 -0
  39. data/app/assets/images/shop/logo.png +0 -0
  40. data/app/assets/images/shop/menu-gourmet.jpg +0 -0
  41. data/app/assets/images/shop/menu-hius.jpg +0 -0
  42. data/app/assets/images/shop/menu-huonetuoksu.jpg +0 -0
  43. data/app/assets/images/shop/menu-info.jpg +0 -0
  44. data/app/assets/images/shop/menu-kasvo.jpg +0 -0
  45. data/app/assets/images/shop/menu-laukut.jpg +0 -0
  46. data/app/assets/images/shop/menu-luomu.jpg +0 -0
  47. data/app/assets/images/shop/menu-men.jpg +0 -0
  48. data/app/assets/images/shop/menu-oljy.jpg +0 -0
  49. data/app/assets/images/shop/menu-tuoksu1.jpg +0 -0
  50. data/app/assets/images/shop/menu-vaatteet.jpg +0 -0
  51. data/app/assets/images/shop/menu-valaisin.jpg +0 -0
  52. data/app/assets/images/shop/menu-vartalo.jpg +0 -0
  53. data/app/assets/images/shop/spacer.gif +0 -0
  54. data/app/assets/images/shop/tausta.jpg +0 -0
  55. data/app/assets/images/shop/tervetuloa.gif +0 -0
  56. data/app/assets/images/shop/valk.png +0 -0
  57. data/app/assets/images/shop/valk3.png +0 -0
  58. data/app/assets/images/shop/violetti-lev.jpg +0 -0
  59. data/app/assets/images/shop/violetti.jpg +0 -0
  60. data/app/assets/images/ui-anim_basic_16x16.gif +0 -0
  61. data/app/assets/images/up-icon.png +0 -0
  62. data/app/assets/javascripts/admin.js +29 -0
  63. data/app/assets/javascripts/shop.js +30 -0
  64. data/app/assets/stylesheets/admin.css.scss +129 -0
  65. data/app/assets/stylesheets/shop-receipt.css.scss +80 -0
  66. data/app/assets/stylesheets/shop.css.scss +403 -0
  67. data/app/controllers/admin_controller.rb +23 -0
  68. data/app/controllers/application_controller.rb +41 -0
  69. data/app/controllers/baskets_controller.rb +176 -0
  70. data/app/controllers/categories_controller.rb +69 -0
  71. data/app/controllers/clerks_controller.rb +64 -0
  72. data/app/controllers/orders_controller.rb +57 -0
  73. data/app/controllers/products_controller.rb +126 -0
  74. data/app/controllers/purchases_controller.rb +72 -0
  75. data/app/controllers/sessions_controller.rb +46 -0
  76. data/app/controllers/shop_controller.rb +90 -0
  77. data/app/controllers/suppliers_controller.rb +63 -0
  78. data/app/helpers/admin_helper.rb +28 -0
  79. data/app/helpers/application_helper.rb +25 -0
  80. data/app/helpers/baskets_helper.rb +4 -0
  81. data/app/helpers/categories_helper.rb +4 -0
  82. data/app/helpers/orders_helper.rb +4 -0
  83. data/app/helpers/products_helper.rb +4 -0
  84. data/app/helpers/purchases_helper.rb +4 -0
  85. data/app/helpers/shop_helper.rb +17 -0
  86. data/app/helpers/suppliers_helper.rb +4 -0
  87. data/app/mailers/.keep +0 -0
  88. data/app/models/basket.rb +114 -0
  89. data/app/models/category.rb +27 -0
  90. data/app/models/clerk.rb +46 -0
  91. data/app/models/item.rb +26 -0
  92. data/app/models/order.rb +72 -0
  93. data/app/models/product.rb +100 -0
  94. data/app/models/purchase.rb +26 -0
  95. data/app/models/supplier.rb +15 -0
  96. data/app/views/addresses/_form_fields.html.haml +4 -0
  97. data/app/views/addresses/show.html.haml +23 -0
  98. data/app/views/baskets/_small.html.haml +25 -0
  99. data/app/views/baskets/edit.html.haml +74 -0
  100. data/app/views/baskets/index.html.haml +55 -0
  101. data/app/views/baskets/show.html.haml +18 -0
  102. data/app/views/categories/_treeview.html.haml +8 -0
  103. data/app/views/categories/_triple.html.haml +12 -0
  104. data/app/views/categories/edit.html.haml +36 -0
  105. data/app/views/categories/index.html.haml +49 -0
  106. data/app/views/categories/show.html.haml +30 -0
  107. data/app/views/clerks/edit.html.haml +20 -0
  108. data/app/views/clerks/index.html.haml +37 -0
  109. data/app/views/clerks/show.html.haml +19 -0
  110. data/app/views/layouts/_admin_menu.html.haml +14 -0
  111. data/app/views/layouts/_google.haml +8 -0
  112. data/app/views/layouts/_messages.html.haml +5 -0
  113. data/app/views/layouts/admin.html.haml +42 -0
  114. data/app/views/layouts/shop.html.haml +96 -0
  115. data/app/views/orders/edit.html.haml +25 -0
  116. data/app/views/orders/index.html.haml +93 -0
  117. data/app/views/orders/show.html.haml +37 -0
  118. data/app/views/products/_line.html.haml +25 -0
  119. data/app/views/products/_name.html.haml +4 -0
  120. data/app/views/products/_online.html.haml +2 -0
  121. data/app/views/products/_triple.html.haml +12 -0
  122. data/app/views/products/edit.html.haml +42 -0
  123. data/app/views/products/index.html.haml +86 -0
  124. data/app/views/products/show.html.haml +94 -0
  125. data/app/views/purchases/edit.html.haml +9 -0
  126. data/app/views/purchases/index.html.haml +52 -0
  127. data/app/views/purchases/show.html.haml +32 -0
  128. data/app/views/sessions/new.html.haml +10 -0
  129. data/app/views/sessions/new_clerk.html.haml +22 -0
  130. data/app/views/shop/_groups.html.haml +8 -0
  131. data/app/views/shop/_menu.html.haml +5 -0
  132. data/app/views/shop/_sub.html.haml +0 -0
  133. data/app/views/shop/checkout.haml +142 -0
  134. data/app/views/shop/group.html.haml +9 -0
  135. data/app/views/shop/main_group.html.haml +9 -0
  136. data/app/views/shop/order.haml +104 -0
  137. data/app/views/shop/product.html.haml +67 -0
  138. data/app/views/shop/product_list.html.haml +50 -0
  139. data/app/views/shop/saved_search.html +6 -0
  140. data/app/views/shop/sub_group.html.haml +19 -0
  141. data/app/views/shop/tuotteista.html.haml +40 -0
  142. data/app/views/shop/welcome.html.haml +103 -0
  143. data/app/views/suppliers/edit.html.haml +10 -0
  144. data/app/views/suppliers/index.html.haml +40 -0
  145. data/app/views/suppliers/show.html.haml +27 -0
  146. data/bin/bundle +3 -0
  147. data/bin/rails +8 -0
  148. data/bin/rake +8 -0
  149. data/bin/rspec +7 -0
  150. data/bin/spring +18 -0
  151. data/config.ru +7 -0
  152. data/config/application.example.yml +13 -0
  153. data/config/application.rb +59 -0
  154. data/config/application.yml +13 -0
  155. data/config/boot.rb +7 -0
  156. data/config/database.yml +25 -0
  157. data/config/environment.rb +6 -0
  158. data/config/environments/development.rb +31 -0
  159. data/config/environments/production.rb +80 -0
  160. data/config/environments/test.rb +36 -0
  161. data/config/i18n-tasks.yml +11 -0
  162. data/config/initializers/attack.rb +32 -0
  163. data/config/initializers/backtrace_silencers.rb +7 -0
  164. data/config/initializers/filter_parameter_logging.rb +4 -0
  165. data/config/initializers/inflections.rb +16 -0
  166. data/config/initializers/migrate.rb +6 -0
  167. data/config/initializers/mime_types.rb +6 -0
  168. data/config/initializers/secret_token.rb +12 -0
  169. data/config/initializers/session_store.rb +3 -0
  170. data/config/initializers/simple_form.rb +149 -0
  171. data/config/initializers/simple_form_bootstrap.rb +48 -0
  172. data/config/initializers/wrap_parameters.rb +14 -0
  173. data/config/locales/config.yml +23 -0
  174. data/config/locales/en.yml +183 -0
  175. data/config/locales/fi.yml +211 -0
  176. data/config/routes.rb +108 -0
  177. data/db/migrate/20131224171442_clerks.rb +15 -0
  178. data/db/migrate/20131226110406_suppliers.rb +9 -0
  179. data/db/migrate/20131226143612_categories.rb +18 -0
  180. data/db/migrate/20131226143747_items.rb +14 -0
  181. data/db/migrate/20131226144134_orders.rb +21 -0
  182. data/db/migrate/20131226144316_baskets.rb +12 -0
  183. data/db/migrate/20131226151151_purchases.rb +11 -0
  184. data/db/migrate/20131226151332_products.rb +27 -0
  185. data/db/schema.rb +138 -0
  186. data/db/seeds.rb +4 -0
  187. data/lib/assets/.keep +0 -0
  188. data/lib/office_clerk.rb +20 -0
  189. data/lib/office_clerk/shipping_method.rb +35 -0
  190. data/lib/tasks/.keep +0 -0
  191. data/lib/tasks/import.rake +33 -0
  192. data/lib/templates/haml/scaffold/_form.html.haml +8 -0
  193. data/office_clerk.gemspec +46 -0
  194. data/public/404.html +58 -0
  195. data/public/422.html +58 -0
  196. data/public/500.html +57 -0
  197. data/public/favicon.ico +0 -0
  198. data/public/humans.txt +20 -0
  199. data/public/robots.txt +5 -0
  200. data/spec/controllers/baskets_controller_spec.rb +112 -0
  201. data/spec/controllers/categories_controller_spec.rb +133 -0
  202. data/spec/controllers/clerks_controller_spec.rb +70 -0
  203. data/spec/controllers/orders_controller_spec.rb +105 -0
  204. data/spec/controllers/products_controller_spec.rb +138 -0
  205. data/spec/controllers/purchases_controller_spec.rb +123 -0
  206. data/spec/controllers/sessions_controller_spec.rb +18 -0
  207. data/spec/controllers/suppliers_controller_spec.rb +137 -0
  208. data/spec/factories/addresses.rb +11 -0
  209. data/spec/factories/baskets.rb +15 -0
  210. data/spec/factories/categories.rb +8 -0
  211. data/spec/factories/clerks.rb +15 -0
  212. data/spec/factories/items.rb +19 -0
  213. data/spec/factories/orders.rb +9 -0
  214. data/spec/factories/products.rb +10 -0
  215. data/spec/factories/purchases.rb +10 -0
  216. data/spec/factories/suppliers.rb +7 -0
  217. data/spec/features/baskets/buttons_spec.rb +35 -0
  218. data/spec/features/baskets/edit_spec.rb +50 -0
  219. data/spec/features/baskets/index_spec.rb +12 -0
  220. data/spec/features/baskets/search_spec.rb +33 -0
  221. data/spec/features/baskets/show_spec.rb +21 -0
  222. data/spec/features/categories_spec.rb +21 -0
  223. data/spec/features/clerks_spec.rb +21 -0
  224. data/spec/features/orders_spec.rb +14 -0
  225. data/spec/features/products/index_spec.rb +30 -0
  226. data/spec/features/products/new_spec.rb +20 -0
  227. data/spec/features/purchases_spec.rb +14 -0
  228. data/spec/features/shops_spec.rb +18 -0
  229. data/spec/features/suppliers_spec.rb +18 -0
  230. data/spec/models/baskets/inventory_spec.rb +34 -0
  231. data/spec/models/baskets/items_spec.rb +37 -0
  232. data/spec/models/baskets/products_spec.rb +31 -0
  233. data/spec/models/category_spec.rb +18 -0
  234. data/spec/models/clerk/email_spec.rb +69 -0
  235. data/spec/models/clerk/password_spec.rb +83 -0
  236. data/spec/models/item_spec.rb +33 -0
  237. data/spec/models/locale_spec.rb +17 -0
  238. data/spec/models/order_spec.rb +19 -0
  239. data/spec/models/product_spec.rb +29 -0
  240. data/spec/models/purchase_spec.rb +8 -0
  241. data/spec/models/supplier_spec.rb +8 -0
  242. data/spec/routing/baskets_routing_spec.rb +35 -0
  243. data/spec/routing/categories_routing_spec.rb +35 -0
  244. data/spec/routing/orders_routing_spec.rb +35 -0
  245. data/spec/routing/products_routing_spec.rb +35 -0
  246. data/spec/routing/purchases_routing_spec.rb +35 -0
  247. data/spec/routing/suppliers_routing_spec.rb +35 -0
  248. data/spec/spec_helper.rb +74 -0
  249. data/spec/support/request_helper.rb +31 -0
  250. data/test/fixtures/baskets.yml +41993 -0
  251. data/test/fixtures/categories.yml +638 -0
  252. data/test/fixtures/clerks.yml +694 -0
  253. data/test/fixtures/items.yml +83651 -0
  254. data/test/fixtures/orders.yml +58918 -0
  255. data/test/fixtures/products.yml +110904 -0
  256. data/test/fixtures/purchases.yml +1755 -0
  257. data/test/fixtures/suppliers.yml +341 -0
  258. data/todo +8 -0
  259. metadata +607 -0
@@ -0,0 +1,52 @@
1
+ .row
2
+ .col-md-9.purchases
3
+ .row
4
+ .col-md-10
5
+ %h2= t(:purchases)
6
+ = paginate @purchases
7
+ .col-md-3
8
+ = image_tag "admin/purchases.jpg" , :class => "img-responsive"
9
+ .row
10
+ .col-md-9
11
+ %div
12
+ %table.table.table-striped.table-bordered.table-condensed
13
+ %thead
14
+ %tr
15
+ %th= sort_link @q, :ordered_on
16
+ %th= sort_link @q, :received_on
17
+ %th= t(:items)
18
+ %th= sort_link @q, :basket_total_price
19
+ %th= @purchase_scope.length.to_s + " " + t(:purchases)
20
+ %tbody
21
+ - @purchases.each do |purchase|
22
+ %tr{:class => "line-#{cycle("1","2")}"}
23
+ %td= date(purchase.ordered_on)
24
+ %td= date(purchase.received_on)
25
+ %td= purchase.basket.items.length
26
+ %td= link_to euros(purchase.basket.total_price) , basket_path(purchase.basket)
27
+ %td= link_to t(:show) , purchase_path(purchase), :title => t(:show)
28
+ .btn-toolbar
29
+ .btn-group
30
+ = paginate @purchases
31
+ .col-md-3
32
+ = search_form_for @q, :url => search_purchases_path, :html => { :class => "well well-small" }, :method => :post do |f|
33
+ .form-group
34
+ = f.text_field :name_cont , :placeholder => t(:name)
35
+ .row
36
+ .col-md-10
37
+ = f.label(:ordered_on)
38
+ .row
39
+ .col-md-5
40
+ = f.text_field :ordered_on_gteq , :class => "form-control datepicker"
41
+ .col-md-5
42
+ = f.text_field :ordered_on_lteq , :class => "form-control datepicker"
43
+ .row
44
+ .col-md-10
45
+ = f.label(:received_on)
46
+ .row
47
+ .col-md-5
48
+ = f.text_field :received_on_gt , :class => "form-control datepicker"
49
+ .col-md-5
50
+ = f.text_field :received_on_lt , :class => "form-control datepicker"
51
+ = f.submit t(:filter), :class => "btn btn-success"
52
+ = link_to t(:cancel), purchases_path, :class => "btn btn-warning"
@@ -0,0 +1,32 @@
1
+ %h2
2
+ = t(:show)
3
+ = t(:purchase)
4
+ %p
5
+ %b
6
+ = t(:name) + " : " + @purchase.name.to_s
7
+ %p
8
+ %b
9
+ -if @purchase.ordered_on
10
+ = t(:ordered_on) + " : " + date(@purchase.ordered_on)
11
+ -else
12
+ = link_to t(:order) , order_purchase_path(@purchase) , :class => "btn btn-primary"
13
+ %p
14
+ %b
15
+ -if @purchase.received_on
16
+ = t(:received) + " : " + date(@purchase.received_on)
17
+ -else
18
+ = link_to t(:receive) , receive_purchase_path(@purchase) , :class => "btn btn-primary"
19
+
20
+ = render "baskets/small" , :basket => @purchase.basket
21
+
22
+ %p
23
+ %b
24
+ = t(:suppliers) + " : "
25
+ = @purchase.basket.suppliers.collect {|s| s.name }.join
26
+ = link_to t(:back), purchases_path, :class => "btn btn-warning"
27
+
28
+ -unless @purchase.received_on
29
+ %h3{"style" => "color:red"}
30
+ = t(:inventory)
31
+ = link_to t(:inventory) , inventory_purchase_path(@purchase) , :class => "btn btn-primary"
32
+
@@ -0,0 +1,10 @@
1
+ %h1= t(:sign_in)
2
+ = form_tag sessions_path do
3
+ %p
4
+ = label_tag :email , t(:email)
5
+ %br= text_field_tag :email, params[:email]
6
+ %p
7
+ = label_tag :password , t(:password)
8
+ %br= password_field_tag :password
9
+ %p.btn= submit_tag t(:sign_in)
10
+
@@ -0,0 +1,22 @@
1
+ %h1 Sign Up
2
+ = form_for @clerk do |f|
3
+ - if @clerk.errors.any?
4
+ .error_messages
5
+ %h2 Form is invalid
6
+ %ul
7
+ - for message in @clerk.errors.full_messages
8
+ %li= message
9
+ %p
10
+ = f.label :email
11
+ %br/
12
+ = f.text_field :email
13
+ %p
14
+ = f.label :password
15
+ %br/
16
+ = f.password_field :password
17
+ %p
18
+ = f.label :password_confirmation
19
+ %br/
20
+ = f.password_field :password_confirmation
21
+ %p.button= f.submit
22
+
@@ -0,0 +1,8 @@
1
+ %ul.group-list.no-bullet
2
+ -@groups.each do |group|
3
+ %li.group-h4
4
+ %a{href: group.link}= group.name
5
+ %ul.group-list.no-bullet
6
+ - group.categories.each do |g|
7
+ %li.group-h6
8
+ %a{href: group_path(g.link)}= g.name
@@ -0,0 +1,5 @@
1
+ %nav.top-bar
2
+ %ul
3
+ - @menu.each do |link , text|
4
+ %li
5
+ %a{ :href => link}= text + "            "
File without changes
@@ -0,0 +1,142 @@
1
+ .row
2
+ %ol.breadcrumb
3
+ %li
4
+ %a{ :href => "/"}= t(:home)
5
+ %li
6
+ = t(:basket)
7
+
8
+
9
+ = bootstrap_form_for @order, :url => shop_checkout_path do |f|
10
+ .row
11
+ = f.alert_message t(:fix_errors) , error_summary: false
12
+
13
+ .col-md-3
14
+ .group-wrapper.side.checkout
15
+ %img{:src => "/assets/shop/basket.jpg"}/
16
+ %h5 Ostoskori
17
+
18
+ .col-md-9
19
+ .row
20
+ %br
21
+ %h4 Ostoskorisi sisältö
22
+ %div
23
+ %table.table.table-hover.table-condensed
24
+ %thead
25
+ %tr
26
+ %th tuote
27
+ %th
28
+ %th hinta a
29
+ %th määrä
30
+ %th yhteishinta
31
+ %tbody
32
+ -current_basket.items.each do |item|
33
+ %tr
34
+ %td.picture.text-center= image_tag item.product.main_picture.url(:thumb) if item.product
35
+ %td.name
36
+ = link_to shop_product_path(:link => item.product.link ) do
37
+ = item.name
38
+ %td= number_to_currency item.product.price
39
+ %td
40
+ = link_to cart_remove_path( :id => item.product.id ) do
41
+ = image_tag "down-icon.png" , :width => 16 , :height => 16
42
+ = item.quantity
43
+ = link_to cart_add_path( :id => item.product.id ) do
44
+ = image_tag "up-icon.png" , :width => 16 , :height => 16
45
+ %td= number_to_currency item.total
46
+
47
+ %tr
48
+ %th
49
+ %th tuotteet yhteensä
50
+ %th
51
+ %th
52
+ %th= number_to_currency current_basket.total_price
53
+
54
+ .row
55
+ %hr
56
+
57
+ .col-md-3
58
+ %h4.highlight
59
+ Valitse toimitustapa
60
+ .row
61
+ .col-md-9
62
+ %br
63
+ - extra = OfficeClerk.config("defaults.free_shipping") - current_basket.total_price
64
+ - if extra > 0
65
+ .frame.bg-high8
66
+ %b= t(:notice) + "!"
67
+ = t(:order_more_for_free_shipping , :more => extra.round(2))
68
+
69
+ .col-md-9
70
+ .row
71
+ .col-md-7
72
+ %h4
73
+ Valitse toimitustapa
74
+ = @order.shipment_type
75
+ - OfficeClerk::ShippingMethod.all.each_value do |s|
76
+ .radio
77
+ = radio_button_tag "order[shipment_type]" , s.type , s.type.to_s == @order.shipment_type , "data-price" => s.price_for(current_basket).round(2)
78
+ = s.name
79
+ = s.price_for(current_basket).round(2)
80
+
81
+
82
+ .col-md-4
83
+ %h4
84
+ = t(:order)
85
+ = @order.number
86
+
87
+ %table.table.table-condensed.basket-total
88
+ %thead
89
+ %tr
90
+ %th Tuotteet yhteensä
91
+ %td.text-right
92
+ %span#basket_total= current_basket.total_price.round(2)
93
+
94
+ %tbody
95
+ %tr
96
+ %th Toimituskulut
97
+ %td.text-right
98
+ %span#shipping_cost= @order.shipment_price
99
+
100
+ %tr
101
+ %th Tilaus yhteensä
102
+ %th.text-right
103
+ %span#order_total= @order.total_price.round(2)
104
+
105
+ .col-md-1
106
+
107
+
108
+ .row
109
+ %hr
110
+ .col-md-3
111
+ .row
112
+ .col-md-9
113
+ %h4.highlight Anna yhteystiedot
114
+ %br/
115
+
116
+ %b Tallennetut osoitteet
117
+
118
+ .frame#previous_address
119
+ %span.name Anna Asiakas
120
+ %br/
121
+ %span.street Mallikatu 3
122
+ %br/
123
+ %span.city 10300 Karjaa
124
+ %br/
125
+ %span.phone 040 333 4455
126
+ %br/
127
+ %br/
128
+ %button.btn.btn-primary.btn-xs#fill_address{:type => "button"} Käytä tätä osoitetta
129
+
130
+ .col-md-9
131
+ .row
132
+ .col-md-9#address_form
133
+ %h4 Yhteystiedot
134
+ = f.text_field :name , :placeholder => t(:name)
135
+ = f.text_field :street , :placeholder => t(:street)
136
+ = f.text_field :city , :placeholder => t(:city)
137
+ = f.text_field :phone , :placeholder => t(:phone)
138
+ = f.email_field :email, :placeholder => t(:email)
139
+ %hr
140
+ %button.btn.btn-primary.btn-lg{:type => "submit"} Tee tilaus
141
+
142
+ .col-md-3
@@ -0,0 +1,9 @@
1
+ - @groups.in_groups_of(3).each do |array|
2
+ .row
3
+ -array.each do |group|
4
+ .col-md-4
5
+ -next unless group
6
+ .group-wrapper
7
+ =link_to shop_group_path(group.link) do
8
+ = image_tag( group.main_picture.url(:product) , :class => "img-responsive")
9
+ %h3= group.name
@@ -0,0 +1,9 @@
1
+ - @groups.in_groups_of(3).each do |array|
2
+ .row
3
+ -array.each do |group|
4
+ .col-md-4
5
+ -next unless group
6
+ .group-wrapper
7
+ =link_to shop_group_path(group.link) do
8
+ = image_tag group.main_picture.url(:product) , :class => "img-responsive"
9
+ %h3= group.name
@@ -0,0 +1,104 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ %meta{:charset => "utf-8"}
5
+ %title= t(:receipt)
6
+ = stylesheet_link_tag "shop" , :media => "all"
7
+ %body
8
+ .row
9
+ %img{:src => "/assets/shop/spacer.gif"}/
10
+
11
+ .receipt.no-screen
12
+ #header
13
+ = image_tag "receipt-logo.gif"
14
+ %br/
15
+ %br/
16
+ .shop
17
+ Auringosta Itään, Kuusta Länteen
18
+ .info
19
+ Fredrikinkatu 19 (Viiskulma)
20
+ %br/
21
+ 00120 Helsinki
22
+
23
+ %hr
24
+ %b.highlight Kiitos tilauksestasi!
25
+ .row
26
+ .col-md-3.no-print
27
+ .group-wrapper
28
+ %img{:src => "/assets/shop/basket.jpg"}/
29
+ %h5 Tilausvahvistus
30
+
31
+ .col-md-9
32
+ .row
33
+ %br
34
+ %h4.highlight Tilausvahvistus
35
+ %b Tilaus
36
+ =@order.number
37
+ vastaanotettu
38
+ =date(@order.ordered_on || Date.today)
39
+ %hr
40
+ %div
41
+ %table.table.table-condensed
42
+ %thead
43
+ %tr
44
+ %th
45
+ %th Tuote
46
+ %th hinta
47
+ %th määrä
48
+ %th yhteishinta
49
+ %tbody
50
+ -@order.basket.items.each do |item|
51
+ %tr
52
+ %td.picture= image_tag item.product.main_picture.url(:thumb) if item.product
53
+ %td.name
54
+ = link_to shop_product_path(:link => item.product.link ) do
55
+ = item.name
56
+ %td= number_to_currency item.product.price
57
+ %td= item.quantity
58
+ %td= number_to_currency item.total
59
+ %tr
60
+ %th Tuotteet yhteensä
61
+ %th
62
+ %th
63
+ %th
64
+ %th= number_to_currency @order.basket.total_price
65
+ %tr
66
+ %td Toimituskulut
67
+ %td
68
+ %td
69
+ %td
70
+ %td= number_to_currency @order.shipment_price
71
+ %tr
72
+ %th Tilaus yhteensä
73
+ %th
74
+ %th
75
+ %th
76
+ %th= number_to_currency @order.total_price
77
+
78
+ %b
79
+ Valittu toimitustapa:
80
+ = t(@order.shipment_type)
81
+
82
+
83
+
84
+ .row
85
+ %hr
86
+ .col-md-6
87
+ %h4.highlight Yhteystiedot
88
+ = @order.name
89
+ %br
90
+ = @order.street
91
+ %br
92
+ = @order.city
93
+ %br
94
+ puh
95
+ =@order.phone
96
+ %br
97
+ = @order.email
98
+
99
+ .col-md-6
100
+ %h4.highlight Tilaushistoria
101
+ Aikaisemmat tilauksesi löydät täältä
102
+ %a{:href => "/linkki_jonnekin"} clerk.auringostaitaan.fi/tilaushistoria
103
+
104
+
@@ -0,0 +1,67 @@
1
+ .row
2
+ %ol.breadcrumb
3
+ %li
4
+ %a{ :href => "/"}= t(:home)
5
+ - parents(@group).each do | group|
6
+ %li
7
+ = link_to group.name , shop_group_path(group.link)
8
+ %li.current
9
+ %a{href: "#"}= @product.name
10
+
11
+ .row
12
+ .col-md-3.tex
13
+ - parents(@group).each do | group|
14
+ .group-wrapper.side
15
+ = link_to shop_group_path(group.link) do
16
+ = image_tag group.main_picture.url(:list)
17
+ %h5= group.name
18
+
19
+ .intro2
20
+ %p.description= markdown( @group.description) rescue ""
21
+
22
+ .col-md-8
23
+ .row.product-info
24
+ .col-md-12.product-title-h1
25
+ %h1.product-title= @product.name
26
+ %br/
27
+
28
+ .row
29
+ .col-md-3.picture
30
+ =image_tag @product.main_picture.url(:product) , :class => "img-responsive-prod"
31
+ #product-description.col-md-9
32
+ .row
33
+ .col-md-12
34
+ = markdown @product.description rescue ""
35
+ .row
36
+ .col-md-4.product-price
37
+ %h4
38
+ =t(:price)
39
+ %span.price.selling= euros @product.price
40
+ .col-md-8
41
+ = form_tag(cart_add_url(:id => @product.id)) do
42
+ #inside-product-cart-form
43
+ .add-to-cart
44
+ .row
45
+ .col-md-10
46
+ %button#add-to-cart-button.btn.btn-primary{:type => :submit}
47
+ = t(:add_to_basket)
48
+
49
+ .row
50
+ .col-md-12
51
+ %br/
52
+ %table.table-striped.table-condensed
53
+ %thead.highlight
54
+ %tr
55
+ %th Muita tuotteita samassa tuoteryhmässä
56
+ %tbody
57
+ - in_group(@product).each do |p|
58
+ %tr
59
+ %td
60
+ =link_to shop_product_path(:link => p.link ) do
61
+ = p.name
62
+
63
+
64
+
65
+ .col-md-1
66
+
67
+