tienda 1.1.2 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/tienda/application.coffee +114 -84
- data/app/assets/javascripts/tienda/custom-scripts.js +182 -0
- data/app/assets/javascripts/tienda/custom.js +200 -0
- data/app/assets/javascripts/tienda/jquery.metisMenu.js +45 -0
- data/app/assets/javascripts/tienda/morris.js +1913 -0
- data/app/assets/javascripts/tienda/raphael-2.1.0.min.js +10 -0
- data/app/assets/stylesheets/tienda/application.scss +2 -577
- data/app/assets/stylesheets/tienda/custom-styles.scss +518 -0
- data/app/assets/stylesheets/tienda/morris-0.4.3.min.css +2 -0
- data/app/controllers/tienda/dashboard_controller.rb +11 -1
- data/app/controllers/tienda/products_controller.rb +7 -3
- data/app/controllers/tienda/sessions_controller.rb +1 -1
- data/app/controllers/tienda/stock_level_adjustments_controller.rb +1 -5
- data/app/helpers/tienda/application_helper.rb +10 -4
- data/app/models/tienda/country.rb +3 -5
- data/app/models/tienda/delivery_service.rb +5 -7
- data/app/models/tienda/order/actions.rb +3 -3
- data/app/models/tienda/order/delivery.rb +1 -1
- data/app/models/tienda/order.rb +8 -8
- data/app/models/tienda/order_item.rb +11 -11
- data/app/models/tienda/product.rb +38 -54
- data/app/models/tienda/stock_level_adjustment.rb +9 -7
- data/app/models/tienda/tax_rate.rb +5 -7
- data/app/models/tienda/user.rb +4 -4
- data/app/validators/permalink_validator.rb +1 -1
- data/app/views/layouts/tienda/application.html.haml +29 -22
- data/app/views/layouts/tienda/sub.html.haml +44 -6
- data/app/views/tienda/application/_navbar.html.haml +164 -0
- data/app/views/tienda/application/_sidebar.html.haml +6 -0
- data/app/views/tienda/countries/_form.html.haml +40 -34
- data/app/views/tienda/countries/edit.html.haml +12 -3
- data/app/views/tienda/countries/index.html.haml +31 -21
- data/app/views/tienda/countries/new.html.haml +11 -3
- data/app/views/tienda/dashboard/home.html.haml +156 -0
- data/app/views/tienda/delivery_service_prices/_form.html.haml +53 -39
- data/app/views/tienda/delivery_service_prices/edit.html.haml +12 -3
- data/app/views/tienda/delivery_service_prices/index.html.haml +28 -19
- data/app/views/tienda/delivery_service_prices/new.html.haml +12 -3
- data/app/views/tienda/delivery_services/_form.html.haml +48 -35
- data/app/views/tienda/delivery_services/edit.html.haml +11 -5
- data/app/views/tienda/delivery_services/index.html.haml +34 -24
- data/app/views/tienda/delivery_services/new.html.haml +12 -3
- data/app/views/tienda/orders/_form.html.haml +78 -53
- data/app/views/tienda/orders/_order_details.html.haml +57 -54
- data/app/views/tienda/orders/_order_items.html.haml +5 -3
- data/app/views/tienda/orders/_payments_form.html.haml +18 -14
- data/app/views/tienda/orders/_payments_table.html.haml +6 -5
- data/app/views/tienda/orders/_search_form.html.haml +40 -24
- data/app/views/tienda/orders/_status_bar.html.haml +36 -32
- data/app/views/tienda/orders/index.html.haml +41 -34
- data/app/views/tienda/orders/new.html.haml +22 -11
- data/app/views/tienda/orders/show.html.haml +24 -18
- data/app/views/tienda/product_categories/_form.html.haml +34 -22
- data/app/views/tienda/product_categories/edit.html.haml +12 -4
- data/app/views/tienda/product_categories/index.html.haml +26 -16
- data/app/views/tienda/product_categories/new.html.haml +11 -3
- data/app/views/tienda/products/_form.html.haml +163 -126
- data/app/views/tienda/products/_table.html.haml +49 -40
- data/app/views/tienda/products/edit.html.haml +14 -6
- data/app/views/tienda/products/index.html.haml +35 -7
- data/app/views/tienda/sessions/new.html.haml +8 -6
- data/app/views/tienda/sessions/reset.html.haml +5 -5
- data/app/views/tienda/settings/edit.html.haml +20 -14
- data/app/views/tienda/stock_level_adjustments/_table.html.haml +33 -0
- data/app/views/tienda/stock_level_adjustments/index.html.haml +20 -39
- data/app/views/tienda/tax_rates/form.html.haml +41 -25
- data/app/views/tienda/tax_rates/index.html.haml +23 -13
- data/app/views/tienda/users/_form.html.haml +36 -24
- data/app/views/tienda/users/edit.html.haml +12 -3
- data/app/views/tienda/users/index.html.haml +23 -13
- data/app/views/tienda/users/new.html.haml +10 -3
- data/app/views/tienda/variants/form.html.haml +98 -57
- data/app/views/tienda/variants/index.html.haml +47 -29
- data/config/initializers/assets.rb +9 -0
- data/config/locales/en.yml +3 -2
- data/config/routes.rb +1 -1
- data/db/migrate/20150517191600_add_stock_counter_cache.rb +5 -0
- data/db/migrate/20150517195800_remove_stock_level_item_polymorphism.rb +6 -0
- data/db/migrate/20150517212100_update_stock_counter_cache.rb +5 -0
- data/db/migrate/20150603235417_add_document_to_orders.rb +5 -0
- data/lib/tienda/default_navigation.rb +9 -8
- data/lib/tienda/navigation_manager.rb +2 -5
- data/lib/tienda/version.rb +1 -1
- data/lib/tienda.rb +2 -6
- metadata +54 -65
@@ -1,14 +1,25 @@
|
|
1
1
|
- @page_title = t('tienda.orders.new_order')
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
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
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
=
|
12
|
-
|
13
|
-
|
14
|
-
|
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
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
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
|
-
|
4
|
-
.
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
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
|
-
|
23
|
-
-
|
24
|
-
|
25
|
-
|
26
|
-
|
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
|
-
|
4
|
-
|
5
|
-
|
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
|
-
.
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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
|
-
|
3
|
-
|
4
|
-
|
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
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
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
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
%
|
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
|
-
%
|
34
|
-
%
|
35
|
-
%
|
36
|
-
%
|
37
|
-
%
|
38
|
-
%
|
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{:
|
41
|
-
%td= text_field_tag 'product[product_attributes_array][][key]', '', :
|
42
|
-
%td= text_field_tag 'product[product_attributes_array][][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') , '#', :
|
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, :
|
50
|
-
%td= text_field_tag 'product[product_attributes_array][][value]', attribute.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"), '#', :
|
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') , '#', :
|
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
|
-
|
58
|
-
.
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
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
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
= f.
|
107
|
-
|
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
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
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
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
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
|
-
|
130
|
-
.
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
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
|
-
|
143
|
-
-
|
144
|
-
|
145
|
-
|
146
|
-
|
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
|
-
%
|
3
|
-
%
|
4
|
-
%
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
%
|
12
|
-
|
13
|
-
-
|
14
|
-
|
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
|
-
%
|
17
|
-
|
18
|
-
|
19
|
-
%td
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
%
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
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
|