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,14 +1,25 @@
1
1
  - @page_title = t('tienda.orders.new_order')
2
2
 
3
- = content_for :header do
4
- %p.buttons= link_to t('tienda.orders.back_to_orders'), :orders, :class => 'button grey'
5
- %h2.orders= t('tienda.orders.new_order')
3
+ .row
4
+ .col-md-12
5
+ %h1.page-header
6
+ = t('tienda.orders.new_order')
7
+ -# %small Lorem ipsum dolor
8
+ / /. ROW
9
+ .row
10
+ .col-md-12
11
+ %p.pull-right
12
+ = link_to t('tienda.orders.back_to_orders'), :orders, class: 'btn btn-default'
6
13
 
7
- = form_for @order, :html => {:class => 'orderForm newOrder'} do |f|
8
- = f.error_messages
9
- = render 'form', :f => f
10
- = field_set_tag t('tienda.orders.ordered_products'), :class => 'padded' do
11
- = render 'order_items_form', :f => f
12
- %p.submit
13
- = f.submit t('tienda.orders.create_order'), :class => 'button green'
14
- = link_to t('tienda.cancel'), :orders, :class => 'button grey'
14
+ .panel.panel-default
15
+ .panel-heading
16
+ = t('tienda.orders.new_order')
17
+ .panel-body
18
+ = form_for @order, html: {class: 'orderForm newOrder'} do |f|
19
+ = f.error_messages
20
+ = render 'form', f: f
21
+ = field_set_tag t('tienda.orders.ordered_products'), class: 'padded' do
22
+ = render 'order_items_form', f: f
23
+ %p.submit
24
+ = f.submit t('tienda.orders.create_order'), class: 'btn btn-primary'
25
+ = link_to t('tienda.cancel'), :orders, class: 'btn btn-default'
@@ -1,25 +1,31 @@
1
1
  - @page_title = "#{t('tienda.orders.order')} ##{@order.number}"
2
2
 
3
- = content_for :header do
4
- %p.buttons
5
- = link_to t('tienda.edit'), [:edit, @order], :class => 'button'
6
- - if @order.accepted?
7
- = link_to t('tienda.orders.despatch_note.despatch_note'), [:despatch_note, @order], :class => 'button', :rel => 'print'
8
- = link_to t('tienda.orders.back_to_orders'), :orders, :class => 'button grey'
9
- %h2.orders= t('tienda.orders.order_no_html', order_number: @order.number)
3
+ .row
4
+ .col-md-12
5
+ %h1.page-header
6
+ = t('tienda.orders.order_no_html', order_number: @order.number)
7
+ -# %small Lorem ipsum dolor
8
+ / /. ROW
9
+ .row
10
+ .col-md-12
11
+ %p.pull-right
12
+ = link_to t('tienda.edit'), [:edit, @order], class: 'btn btn-default'
13
+ - if @order.accepted?
14
+ = link_to t('tienda.orders.despatch_note.despatch_note'), [:despatch_note, @order], class: 'btn btn-success', rel: 'print'
15
+ = link_to t('tienda.orders.back_to_orders'), :orders, class: 'btn btn-default'
10
16
 
11
- #order
17
+ - if @order.received?
18
+ = render 'order_details'
19
+ = render 'status_bar'
20
+ - else
21
+ %p.warning= t('tienda.orders.in_progress_warning')
12
22
 
13
- - if @order.received?
14
- = render 'order_details'
15
- = render 'status_bar'
16
- - else
17
- %p.warning= t('tienda.orders.in_progress_warning')
23
+ = render 'order_items'
18
24
 
19
- = field_set_tag t('tienda.orders.order_items'), :class => 'padded' do
20
- = render 'order_items'
21
-
22
- - if @order.received?
23
- = field_set_tag t('tienda.orders.payments'), :class => 'padded orderPayments' do
25
+ - if @order.received?
26
+ .panel.panel-default
27
+ .panel-heading
28
+ = t('tienda.orders.payments')
29
+ .panel-body
24
30
  = render 'payments_table'
25
31
  = render 'payments_form'
@@ -1,26 +1,38 @@
1
1
  = form_for @product_category do |f|
2
2
  = f.error_messages
3
- = field_set_tag t('tienda.product_category.category_details') do
4
- .splitContainer
5
- %dl.half
6
- %dt= f.label :name, t('tienda.product_category.name')
7
- %dd= f.text_field :name, :class => 'focus text'
8
- %dl.half
9
- %dt= f.label :permalink, t('tienda.product_category.permalink')
10
- %dd= f.text_field :permalink, :class => 'text'
11
- %dl
12
- %dt= f.label :description, t('tienda.product_category.description')
13
- %dd= f.text_area :description, :class => 'text'
3
+ .panel.panel-default
4
+ .panel-heading
5
+ = t('tienda.product_category.category_details')
6
+ .panel-body
7
+ .row
8
+ .col-md-6
9
+ .form-group
10
+ = f.label :name, t('tienda.product_category.name')
11
+ = f.text_field :name, class: 'focus form-control'
12
+ .col-md-6
13
+ .form-group
14
+ = f.label :permalink, t('tienda.product_category.permalink')
15
+ = f.text_field :permalink, class: 'form-control'
16
+ .row
17
+ .col-md-12
18
+ .form-group
19
+ = f.label :description, t('tienda.product_category.description')
20
+ = f.text_area :description, class: 'form-control'
14
21
 
15
- = field_set_tag t('tienda.product_category.attachments') do
16
- %dl
17
- %dt= f.label :image_file, t('tienda.product_category.image')
18
- %dd
19
- = attachment_preview @product_category.image
20
- %p= f.file_field :image_file
22
+ .panel.panel-default
23
+ .panel-heading
24
+ = t('tienda.product_category.attachments')
25
+ .panel-body
26
+ .row
27
+ .col-md-12
28
+ = f.label :image_file, t('tienda.product_category.image')
29
+ %div
30
+ = attachment_preview @product_category.image
31
+ %p= f.file_field :image_file, class: 'form-control'
21
32
 
22
- %p.submit
23
- - unless @product_category.new_record?
24
- %span.right= link_to t('tienda.delete') , @product_category, :class => 'button purple', :method => :delete, :data => {:confirm => t('tienda.product_category.delete_confirmation') }
25
- = f.submit t('tienda.submit'), :class => 'button green'
26
- = link_to t('tienda.cancel') , :product_categories, :class => 'button'
33
+ .panel.panel-default
34
+ .panel-body
35
+ - unless @product_category.new_record?
36
+ %span.pull-right= link_to t('tienda.delete') , @product_category, class: 'btn btn-danger', method: :delete, data: {confirm: t('tienda.product_category.delete_confirmation') }
37
+ = f.submit t('tienda.submit'), class: 'btn btn-primary'
38
+ = link_to t('tienda.cancel') , :product_categories, class: 'btn btn-default'
@@ -1,6 +1,14 @@
1
1
  - @page_title = t('tienda.product_category.product_categories')
2
- = content_for :header do
3
- %p.buttons= link_to t('tienda.product_category.back_to_categories'), :product_categories, :class => 'button'
4
- %h2.products= t('tienda.product_category.product_categories')
5
- = render 'form'
6
2
 
3
+ .row
4
+ .col-md-12
5
+ %h1.page-header
6
+ = t('tienda.product_category.product_categories')
7
+ -# %small Lorem ipsum dolor
8
+ / /. ROW
9
+ .row
10
+ .col-md-12
11
+ %p.pull-right
12
+ = link_to t('tienda.product_category.back_to_categories'), :product_categories, class: 'btn btn-primary'
13
+
14
+ = render 'form'
@@ -1,19 +1,29 @@
1
1
  - @page_title = t('tienda.product_category.product_categories')
2
2
 
3
- = content_for :header do
4
- %p.buttons=link_to t('tienda.product_category.new_category'), :new_product_category, :class => 'button green'
5
- %h2.products= t('tienda.product_category.product_categories')
3
+ .row
4
+ .col-md-12
5
+ %h1.page-header
6
+ = t('tienda.product_category.product_categories')
7
+ -# %small Lorem ipsum dolor
8
+ / /. ROW
9
+ .row
10
+ .col-md-12
11
+ %p.pull-right
12
+ = link_to t('tienda.product_category.new_category'), :new_product_category, class: 'btn btn-primary'
6
13
 
7
- .table
8
- %table.data
9
- %thead
10
- %tr
11
- %th= t('tienda.product_category.name')
12
- %tbody
13
- - if @product_categories.empty?
14
- %tr.empty
15
- %td= t('tienda.product_category.no_categories')
16
- - else
17
- - for cat in @product_categories
18
- %tr
19
- %td= link_to cat.name, [:edit, cat]
14
+ .panel.panel-default
15
+ .panel-heading
16
+ Listing product categories
17
+ .panel-body
18
+ %table.table.table-hover
19
+ %thead
20
+ %tr
21
+ %th= t('tienda.product_category.name')
22
+ %tbody
23
+ - if @product_categories.empty?
24
+ %tr.empty
25
+ %td= t('tienda.product_category.no_categories')
26
+ - else
27
+ - for cat in @product_categories
28
+ %tr
29
+ %td= link_to cat.name, [:edit, cat]
@@ -1,6 +1,14 @@
1
1
  - @page_title = t('tienda.product_category.product_categories')
2
- = content_for :header do
3
- %p.buttons= link_to t('tienda.product_category.back_to_categories'), :product_categories, :class => 'button'
4
- %h2.products= t('tienda.product_category.product_categories')
2
+
3
+ .row
4
+ .col-md-12
5
+ %h1.page-header
6
+ = t('tienda.product_category.product_categories')
7
+ -# %small Lorem ipsum dolor
8
+ / /. ROW
9
+ .row
10
+ .col-md-12
11
+ %p.pull-right
12
+ = link_to t('tienda.product_category.back_to_categories'), :product_categories, class: 'btn btn-primary'
5
13
 
6
14
  = render 'form'
@@ -1,146 +1,183 @@
1
1
  = form_for @product, :html => {:multipart => true} do |f|
2
2
  = f.error_messages
3
- = field_set_tag t('tienda.products.product_information') do
4
- %dl
5
- %dt= f.label :product_category_id, t('tienda.products.product_category')
6
- %dd= f.collection_select :product_category_id, Tienda::ProductCategory.ordered, :id, :name, {:prompt => false}, {:class => 'chosen'}
3
+ .panel.panel-default
4
+ .panel-heading
5
+ = t('tienda.products.product_information')
6
+ .panel-body
7
+ .row
8
+ .col-md-12
9
+ .form-group
10
+ = f.label :product_category_id, t('tienda.products.product_category')
11
+ = f.collection_select :product_category_id, Tienda::ProductCategory.ordered, :id, :name, {prompt: false}, {class: 'form-control'}
12
+ .row
13
+ .col-md-4
14
+ .form-group
15
+ = f.label :name, t('tienda.products.name')
16
+ = f.text_field :name, class: 'form-control focus'
17
+ .col-md-4
18
+ .form-group
19
+ = f.label :permalink, t('tienda.products.permalink')
20
+ = f.text_field :permalink, class: 'form-control'
21
+ .col-md-4
22
+ .form-group
23
+ = f.label :sku, t('tienda.products.sku')
24
+ = f.text_field :sku, class: 'form-control'
25
+ .row
26
+ .col-md-12
27
+ .form-group
28
+ = f.label :description, t('tienda.products.description')
29
+ = f.text_area :description, class: 'form-control'
30
+ .row
31
+ .col-md-12
32
+ .form-group
33
+ = f.label :short_description, t('tienda.products.short_description')
34
+ = f.text_area :short_description, class: 'form-control'
35
+ .row
36
+ .col-md-12
37
+ .form-group
38
+ = f.label :in_the_box, t('tienda.products.in_the_box')
39
+ = f.text_area :in_the_box, class: 'form-control'
7
40
 
8
- .splitContainer
9
- %dl.third
10
- %dt= f.label :name, t('tienda.products.name')
11
- %dd= f.text_field :name, :class => 'text focus'
12
- %dl.third
13
- %dt= f.label :permalink, t('tienda.products.permalink')
14
- %dd= f.text_field :permalink, :class => 'text'
15
- %dl.third
16
- %dt= f.label :sku, t('tienda.products.sku')
17
- %dd= f.text_field :sku, :class => 'text'
18
- %dl
19
- %dt= f.label :description, t('tienda.products.description')
20
- %dd= f.text_area :description, :class => 'text'
21
- %dl
22
- %dt= f.label :short_description, t('tienda.products.short_description')
23
- %dd= f.text_area :short_description, :class => 'text'
24
- %dl
25
- %dt= f.label :in_the_box, t('tienda.products.in_the_box')
26
- %dd= f.text_area :in_the_box, :class => 'text'
27
-
28
- = field_set_tag t('tienda.products.attributes') do
29
- .margin
30
- %table.productAttributes
41
+ .panel.panel-default
42
+ .panel-heading
43
+ = t('tienda.products.attributes')
44
+ .panel-body
45
+ %table.productAttributes.table.table-hover
31
46
  %thead
32
47
  %tr
33
- %td= t('tienda.products.name')
34
- %td= t('tienda.products.value')
35
- %td.searchable= t('tienda.products.searchable?')
36
- %td.searchable= t('tienda.products.public?')
37
- %td.remove= t('tienda.products.remove')
38
- %td
48
+ %th= t('tienda.products.name')
49
+ %th= t('tienda.products.value')
50
+ %th.searchable= t('tienda.products.searchable?')
51
+ %th.searchable= t('tienda.products.public?')
52
+ %th.remove= t('tienda.products.remove')
53
+ %th
39
54
  %tbody
40
- %tr.template{:style => 'display:none;'}
41
- %td= text_field_tag 'product[product_attributes_array][][key]', '', :placeholder => t('tienda.products.name')
42
- %td= text_field_tag 'product[product_attributes_array][][value]', '', :placeholder => t('tienda.products.value')
55
+ %tr.template{style: 'display:none;'}
56
+ %td= text_field_tag 'product[product_attributes_array][][key]', '', placeholder: t('tienda.products.name'), class: 'form-control'
57
+ %td= text_field_tag 'product[product_attributes_array][][value]', '', placeholder: t('tienda.products.value'), class: 'form-control'
43
58
  %td.searchable= check_box_tag 'product[product_attributes_array][][searchable]', '1'
44
59
  %td.searchable= check_box_tag 'product[product_attributes_array][][public]', '1'
45
- %td.remove= link_to t('tienda.remove') , '#', :class => 'button button-mini purple'
60
+ %td.remove= link_to t('tienda.remove') , '#', class: 'btn btn-sm btn-danger'
46
61
  %td.handle
47
62
  - for attribute in @product.product_attributes
48
63
  %tr
49
- %td= text_field_tag 'product[product_attributes_array][][key]', attribute.key, :placeholder => t('tienda.products.name')
50
- %td= text_field_tag 'product[product_attributes_array][][value]', attribute.value, :placeholder => t('tienda.products.value')
64
+ %td= text_field_tag 'product[product_attributes_array][][key]', attribute.key, placeholder: t('tienda.products.name'), class: 'form-control'
65
+ %td= text_field_tag 'product[product_attributes_array][][value]', attribute.value, placeholder: t('tienda.products.value'), class: 'form-control'
51
66
  %td.searchable= check_box_tag 'product[product_attributes_array][][searchable]', '1', attribute.searchable?
52
67
  %td.searchable= check_box_tag 'product[product_attributes_array][][public]', '1', attribute.public?
53
- %td.remove= link_to t("tienda.remove"), '#', :class => 'button button-mini purple'
68
+ %td.remove= link_to t("tienda.remove"), '#', class: 'btn btn-sm btn-danger'
54
69
  %td.handle
55
- %p.addAttribute= link_to t('tienda.products.add_attribute') , '#', :data => {:behavior => 'addAttributeToAttributesTable'}, :class => 'button button-mini green'
70
+ %p.addAttribute= link_to t('tienda.products.add_attribute') , '#', data: {behavior: 'addAttributeToAttributesTable'}, class: 'btn btn-success btn-sm'
71
+
72
+ .panel.panel-default
73
+ .panel-heading
74
+ = t('tienda.products.attachments')
75
+ .panel-body
76
+ .row
77
+ .col-md-6
78
+ .form-group
79
+ = f.label :default_image_file, t('tienda.products.default_image')
80
+ %p= f.file_field :default_image_file, class: 'form-control'
81
+ %div
82
+ = attachment_preview @product.default_image
83
+ .col-md-6
84
+ .form-group
85
+ = f.label :second_image_file, t('tienda.products.second_image')
86
+ %p= f.file_field :second_image_file, class: 'form-control'
87
+ %div
88
+ = attachment_preview @product.second_image
89
+ .row
90
+ .col-md-6
91
+ .form-group
92
+ = f.label :third_image_file, t('tienda.products.third_image')
93
+ %p= f.file_field :third_image_file, class: 'form-control'
94
+ %div
95
+ = attachment_preview @product.third_image
96
+ .col-md-6
97
+ .form-group
98
+ = f.label :fourth_image_file, t('tienda.products.fourth_image')
99
+ %p= f.file_field :fourth_image_file, class: 'form-control'
100
+ %div
101
+ = attachment_preview @product.fourth_image
102
+ .row
103
+ .col-md-6
104
+ .form-group
105
+ = f.label :fifth_image_file, t('tienda.products.fifth_image')
106
+ %p= f.file_field :fifth_image_file, class: 'form-control'
107
+ %div
108
+ = attachment_preview @product.fifth_image
109
+ .col-md-6
110
+ .form-group
111
+ = f.label :data_sheet_file, t('tienda.products.datasheet')
112
+ %p= f.file_field :data_sheet_file, class: 'form-control'
113
+ %div
114
+ = attachment_preview @product.data_sheet
56
115
 
57
- = field_set_tag t('tienda.products.attachments') do
58
- .splitContainer
59
- %dl.half
60
- %dt
61
- = f.label :default_image_file, t('tienda.products.default_image')
62
- %p= f.file_field :default_image_file
63
- %dd
64
- = attachment_preview @product.default_image
65
- %dl.half
66
- %dt
67
- = f.label :second_image_file, t('tienda.products.second_image')
68
- %p= f.file_field :second_image_file
69
- %dd
70
- = attachment_preview @product.second_image
71
- .splitContainer
72
- %dl.half
73
- %dt
74
- = f.label :third_image_file, t('tienda.products.third_image')
75
- %p= f.file_field :third_image_file
76
- %dd
77
- = attachment_preview @product.third_image
78
- %dl.half
79
- %dt
80
- = f.label :fourth_image_file, t('tienda.products.fourth_image')
81
- %p= f.file_field :fourth_image_file
82
- %dd
83
- = attachment_preview @product.fourth_image
84
- .splitContainer
85
- %dl.half
86
- %dt
87
- = f.label :fifth_image_file, t('tienda.products.fifth_image')
88
- %p= f.file_field :fifth_image_file
89
- %dd
90
- = attachment_preview @product.fifth_image
91
- %dl.half
92
- %dt
93
- = f.label :data_sheet_file, t('tienda.products.datasheet')
94
- %p= f.file_field :data_sheet_file
95
- %dd
96
- = attachment_preview @product.data_sheet
116
+ .panel.panel-default
117
+ .panel-heading
118
+ = t('tienda.products.pricing')
119
+ .panel-body
120
+ - unless @product.has_variants?
121
+ .row
122
+ .col-md-4
123
+ .form-group
124
+ = f.label :price, t('tienda.products.price')
125
+ .form-group.input-group
126
+ %span.input-group-addon= Tienda.settings.currency_unit.html_safe
127
+ = f.text_field :price, class: 'form-control'
97
128
 
98
- - unless @product.has_variants?
99
- = field_set_tag t('tienda.products.pricing') do
100
- .splitContainer
101
- %dl.third
102
- %dt= f.label :price, t('tienda.products.price')
103
- %dd
104
- .moneyInput
105
- .currency= Tienda.settings.currency_unit.html_safe
106
- = f.text_field :price, :class => 'text'
107
- %dl.third
108
- %dt= f.label :cost_price, t('tienda.products.cost_price')
109
- %dd
110
- .moneyInput
111
- .currency= Tienda.settings.currency_unit.html_safe
112
- = f.text_field :cost_price, :class => 'text'
113
- %dl.third
114
- %dt= f.label :tax_rate_id, t('tienda.products.tax_rate')
115
- %dd= f.collection_select :tax_rate_id, Tienda::TaxRate.ordered, :id, :description, {:include_blank => true}, {:class => 'chosen-with-deselect', :data => {:placeholder => t('tienda.products.no_tax')}}
129
+ .col-md-4
130
+ .form-group
131
+ = f.label :cost_price, t('tienda.products.cost_price')
132
+ .form-group.input-group
133
+ %span.input-group-addon= Tienda.settings.currency_unit.html_safe
134
+ = f.text_field :cost_price, class: 'form-control'
135
+ .col-md-4
136
+ .form-group
137
+ = f.label :tax_rate_id, t('tienda.products.tax_rate')
138
+ = f.collection_select :tax_rate_id, Tienda::TaxRate.ordered, :id, :description, {include_blank: true}, {class: 'form-control', data: {placeholder: t('tienda.products.no_tax')}}
116
139
 
117
- = field_set_tag t('tienda.products.stock_control') do
118
- .splitContainer
119
- %dl.half
120
- %dt= f.label :weight, t('tienda.products.weight')
121
- %dd= f.text_field :weight, :class => 'text'
140
+ .panel.panel-default
141
+ .panel-heading
142
+ = t('tienda.products.stock_control')
143
+ .panel-body
144
+ .row
145
+ .col-md-6
146
+ .form-group
147
+ = f.label :weight, t('tienda.products.weight')
148
+ = f.text_field :weight, class: 'form-control'
122
149
 
123
- %dl.half
124
- %dt= f.label :stock_control, t('tienda.products.stock_control')
125
- %dd.checkbox
126
- = f.check_box :stock_control
127
- = f.label :stock_control, t('tienda.products.enable_stock_control?')
150
+ .col-md-6
151
+ .form-group
152
+ = f.label :stock_control, t('tienda.products.stock_control')
153
+ .checkbox
154
+ %label
155
+ = f.check_box :stock_control
156
+ = t('tienda.products.enable_stock_control?')
128
157
 
129
- = field_set_tag t('tienda.products.website_properties') do
130
- .splitContainer
131
- %dl.half
132
- %dt= f.label :active, t('tienda.products.on_sale?')
133
- %dd.checkbox
134
- = f.check_box :active
135
- = f.label :active, t('tienda.products.on_sale_info')
136
- %dl.half
137
- %dt= f.label :featured, t('tienda.products.featured?')
138
- %dd.checkbox
139
- = f.check_box :featured
140
- = f.label :featured, t('tienda.products.featured_info')
158
+ .panel.panel-default
159
+ .panel-heading
160
+ = t('tienda.products.website_properties')
161
+ .panel-body
162
+ .row
163
+ .col-md-6
164
+ .form-group
165
+ = f.label :active, t('tienda.products.on_sale?')
166
+ .checkbox
167
+ %label
168
+ = f.check_box :active
169
+ = t('tienda.products.on_sale_info')
170
+ .col-md-6
171
+ .form-group
172
+ = f.label :featured, t('tienda.products.featured?')
173
+ .checkbox
174
+ %label
175
+ = f.check_box :featured
176
+ =t('tienda.products.featured_info')
141
177
 
142
- %p.submit
143
- - unless @product.new_record?
144
- %span.right= link_to t('tienda.delete') , @product, :class => 'button purple', :method => :delete, :data => {:confirm => "Are you sure you wish to remove this product?"}
145
- = f.submit t('tienda.submit'), :class => 'button green'
146
- = link_to t('tienda.cancel'), :products, :class => 'button'
178
+ .panel.panel-default
179
+ .panel-body
180
+ - unless @product.new_record?
181
+ %span.pull-right= link_to t('tienda.delete') , @product, class: 'btn btn-danger', method: :delete, data: {confirm: "Are you sure you wish to remove this product?"}
182
+ = f.submit t('tienda.submit'), class: 'btn btn-primary'
183
+ = link_to t('tienda.cancel'), :products, class: 'btn btn-default'
@@ -1,42 +1,51 @@
1
- .table
2
- %table.data
3
- %thead
4
- %tr
5
- %th{:width => '20%'}= t('tienda.products.sku')
6
- %th{:width => '40%'}= t('tienda.products.name')
7
- %th{:width => '25%'}= t('tienda.products.price_variants')
8
- %th{:width => '15%'}= t('tienda.products.stock')
9
- %tbody
10
- - if products.empty?
11
- %tr.empty
12
- %td{:colspan => 4}= t('tienda.products.no_products')
13
- - else
14
- - for category, products in products
1
+ %table.table.table-hover
2
+ %thead
3
+ %tr
4
+ %th{width: '20%'}= t('tienda.products.sku')
5
+ %th{width: '40%'}= t('tienda.products.name')
6
+ %th{width: '25%'}= t('tienda.products.price_variants')
7
+ %th{width: '15%'}= t('tienda.products.stock')
8
+ %tbody
9
+ - if products.empty?
10
+ %tr.empty
11
+ %td{colspan: 4}= t('tienda.products.no_products')
12
+ - else
13
+ - for category, products in products
14
+ %tr
15
+ %th.info{colspan: 4}= category.name
16
+ - for product in products
15
17
  %tr
16
- %th{:colspan => 4}= category.name
17
- - for product in products
18
- %tr
19
- %td= product.sku
20
- %td= link_to product.name, [:edit, product]
21
- - if product.has_variants?
22
- %td.table{:colspan => 2}
23
- %table.data
24
- - for variant in product.variants
25
- %tr
26
- %td{:width => '40%'}= link_to variant.name, edit_product_variant_path(product, variant)
27
- %td{:width => '30%'}= number_to_currency variant.price
28
- %td{:width => '30%'}
29
- - if variant.stock_control?
30
- %span.float-right= link_to t('tienda.products.edit') , stock_level_adjustments_path(:item_type => variant.class, :item_id => variant.id), :class => 'edit', :rel => 'dialog', :data => {:dialog_width => 700, :dialog_behavior => 'stockLevelAdjustments'}
31
- = boolean_tag(variant.in_stock?, nil, :true_text => variant.stock, :false_text => t('tienda.products.no_stock'))
32
- - else
33
- ∞
34
- - else
35
- %td= number_to_currency product.price
36
- %td
37
- - if product.stock_control?
38
- %span.float-right= link_to t('tienda.products.edit'), stock_level_adjustments_path(:item_type => product.class, :item_id => product.id), :class => 'edit', :rel => 'dialog', :data => {:dialog_width => 700, :dialog_behavior => 'stockLevelAdjustments'}
39
- = boolean_tag(product.in_stock?, nil, :true_text => product.stock, :false_text => t('tienda.products.no_stock'))
40
- - else
41
- ∞
18
+ %td= product.sku
19
+ %td= link_to product.name, [:edit, product]
20
+ - if product.has_variants?
21
+ %td{colspan: 2}
22
+ %table.table.table-hover
23
+ - for variant in product.variants
24
+ %tr
25
+ %td{width: '40%'}= link_to variant.name, edit_product_variant_path(product, variant)
26
+ %td{width: '30%'}= number_to_currency variant.price
27
+ %td{width: '30%'}
28
+ - if variant.stock_control?
29
+ %span.float-right= link_to t('tienda.products.edit') , stock_level_adjustments_path(item_type: variant.class, item_id: variant.id), class: 'btn btn-default btn-sm', rel: 'dialog', data: {toggle: 'modal', target: '#stockModal'}
30
+ %span.label{class: "#{variant.in_stock? ? 'label-default' : 'label-danger'}"}
31
+ = boolean_tag(variant.in_stock?, nil, true_text: variant.stock, false_text: t('tienda.products.no_stock'))
32
+ - else
33
+ ∞
34
+ - else # Product has not variants
35
+ %td= number_to_currency product.price
36
+ %td
37
+ - if product.stock_control?
38
+ %span.float-right= link_to t('tienda.products.edit'), stock_level_adjustments_path(item_type: product.class, item_id: product.id), class: 'btn btn-default btn-sm', rel: 'dialog', data: {toggle: 'modal', target: '#stockModal'}
39
+ %span.label{class: "#{product.in_stock? ? 'label-default' : 'label-danger'}"}
40
+ = boolean_tag(product.in_stock?, nil, true_text: product.stock_count, false_text: t('tienda.products.no_stock'))
41
+ - else
42
+ ∞
42
43
 
44
+ / Modal
45
+ #stockModal.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "myModalLabel", :role => "dialog", :tabindex => "-1"}
46
+ .modal-dialog
47
+ .modal-content
48
+
49
+ / /.modal-content
50
+ / /.modal-dialog
51
+ / /.modal