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
@@ -5,10 +5,9 @@
5
5
  .col-md-6
6
6
  %h3
7
7
  - if @product.product_item?
8
- = link_to @product.product.name , product_url(@product.product)
8
+ = link_to @product.product.name , office.product_url(@product.product)
9
9
  = @product.name
10
10
  %small
11
11
  = @product.online ? t(:online) : t(:not_online)
12
12
  .col-md-4
13
13
  %h2= t(:preview)
14
-
@@ -5,7 +5,7 @@
5
5
  - @product.products.each do |product|
6
6
  %td
7
7
  = image_tag product.main_picture.url(:thumb)
8
- =link_to product.name , product_path(product)
8
+ =link_to product.name , office.product_path(product)
9
9
  %tr.line-2
10
10
  %td=t(:price)
11
11
  - @product.products.each do |product|
@@ -1,11 +1,15 @@
1
- %h4.product-name
2
- =product.name
3
- .row
4
- .col-md-4
5
- .square-image
6
- =image_tag product.main_picture.url
7
- .col-md-8.bottom
8
- .product-fact
9
- %p= markdown product.summary
10
- .price.selling
1
+ .admin
2
+ .product-container
3
+ %h4.product-name
4
+ =product.name
5
+ .row
6
+ .col-md-4
7
+ .square-image
8
+ =image_tag product.main_picture.url
9
+ .col-md-8
10
+ .product-fact
11
+ %p= markdown product.summary
12
+ .row
13
+ .product-list-price
11
14
  = euros product.price
15
+
@@ -8,5 +8,5 @@
8
8
  -next unless product
9
9
  %td= image_tag product.main_picture.url(:thumb)
10
10
  %td
11
- = link_to product_path(product), :title => t(:show) , :class => product.online && "online" do
11
+ = link_to office.product_path(product), :title => t(:show) , :class => product.online && "online" do
12
12
  = product.full_name
@@ -1,6 +1,6 @@
1
1
  = render "head"
2
-
3
- = bootstrap_form_for(@product, :html => { :multipart => true , :role=>"form"} ) do |f|
2
+ - url = @product.persisted? ? office.product_path(@product) : office.products_path
3
+ = bootstrap_form_for(@product, :html => { :multipart => true , :role=>"form"} , :url => url) do |f|
4
4
  = f.hidden_field( :product_id) if @product.product_id
5
5
  .row
6
6
  .col-md-8
@@ -42,6 +42,6 @@
42
42
  .col-md-8
43
43
  = f.submit :class => "btn btn-success"
44
44
  -if @product.product_id
45
- = link_to t(:cancel), product_path(@product.product), :class => "btn btn-warning"
45
+ = link_to t(:cancel), office.product_path(@product.product), :class => "btn btn-warning"
46
46
  -else
47
- = link_to t(:cancel), products_path, :class => "btn btn-warning"
47
+ = link_to t(:cancel), office.products_path, :class => "btn btn-warning"
@@ -12,22 +12,26 @@
12
12
  = t(:products)
13
13
  = paginate @products
14
14
  .col-md-2
15
- = link_to t(:new) + ' ' + t(:product) , new_product_path , :class => "btn btn-primary"
15
+ = link_to t(:new) + ' ' + t(:product) , office.new_product_path , :class => "btn btn-primary"
16
16
  .col-md-3
17
17
  = image_tag "office_clerk/products.jpg" , :class => "img-responsive"
18
18
 
19
19
  .row
20
20
  .col-md-9
21
21
  %div
22
- %table.table-striped.table-bordered.table-condensed
22
+ %table.table.table-condensed
23
23
  %thead
24
24
  %tr
25
25
  %th=t( "picture")
26
- %th= sort_link @q, :ean
27
- %th= sort_link @q, :name
28
- %th= sort_link @q, :price
29
- %th=t(:supplier) + " " + t(:category)
30
- %th= sort_link @q, :inventory
26
+ %th= sort_link [:office,@q], :ean
27
+ %th= sort_link [:office,@q], :name
28
+ %th= sort_link [:office,@q], :price
29
+ %th= sort_link [:office,@q], :cost
30
+ %th
31
+ =t(:supplier)
32
+ %br
33
+ =t(:category)
34
+ %th= sort_link [:office,@q], :inventory
31
35
  %th
32
36
  %label.checkbox
33
37
  = @product_scope.length.to_s + " " + t(:products)
@@ -38,21 +42,22 @@
38
42
  %td.image= image_tag product.main_picture.url(:thumb)
39
43
  %td.ean= product.line? ? "#{product.products.length} #{t(:items)}" : product.ean
40
44
  %td.name
41
- = link_to product_path(product), :title => t(:show) , :class => product.online && "online" do
45
+ = link_to office.product_path(product), :title => t(:show) , :class => product.online && "online" do
42
46
  =product.full_name
43
- %td.price=euros(product.price)
47
+ %td.price.text-right=euros(product.price)
48
+ %td.price.text-right=euros(product.cost)
44
49
  %td.supplier
45
50
  =product.supplier.supplier_name if product.supplier
46
51
  %br
47
52
  =product.category.name if product.category
48
53
  %td.inventory=product.inventory
49
54
  -if params[:basket]
50
- %td= link_to t(:add_to_basket) , edit_basket_path(:id => params[:basket] , :add => product.id)
55
+ %td= link_to t(:add_to_basket) , office.edit_basket_path(:id => params[:basket] , :add => product.id)
51
56
  -else
52
- %td= link_to t(:edit) ,edit_product_path(product), :title => t(:edit)
57
+ %td= link_to t(:edit) ,office.edit_product_path(product), :title => t(:edit)
53
58
  = paginate @products
54
59
  .col-md-3
55
- = search_form_for @q, :url => search_products_path, :html => { :class => "form-horizontal" }, :method => :get do |f|
60
+ = search_form_for @q, :url => office.search_products_path, :html => { :class => "form-horizontal" }, :method => :get do |f|
56
61
  .form-group
57
62
  .input-group
58
63
  - if params[:basket]
@@ -87,6 +92,12 @@
87
92
  = f.text_field :price_gteq , :class => "form-control"
88
93
  .col-md-4
89
94
  = f.text_field :price_lteq , :class => "form-control"
95
+ .col-md-4
96
+ = f.label(:cost)
97
+ .col-md-4
98
+ = f.text_field :cost_gteq , :class => "form-control"
99
+ .col-md-4
100
+ = f.text_field :cost_lteq , :class => "form-control"
90
101
  .col-md-4
91
102
  = f.label(:inventory)
92
103
  .col-md-4
@@ -104,4 +115,4 @@
104
115
  .col-md-8
105
116
  = f.collection_select :category_id_eq, Category.all, :id, :name, {:include_blank => true}, :class=>"form-control"
106
117
  = f.submit t(:filter), :class => "btn btn-success" , :id => :filter
107
- = link_to t(:cancel), products_path, :class => "btn btn-warning"
118
+ = link_to t(:cancel), office.products_path, :class => "btn btn-warning"
@@ -21,52 +21,55 @@
21
21
  .col-md-6
22
22
  %p
23
23
  %b= t(:price) + " : "
24
- = in_place @product , :price , :display_with => :euros
24
+ = in_place @product , :price , :display_with => :best_euros , :url => office.product_path(@product)
25
25
  %p
26
26
  %b= t(:cost) + " : "
27
- = in_place @product , :cost , :display_with => :euros
27
+ = in_place @product , :cost , :display_with => :best_euros , :url => office.product_path(@product)
28
28
  %p
29
29
  %b= t(:category) + " : "
30
- = link_to @product.category.name ,category_path(@product.category) if @product.category
30
+ = link_to @product.category.name , office.category_path(@product.category) if @product.category
31
31
  %p
32
32
  %b= t(:link) + " : "
33
33
  = @product.link
34
34
  %p
35
35
  %b= t(:ean) + " : "
36
- = in_place @product , :ean
36
+ = in_place @product , :ean , :url => office.product_path(@product)
37
37
  .col-md-6
38
38
  %p
39
39
  %b= t(:weight) + " : "
40
- = in_place @product , :weight
40
+ = in_place @product , :weight , :url => office.product_path(@product)
41
41
  %p
42
42
  %b= t(:inventory) + " : "
43
43
  = @product.inventory
44
+ %p
45
+ %b= t(:stock_level) + " : "
46
+ = in_place @product , :stock_level , :url => office.product_path(@product)
44
47
  %p
45
48
  %b= t(:supplier) + " : "
46
49
  = link_to @product.supplier.supplier_name ,supplier_path(@product.supplier) if @product.supplier
47
50
  %p
48
51
  %b= t(:scode) + " : "
49
- = in_place @product , :scode
52
+ = in_place @product , :scode , :url => office.product_path(@product)
50
53
  %p
51
54
  %b= t(:tax_percent) + " : "
52
- = in_place @product , :tax
55
+ = in_place @product , :tax , :url => office.product_path(@product)
53
56
  .col-md-4
54
57
  %p
55
58
  %b= t(:summary) + " : "
56
- = in_place @product , :summary
59
+ = in_place @product , :summary , :url => office.product_path(@product)
57
60
  %p
58
61
  %b= t(:description) + " : "
59
- = in_place @product , :description , :as => :textarea
62
+ = in_place @product , :description , :as => :textarea , :url => office.product_path(@product)
60
63
  .col-md-4
61
64
  =render :partial => "products/preview_box" , :locals => {:product => @product}
62
65
  = markdown @product.description
63
66
  %br
64
67
  .row.product_show_row_buttons
65
68
  .col-md-2
66
- = link_to t(:edit), edit_product_path(@product), :class => "btn btn-success"
69
+ = link_to t(:edit), office.edit_product_path(@product), :class => "btn btn-success"
67
70
  .col-md-2
68
- = link_to t(:delete) , delete_product_path(@product), :class => "btn btn-danger"
71
+ = link_to t(:delete) , office.product_path(@product), :method => :delete , :class => "btn btn-danger", :data => { :confirm => t(:are_you_sure )}
69
72
  -unless @product.product_item?
70
73
  .col-md-2
71
- = link_to t(:new_item) , new_product_path( :parent_id => @product.id), :class => "btn btn-primary"
74
+ = link_to t(:new_item) , office.new_product_path( :parent_id => @product.id), :class => "btn btn-primary"
72
75
  .col-md-6.product_show_row_end
@@ -4,6 +4,8 @@
4
4
  .col-md-10
5
5
  %h2= t(:purchases)
6
6
  = paginate @purchases
7
+ .col-md-2
8
+ = link_to t(:new) + ' ' + t(:purchase) , office.new_purchase_path , :class => "btn btn-primary new_purchase"
7
9
  .col-md-3
8
10
  = image_tag "office_clerk/purchases.jpg" , :class => "img-responsive"
9
11
  .row
@@ -12,24 +14,26 @@
12
14
  %table.table.table-striped.table-bordered.table-condensed
13
15
  %thead
14
16
  %tr
15
- %th= sort_link @q, :ordered_on
16
- %th= sort_link @q, :received_on
17
+ %th= t(:name)
18
+ %th= sort_link [:office,@q], :ordered_on
19
+ %th= sort_link [:office,@q], :received_on
17
20
  %th= t(:items)
18
- %th= sort_link @q, :basket_total_price
21
+ %th= sort_link [:office,@q], :basket_total_price
19
22
  %th= @purchase_scope.length.to_s + " " + t(:purchases)
20
23
  %tbody
21
24
  - @purchases.each do |purchase|
22
25
  %tr{:class => "line-#{cycle("1","2")}"}
26
+ %td= purchase.name
23
27
  %td= date(purchase.ordered_on)
24
28
  %td= date(purchase.received_on)
25
29
  %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)
30
+ %td= link_to euros(purchase.basket.total_price) , office.basket_path(purchase.basket)
31
+ %td= link_to t(:show) , office.purchase_path(purchase), :title => t(:show)
28
32
  .btn-toolbar
29
33
  .btn-group
30
34
  = paginate @purchases
31
35
  .col-md-3
32
- = search_form_for @q, :url => search_purchases_path, :html => { :class => "form-horizontal" }, :method => :post do |f|
36
+ = search_form_for @q, :url => office.search_purchases_path, :html => { :class => "form-horizontal" }, :method => :get do |f|
33
37
  .form-group
34
38
  = f.text_field :name_cont , :class => "form-control" , :placeholder => t(:name)
35
39
  .row
@@ -50,4 +54,4 @@
50
54
  = f.text_field :received_on_lt , :class => "form-control datepicker"
51
55
  %br
52
56
  = f.submit t(:filter), :id => :filter , :class => "btn btn-success"
53
- = link_to t(:cancel), purchases_path, :class => "btn btn-warning"
57
+ = link_to t(:cancel), office.purchases_path, :class => "btn btn-warning"
@@ -1,32 +1,49 @@
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 order_link"
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 receive_link"
1
+ .row
2
+ %h2
3
+ = t(:purchase)
4
+ %p
5
+ %b= t(:name)
6
+ = in_place @purchase , :name , :url => office.purchases_path(@purchase)
7
+ .row
8
+ .col-md-3
9
+ %p
10
+ %b
11
+ = t(:ordered_on) + " : "
12
+ -if @purchase.ordered_on
13
+ = date(@purchase.ordered_on)
14
+ -else
15
+ = link_to t(:order) , office.order_purchase_path(@purchase) , :class => "btn btn-primary order_link"
16
+ .col-md-3
17
+ %p
18
+ %b
19
+ = t(:received_on) + " : "
20
+ -if @purchase.received_on
21
+ = date(@purchase.received_on)
22
+ -else
23
+ = link_to t(:receive) , office.receive_purchase_path(@purchase) , :class => "btn btn-primary receive_link"
24
+ .col-md-6
25
+ %p
26
+ %b
27
+ = t(:suppliers) + " : "
28
+ = raw @purchase.basket.suppliers.collect {|s| link_to( s.supplier_name , supplier_path(s)) }.join(",")
19
29
 
20
30
  = render "baskets/small" , :basket => @purchase.basket
21
31
 
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"
32
+ .row
33
+ .col-md-5
34
+ %b= t(:order_actions)
35
+ %br
36
+ = link_to t(:edit), office.edit_basket_path(@purchase.basket), :class => "btn btn-info edit_basket" unless @purchase.basket.locked?
37
+
38
+ = link_to t(:back), office.purchases_path, :class => "btn btn-warning"
27
39
 
28
40
  -unless @purchase.received_on
29
41
  %h3{"style" => "color:red"}
30
42
  = t(:inventory)
31
- = link_to t(:inventory) , inventory_purchase_path(@purchase) , :class => "btn btn-primary inventory_link", :data => { :confirm => t(:are_you_sure) }
32
-
43
+ %br
44
+ = link_to t(:inventory) , office.inventory_purchase_path(@purchase) , :class => "btn btn-primary btn-danger inventory_link", :data => { :confirm => t(:are_you_sure) }
45
+
46
+ .row
47
+ %br
48
+ .col-md-12
49
+ .purchase_show_last
@@ -1,10 +1,10 @@
1
- %h1= t(:sign_up)
2
- = bootstrap_form_for @clerk , :url => sign_up_path do |f|
3
- .form_group
4
- = f.text_field :email
5
- .form_group
6
- = f.password_field :password
7
- .form_group
8
- = f.password_field :password_confirmation
9
- %p.button= f.submit :class => "btn btn-info submit"
10
-
1
+ .col-md-4
2
+ %h1= t(:sign_up)
3
+ = bootstrap_form_for @clerk , :url => office.sign_up_path do |f|
4
+ .form_group
5
+ = f.text_field :email
6
+ .form_group
7
+ = f.password_field :password
8
+ .form_group
9
+ = f.password_field :password_confirmation
10
+ %p.button= f.submit :class => "btn btn-info submit"
@@ -1,10 +1,10 @@
1
1
  %h2
2
2
  = t params["action"]
3
3
  = t(:supplier)
4
- = bootstrap_form_for(@supplier) do |f|
4
+ = bootstrap_form_for(@supplier, :url => office.suppliers_path) do |f|
5
5
  .row
6
6
  = f.text_field :supplier_name
7
7
  = render "addresses/form_fields" ,:f => f
8
8
  .form-actions
9
9
  = f.submit :class => "btn btn-success"
10
- = link_to t(:back), suppliers_path, :class => "btn btn-warning"
10
+ = link_to t(:back), office.suppliers_path, :class => "btn btn-warning"
@@ -5,7 +5,7 @@
5
5
  %h2= t(:suppliers)
6
6
  = paginate @suppliers
7
7
  .col-md-2
8
- = link_to t(:new) + ' ' + t(:supplier) , new_supplier_path , :class => "btn btn-primary"
8
+ = link_to t(:new) + ' ' + t(:supplier) , office.new_supplier_path , :class => "btn btn-primary"
9
9
  .col-md-3
10
10
  = image_tag "office_clerk/suppliers.jpg" , :class => "img-responsive"
11
11
  .row
@@ -14,7 +14,7 @@
14
14
  %table.table.table-striped.table-bordered.table-condensed
15
15
  %thead
16
16
  %tr
17
- %th=sort_link @q, :supplier_name
17
+ %th=sort_link [:office,@q], :supplier_name
18
18
  %th=t :count
19
19
  %th=t :address
20
20
  %th{:colspan => "2"}
@@ -26,15 +26,14 @@
26
26
  %td.name=supplier.supplier_name
27
27
  %td=supplier.products.count
28
28
  %td=supplier.whole_address
29
- %td= link_to t(:show) , supplier_path(supplier), :title => t(:show)
30
- %td= link_to t(:edit) , edit_supplier_path(supplier), :title => t(:edit)
29
+ %td= link_to t(:show) , office.supplier_path(supplier), :title => t(:show)
30
+ %td= link_to t(:edit) , office.edit_supplier_path(supplier), :title => t(:edit)
31
31
  = paginate @suppliers
32
32
  .col-md-3
33
- = search_form_for @q, :url => search_suppliers_path, :html => { :class => "form-horizontal" }, :method => :post do |f|
33
+ = search_form_for @q, :url => office.search_suppliers_path, :html => { :class => "form-horizontal" }, :method => :get do |f|
34
34
  .form-group
35
35
  = f.text_field :supplier_name_cont , :class => "form-control", :placeholder => t(:name)
36
36
  .form-group
37
37
  = f.text_field :address_cont , :class => "form-control", :placeholder => t(:address)
38
38
  = f.submit t(:filter), :id => :filter , :class => "btn btn-success"
39
- = link_to t(:cancel), suppliers_path, :class => "btn btn-warning"
40
-
39
+ = link_to t(:cancel), office.suppliers_path, :class => "btn btn-warning"
@@ -20,8 +20,7 @@
20
20
  %b
21
21
  = t(:country) + " : " + @supplier.country.to_s
22
22
 
23
- = link_to t(:edit), edit_supplier_path(@supplier), :class => "btn btn-success"
24
- = link_to t(:back), suppliers_path, :class => "btn btn-warning"
23
+ = link_to t(:edit), office.edit_supplier_path(@supplier), :class => "btn btn-success"
24
+ = link_to t(:back), office.suppliers_path, :class => "btn btn-warning"
25
25
 
26
26
  =render "products/triple" , :products => @supplier.products.no_items
27
-
@@ -0,0 +1,97 @@
1
+ # i18n-tasks finds and manages missing and unused translations https://github.com/glebm/i18n-tasks
2
+
3
+ base_locale: en
4
+ ## i18n-tasks detects locales automatically from the existing locale files
5
+ ## uncomment to set locales explicitly
6
+ locales: [en, fi]
7
+
8
+ ## i18n-tasks report locale, default: en, available: en, ru
9
+ # internal_locale: ru
10
+
11
+ # Read and write locale data
12
+ data:
13
+ ## by default, translation data are read from the file system, or you can provide a custom data adapter
14
+ # adapter: I18n::Tasks::Data::FileSystem
15
+
16
+ # Locale files to read from
17
+ read:
18
+ - config/locales/%{locale}.yml
19
+ # - config/locales/*.%{locale}.yml
20
+ # - config/locales/**/*.%{locale}.yml
21
+
22
+ # key => file routes, matched top to bottom
23
+ write:
24
+ ## E.g., write devise and simple form keys to their respective files
25
+ - ['{config}.*', 'config/locales/\1.%{locale}.yml']
26
+ # Catch-all
27
+ - config/locales/%{locale}.yml
28
+ # `i18n-tasks normalize -p` will force move the keys according to these rules
29
+
30
+ # YAML / JSON serializer options, passed to load / dump / parse / serialize
31
+ yaml:
32
+ write:
33
+ # do not wrap lines at 80 characters
34
+ line_width: -1
35
+ json:
36
+ write:
37
+ # pretty print JSON
38
+ indent: ' '
39
+ space: ' '
40
+ object_nl: "\n"
41
+ array_nl: "\n"
42
+
43
+ # Find translate calls
44
+ search:
45
+ ## Default scanner finds t() and I18n.t() calls
46
+ # scanner: I18n::Tasks::Scanners::PatternWithScopeScanner
47
+
48
+ ## Paths to search in, passed to File.find
49
+ paths:
50
+ - app/
51
+
52
+ ## Root for resolving relative keys (default)
53
+ # relative_roots:
54
+ # - app/views
55
+
56
+ ## File.fnmatch patterns to exclude from search (default)
57
+ # exclude: ["*.jpg", "*.png", "*.gif", "*.svg", "*.ico", "*.eot", "*.ttf", "*.woff", "*.pdf"]
58
+
59
+ ## Or, File.fnmatch patterns to include
60
+ # include: ["*.rb", "*.html.slim"]
61
+
62
+ ## Google Translate
63
+ # # Get an API key and set billing info at https://code.google.com/apis/console to use Google Translate
64
+ translation:
65
+ api_key: "AIzaSyCRjToD-btZK_eaaLeqKNmoh1fPoqhbAtQ"
66
+
67
+ ## Consider these keys not missing
68
+ ignore_missing:
69
+ - receipt.header
70
+
71
+ # - 'errors.messages.{accepted,blank,invalid,too_short,too_long}'
72
+ # - '{devise,simple_form}.*'
73
+
74
+ ## Consider these keys used
75
+ ignore_unused:
76
+ - 'activerecord.*'
77
+ - "will_paginate.*"
78
+ - "order_button.*"
79
+ - product_line
80
+ - product_item
81
+ - create
82
+
83
+ # - '{devise,kaminari,will_paginate}.*'
84
+ # - 'simple_form.{yes,no}'
85
+ # - 'simple_form.{placeholders,hints,labels}.*'
86
+ # - 'simple_form.{error_notification,required}.:'
87
+
88
+ ## Exclude these keys from `i18n-tasks eq-base' report
89
+ # ignore_eq_base:
90
+ # all:
91
+ # - common.ok
92
+ # fr,es:
93
+ # - common.brand
94
+
95
+ ## Exclude these keys from all of the reports
96
+ #ignore:
97
+ # - kaminari.*