solidus_backend 2.11.4 → 2.11.9
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of solidus_backend might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/assets/javascripts/spree/backend/views/tables/return_items.js +5 -0
- data/app/assets/javascripts/spree/backend/views/tables/selectable_table/sum_return_item_amount.js +10 -3
- data/app/controllers/spree/admin/products_controller.rb +5 -0
- data/app/views/spree/admin/orders/customer_details/show.html.erb +1 -1
- data/app/views/spree/admin/products/_form.html.erb +1 -1
- data/app/views/spree/admin/taxons/_form.html.erb +18 -1
- data/app/views/spree/admin/taxons/attachment_forms/_paperclip.html.erb +8 -1
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_en-AU.js +10 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_en-GB.js +10 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_en-IN.js +10 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_en-NZ.js +10 -0
- metadata +10 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce3323645ad10557194315179ec8014a1491c6dc124c7134f5859f514d8994bb
|
4
|
+
data.tar.gz: f7e60abb8f4a3557d349c936c2be5df2fcb88792acc6d9b6199a7b8430713946
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb579d97b6a804f90fcf8dfac6ad7ba143ca64c848c550fefa94bbe268aaf6f843ed101b093be73945d174cc19575e7129b4eaddbe82ee8891b6e2121d89f87d
|
7
|
+
data.tar.gz: ab688b957bd0eccb4e675cd36b69b3f93c8937a9256823a9c8cc3838675ef9b3579eab9092f1e6005f5bf1823d42c804b76709f99c30723fffecc3910669cb20
|
@@ -4,6 +4,11 @@ Spree.Views.Tables.ReturnItems = Backbone.View.extend({
|
|
4
4
|
var tfoot = document.createElement('tfoot')
|
5
5
|
new Spree.Views.Tables.SelectableTable.SumReturnItemAmount({el: tfoot, model: this.model});
|
6
6
|
this.$el.append(tfoot);
|
7
|
+
|
8
|
+
this.$el.find('input, select').not('.add-item').on('change', function(e) {
|
9
|
+
$(this).closest('tr').find('input.add-item').prop('checked', true)
|
10
|
+
.change();
|
11
|
+
});
|
7
12
|
}
|
8
13
|
},
|
9
14
|
})
|
data/app/assets/javascripts/spree/backend/views/tables/selectable_table/sum_return_item_amount.js
CHANGED
@@ -15,8 +15,11 @@ Spree.Views.Tables.SelectableTable.SumReturnItemAmount = Backbone.View.extend({
|
|
15
15
|
},
|
16
16
|
|
17
17
|
totalSelectedReturnItemAmount: function () {
|
18
|
-
var totalAmount = 0
|
18
|
+
var totalAmount = 0;
|
19
19
|
var selectedItems = [];
|
20
|
+
var decimals = 0;
|
21
|
+
var separator = Spree.t('currency_separator');
|
22
|
+
var amount, decimalAmount;
|
20
23
|
|
21
24
|
if(this.model.get('allSelected')) {
|
22
25
|
selectedItems = $('.selectable');
|
@@ -24,9 +27,13 @@ Spree.Views.Tables.SelectableTable.SumReturnItemAmount = Backbone.View.extend({
|
|
24
27
|
selectedItems = $(this.model.attributes.selectedItems);
|
25
28
|
}
|
26
29
|
selectedItems.each(function(_, selectedItem){
|
27
|
-
|
30
|
+
amount = $(selectedItem).data('price');
|
31
|
+
decimalAmount = amount.toString().split(separator)[1] || '';
|
32
|
+
decimals = Math.max(decimals, decimalAmount.length);
|
33
|
+
|
34
|
+
totalAmount += parseFloat(amount);
|
28
35
|
})
|
29
36
|
|
30
|
-
return totalAmount;
|
37
|
+
return accounting.formatNumber(totalAmount, decimals, Spree.t('currency_delimiter'), separator);
|
31
38
|
},
|
32
39
|
});
|
@@ -10,6 +10,7 @@ module Spree
|
|
10
10
|
helper_method :clone_object_url
|
11
11
|
before_action :split_params, only: [:create, :update]
|
12
12
|
before_action :normalize_variant_property_rules, only: [:update]
|
13
|
+
before_action :set_default_tax_category, only: [:new, :edit]
|
13
14
|
|
14
15
|
def show
|
15
16
|
redirect_to action: :edit
|
@@ -46,6 +47,10 @@ module Spree
|
|
46
47
|
|
47
48
|
private
|
48
49
|
|
50
|
+
def set_default_tax_category
|
51
|
+
@product.tax_category_id ||= @default_tax_category&.id
|
52
|
+
end
|
53
|
+
|
49
54
|
def split_params
|
50
55
|
if params[:product][:taxon_ids].present?
|
51
56
|
params[:product][:taxon_ids] = params[:product][:taxon_ids].split(',')
|
@@ -12,7 +12,7 @@
|
|
12
12
|
<section>
|
13
13
|
<%= content_tag :h4, t('spree.account') %>
|
14
14
|
<%= t('spree.email') %>: <%= @order.email %><br>
|
15
|
-
<%= t('spree.guest_checkout') %>: <%= @order.user ? t('spree.yes') : t('spree.no') %>
|
15
|
+
<%= t('spree.guest_checkout') %>: <%= @order.user.nil? ? t('spree.yes') : t('spree.no') %>
|
16
16
|
</section>
|
17
17
|
|
18
18
|
<section>
|
@@ -158,7 +158,7 @@
|
|
158
158
|
<%= f.field_container :tax_category do %>
|
159
159
|
<%= f.label :tax_category_id, Spree::TaxCategory.model_name.human %>
|
160
160
|
<%= f.field_hint :tax_category, default_tax_category: @default_tax_category&.name %>
|
161
|
-
<%= f.collection_select(:tax_category_id, @tax_categories, :id, :name, { include_blank: t('spree.match_choices.none')
|
161
|
+
<%= f.collection_select(:tax_category_id, @tax_categories, :id, :name, { include_blank: t('spree.match_choices.none') }, { class: 'custom-select' }) %>
|
162
162
|
<%= f.error_message_on :tax_category %>
|
163
163
|
<% end %>
|
164
164
|
</div>
|
@@ -20,7 +20,24 @@
|
|
20
20
|
</div>
|
21
21
|
<% end %>
|
22
22
|
|
23
|
-
|
23
|
+
<% if f.object.class.attachment_definitions.size > 1 %>
|
24
|
+
<%= render "spree/admin/taxons/attachment_forms/#{f.object.attachment_partial_name}", f: f %>
|
25
|
+
<% else %>
|
26
|
+
<%= f.field_container :icon do %>
|
27
|
+
<%= f.label :icon %><br>
|
28
|
+
<%= f.file_field :icon %>
|
29
|
+
<% if f.object.icon_present? %>
|
30
|
+
<%= image_tag f.object.icon(:mini) %>
|
31
|
+
<%= link_to t('spree.actions.remove'),
|
32
|
+
admin_taxonomy_taxon_attachment_path(@taxonomy,
|
33
|
+
@taxon.id,
|
34
|
+
attachment_definition: :icon,
|
35
|
+
authenticity_token: form_authenticity_token),
|
36
|
+
method: :delete,
|
37
|
+
class: 'btn btn-sm btn-danger' %>
|
38
|
+
<% end %>
|
39
|
+
<% end %>
|
40
|
+
<% end %>
|
24
41
|
</div>
|
25
42
|
|
26
43
|
<div class="col-5">
|
@@ -1,8 +1,15 @@
|
|
1
|
+
<%
|
2
|
+
Spree::Deprecation.warn(
|
3
|
+
"This partial with its support for multiple Spree::Taxon attachments is deprecated and will be removed in a future " \
|
4
|
+
"version of Solidus, please overwrite the standard view if you need to support custom attachments."
|
5
|
+
)
|
6
|
+
%>
|
7
|
+
|
1
8
|
<% f.object.class.attachment_definitions.each do |attachment, definition| %>
|
2
9
|
<%= f.field_container attachment do %>
|
3
10
|
<%= f.label attachment %><br>
|
4
11
|
<%= f.file_field attachment %>
|
5
|
-
<% if f.object.send(attachment)
|
12
|
+
<% if f.object.send(:"#{attachment}_present?") %>
|
6
13
|
<%= image_tag f.object.send(attachment, definition[:default_style]) %>
|
7
14
|
<%= link_to t('spree.actions.remove'),
|
8
15
|
admin_taxonomy_taxon_attachment_path(@taxonomy,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_backend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.11.
|
4
|
+
version: 2.11.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Solidus Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus_api
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.11.
|
19
|
+
version: 2.11.9
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.11.
|
26
|
+
version: 2.11.9
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: solidus_core
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.11.
|
33
|
+
version: 2.11.9
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.11.
|
40
|
+
version: 2.11.9
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: coffee-rails
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -770,6 +770,10 @@ files:
|
|
770
770
|
- vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_da.js
|
771
771
|
- vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_de.js
|
772
772
|
- vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_el.js
|
773
|
+
- vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_en-AU.js
|
774
|
+
- vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_en-GB.js
|
775
|
+
- vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_en-IN.js
|
776
|
+
- vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_en-NZ.js
|
773
777
|
- vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_en-US.js
|
774
778
|
- vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_es-MX.js
|
775
779
|
- vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_es.js
|