office_clerk 0.8 → 0.9

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 (120) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +6 -2
  3. data/Gemfile.lock +159 -100
  4. data/Guardfile +3 -0
  5. data/README.md +7 -2
  6. data/Rakefile +9 -0
  7. data/app/assets/images/missing_list.png +0 -0
  8. data/app/assets/images/missing_product.png +0 -0
  9. data/app/assets/images/missing_thumb.png +0 -0
  10. data/app/assets/javascripts/office_clerk.js +7 -5
  11. data/app/assets/stylesheets/office_clerk.css.scss +89 -14
  12. data/app/controllers/baskets_controller.rb +37 -26
  13. data/app/controllers/orders_controller.rb +44 -29
  14. data/app/controllers/products_controller.rb +6 -6
  15. data/app/controllers/purchases_controller.rb +18 -8
  16. data/app/helpers/admin_helper.rb +16 -21
  17. data/app/helpers/baskets_helper.rb +31 -0
  18. data/app/helpers/categories_helper.rb +3 -0
  19. data/app/helpers/office_helper.rb +34 -7
  20. data/app/helpers/orders_helper.rb +2 -3
  21. data/app/models/basket.rb +46 -20
  22. data/app/models/clerk.rb +6 -1
  23. data/app/models/item.rb +7 -0
  24. data/app/models/order.rb +18 -6
  25. data/app/models/product.rb +23 -8
  26. data/app/views/addresses/show.html.haml +2 -2
  27. data/app/views/baskets/_small.html.haml +2 -2
  28. data/app/views/baskets/edit.html.haml +19 -16
  29. data/app/views/baskets/index.html.haml +13 -5
  30. data/app/views/baskets/show.html.haml +3 -3
  31. data/app/views/categories/_treeview.html.haml +1 -2
  32. data/app/views/categories/edit.html.haml +4 -5
  33. data/app/views/categories/index.html.haml +7 -7
  34. data/app/views/categories/show.html.haml +3 -4
  35. data/app/views/clerks/edit.html.haml +4 -3
  36. data/app/views/clerks/index.html.haml +6 -6
  37. data/app/views/clerks/show.html.haml +3 -3
  38. data/app/views/layouts/_admin_menu.html.haml +8 -8
  39. data/app/views/layouts/_messages.html.haml +2 -2
  40. data/app/views/layouts/office_clerk.haml +10 -27
  41. data/app/views/order_mailer/confirm.text.erb +1 -2
  42. data/app/views/order_mailer/shipped.text.erb +2 -1
  43. data/app/views/orders/index.csv.erb +6 -6
  44. data/app/views/orders/index.html.haml +25 -20
  45. data/app/views/orders/shipment.haml +57 -0
  46. data/app/views/orders/show.html.haml +106 -39
  47. data/app/views/products/_head.haml +1 -2
  48. data/app/views/products/_line.html.haml +1 -1
  49. data/app/views/products/_preview_box.haml +14 -10
  50. data/app/views/products/_triple.html.haml +1 -1
  51. data/app/views/products/edit.html.haml +4 -4
  52. data/app/views/products/index.html.haml +24 -13
  53. data/app/views/products/show.html.haml +15 -12
  54. data/app/views/purchases/index.html.haml +11 -7
  55. data/app/views/purchases/show.html.haml +42 -25
  56. data/app/views/sessions/sign_up.haml +10 -10
  57. data/app/views/suppliers/edit.html.haml +2 -2
  58. data/app/views/suppliers/index.html.haml +6 -7
  59. data/app/views/suppliers/show.html.haml +2 -3
  60. data/config/i18n-tasks.yml +97 -0
  61. data/config/initializers/migrate.rb +11 -1
  62. data/config/initializers/paperclip.rb +17 -0
  63. data/config/locales/config.yml +0 -1
  64. data/config/locales/en.yml +99 -116
  65. data/config/locales/fi.yml +101 -117
  66. data/config/routes.rb +18 -15
  67. data/db/migrate/20131226143612_categories.rb +2 -2
  68. data/db/migrate/20131226151332_products.rb +3 -3
  69. data/lib/office_clerk/engine.rb +5 -8
  70. data/lib/office_clerk/shipping_method.rb +12 -1
  71. data/lib/office_clerk/version.rb +1 -1
  72. data/office_clerk.gemspec +5 -5
  73. data/spec/controllers/baskets_controller_spec.rb +2 -2
  74. data/spec/controllers/orders_controller_spec.rb +0 -29
  75. data/spec/controllers/products_controller_spec.rb +4 -3
  76. data/spec/controllers/purchases_controller_spec.rb +3 -4
  77. data/spec/factories/orders.rb +6 -1
  78. data/spec/factories/products.rb +3 -0
  79. data/spec/features/baskets/edit_spec.rb +6 -1
  80. data/spec/features/baskets/index_spec.rb +1 -0
  81. data/spec/features/baskets/search_spec.rb +1 -1
  82. data/spec/features/orders/filter_spec.rb +19 -0
  83. data/spec/features/orders/inventory_spec.rb +19 -0
  84. data/spec/features/orders/ordering_spec.rb +84 -0
  85. data/spec/features/paginate_spec.rb +11 -0
  86. data/spec/features/sessions_spec.rb +2 -1
  87. data/spec/{models/locale_spec.rb → i18n_spec.rb} +19 -1
  88. data/spec/mailers/order_mailer_spec.rb +2 -1
  89. data/spec/models/baskets/inventory_spec.rb +9 -2
  90. data/spec/models/baskets/items_spec.rb +6 -1
  91. data/spec/models/order_spec.rb +20 -1
  92. data/spec/routing/baskets_routing_spec.rb +5 -1
  93. data/spec/routing/orders_routing_spec.rb +0 -12
  94. data/spec/spec_helper.rb +16 -3
  95. data/test_app/bin/setup +29 -0
  96. data/test_app/config/application.rb +3 -0
  97. data/test_app/config/boot.rb +1 -2
  98. data/test_app/config/environment.rb +1 -1
  99. data/test_app/config/environments/development.rb +1 -1
  100. data/test_app/config/environments/production.rb +20 -21
  101. data/test_app/config/environments/test.rb +7 -4
  102. data/test_app/config/initializers/assets.rb +11 -0
  103. data/test_app/config/initializers/cookies_serializer.rb +3 -0
  104. data/test_app/config/initializers/mime_types.rb +0 -1
  105. data/test_app/config/initializers/session_store.rb +1 -1
  106. data/test_app/config/routes.rb +1 -2
  107. data/test_app/config/secrets.yml +22 -0
  108. data/test_app/db/migrate/20141114205526_suppliers.office.rb +1 -1
  109. data/test_app/db/migrate/20141114205527_categories.office.rb +3 -3
  110. data/test_app/db/migrate/20141114205528_items.office.rb +1 -1
  111. data/test_app/db/migrate/20141114205529_orders.office.rb +1 -1
  112. data/test_app/db/migrate/20141114205530_baskets.office.rb +1 -1
  113. data/test_app/db/migrate/20141114205531_purchases.office.rb +1 -1
  114. data/test_app/db/migrate/20141114205532_products.office.rb +4 -4
  115. data/test_app/db/schema.rb +26 -26
  116. metadata +35 -28
  117. data/app/views/orders/edit.html.haml +0 -25
  118. data/app/views/orders/ship.haml +0 -91
  119. data/app/views/purchases/edit.html.haml +0 -9
  120. data/spec/features/orders_spec.rb +0 -37
@@ -2,7 +2,7 @@
2
2
  = t(:clerk) + " : " + @clerk.email
3
3
  -if @clerk.admin
4
4
  (
5
- =t(:admin)
5
+ =t(:admin)
6
6
  )
7
7
  %p
8
8
  %b= t(:address)
@@ -15,5 +15,5 @@
15
15
  %p
16
16
  %b= t(:phone) + " : " + @clerk.phone.to_s
17
17
 
18
- = link_to t(:edit), edit_clerk_path(@clerk), :class => "btn btn-success"
19
- = link_to t(:back), clerks_path, :class => "btn btn-warning"
18
+ = link_to t(:edit), office.edit_clerk_path(@clerk), :class => "btn btn-success"
19
+ = link_to t(:back), office.clerks_path, :class => "btn btn-warning"
@@ -1,16 +1,16 @@
1
1
  %li{:class => params[:controller] == "products" && "active" }
2
- = link_to t(:products), products_path
2
+ = link_to t(:products), office.products_path
3
3
  %li{:class => params[:controller] == "baskets" && "active" }
4
- = link_to t(:baskets), baskets_path
4
+ = link_to t(:baskets), office.baskets_path
5
5
  %li{:class => params[:controller] == "orders" && "active" }
6
- = link_to t(:orders), orders_path
6
+ = link_to t(:orders), office.orders_path
7
7
  %li{:class => params[:controller] == "purchases" && "active" }
8
- = link_to t(:purchases), purchases_path
8
+ = link_to t(:purchases), office.purchases_path
9
9
  %li{:class => params[:controller] == "categories" && "active" }
10
- = link_to t(:categories), categories_path
10
+ = link_to t(:categories), office.categories_path
11
11
  %li{:class => params[:controller] == "suppliers" && "active" }
12
- = link_to t(:suppliers), suppliers_path
12
+ = link_to t(:suppliers), office.suppliers_path
13
13
  %li{:class => params[:controller] == "clerks" && "active" }
14
- = link_to t(:clerks), clerks_path
14
+ = link_to t(:clerks), office.clerks_path
15
15
  %li{:class => params[:controller] == "manage" && "active" }
16
- = link_to t(:manage), manage_all_path
16
+ = link_to t(:manage), office.manage_all_path
@@ -1,5 +1,5 @@
1
1
  - flash.each do |name, msg|
2
2
  - if msg.is_a?(String)
3
- %div{:class => "alert alert-#{name == :notice ? "success" : "danger"}"}
3
+ %div{:class => "alert alert-#{name}"}
4
4
  %button.close{"aria-hidden" => "true", "data-dismiss" => "alert", :type => "btn btn-primary"} ×
5
- = content_tag :div, msg, :id => "flash_#{name}"
5
+ %div= msg
@@ -2,12 +2,14 @@
2
2
  %html{:lang => (I18n.locale || I18n.default_locale)}
3
3
  %head
4
4
  %meta{:charset => "utf-8"}/
5
- %title Office Clerk
6
- %meta{:content => "Office Clerk", :name => "description"}
5
+ %title= content_for?(:title) ? content_for(:title) : "Office Clerk"
6
+ = include_gon(:init => true)
7
7
  = stylesheet_link_tag "office_clerk" , :media => :all
8
+ -office_assets.each do |ass|
9
+ = stylesheet_link_tag ass , :media => :all
8
10
  = javascript_include_tag "office_clerk"
9
- = include_gon(:init => true)
10
- = render "layouts/header_extra"
11
+ -office_assets.each do |ass|
12
+ = javascript_include_tag ass
11
13
  = csrf_meta_tags
12
14
  = yield :head
13
15
  %body{:style => ""}
@@ -19,31 +21,12 @@
19
21
  %a{href: "/"}= t(:shop)
20
22
  = render :partial => "layouts/admin_menu"
21
23
  %ul.nav.navbar-nav.navbar-right
22
- %li= link_to current_clerk.email , edit_clerk_path(current_clerk)
23
- %li= link_to t(:sign_out), sign_out_path
24
-
25
- - if not flash[:notice].blank? then
26
- .row.content.hidden-print
27
- .col-md-12.alert
28
- .alert-notice.row
29
- .col-md-3
30
- .alert-heading= t(:info) + " :"
31
- .col-md-9
32
- .alert-message!= flash[:notice]
33
- - if not flash[:alert].blank? then
34
- .row.content.hidden-print
35
- .col-md-12.alert
36
- .alert-error.row
37
- .col-md-3
38
- .alert-heading= t(:info) + " :"
39
- .col-md-9
40
- .alert-message= flash[:alert]
41
- .large-12.column
42
- .row.space
43
- =image_tag "shop/spacer.gif"
24
+ %li= link_to current_clerk.email , office.edit_clerk_path(current_clerk)
25
+ %li= link_to t(:sign_out), office.sign_out_path
26
+ = render "layouts/messages"
44
27
 
45
28
  = yield
46
29
 
47
30
  .row
48
31
  .col-md-12
49
- %br
32
+ %br
@@ -8,8 +8,7 @@ Tarkistathan että tiedot ovat oikein.
8
8
  Maksutapa: Ennakkomaksu
9
9
 
10
10
  Tilauksesi lähetetään, kun olet maksanut sen ja maksusi on kirjautunut tilillemme.
11
- Tilinumero FI1017 4530 0013 2474, mainitse viestikentässä tilausnumerosi <%= @order.number %>
12
- tai käytä <%=viite%>
11
+ Tilinumero FI1017 4530 0013 2474, mainitse viestikentässä tilausnumerosi <%= @order.number %>.
13
12
 
14
13
  Kun maksusi on kirjautunut tilille, lähetämme tilaamasi tuotteet 1-3 arkipäivän kuluessa.
15
14
 
@@ -1,6 +1,7 @@
1
1
  Hyvä asiakkaamme,
2
2
 
3
- Tilauksesi <%= @order.number %> on postitettu <%= date(@order.shipped_on) %>.
3
+ Tilauksesi <%= @order.number %> on kuitattu maksetuksi ja
4
+ tilaus on postitettu <%= date(@order.shipped_on) %>.
4
5
 
5
6
  <% unless @order.shipment_info.blank? %>
6
7
  Postin seurantatunnus on <%=@order.shipment_info%>
@@ -1,9 +1,9 @@
1
- <%= [:order_number , :ordered_on ,:total_price , :vat , :vat , :paid_on ].collect{|i| I18n.t(i)}.join(";") %>
2
- <% @orders.each do |order| %>
3
- <% values = [ order.number.to_s , date(order.ordered_on) , order.total_price.round(2)] %>
1
+ <%= [t(:order_number) , t(:ordered_on) , t(:total_price) , t(:vat) + " 14" , t(:vat) + " 24" , t(:paid_on) ].join(";") %>
2
+ <% @order_scope.each do |order| %>
3
+ <% values = [ order.number.to_s , date(order.ordered_on) , number_with_comma(order.total_price)] %>
4
4
  <% taxes = order.taxes %>
5
- <% values << taxes[14.0].round(2) %>
6
- <% values << taxes[24.0].round(2) %>
7
- <% values << date(order.paid_on) %>
5
+ <% values << number_with_comma(taxes[14.0]) %>
6
+ <% values << number_with_comma(taxes[24.0]) %>
7
+ <% values << date(order.paid_on) %>
8
8
  <%= values.join(";") %>
9
9
  <%end%>
@@ -1,43 +1,48 @@
1
1
  .row
2
2
  .col-md-9.orders
3
- %h2= t(:orders)
4
- = paginate @orders
3
+ .row
4
+ .col-md-10
5
+ %h2= t(:orders)
6
+ = paginate @orders
7
+ .col-md-2
8
+ = link_to t(:new) + ' ' + t(:order) , office.new_order_path , :class => "btn btn-primary new_order"
5
9
  .col-md-3
6
10
  = image_tag "office_clerk/orders.jpg" , :class => "img-responsive"
11
+
7
12
  .row
8
13
  .col-md-9
9
14
  %div
10
- %table.table.table-striped.table-bordered.table-condensed
15
+ %table.table.table-hover.table-condensed
11
16
  %thead
12
17
  %tr
13
- %th= sort_link @q, :number
14
- %th= sort_link @q, :ordered_on
15
- %th= t(:items)
16
- %th= sort_link @q, :basket_total_price
17
- %th= sort_link @q, :email
18
- %th= sort_link @q, :paid_on
19
- %th= sort_link @q, :shipped_on
18
+ %th= sort_link [:office,@q], :number
19
+ %th.text-right= sort_link [:office,@q], :ordered_on
20
+ %th.text-right= t(:items)
21
+ %th.text-right= sort_link [:office,@q], :basket_total_price
22
+ %th= sort_link [:office,@q], :email
23
+ %th.text-right= sort_link [:office,@q], :paid_on
24
+ %th.text-right= sort_link [:office,@q], :shipped_on
20
25
  %tbody
21
26
  - @orders.each do |order|
22
27
  %tr{:class => "line-#{cycle("1","2")}"}
23
28
  %td.number
24
- = link_to order.number.to_s , order_path(order), :title => t(:show)
29
+ = link_to order.number.to_s , office.order_path(order), :title => t(:show)
25
30
  -unless order.note.blank?
26
31
  %span.glyphicon.glyphicon-flag
27
- %td= date(order.ordered_on)
28
- %td= order.basket.items.length
29
- %td= link_to euros(order.total_price), basket_path(order.basket)
32
+ %td.text-right= date(order.ordered_on)
33
+ %td.text-right= order.basket.items.length rescue "basket #{order.id}"
34
+ %td.text-right= link_to euros(order.total_price), office.basket_path(order.basket)
30
35
  %td.email= order.email
31
- %td= date(order.paid_on)
32
- %td= date(order.shipped_on)
36
+ %td.text-right= date(order.paid_on)
37
+ %td.text-right= date(order.shipped_on)
33
38
  .btn-toolbar
34
39
  .btn-group
35
40
  = paginate @orders
36
41
  .btn-group.pull-right
37
- = link_to orders_path(:format => :csv), :class => "btn btn-primary" do
42
+ = link_to office.orders_path({:format => :csv}.merge( params)), {:class => "btn btn-primary"} do
38
43
  %i.icon-download CSV
39
44
  .col-md-3
40
- = search_form_for @q, :url => search_orders_path, :html => { :class => "form-horizontal" , :role => "form"}, :method => :get do |f|
45
+ = search_form_for @q, :url => office.search_orders_path, :html => { :class => "form-horizontal" , :role => "form"}, :method => :get do |f|
41
46
  .form-group
42
47
  .input-group
43
48
  = f.text_field :number_cont ,:class => "form-control" , :placeholder => t(:order_number)
@@ -67,7 +72,7 @@
67
72
  = f.radio_button :paid_on_blank , true
68
73
  .form-group.col-md-6
69
74
  = f.text_field :paid_on_gteq , :class => "form-control datepicker" , :value => sort_date(:paid_on_gteq)
70
- .form-group.col-md-4
75
+ .form-group.col-md-3
71
76
  = f.text_field :paid_on_lteq , :class => "form-control datepicker", :value => sort_date(:paid_on_lteq)
72
77
  .form-group
73
78
  .col-md-3
@@ -88,4 +93,4 @@
88
93
  .form-group.col-md-4
89
94
  = f.text_field :canceled_on_lteq , :class => "form-control datepicker",:value => sort_date(:canceled_on_lteq)
90
95
  = f.submit t(:filter), :id => :filter , :class => "btn btn-success"
91
- = link_to t(:cancel), orders_path, :class => "btn btn-warning"
96
+ = link_to t(:cancel), office.orders_path, :class => "btn btn-warning"
@@ -0,0 +1,57 @@
1
+ = bootstrap_form_for @order, :url => office.shipment_order_path do |f|
2
+ .row
3
+ = f.alert_message t(:fix_errors) , error_summary: false
4
+
5
+ .row
6
+ .col-md-8
7
+ .row
8
+ .col-md-9#address_form
9
+ %h4=t(:contact_details)
10
+ = f.text_field :name , :placeholder => t(:name)
11
+ = f.text_field :street , :placeholder => t(:street)
12
+ = f.text_field :city , :placeholder => t(:city)
13
+ = f.text_field :phone , :placeholder => t(:phone)
14
+ = f.email_field :email, :placeholder => t(:email)
15
+ %hr
16
+ %button.btn.btn-primary.btn-lg#make_order{:type => "submit"}
17
+ =t(:update)
18
+
19
+ .col-md-3
20
+ .col-md-4
21
+ %h4
22
+ =t(:choose_shipment)
23
+ = @order.shipment_type
24
+ - OfficeClerk::ShippingMethod.all.each_value do |s|
25
+ -next unless s.available?(@order.basket)
26
+ .radio
27
+ = radio_button_tag "order[shipment_type]" , s.type , s.type.to_s == @order.shipment_type , "data-price" => s.price_for(@order.basket).round(2)
28
+ %b
29
+ = s.name + ": "
30
+ = s.price_for(@order.basket).round(2)
31
+
32
+
33
+ %br
34
+ %br
35
+ %br
36
+ %h4
37
+ = t(:order)
38
+ = @order.number
39
+
40
+ %table.table.table-condensed.basket-total
41
+ %thead
42
+ %tr
43
+ %th Tuotteet yhteensä
44
+ %td.text-right
45
+ %span#basket_total= @order.basket.total_price.round(2)
46
+
47
+ %tbody
48
+ %tr
49
+ %th Toimituskulut
50
+ %td.text-right
51
+ %span#shipping_cost= @order.shipment_price
52
+
53
+ %tr
54
+ %th Tilaus yhteensä
55
+ %th.text-right
56
+ %span#order_total= @order.total_price.round(2)
57
+
@@ -1,61 +1,104 @@
1
1
  .row
2
2
  %h2
3
3
  = t(:order) + " : " + @order.number.to_s
4
+ - unless @order.canceled_on.blank?
5
+ = t(:canceled_on) + " : " + date(@order.canceled_on)
6
+
4
7
  .row
8
+ .col-md-7
9
+ %table.table.table-condensed.no-bg.no-border
10
+ %tbody
11
+ %tr
12
+ %td
13
+ %b
14
+ = t(:ordered_on) + " : "
15
+ = date(@order.ordered_on)
16
+ %td
17
+ %tr
18
+ %td
19
+ %b
20
+ = t(:customer)
21
+ = @order.name
22
+ %br
23
+ = @order.street
24
+ = @order.city
25
+ %br
26
+ = link_to @order.email.to_s , office.search_orders_path( :"q[email_cont]" => @order.email )
27
+ %br
28
+ = @order.phone.to_s
29
+
30
+ %td
31
+ %b
32
+ = t(:shipment_type) + " : "
33
+ = @order.shipment_type
34
+ %br
35
+ %br
36
+
37
+ = link_to t(:edit) , office.shipment_order_path(@order) , :class => "btn btn-info shipment_type"
38
+
39
+ = link_to t(:new) + ' ' + t(:order) , office.new_order_path( :address => @order.id) , :class => "btn btn-primary copy_order"
40
+
41
+ %tr
42
+ %td
43
+ %b
44
+ = t(:paid_on) + ":"
45
+ \
46
+ -if @order.paid_on
47
+ = date(@order.paid_on)
48
+ -else
49
+ = link_to t(:paid), office.pay_order_path(@order), :class => "btn btn-info pay_now"
50
+
51
+ %td
52
+ %b
53
+ = t(:shipped_on) + " : "
54
+ -unless(@order.shipped_on.blank?)
55
+ =date(@order.shipped_on)
56
+ -else
57
+ = link_to t(:ship), office.ship_order_path(@order), :class => "btn btn-info ship_now"
58
+
59
+ %tr
60
+ %td
61
+ \
62
+ %td
63
+ \
64
+
65
+
66
+ .col-md-1
5
67
  .col-md-4
6
68
  %p
7
- %b
8
- = t(:email) + " : " + @order.email.to_s
9
- %p
10
- %b
11
- = t(:phone) + " : " + @order.phone.to_s
12
- %p
13
- %b
14
- = t(:ordered_on) + " : " + date(@order.ordered_on)
69
+ %b= t(:note)
70
+ = in_place @order , :note, :as => :textarea , :url => office.order_path(@order)
15
71
  %p
16
- %b
17
- = t(:canceled_on) + " : " + date(@order.canceled_on)
18
- .col-md-4
72
+ %b= t(:shipment_info)
73
+ = in_place @order , :shipment_info , :url => office.order_path(@order)
19
74
  %p
20
- %b
21
- = t(:shipment_type) + " : " + @order.shipment_type.to_s
75
+ %b= t(:payment_info)
76
+ = in_place @order , :payment_info , :url => office.order_path(@order)
22
77
  %p
23
- %b
24
- -if @order.paid_on
25
- %b= t(:paid_on) + " : " + date(@order.paid_on)
26
- -else
27
- = link_to t(:paid), pay_order_path(@order), :class => "btn btn-info pay_now"
78
+ %br
79
+ %br
80
+ %br
81
+ %b= t(:total_price) + " : " + euros(@order.total_price)
28
82
 
29
- %p
30
- -if @order.shipped_on
31
- %b
32
- = t(:shipped_on) + " : " + date(@order.shipped_on)
33
- -else
34
- = link_to t(:ship), ship_order_path(@order), :class => "btn btn-info ship_now"
35
- .col-md-4
36
- %p
37
- %b= t(:note)
38
- %p
39
- = in_place @order , :note, :as => :textarea
40
83
 
41
84
  -content_for :basket do
42
85
  %tr
43
- %td= t(:name)
44
- %td=@order.name
86
+ %td
87
+ %td
45
88
  %td
46
89
  %b= t(:total_tax) + " : "
47
90
  %td
48
91
  %b= euros(@order.total_tax)
49
92
  %tr
50
- %td= t(:street)
51
- %td= @order.street
93
+ %td
94
+ %td
52
95
  %td
53
96
  %b= t(:shipment_price) + " : "
54
97
  %td
55
98
  %b= euros(@order.shipment_price)
56
99
  %tr
57
- %td= t(:city)
58
- %td=@order.city
100
+ %td
101
+ %td
59
102
  %td
60
103
  %b= t(:total_price) + " : "
61
104
  %td
@@ -63,11 +106,35 @@
63
106
 
64
107
  .row
65
108
  = render "baskets/small" , :basket => @order.basket
109
+
66
110
  .row
67
111
  %br
112
+
113
+ .col-md-5
114
+ %b= t(:order_actions)
115
+ %br
116
+
117
+ = link_to t(:back), office.orders_path, :class => "btn btn-warning"
118
+
119
+ = link_to t(:edit), office.edit_basket_path(@order.basket), :class => "btn btn-info edit_basket" unless @order.basket.locked?
120
+
121
+ = link_to t(:cancel), office.cancel_order_path(@order), :data =>{:confirm => t(:cancel_confirmation )} , :class => "btn btn-danger cancel_order" if @order.basket.locked?
122
+
123
+ = link_to t(:destroy) , office.order_path(@order), :data => {:confirm => t(:are_you_sure )}, :method => :delete, :title => t(:destroy) , :class => "btn btn-danger" if @order.shipped_on.nil? and @order.paid_on.nil?
124
+
68
125
  .col-md-2
69
- = link_to t(:back), orders_path, :class => "btn btn-warning"
70
- .col-md-10
126
+ .col-md-5
127
+ %b= t(:order_mail)
128
+ %br
71
129
  - mail_actions.each do |action|
72
- = link_to t("#{action}_order_button") , mail_order_path( @order , :act => action) , :class => "btn btn-info"
73
- .col-md-12.order_show_back
130
+ = link_to t("order_button.#{action}") , office.mail_order_path( @order , :act => action) , :class => "btn btn-info"
131
+
132
+
133
+
134
+ .row
135
+ %br
136
+ .col-md-12
137
+ %b= t(:order_print)
138
+ .order_show_back
139
+ %br
140
+ %br