tienda 1.1.2 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/tienda/application.coffee +114 -84
  3. data/app/assets/javascripts/tienda/custom-scripts.js +182 -0
  4. data/app/assets/javascripts/tienda/custom.js +200 -0
  5. data/app/assets/javascripts/tienda/jquery.metisMenu.js +45 -0
  6. data/app/assets/javascripts/tienda/morris.js +1913 -0
  7. data/app/assets/javascripts/tienda/raphael-2.1.0.min.js +10 -0
  8. data/app/assets/stylesheets/tienda/application.scss +2 -577
  9. data/app/assets/stylesheets/tienda/custom-styles.scss +518 -0
  10. data/app/assets/stylesheets/tienda/morris-0.4.3.min.css +2 -0
  11. data/app/controllers/tienda/dashboard_controller.rb +11 -1
  12. data/app/controllers/tienda/products_controller.rb +7 -3
  13. data/app/controllers/tienda/sessions_controller.rb +1 -1
  14. data/app/controllers/tienda/stock_level_adjustments_controller.rb +1 -5
  15. data/app/helpers/tienda/application_helper.rb +10 -4
  16. data/app/models/tienda/country.rb +3 -5
  17. data/app/models/tienda/delivery_service.rb +5 -7
  18. data/app/models/tienda/order/actions.rb +3 -3
  19. data/app/models/tienda/order/delivery.rb +1 -1
  20. data/app/models/tienda/order.rb +8 -8
  21. data/app/models/tienda/order_item.rb +11 -11
  22. data/app/models/tienda/product.rb +38 -54
  23. data/app/models/tienda/stock_level_adjustment.rb +9 -7
  24. data/app/models/tienda/tax_rate.rb +5 -7
  25. data/app/models/tienda/user.rb +4 -4
  26. data/app/validators/permalink_validator.rb +1 -1
  27. data/app/views/layouts/tienda/application.html.haml +29 -22
  28. data/app/views/layouts/tienda/sub.html.haml +44 -6
  29. data/app/views/tienda/application/_navbar.html.haml +164 -0
  30. data/app/views/tienda/application/_sidebar.html.haml +6 -0
  31. data/app/views/tienda/countries/_form.html.haml +40 -34
  32. data/app/views/tienda/countries/edit.html.haml +12 -3
  33. data/app/views/tienda/countries/index.html.haml +31 -21
  34. data/app/views/tienda/countries/new.html.haml +11 -3
  35. data/app/views/tienda/dashboard/home.html.haml +156 -0
  36. data/app/views/tienda/delivery_service_prices/_form.html.haml +53 -39
  37. data/app/views/tienda/delivery_service_prices/edit.html.haml +12 -3
  38. data/app/views/tienda/delivery_service_prices/index.html.haml +28 -19
  39. data/app/views/tienda/delivery_service_prices/new.html.haml +12 -3
  40. data/app/views/tienda/delivery_services/_form.html.haml +48 -35
  41. data/app/views/tienda/delivery_services/edit.html.haml +11 -5
  42. data/app/views/tienda/delivery_services/index.html.haml +34 -24
  43. data/app/views/tienda/delivery_services/new.html.haml +12 -3
  44. data/app/views/tienda/orders/_form.html.haml +78 -53
  45. data/app/views/tienda/orders/_order_details.html.haml +57 -54
  46. data/app/views/tienda/orders/_order_items.html.haml +5 -3
  47. data/app/views/tienda/orders/_payments_form.html.haml +18 -14
  48. data/app/views/tienda/orders/_payments_table.html.haml +6 -5
  49. data/app/views/tienda/orders/_search_form.html.haml +40 -24
  50. data/app/views/tienda/orders/_status_bar.html.haml +36 -32
  51. data/app/views/tienda/orders/index.html.haml +41 -34
  52. data/app/views/tienda/orders/new.html.haml +22 -11
  53. data/app/views/tienda/orders/show.html.haml +24 -18
  54. data/app/views/tienda/product_categories/_form.html.haml +34 -22
  55. data/app/views/tienda/product_categories/edit.html.haml +12 -4
  56. data/app/views/tienda/product_categories/index.html.haml +26 -16
  57. data/app/views/tienda/product_categories/new.html.haml +11 -3
  58. data/app/views/tienda/products/_form.html.haml +163 -126
  59. data/app/views/tienda/products/_table.html.haml +49 -40
  60. data/app/views/tienda/products/edit.html.haml +14 -6
  61. data/app/views/tienda/products/index.html.haml +35 -7
  62. data/app/views/tienda/sessions/new.html.haml +8 -6
  63. data/app/views/tienda/sessions/reset.html.haml +5 -5
  64. data/app/views/tienda/settings/edit.html.haml +20 -14
  65. data/app/views/tienda/stock_level_adjustments/_table.html.haml +33 -0
  66. data/app/views/tienda/stock_level_adjustments/index.html.haml +20 -39
  67. data/app/views/tienda/tax_rates/form.html.haml +41 -25
  68. data/app/views/tienda/tax_rates/index.html.haml +23 -13
  69. data/app/views/tienda/users/_form.html.haml +36 -24
  70. data/app/views/tienda/users/edit.html.haml +12 -3
  71. data/app/views/tienda/users/index.html.haml +23 -13
  72. data/app/views/tienda/users/new.html.haml +10 -3
  73. data/app/views/tienda/variants/form.html.haml +98 -57
  74. data/app/views/tienda/variants/index.html.haml +47 -29
  75. data/config/initializers/assets.rb +9 -0
  76. data/config/locales/en.yml +3 -2
  77. data/config/routes.rb +1 -1
  78. data/db/migrate/20150517191600_add_stock_counter_cache.rb +5 -0
  79. data/db/migrate/20150517195800_remove_stock_level_item_polymorphism.rb +6 -0
  80. data/db/migrate/20150517212100_update_stock_counter_cache.rb +5 -0
  81. data/db/migrate/20150603235417_add_document_to_orders.rb +5 -0
  82. data/lib/tienda/default_navigation.rb +9 -8
  83. data/lib/tienda/navigation_manager.rb +2 -5
  84. data/lib/tienda/version.rb +1 -1
  85. data/lib/tienda.rb +2 -6
  86. metadata +54 -65
@@ -1,27 +1,37 @@
1
1
  - @page_title = t('tienda.delivery_services.delivery_services')
2
2
 
3
- = content_for :header do
4
- %p.buttons= link_to t('tienda.delivery_services.new'), :new_delivery_service, :class => 'button green'
5
- %h2.delivery_services= t('tienda.delivery_services.delivery_services')
3
+ .row
4
+ .col-md-12
5
+ %h1.page-header
6
+ = t('tienda.delivery_services.delivery_services')
7
+ -# %small Lorem ipsum dolor
8
+ / /. ROW
9
+ .row
10
+ .col-md-12
11
+ %p.pull-right
12
+ = link_to t('tienda.delivery_services.new'), :new_delivery_service, class: 'btn btn-primary'
6
13
 
7
- .table
8
- %table.data
9
- %thead
10
- %tr
11
- %th= t('tienda.delivery_services.name')
12
- %th= t('tienda.delivery_services.prices')
13
- %th= t('tienda.delivery_services.courier')
14
- %th= t('tienda.delivery_services.active?')
15
- %th= t('tienda.delivery_services.default?')
16
- %tbody
17
- - if @delivery_services.empty?
18
- %tr.empty
19
- %td{:colspan => 5}= t('tienda.delivery_services.no_services')
20
- - else
21
- - for delivery_service in @delivery_services
22
- %tr
23
- %td= link_to delivery_service.name, [:edit, delivery_service]
24
- %td= link_to t('tienda.delivery_services.set_prices'), [delivery_service, :delivery_service_prices]
25
- %td= delivery_service.courier
26
- %td= boolean_tag delivery_service.active?
27
- %td= boolean_tag delivery_service.default?
14
+ .panel.panel-default
15
+ .panel-heading
16
+ Listing delivery services
17
+ .panel-body
18
+ %table.table.table-hover
19
+ %thead
20
+ %tr
21
+ %th= t('tienda.delivery_services.name')
22
+ %th= t('tienda.delivery_services.prices')
23
+ %th= t('tienda.delivery_services.courier')
24
+ %th= t('tienda.delivery_services.active?')
25
+ %th= t('tienda.delivery_services.default?')
26
+ %tbody
27
+ - if @delivery_services.empty?
28
+ %tr.empty
29
+ %td{:colspan => 5}= t('tienda.delivery_services.no_services')
30
+ - else
31
+ - for delivery_service in @delivery_services
32
+ %tr
33
+ %td= link_to delivery_service.name, [:edit, delivery_service]
34
+ %td= link_to t('tienda.delivery_services.set_prices'), [delivery_service, :delivery_service_prices]
35
+ %td= delivery_service.courier
36
+ %td= boolean_tag delivery_service.active?
37
+ %td= boolean_tag delivery_service.default?
@@ -1,6 +1,15 @@
1
1
  - @page_title = t('tienda.delivery_services.delivery_services')
2
2
 
3
- = content_for :header do
4
- %p.buttons= link_to t('tienda.delivery_services.back'), :delivery_services, :class => 'button'
5
- %h2.delivery_services= t('tienda.delivery_services.delivery_services')
3
+ .row
4
+ .col-md-12
5
+ %h1.page-header
6
+ = t('tienda.delivery_services.delivery_services')
7
+ -# %small Lorem ipsum dolor
8
+ / /. ROW
9
+
10
+ .row
11
+ .col-md-12
12
+ %p.pull-right
13
+ = link_to t('tienda.delivery_services.back'), :delivery_services, class: 'btn btn-default'
14
+
6
15
  = render 'form'
@@ -1,55 +1,80 @@
1
1
  = field_set_tag t('tienda.orders.billing_address') do
2
- .splitContainer
3
- %dl.third
4
- %dt= f.label :first_name, t('tienda.orders.first_name')
5
- %dd= f.text_field :first_name, :class => 'focus text'
6
- %dl.third
7
- %dt= f.label :last_name, t('tienda.orders.last_name')
8
- %dd= f.text_field :last_name, :class => 'text'
9
- %dl.third
10
- %dt= f.label :company, t('tienda.orders.company')
11
- %dd= f.text_field :company, :class => 'text'
12
- %dl
13
- %dt= f.label :billing_address1, t('tienda.orders.address')
14
- %dd.space= f.text_field :billing_address1, :class => 'text'
15
- %dd.space= f.text_field :billing_address2, :class => 'text'
16
- %dd.space= f.text_field :billing_address3, :class => 'text'
17
- %dd.space= f.text_field :billing_address4, :class => 'text'
18
- .splitContainer
19
- %dl.half
20
- %dt= f.label :billing_postcode, t('tienda.orders.post_code')
21
- %dd= f.text_field :billing_postcode, :class => 'text'
22
- %dl.half
23
- %dt= f.label :billing_country_id, t('tienda.orders.country')
24
- %dd= f.collection_select :billing_country_id, Tienda::Country.ordered, :id, :name, {:include_blank => true}, {:data => {:placeholder => t('tienda.orders.select_country')}}
2
+ .row
3
+ .col-md-4
4
+ .form-group
5
+ = f.label :first_name, t('tienda.orders.first_name')
6
+ = f.text_field :first_name, class: 'focus form-control'
7
+ .col-md-4
8
+ .form-group
9
+ = f.label :last_name, t('tienda.orders.last_name')
10
+ = f.text_field :last_name, class: 'form-control'
11
+ .col-md-4
12
+ .form-group
13
+ = f.label :company, t('tienda.orders.company')
14
+ = f.text_field :company, class: 'form-control'
15
+ .row
16
+ .col-md-12
17
+  
18
+ .row
19
+ .col-md-12
20
+ .form-group
21
+ = f.label :billing_address1, t('tienda.orders.address')
22
+ = f.text_field :billing_address1, class: 'form-control'
23
+ = f.text_field :billing_address2, class: 'form-control'
24
+ = f.text_field :billing_address3, class: 'form-control'
25
+ = f.text_field :billing_address4, class: 'form-control'
26
+ .row
27
+ .col-md-12
28
+  
29
+ .row
30
+ .col-md-6
31
+ .form-group
32
+ = f.label :billing_postcode, t('tienda.orders.post_code')
33
+ = f.text_field :billing_postcode, class: 'form-control'
34
+ .col-md-6
35
+ .form-group
36
+ = f.label :billing_country_id, t('tienda.orders.country')
37
+ = f.collection_select :billing_country_id, Tienda::Country.ordered, :id, :name, {include_blank: true}, {class: 'form-control', data: {placeholder: t('tienda.orders.select_country')}}
38
+ .row
39
+ .col-md-12
40
+  
41
+ .row
42
+ .col-md-4
43
+ .form-group
44
+ = f.label :email_address, t('tienda.orders.email_address')
45
+ = f.text_field :email_address, class: 'form-control'
46
+ .col-md-4
47
+ .form-group
48
+ = f.label :phone_number, t('tienda.orders.phone_number')
49
+ = f.text_field :phone_number, class: 'form-control'
50
+ .col-md-4
51
+ .form-group
52
+ = f.label :separate_delivery_address, t('tienda.orders.separate_delivery_address')
53
+ .checkbox
54
+ %label
55
+ = f.check_box :separate_delivery_address
56
+ = t('tienda.orders.use_separate_delivery_address?')
25
57
 
26
- .splitContainer
27
- %dl.third
28
- %dt= f.label :email_address, t('tienda.orders.email_address')
29
- %dd= f.text_field :email_address, :class => 'text'
30
- %dl.third
31
- %dt= f.label :phone_number, t('tienda.orders.phone_number')
32
- %dd= f.text_field :phone_number, :class => 'text'
33
- %dl.third
34
- %dt= f.label :separate_delivery_address, t('tienda.orders.separate_delivery_address')
35
- %dd.checkbox
36
- = f.check_box :separate_delivery_address
37
- = f.label :separate_delivery_address, t('tienda.orders.use_separate_delivery_address?')
38
-
39
- = field_set_tag t('tienda.orders.delivery_address'), :class => 'delivery' do
40
- %dl
41
- %dt= f.label :delivery_name, t('tienda.orders.delivery_name')
42
- %dd= f.text_field :delivery_name, :class => 'text'
43
- %dl
44
- %dt= f.label :delivery_address1, t('tienda.orders.address')
45
- %dd.space= f.text_field :delivery_address1, :class => 'text'
46
- %dd.space= f.text_field :delivery_address2, :class => 'text'
47
- %dd.space= f.text_field :delivery_address3, :class => 'text'
48
- %dd.space= f.text_field :delivery_address4, :class => 'text'
49
- .splitContainer
50
- %dl.half
51
- %dt= f.label :delivery_postcode, t('tienda.orders.post_code')
52
- %dd= f.text_field :delivery_postcode, :class => 'text'
53
- %dl.half
54
- %dt= f.label :delivery_country_id, t('tienda.orders.country')
55
- %dd= f.collection_select :delivery_country_id, Tienda::Country.ordered, :id, :name, {:include_blank => true}, {:data => {:placeholder => t('tienda.orders.select_country')}}
58
+ = field_set_tag t('tienda.orders.delivery_address'), class: 'delivery' do
59
+ .row
60
+ .col-md-12
61
+ .form-group
62
+ = f.label :delivery_name, t('tienda.orders.delivery_name')
63
+ = f.text_field :delivery_name, class: 'form-control'
64
+ .row
65
+ .col-md-12
66
+ .form-group
67
+ = f.label :delivery_address1, t('tienda.orders.address')
68
+ = f.text_field :delivery_address1, class: 'form-control'
69
+ = f.text_field :delivery_address2, class: 'form-control'
70
+ = f.text_field :delivery_address3, class: 'form-control'
71
+ = f.text_field :delivery_address4, class: 'form-control'
72
+ .row
73
+ .col-md-6
74
+ .form-group
75
+ = f.label :delivery_postcode, t('tienda.orders.post_code')
76
+ = f.text_field :delivery_postcode, class: 'form-control'
77
+ .col-md-6
78
+ .form-group
79
+ = f.label :delivery_country_id, t('tienda.orders.country')
80
+ = f.collection_select :delivery_country_id, Tienda::Country.ordered, :id, :name, {include_blank: true}, {class: 'form-control', data: {placeholder: t('tienda.orders.select_country')}}
@@ -1,57 +1,60 @@
1
- .details
2
- .left
3
- %dl
4
- %dt= t('tienda.orders.name')
5
- %dd= @order.full_name
6
- %dt= t('tienda.orders.company')
7
- %dd= @order.company.blank? ? '-' : @order.company
8
- %dt
1
+ .panel.panel-default
2
+ .panel-heading
3
+ Order Details
4
+ .panel-body
5
+ .col-md-6
6
+ %dl
7
+ %dt= t('tienda.orders.name')
8
+ %dd= @order.full_name
9
+ %dt= t('tienda.orders.company')
10
+ %dd= @order.company.blank? ? '-' : @order.company
11
+ %dt
12
+ - if @order.separate_delivery_address?
13
+ = t('tienda.orders.billing_address')
14
+ - else
15
+ = t('tienda.orders.billing_delivery_address')
16
+
17
+ %dd= @order.billing_address1
18
+ %dd= @order.billing_address2
19
+ %dd= @order.billing_address3
20
+ %dd= @order.billing_address4
21
+ %dd= @order.billing_postcode
22
+ %dd= @order.billing_country.try(:name)
9
23
  - if @order.separate_delivery_address?
10
- = t('tienda.orders.billing_address')
11
- - else
12
- = t('tienda.orders.billing_delivery_address')
24
+ %dt= t('tienda.orders.delivery_address')
25
+ %dd= @order.delivery_name
26
+ %dd= @order.delivery_address1
27
+ %dd= @order.delivery_address2
28
+ %dd= @order.delivery_address3
29
+ %dd= @order.delivery_address4
30
+ %dd= @order.delivery_postcode
31
+ %dd= @order.delivery_country.try(:name)
32
+ .col-md-6
33
+ %dl
34
+ %dt= t('tienda.orders.email_address')
35
+ %dd= mail_to @order.email_address
36
+ %dt= t('tienda.orders.telephone')
37
+ %dd= @order.phone_number
38
+ %dt= t('tienda.orders.weight')
39
+ %dd= number_to_weight @order.total_weight
40
+ - if @order.received?
41
+ %dt= t('tienda.orders.build_time')
42
+ %dd= distance_of_time_in_words(@order.created_at, @order.received_at)
43
+ - if @order.invoiced?
44
+ %dt= t('tienda.orders.invoice_number')
45
+ %dd= @order.invoice_number
46
+ %dt= t('tienda.orders.order_balance')
47
+ %dd= boolean_tag @order.paid_in_full?, nil, true_text: number_to_currency(@order.balance), false_text: number_to_currency(@order.balance)
48
+ - if @order.accepted? && !@order.shipped?
49
+ = form_tag [:ship, @order] do
50
+ .form-group
51
+ = label_tag 'consignment_number', t('tienda.orders.consignment_number')
52
+ = text_field_tag 'consignment_number', '', class: 'form-control'
53
+ .form-group
54
+ = submit_tag t('tienda.orders.mark_as_shipped') , class: 'btn btn-primary btn-sm'
13
55
 
14
- %dd= @order.billing_address1
15
- %dd= @order.billing_address2
16
- %dd= @order.billing_address3
17
- %dd= @order.billing_address4
18
- %dd= @order.billing_postcode
19
- %dd= @order.billing_country.try(:name)
20
- - if @order.separate_delivery_address?
21
- %dt= t('tienda.orders.delivery_address')
22
- %dd= @order.delivery_name
23
- %dd= @order.delivery_address1
24
- %dd= @order.delivery_address2
25
- %dd= @order.delivery_address3
26
- %dd= @order.delivery_address4
27
- %dd= @order.delivery_postcode
28
- %dd= @order.delivery_country.try(:name)
29
- .right
30
- %dl
31
- %dt= t('tienda.orders.email_address')
32
- %dd= mail_to @order.email_address
33
- %dt= t('tienda.orders.telephone')
34
- %dd= @order.phone_number
35
- %dt= t('tienda.orders.weight')
36
- %dd= number_to_weight @order.total_weight
37
- - if @order.received?
38
- %dt= t('tienda.orders.build_time')
39
- %dd= distance_of_time_in_words(@order.created_at, @order.received_at)
40
- - if @order.invoiced?
41
- %dt= t('tienda.orders.invoice_number')
42
- %dd= @order.invoice_number
43
- %dt= t('tienda.orders.order_balance')
44
- %dd= boolean_tag @order.paid_in_full?, nil, :true_text => number_to_currency(@order.balance), :false_text => number_to_currency(@order.balance)
45
- - if @order.accepted? && !@order.shipped?
46
- = form_tag [:ship, @order] do
47
- %dl.form
48
- %dt.padding= label_tag 'consignment_number', t('tienda.orders.consignment_number')
49
- %dd= text_field_tag 'consignment_number', '', :class => 'text'
56
+ - unless @order.accepted? || @order.rejected?
50
57
  %dl.form
51
- %dd= submit_tag t('tienda.orders.mark_as_shipped') , :class => 'button green button-mini'
52
-
53
- - unless @order.accepted? || @order.rejected?
54
- %dl.form
55
- %dd
56
- = link_to t('tienda.orders.accept'), [:accept, @order], :method => :post, :class => 'button green'
57
- = link_to t('tienda.orders.reject'), [:reject, @order], :method => :post, :class => 'button purple'
58
+ %dd
59
+ = link_to t('tienda.orders.accept'), [:accept, @order], method: :post, class: 'btn btn-primary'
60
+ = link_to t('tienda.orders.reject'), [:reject, @order], method: :post, class: 'btn btn-danger'
@@ -1,6 +1,8 @@
1
- .order_items
2
- .table
3
- %table.data
1
+ .panel.panel-default
2
+ .panel-heading
3
+ = t('tienda.orders.order_items')
4
+ .panel-body
5
+ %table.table.table-hover
4
6
  %thead
5
7
  %tr
6
8
  %th.qty= t('tienda.orders.qty')
@@ -1,15 +1,19 @@
1
1
  = form_for [@order, Tienda::Payment.new(:amount => @order.balance)] do |f|
2
- %dl.text
3
- %dt= f.label :method, t('tienda.orders.method')
4
- %dd= f.text_field :method, :class => 'text'
5
- %dl.text
6
- %dt= f.label :reference, t('tienda.orders.reference')
7
- %dd= f.text_field :reference, :class => 'text'
8
- %dl.amount
9
- %dt= f.label :amount, t('tienda.orders.amount')
10
- %dd
11
- .moneyInput
12
- .currency= Tienda.settings.currency_unit.html_safe
13
- = f.text_field :amount, :class => 'text'
14
- %dl.submit
15
- %dd= f.submit t('tienda.orders.add_payment') , :class => 'button green'
2
+ .col-md-3
3
+ .form-group
4
+ = f.label :method, t('tienda.orders.method')
5
+ = f.text_field :method, class: 'form-control'
6
+ .col-md-3
7
+ .form-group
8
+ = f.label :reference, t('tienda.orders.reference')
9
+ = f.text_field :reference, class: 'form-control'
10
+ .col-md-3
11
+ .form-group
12
+ = f.label :amount, t('tienda.orders.amount')
13
+ .form-group.input-group
14
+ %span.input-group-addon= Tienda.settings.currency_unit.html_safe
15
+ = f.text_field :amount, class: 'form-control'
16
+ .col-md-3
17
+ .form-group
18
+ %br
19
+ = f.submit t('tienda.orders.add_payment') , class: 'btn btn-primary'
@@ -1,6 +1,6 @@
1
1
  - unless @payments.empty?
2
2
  .table
3
- %table.data
3
+ %table.table.table-hover
4
4
  %thead
5
5
  %tr
6
6
  %th= t('tienda.orders.id')
@@ -27,11 +27,12 @@
27
27
  #{t('tienda.orders.from_payment')} ##{payment.parent_payment_id}
28
28
  - else
29
29
  %td= number_to_currency payment.amount
30
- %td= boolean_tag payment.refunded?, nil, :true_text => number_to_currency(payment.amount_refunded)
30
+ %td= boolean_tag payment.refunded?, nil, true_text: number_to_currency(payment.amount_refunded)
31
31
  %td.refund
32
32
  - if payment.refundable?
33
- = link_to t('tienda.orders.refund'), [:refund, @order, payment], :class => 'button purple button-mini', :rel => 'dialog'
33
+ = link_to t('tienda.orders.refund'), [:refund, @order, payment], class: 'btn btn-danger btn-sm', rel: 'dialog'
34
34
  - else
35
- = link_to t('tienda.delete'), [@order, payment], :class => 'button purple button-mini', :data => {:confirm => t('tienda.orders.payment_remove_confirmation') }, :method => :delete
35
+ = link_to t('tienda.delete'), [@order, payment], class: 'btn btn-danger btn-sm', data: {confirm: t('tienda.orders.payment_remove_confirmation') }, method: :delete
36
36
  - else
37
- %p.notice= t('tienda.orders.no_payments')
37
+ .alert.alert-warning
38
+ = t('tienda.orders.no_payments')
@@ -1,24 +1,40 @@
1
- .orderSearch{:style => action_name == 'search' ? "display:block" : ''}
2
- = search_form_for @query, :url => search_orders_path, :html => { :method => :post } do |f|
3
- %dl.left
4
- %dt= f.label :id_eq, t('tienda.orders.order_number')
5
- %dd= f.text_field :id_eq
6
- %dt= f.label :first_name_or_last_name_or_company_cont, t('tienda.orders.customer')
7
- %dd= f.text_field :first_name_or_last_name_or_company_cont
8
- %dt= f.label :address1_or_address2_or_address3_or_address4_or_postcode_cont, t('tienda.orders.billing_address')
9
- %dd= f.text_field :billing_address1_or_billing_address2_or_billing_address3_or_billing_address4_or_billing_postcode_cont
10
- %dt= f.label :consignment_number_cont, t('tienda.orders.consignment_number')
11
- %dd= f.text_field :consignment_number_cont
12
- %dt= f.label :received_at_eq, t('tienda.orders.received_between')
13
- %dd
14
- = f.text_field :received_at_gteq, :class => 'small'
15
- →
16
- = f.text_field :received_at_lteq, :class => 'small'
17
- %dl.right
18
- %dt= f.label :email_address_cont, t('tienda.orders.email_address')
19
- %dd= f.text_field :email_address_cont
20
- %dt= f.label :phone_number_cont, t('tienda.orders.phone_number')
21
- %dd= f.text_field :phone_number_cont
22
- %dt= f.label :status_eq, t('tienda.orders.status')
23
- %dd= f.select :status_eq, [nil] + Tienda::Order::STATUSES.map { |s| [t("tienda.orders.statuses.#{s}"), s]}
24
- %dd= f.submit t('tienda.orders.search'), :class => 'button green button'
1
+ .panel.panel-default.search-orders.hide{style: action_name == 'search' ? 'display:block' : ''}
2
+ .panel-heading
3
+ Search orders
4
+ .panel-body
5
+ = search_form_for @query, url: search_orders_path, html: { method: :post } do |f|
6
+ .row
7
+ .col-md-6
8
+ .form-group
9
+ = f.label :id_eq, t('tienda.orders.order_number')
10
+ = f.text_field :id_eq, class: 'form-control'
11
+ .form-group
12
+ = f.label :first_name_or_last_name_or_company_cont, t('tienda.orders.customer')
13
+ = f.text_field :first_name_or_last_name_or_company_cont, class: 'form-control'
14
+ .form-group
15
+ = f.label :address1_or_address2_or_address3_or_address4_or_postcode_cont, t('tienda.orders.billing_address')
16
+ = f.text_field :billing_address1_or_billing_address2_or_billing_address3_or_billing_address4_or_billing_postcode_cont, class: 'form-control'
17
+ .form-group
18
+ = f.label :consignment_number_cont, t('tienda.orders.consignment_number')
19
+ = f.text_field :consignment_number_cont, class: 'form-control'
20
+ .row
21
+ .col-md-12
22
+ = f.label :received_at_eq, t('tienda.orders.received_between')
23
+ .col-md-5
24
+ = f.text_field :received_at_gteq, class: 'form-control col-md-5'
25
+ .col-md-1
26
+ %p.form-control-static
27
+ →
28
+ .col-md-6
29
+ = f.text_field :received_at_lteq, class: 'form-control col-md-5'
30
+ .col-md-6
31
+ .form-group
32
+ = f.label :email_address_cont, t('tienda.orders.email_address')
33
+ = f.text_field :email_address_cont, class: 'form-control'
34
+ .form-group
35
+ = f.label :phone_number_cont, t('tienda.orders.phone_number')
36
+ = f.text_field :phone_number_cont, class: 'form-control'
37
+ .form-group
38
+ = f.label :status_eq, t('tienda.orders.status')
39
+ = f.select :status_eq, [nil] + Tienda::Order::STATUSES.map { |s| [t("tienda.orders.statuses.#{s}"), s]}, {}, class: 'form-control'
40
+ = f.submit t('tienda.orders.search'), class: 'btn btn-primary'
@@ -1,35 +1,39 @@
1
- .status-bar
2
- %ul
3
- - if @order.received?
4
- %li.received
5
- %h4= t('tienda.orders.order_received')
6
- %p
7
- = t('tienda.orders.status_bar.on_date', on: @order.received_at.to_s(:short))
8
- = t('tienda.orders.status_bar.from_ip', ip: @order.ip_address)
1
+ .panel.panel-default
2
+ .panel-heading
3
+ Order Status
4
+ .panel-body
5
+ .status-bar
6
+ %ul
7
+ - if @order.received?
8
+ %li.received
9
+ %h4= t('tienda.orders.order_received')
10
+ %p
11
+ = t('tienda.orders.status_bar.on_date', on: @order.received_at.to_s(:short))
12
+ = t('tienda.orders.status_bar.from_ip', ip: @order.ip_address)
9
13
 
10
- - if @order.accepted?
11
- %li.accepted
12
- %h4= t('tienda.orders.order_accepted')
13
- %p
14
- = t('tienda.orders.status_bar.on_date', on: @order.accepted_at.to_s(:short))
15
- - if @order.accepter
16
- = t('tienda.orders.status_bar.by_user', user: @order.accepter.short_name)
14
+ - if @order.accepted?
15
+ %li.accepted
16
+ %h4= t('tienda.orders.order_accepted')
17
+ %p
18
+ = t('tienda.orders.status_bar.on_date', on: @order.accepted_at.to_s(:short))
19
+ - if @order.accepter
20
+ = t('tienda.orders.status_bar.by_user', user: @order.accepter.short_name)
17
21
 
18
- - elsif @order.rejected?
19
- %li.rejected
20
- %h4= t('tienda.orders.order_rejected')
21
- %p
22
- = t('tienda.orders.status_bar.on_date', on: @order.rejected_at.to_s(:short))
23
- - if @order.rejecter
24
- = t('tienda.orders.status_bar.by_user', user: @order.rejecter.short_name)
22
+ - elsif @order.rejected?
23
+ %li.rejected
24
+ %h4= t('tienda.orders.order_rejected')
25
+ %p
26
+ = t('tienda.orders.status_bar.on_date', on: @order.rejected_at.to_s(:short))
27
+ - if @order.rejecter
28
+ = t('tienda.orders.status_bar.by_user', user: @order.rejecter.short_name)
25
29
 
26
- - if @order.shipped?
27
- %li.shipped
28
- %h4= t('tienda.orders.order_shipped')
29
- %p
30
- = t('tienda.orders.status_bar.on_date', on: @order.shipped_at.to_s(:short))
31
- = t('tienda.orders.status_bar.by_user', user: @order.shipper.try(:short_name) || 'Unknown')
32
- - if @order.delivery_service && @order.courier_tracking_url
33
- %p= link_to t('tienda.orders.status_bar.tracking_url'), @order.courier_tracking_url
34
- - else
35
- %p= t('tienda.orders.status_bar.consignment_no_html', consignment_number: @order.consignment_number)
30
+ - if @order.shipped?
31
+ %li.shipped
32
+ %h4= t('tienda.orders.order_shipped')
33
+ %p
34
+ = t('tienda.orders.status_bar.on_date', on: @order.shipped_at.to_s(:short))
35
+ = t('tienda.orders.status_bar.by_user', user: @order.shipper.try(:short_name) || 'Unknown')
36
+ - if @order.delivery_service && @order.courier_tracking_url
37
+ %p= link_to t('tienda.orders.status_bar.tracking_url'), @order.courier_tracking_url
38
+ - else
39
+ %p= t('tienda.orders.status_bar.consignment_no_html', consignment_number: @order.consignment_number)
@@ -1,39 +1,46 @@
1
1
  - @page_title = t('tienda.orders.orders')
2
2
 
3
- = content_for :header do
4
- %p.buttons
5
- = link_to t('tienda.orders.new_order'), :new_order, :class => 'button green'
6
- = link_to t('tienda.orders.search_orders'), '#', :class => 'button', :rel => 'searchOrders'
7
- %h2.orders
8
- = t('tienda.orders.orders')
9
- %span= page_entries_info @orders
3
+ .row
4
+ .col-md-12
5
+ %h1.page-header
6
+ = t('tienda.orders.orders')
7
+ %small= page_entries_info @orders
8
+ / /. ROW
9
+ .row
10
+ .col-md-12
11
+ %p.pull-right
12
+ = link_to t('tienda.orders.new_order'), :new_order, class: 'btn btn-primary'
13
+ = link_to t('tienda.orders.search_orders'), '#', class: 'btn btn-default', rel: 'searchOrders'
10
14
 
11
15
  = render 'search_form'
12
16
 
13
- .table
14
- %table.data
15
- %thead
16
- %tr
17
- %th= t('tienda.orders.number')
18
- %th= t('tienda.orders.customer')
19
- %th= t('tienda.orders.status')
20
- %th= t('tienda.orders.products')
21
- %th= t('tienda.orders.total')
22
- %th= t('tienda.orders.payment')
23
- %tbody
24
- - if @orders.empty?
25
- %tr.empty
26
- %td{:colspan => 6}= t('tienda.orders.no_orders')
27
- - else
28
- - for order in @orders
29
- %tr
30
- %td= link_to order.number, order
31
- %td= order.customer_name
32
- %td= status_tag order.status
33
- %td
34
- %ul
35
- - for item in order.order_items
36
- %li #{item.quantity} x #{item.ordered_item.full_name}
37
- %td= number_to_currency order.total
38
- %td= boolean_tag order.paid_in_full?, nil, :true_text => number_to_currency(order.amount_paid), :false_text => number_to_currency(order.amount_paid)
39
- = paginate @orders
17
+ .panel.panel-default
18
+ .panel-heading
19
+ Listing orders
20
+ .panel-body
21
+ %table.table.table-hover
22
+ %thead
23
+ %tr
24
+ %th= t('tienda.orders.number')
25
+ %th= t('tienda.orders.customer')
26
+ %th= t('tienda.orders.status')
27
+ %th= t('tienda.orders.products')
28
+ %th= t('tienda.orders.total')
29
+ %th= t('tienda.orders.payment')
30
+ %tbody
31
+ - if @orders.empty?
32
+ %tr.empty
33
+ %td{colspan: 6}= t('tienda.orders.no_orders')
34
+ - else
35
+ - for order in @orders
36
+ %tr
37
+ %td= link_to order.number, order
38
+ %td= order.customer_name
39
+ %td= status_tag order.status
40
+ %td
41
+ %ul
42
+ - for item in order.order_items
43
+ %li #{item.quantity} x #{item.ordered_item.full_name}
44
+ %td= number_to_currency order.total
45
+ %td= boolean_tag order.paid_in_full?, nil, true_text: number_to_currency(order.amount_paid), false_text: number_to_currency(order.amount_paid)
46
+ = paginate @orders