solidus_backend 2.2.2 → 2.3.0.beta1
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.js +1 -2
- data/app/assets/javascripts/spree/backend/address_states.js +1 -1
- data/app/assets/javascripts/spree/backend/adjustments.js.coffee +1 -1
- data/app/assets/javascripts/spree/backend/admin.js +37 -41
- data/app/assets/javascripts/spree/backend/components/editable_table.js.coffee +3 -0
- data/app/assets/javascripts/spree/backend/images/index.js.coffee +1 -1
- data/app/assets/javascripts/spree/backend/images/upload.js +13 -189
- data/app/assets/javascripts/spree/backend/models/image_upload.js +76 -0
- data/app/assets/javascripts/spree/backend/models/index.js +2 -0
- data/app/assets/javascripts/spree/backend/models/taxonomy.js +3 -0
- data/app/assets/javascripts/spree/backend/namespaces.js +3 -1
- data/app/assets/javascripts/spree/backend/payments/new.js +8 -36
- data/app/assets/javascripts/spree/backend/promotions.js.coffee +1 -1
- data/app/assets/javascripts/spree/backend/select_payments.js.coffee +0 -12
- data/app/assets/javascripts/spree/backend/shipments.js +1 -1
- data/app/assets/javascripts/spree/backend/spree-select2.js +1 -1
- data/app/assets/javascripts/spree/backend/taxonomy.js.coffee +101 -95
- data/app/assets/javascripts/spree/backend/templates/products/upload_progress.hbs +5 -3
- data/app/assets/javascripts/spree/backend/views/images/upload_progress.js +48 -0
- data/app/assets/javascripts/spree/backend/views/images/upload_zone.js +39 -0
- data/app/assets/javascripts/spree/backend/views/index.js +6 -0
- data/app/assets/javascripts/spree/backend/views/order/address.js +1 -5
- data/app/assets/javascripts/spree/backend/views/payment/edit_credit_card.js +23 -0
- data/app/assets/javascripts/spree/backend/views/payment/new.js +25 -0
- data/app/assets/javascripts/spree/backend/views/state_select.js +4 -4
- data/app/assets/javascripts/spree/backend/views/tables/editable_table.js.coffee +14 -0
- data/app/assets/javascripts/spree/backend/views/tables/editable_table_row.js.coffee +45 -0
- data/app/assets/stylesheets/spree/backend/components/_date-picker.scss +0 -1
- data/app/assets/stylesheets/spree/backend/components/_editable_table.scss +37 -0
- data/app/assets/stylesheets/spree/backend/plugins/_bootstrap_tooltip.scss +2 -2
- data/app/assets/stylesheets/spree/backend/sections/_products.scss +0 -8
- data/app/assets/stylesheets/spree/backend/sections/_style_guide.scss +15 -9
- data/app/assets/stylesheets/spree/backend/shared/_icons.scss +14 -14
- data/app/assets/stylesheets/spree/backend/shared/_tables.scss +1 -2
- data/app/assets/stylesheets/spree/backend/shared/_utilities.scss +13 -0
- data/app/assets/stylesheets/spree/backend/spree_admin.scss +1 -1
- data/app/controllers/spree/admin/cancellations_controller.rb +1 -1
- data/app/controllers/spree/admin/orders/customer_details_controller.rb +1 -1
- data/app/controllers/spree/admin/orders_controller.rb +3 -10
- data/app/controllers/spree/admin/payment_methods_controller.rb +19 -6
- data/app/controllers/spree/admin/payments_controller.rb +2 -2
- data/app/controllers/spree/admin/products_controller.rb +3 -9
- data/app/controllers/spree/admin/promotion_rules_controller.rb +5 -1
- data/app/controllers/spree/admin/promotions_controller.rb +1 -1
- data/app/controllers/spree/admin/properties_controller.rb +1 -1
- data/app/controllers/spree/admin/reports_controller.rb +24 -21
- data/app/controllers/spree/admin/resource_controller.rb +25 -14
- data/app/controllers/spree/admin/style_guide_controller.rb +4 -0
- data/app/controllers/spree/admin/users_controller.rb +1 -1
- data/app/controllers/spree/admin/variants_controller.rb +5 -0
- data/app/helpers/spree/admin/navigation_helper.rb +6 -2
- data/app/helpers/spree/promotion_rules_helper.rb +2 -2
- data/app/models/spree/backend_configuration.rb +1 -0
- data/app/views/spree/admin/adjustments/_form.html.erb +1 -1
- data/app/views/spree/admin/customer_returns/_return_item_selection.html.erb +2 -2
- data/app/views/spree/admin/customer_returns/new.html.erb +1 -1
- data/app/views/spree/admin/images/_form.html.erb +1 -1
- data/app/views/spree/admin/images/_image_row.html.erb +22 -4
- data/app/views/spree/admin/images/create.js.erb +8 -5
- data/app/views/spree/admin/images/index.html.erb +4 -8
- data/app/views/spree/admin/orders/_risk_analysis.html.erb +6 -7
- data/app/views/spree/admin/orders/_shipment.html.erb +1 -1
- data/app/views/spree/admin/orders/confirm/_customer_details.html.erb +1 -1
- data/app/views/spree/admin/orders/confirm/_payments.html.erb +1 -1
- data/app/views/spree/admin/orders/index.html.erb +3 -3
- data/app/views/spree/admin/payment_methods/_form.html.erb +5 -5
- data/app/views/spree/admin/payments/_form.html.erb +2 -2
- data/app/views/spree/admin/payments/_list.html.erb +1 -1
- data/app/views/spree/admin/payments/show.html.erb +1 -1
- data/app/views/spree/admin/payments/source_forms/_gateway.html.erb +2 -7
- data/app/views/spree/admin/prices/_form.html.erb +2 -2
- data/app/views/spree/admin/prices/edit.html.erb +2 -0
- data/app/views/spree/admin/prices/index.html.erb +5 -4
- data/app/views/spree/admin/prices/new.html.erb +4 -0
- data/app/views/spree/admin/product_properties/index.html.erb +1 -1
- data/app/views/spree/admin/products/_form.html.erb +4 -3
- data/app/views/spree/admin/products/index.html.erb +3 -3
- data/app/views/spree/admin/products/new.html.erb +2 -2
- data/app/views/spree/admin/products/new.js.erb +0 -3
- data/app/views/spree/admin/promotion_actions/create.js.erb +2 -6
- data/app/views/spree/admin/promotion_rules/create.js.erb +0 -8
- data/app/views/spree/admin/promotions/_actions.html.erb +2 -2
- data/app/views/spree/admin/promotions/_form.html.erb +1 -1
- data/app/views/spree/admin/promotions/_promotion_action.html.erb +3 -4
- data/app/views/spree/admin/promotions/_promotion_rule.html.erb +3 -3
- data/app/views/spree/admin/promotions/_rules.html.erb +1 -1
- data/app/views/spree/admin/promotions/actions/_create_item_adjustments.html.erb +6 -2
- data/app/views/spree/admin/promotions/actions/_promotion_calculators_with_custom_fields.html.erb +1 -1
- data/app/views/spree/admin/promotions/calculators/distributed_amount/_fields.html.erb +54 -0
- data/app/views/spree/admin/promotions/calculators/tiered_flat_rate/_fields.html.erb +33 -14
- data/app/views/spree/admin/promotions/calculators/tiered_percent/_fields.html.erb +33 -14
- data/app/views/spree/admin/promotions/index.html.erb +1 -1
- data/app/views/spree/admin/promotions/rules/_first_repeat_purchase_since.html.erb +1 -1
- data/app/views/spree/admin/promotions/rules/_item_total.html.erb +1 -1
- data/app/views/spree/admin/promotions/rules/_landing_page.html.erb +1 -1
- data/app/views/spree/admin/promotions/rules/_nth_order.html.erb +1 -1
- data/app/views/spree/admin/promotions/rules/_product.html.erb +1 -1
- data/app/views/spree/admin/promotions/rules/_taxon.html.erb +1 -1
- data/app/views/spree/admin/promotions/rules/_user_role.html.erb +2 -2
- data/app/views/spree/admin/refunds/edit.html.erb +1 -1
- data/app/views/spree/admin/refunds/new.html.erb +1 -1
- data/app/views/spree/admin/reimbursements/edit.html.erb +2 -2
- data/app/views/spree/admin/reports/sales_total.html.erb +1 -1
- data/app/views/spree/admin/return_authorizations/_form.html.erb +4 -4
- data/app/views/spree/admin/shared/_address_form.html.erb +2 -2
- data/app/views/spree/admin/shared/_calculator_fields.html.erb +1 -1
- data/app/views/spree/admin/shared/_product_tabs.html.erb +4 -4
- data/app/views/spree/admin/shared/_report_order_criteria.html.erb +1 -1
- data/app/views/spree/admin/shared/_variant_search.html.erb +1 -1
- data/app/views/spree/admin/shipping_methods/_form.html.erb +1 -1
- data/app/views/spree/admin/states/index.html.erb +1 -1
- data/app/views/spree/admin/stock_items/_stock_management.html.erb +1 -1
- data/app/views/spree/admin/stock_locations/_form.html.erb +1 -1
- data/app/views/spree/admin/stock_transfers/edit.html.erb +1 -1
- data/app/views/spree/admin/stock_transfers/index.html.erb +1 -1
- data/app/views/spree/admin/stock_transfers/new.html.erb +1 -1
- data/app/views/spree/admin/store_credits/_form.html.erb +1 -1
- data/app/views/spree/admin/store_credits/_update_reason_field.html.erb +1 -1
- data/app/views/spree/admin/stores/_form.html.erb +1 -1
- data/app/views/spree/admin/style_guide/topics/forms/_building_forms.html.erb +4 -8
- data/app/views/spree/admin/style_guide/topics/forms/_buttons.html.erb +6 -0
- data/app/views/spree/admin/style_guide/topics/forms/_helper_text.html.erb +13 -0
- data/app/views/spree/admin/style_guide/topics/forms/_inputs.html.erb +96 -0
- data/app/views/spree/admin/style_guide/topics/forms/_labels.html.erb +6 -0
- data/app/views/spree/admin/style_guide/topics/forms/_validation.html.erb +8 -1
- data/app/views/spree/admin/style_guide/topics/layout/_full_width_table_layout.html.erb +10 -0
- data/app/views/spree/admin/style_guide/topics/layout/_helpful_layout.html.erb +0 -0
- data/app/views/spree/admin/style_guide/topics/layout/_sidebar_layout.html.erb +4 -0
- data/app/views/spree/admin/style_guide/topics/messaging/_flashes.html.erb +10 -4
- data/app/views/spree/admin/style_guide/topics/messaging/_tooltips.html.erb +45 -0
- data/app/views/spree/admin/style_guide/topics/tables/_forms_in_tables.html.erb +4 -0
- data/app/views/spree/admin/style_guide/topics/typography/_lists.html.erb +1 -1
- data/app/views/spree/admin/tax_rates/_form.html.erb +17 -3
- data/app/views/spree/admin/tax_rates/index.html.erb +12 -3
- data/app/views/spree/admin/taxonomies/edit.erb +1 -8
- data/app/views/spree/admin/taxons/_form.html.erb +6 -4
- data/app/views/spree/admin/taxons/edit.html.erb +0 -15
- data/app/views/spree/admin/taxons/index.html.erb +1 -1
- data/app/views/spree/admin/variants/_form.html.erb +8 -9
- data/app/views/spree/admin/variants/new.js.erb +0 -1
- data/config/routes.rb +1 -1
- data/spec/controllers/spree/admin/orders/customer_details_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/orders_controller_spec.rb +16 -4
- data/spec/controllers/spree/admin/payment_methods_controller_spec.rb +2 -2
- data/spec/controllers/spree/admin/payments_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/products_controller_spec.rb +33 -0
- data/spec/controllers/spree/admin/variants_controller_spec.rb +39 -13
- data/spec/features/admin/configuration/payment_methods_spec.rb +11 -11
- data/spec/features/admin/configuration/shipping_methods_spec.rb +1 -1
- data/spec/features/admin/configuration/states_spec.rb +4 -4
- data/spec/features/admin/configuration/store_spec.rb +3 -3
- data/spec/features/admin/configuration/tax_rates_spec.rb +1 -1
- data/spec/features/admin/orders/adjustments_spec.rb +1 -1
- data/spec/features/admin/orders/customer_details_spec.rb +10 -11
- data/spec/features/admin/orders/listing_spec.rb +1 -1
- data/spec/features/admin/orders/new_order_spec.rb +4 -11
- data/spec/features/admin/orders/order_details_spec.rb +20 -30
- data/spec/features/admin/orders/return_payment_state_spec.rb +60 -0
- data/spec/features/admin/orders/shipments_spec.rb +7 -0
- data/spec/features/admin/products/edit/images_spec.rb +48 -9
- data/spec/features/admin/products/edit/variants_spec.rb +1 -1
- data/spec/features/admin/products/option_types_spec.rb +2 -2
- data/spec/features/admin/products/products_spec.rb +49 -3
- data/spec/features/admin/products/stock_management_spec.rb +1 -3
- data/spec/features/admin/products/variant_spec.rb +20 -0
- data/spec/features/admin/promotion_adjustments_spec.rb +35 -34
- data/spec/features/admin/promotions/option_value_rule_spec.rb +2 -2
- data/spec/features/admin/promotions/product_rule_spec.rb +1 -1
- data/spec/features/admin/promotions/tiered_calculator_spec.rb +2 -2
- data/spec/features/admin/promotions/user_rule_spec.rb +2 -2
- data/spec/features/admin/stock_transfer_spec.rb +11 -8
- data/spec/helpers/admin/navigation_helper_spec.rb +23 -0
- metadata +26 -18
- data/app/assets/javascripts/spree/backend/images/new.js.coffee +0 -7
- data/app/assets/stylesheets/spree/backend/sections/_payments.scss +0 -14
- data/app/helpers/spree/admin/images_helper.rb +0 -17
- data/app/views/spree/admin/orders/_add_line_item.html.erb +0 -15
- data/app/views/spree/admin/prices/new.js.erb +0 -2
- data/app/views/spree/admin/products/_properties_form.erb +0 -10
- data/app/views/spree/admin/promotions/_tab.html.erb +0 -1
- data/app/views/spree/admin/shared/_report_criteria.html.erb +0 -17
- data/app/views/spree/admin/states/_new.html.erb +0 -7
- data/app/views/spree/admin/stock_locations/_transfer_stock_form.html.erb +0 -38
- data/app/views/spree/admin/stock_transfers/_stock_movements.html.erb +0 -27
- data/app/views/spree/admin/taxons/_taxon_table.html.erb +0 -23
@@ -0,0 +1,23 @@
|
|
1
|
+
//= require jquery.payment
|
2
|
+
Spree.Views.Payment.EditCreditCard = Backbone.View.extend({
|
3
|
+
initialize: function() {
|
4
|
+
this.$(".cardNumber").payment('formatCardNumber');
|
5
|
+
this.$(".cardExpiry").payment('formatCardExpiry');
|
6
|
+
this.$(".cardCode").payment('formatCardCVC');
|
7
|
+
|
8
|
+
this.render()
|
9
|
+
},
|
10
|
+
|
11
|
+
events: {
|
12
|
+
'change [name=card]': 'render',
|
13
|
+
'change .cardNumber': 'render'
|
14
|
+
},
|
15
|
+
|
16
|
+
render: function() {
|
17
|
+
var isNew = (this.$('[name=card]:checked').val() === 'new') || (this.$('[name=card]').length == 0);
|
18
|
+
this.$('.js-new-credit-card-form').toggleClass('hidden', !isNew)
|
19
|
+
this.$('.js-new-credit-card-form :input').prop('disabled', !isNew)
|
20
|
+
|
21
|
+
this.$(".ccType").val($.payment.cardType(this.$('.cardNumber').val()))
|
22
|
+
}
|
23
|
+
})
|
@@ -0,0 +1,25 @@
|
|
1
|
+
Spree.Views.Payment.New = Backbone.View.extend({
|
2
|
+
initialize: function() {
|
3
|
+
this.onSelectMethod()
|
4
|
+
},
|
5
|
+
|
6
|
+
events: {
|
7
|
+
'change [name="payment[payment_method_id]"]': 'onSelectMethod',
|
8
|
+
'change .cardNumber': 'onChangeCard'
|
9
|
+
},
|
10
|
+
|
11
|
+
onSelectMethod: function(e) {
|
12
|
+
this.selectedId = parseInt(this.$('input[name="payment[payment_method_id]"]:checked').val())
|
13
|
+
this.render();
|
14
|
+
},
|
15
|
+
|
16
|
+
render: function() {
|
17
|
+
var view = this;
|
18
|
+
this.$('.payment-method-settings .payment-methods').each(function() {
|
19
|
+
var $method = $(this);
|
20
|
+
var selected = $method.data("payment-method-id") === view.selectedId;
|
21
|
+
$method.toggleClass('hidden', !selected);
|
22
|
+
$method.find(':input').prop('disabled', !selected);
|
23
|
+
});
|
24
|
+
}
|
25
|
+
});
|
@@ -24,7 +24,7 @@ Spree.Views.StateSelect = Backbone.View.extend({
|
|
24
24
|
onChange: function() {
|
25
25
|
this.model.set({
|
26
26
|
state_name: this.$state_input.val(),
|
27
|
-
state_id: this.$state_select.
|
27
|
+
state_id: this.$state_select.val()
|
28
28
|
})
|
29
29
|
},
|
30
30
|
|
@@ -39,11 +39,11 @@ Spree.Views.StateSelect = Backbone.View.extend({
|
|
39
39
|
},
|
40
40
|
|
41
41
|
render: function() {
|
42
|
-
this.$state_select.empty().
|
42
|
+
this.$state_select.empty().hide();
|
43
43
|
this.$state_input.hide();
|
44
44
|
|
45
45
|
if (!this.states.fetched) {
|
46
|
-
this.$state_select.show().
|
46
|
+
this.$state_select.show().prop("disabled", true);
|
47
47
|
} else if (this.states.length) {
|
48
48
|
var $state_select = this.$state_select;
|
49
49
|
this.states.each(function(state) {
|
@@ -52,7 +52,7 @@ Spree.Views.StateSelect = Backbone.View.extend({
|
|
52
52
|
);
|
53
53
|
})
|
54
54
|
this.$state_select.val(this.model.get("state_id"))
|
55
|
-
this.$state_select.show().
|
55
|
+
this.$state_select.show().prop("disabled", false);
|
56
56
|
} else {
|
57
57
|
this.$state_input.prop('disabled', false).show();
|
58
58
|
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Spree.Views.Tables ||= {}
|
2
|
+
|
3
|
+
class Spree.Views.Tables.EditableTable
|
4
|
+
@add: ($el) ->
|
5
|
+
new Spree.Views.Tables.EditableTableRow el: $el
|
6
|
+
|
7
|
+
@append: (html) ->
|
8
|
+
$row = $(html)
|
9
|
+
|
10
|
+
$('#images-table').removeClass('hidden').find('tbody').append($row)
|
11
|
+
$row.find('.select2').select2()
|
12
|
+
$('.no-objects-found').hide()
|
13
|
+
|
14
|
+
@add($row)
|
@@ -0,0 +1,45 @@
|
|
1
|
+
Spree.Views.Tables.EditableTableRow = Backbone.View.extend
|
2
|
+
events:
|
3
|
+
"select2-open": "onEdit"
|
4
|
+
"focus input": "onEdit"
|
5
|
+
"click [data-action=save]": "onSave"
|
6
|
+
"click [data-action=cancel]": "onCancel"
|
7
|
+
'keyup input': 'onKeypress'
|
8
|
+
|
9
|
+
onEdit: (e) ->
|
10
|
+
return if @$el.hasClass('editing')
|
11
|
+
@$el.addClass('editing')
|
12
|
+
|
13
|
+
@$el.find('input, select').each ->
|
14
|
+
$input = $(this)
|
15
|
+
$input.data 'original-value', $input.val()
|
16
|
+
|
17
|
+
onCancel: (e) ->
|
18
|
+
e.preventDefault()
|
19
|
+
@$el.removeClass("editing")
|
20
|
+
|
21
|
+
@$el.find('input, select').each ->
|
22
|
+
$input = $(this)
|
23
|
+
originalValue = $input.data('original-value')
|
24
|
+
$input.val(originalValue).change()
|
25
|
+
|
26
|
+
onSave: (e) ->
|
27
|
+
e.preventDefault()
|
28
|
+
|
29
|
+
Spree.ajax @$el.find('.actions [data-action=save]').attr('href'),
|
30
|
+
data: @$el.find('select, input').serialize()
|
31
|
+
dataType: 'json'
|
32
|
+
method: 'put'
|
33
|
+
success: (response) =>
|
34
|
+
@$el.removeClass("editing")
|
35
|
+
error: (response) =>
|
36
|
+
show_flash 'error', response.responseJSON.error
|
37
|
+
|
38
|
+
ENTER_KEY: 13
|
39
|
+
ESC_KEY: 27
|
40
|
+
|
41
|
+
onKeypress: (e) ->
|
42
|
+
key = e.keyCode || e.which
|
43
|
+
switch key
|
44
|
+
when @ENTER_KEY then @onSave(e)
|
45
|
+
when @ESC_KEY then @onCancel(e)
|
@@ -0,0 +1,37 @@
|
|
1
|
+
.inline-editable-table tr:not(:hover):not(.editing) {
|
2
|
+
input {
|
3
|
+
border: 1px solid transparent;
|
4
|
+
color: inherit;
|
5
|
+
background-color: transparent;
|
6
|
+
}
|
7
|
+
|
8
|
+
.select2-arrow {
|
9
|
+
display: none;
|
10
|
+
}
|
11
|
+
|
12
|
+
.select2-choice {
|
13
|
+
background-color: transparent;
|
14
|
+
border-color: transparent;
|
15
|
+
color: inherit;
|
16
|
+
}
|
17
|
+
|
18
|
+
.select2-chosen {
|
19
|
+
color: inherit;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
.inline-editable-table tr {
|
24
|
+
.fa-check, .fa-cancel {
|
25
|
+
display: none !important;
|
26
|
+
}
|
27
|
+
|
28
|
+
&.editing {
|
29
|
+
.fa-check, .fa-cancel {
|
30
|
+
display: inline-block !important;
|
31
|
+
}
|
32
|
+
|
33
|
+
.fa {
|
34
|
+
display: none;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
@@ -38,10 +38,10 @@
|
|
38
38
|
&.action-edit, &.action-save, &.action-capture, &.action-add {
|
39
39
|
@include bootstrap-tooltip-color($brand-success);
|
40
40
|
}
|
41
|
-
&.action-clone {
|
41
|
+
&.action-clone, &.action-cancel {
|
42
42
|
@include bootstrap-tooltip-color($brand-warning);
|
43
43
|
}
|
44
|
-
&.action-void, &.action-failure, &.action-
|
44
|
+
&.action-void, &.action-failure, &.action-remove {
|
45
45
|
@include bootstrap-tooltip-color($brand-danger);
|
46
46
|
}
|
47
47
|
}
|
@@ -26,7 +26,8 @@
|
|
26
26
|
flex: 1;
|
27
27
|
}
|
28
28
|
|
29
|
-
ul
|
29
|
+
ul.example,
|
30
|
+
ul.example ul {
|
30
31
|
list-style: none;
|
31
32
|
padding-left: 0;
|
32
33
|
}
|
@@ -64,10 +65,6 @@
|
|
64
65
|
margin: 4rem 0;
|
65
66
|
}
|
66
67
|
|
67
|
-
&-section {
|
68
|
-
@include clearfix;
|
69
|
-
}
|
70
|
-
|
71
68
|
&-section-header {
|
72
69
|
@include margin(7rem 0 3rem);
|
73
70
|
border-bottom: 1px solid darken($color-7, 10%);
|
@@ -88,13 +85,13 @@
|
|
88
85
|
}
|
89
86
|
|
90
87
|
.half {
|
91
|
-
|
92
|
-
|
88
|
+
display: inline-block;
|
89
|
+
width: 49%;
|
93
90
|
padding-right: 1rem;
|
91
|
+
vertical-align: top;
|
94
92
|
|
95
93
|
+ .half {
|
96
|
-
|
97
|
-
margin-left: 50%;
|
94
|
+
display: inline-block;
|
98
95
|
padding-right: 0;
|
99
96
|
padding-left: 1rem;
|
100
97
|
}
|
@@ -106,6 +103,15 @@
|
|
106
103
|
border: 1px solid darken($color-7, 10%);
|
107
104
|
}
|
108
105
|
}
|
106
|
+
|
107
|
+
table.with-actions-borders {
|
108
|
+
th, td {
|
109
|
+
&.actions {
|
110
|
+
border-right: 1px solid #cee1f4 !important;
|
111
|
+
border-bottom: 1px solid #cee1f4 !important;
|
112
|
+
}
|
113
|
+
}
|
114
|
+
}
|
109
115
|
}
|
110
116
|
|
111
117
|
.color-variables {
|
@@ -14,24 +14,24 @@
|
|
14
14
|
}
|
15
15
|
}
|
16
16
|
|
17
|
-
.fa-email
|
18
|
-
.fa-resume
|
19
|
-
.fa-approve
|
17
|
+
.fa-email { @extend .fa-envelope }
|
18
|
+
.fa-resume { @extend .fa-refresh }
|
19
|
+
.fa-approve { @extend .fa-check }
|
20
20
|
|
21
|
-
.fa-remove
|
22
|
-
.fa-cancel
|
23
|
-
.fa-void
|
21
|
+
.fa-remove,
|
22
|
+
.fa-cancel,
|
23
|
+
.fa-void { @extend .fa-times }
|
24
24
|
|
25
|
-
.fa-failure
|
25
|
+
.fa-failure { @extend .fa-thumbs-down }
|
26
26
|
|
27
|
-
.fa-trash
|
27
|
+
.fa-trash { @extend .fa-trash-o }
|
28
28
|
|
29
|
-
.fa-capture
|
30
|
-
.fa-credit
|
31
|
-
.fa-approve
|
32
|
-
.fa-icon-cogs
|
33
|
-
.fa-ok
|
34
|
-
.fa-icon-ok
|
29
|
+
.fa-capture { @extend .fa-check }
|
30
|
+
.fa-credit { @extend .fa-check }
|
31
|
+
.fa-approve { @extend .fa-check }
|
32
|
+
.fa-icon-cogs { @extend .fa-cogs }
|
33
|
+
.fa-ok,
|
34
|
+
.fa-icon-ok { @extend .fa-check }
|
35
35
|
|
36
36
|
button, a {
|
37
37
|
&.fa:before {
|
@@ -40,7 +40,7 @@ table {
|
|
40
40
|
font-size: $font-size-base;
|
41
41
|
}
|
42
42
|
|
43
|
-
|
43
|
+
.fa {
|
44
44
|
font-size: 120%;
|
45
45
|
background-color: very-light($color-3);
|
46
46
|
border: 1px solid $color-border;
|
@@ -112,7 +112,6 @@ table {
|
|
112
112
|
}
|
113
113
|
|
114
114
|
.handle {
|
115
|
-
@extend [class^="icon-"]:before;
|
116
115
|
@extend .fa;
|
117
116
|
@extend .fa-bars;
|
118
117
|
cursor: move;
|
@@ -20,6 +20,19 @@
|
|
20
20
|
display: none;
|
21
21
|
}
|
22
22
|
|
23
|
+
/* hide and show elements based on editing */
|
24
|
+
.editing .editing-hide {
|
25
|
+
display: none;
|
26
|
+
}
|
27
|
+
|
28
|
+
.editing .editing-show {
|
29
|
+
display: block;
|
30
|
+
}
|
31
|
+
|
32
|
+
.editing-show {
|
33
|
+
display: none;
|
34
|
+
}
|
35
|
+
|
23
36
|
// For block grids
|
24
37
|
.frameless {
|
25
38
|
margin-left: -10px;
|
@@ -35,6 +35,7 @@
|
|
35
35
|
@import 'spree/backend/components/sidebar';
|
36
36
|
@import 'spree/backend/components/number_field_update';
|
37
37
|
@import 'spree/backend/components/stock_table';
|
38
|
+
@import 'spree/backend/components/editable_table';
|
38
39
|
@import 'spree/backend/components/tabs';
|
39
40
|
|
40
41
|
@import 'font-awesome';
|
@@ -56,4 +57,3 @@
|
|
56
57
|
@import 'spree/backend/sections/transfer_items';
|
57
58
|
@import 'spree/backend/sections/stock_transfers';
|
58
59
|
@import 'spree/backend/sections/style_guide';
|
59
|
-
@import 'spree/backend/sections/payments';
|
@@ -69,23 +69,16 @@ module Spree
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def new
|
72
|
-
user = Spree.user_class.
|
72
|
+
user = Spree.user_class.find_by(id: params[:user_id]) if params[:user_id]
|
73
73
|
@order = Spree::Core::Importer::Order.import(user, order_params)
|
74
74
|
redirect_to cart_admin_order_url(@order)
|
75
75
|
end
|
76
76
|
|
77
77
|
def edit
|
78
78
|
require_ship_address
|
79
|
-
|
80
|
-
unless @order.completed?
|
81
|
-
@order.refresh_shipment_rates
|
82
|
-
end
|
83
79
|
end
|
84
80
|
|
85
81
|
def cart
|
86
|
-
unless @order.completed?
|
87
|
-
@order.refresh_shipment_rates
|
88
|
-
end
|
89
82
|
if @order.shipped_shipments.count > 0
|
90
83
|
redirect_to edit_admin_order_url(@order)
|
91
84
|
end
|
@@ -145,7 +138,7 @@ module Spree
|
|
145
138
|
end
|
146
139
|
|
147
140
|
def resend
|
148
|
-
OrderMailer.confirm_email(@order
|
141
|
+
OrderMailer.confirm_email(@order, true).deliver_later
|
149
142
|
flash[:success] = Spree.t(:order_email_resent)
|
150
143
|
|
151
144
|
redirect_to(spree.edit_admin_order_path(@order))
|
@@ -178,7 +171,7 @@ module Spree
|
|
178
171
|
end
|
179
172
|
|
180
173
|
def load_order
|
181
|
-
@order = Spree::Order.includes(:adjustments).
|
174
|
+
@order = Spree::Order.includes(:adjustments).find_by!(number: params[:id])
|
182
175
|
authorize! action, @order
|
183
176
|
end
|
184
177
|
|
@@ -2,8 +2,8 @@ module Spree
|
|
2
2
|
module Admin
|
3
3
|
class PaymentMethodsController < ResourceController
|
4
4
|
skip_before_action :load_resource, only: :create
|
5
|
-
before_action :
|
6
|
-
before_action :
|
5
|
+
before_action :load_payment_method_types, except: [:index]
|
6
|
+
before_action :validate_payment_method_type, only: [:create, :update]
|
7
7
|
|
8
8
|
respond_to :html
|
9
9
|
|
@@ -49,16 +49,29 @@ module Spree
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def load_providers
|
52
|
-
|
52
|
+
load_payment_method_types
|
53
53
|
end
|
54
|
+
deprecate load_providers: :load_payment_method_types, deprecator: Spree::Deprecation
|
54
55
|
|
55
|
-
def
|
56
|
+
def load_payment_method_types
|
57
|
+
@payment_method_types = Rails.application.config.spree.payment_methods.sort_by(&:name)
|
58
|
+
# TODO: Remove `@providers` instance var once `load_providers` gets removed.
|
59
|
+
@providers = @payment_method_types
|
60
|
+
end
|
61
|
+
|
62
|
+
def validate_payment_provider
|
63
|
+
validate_payment_method_type
|
64
|
+
end
|
65
|
+
deprecate validate_payment_provider: :validate_payment_method_type,
|
66
|
+
deprecator: Spree::Deprecation
|
67
|
+
|
68
|
+
def validate_payment_method_type
|
56
69
|
requested_type = params[:payment_method].delete(:type)
|
57
|
-
@payment_method_type = @
|
70
|
+
@payment_method_type = @payment_method_types.detect do |klass|
|
58
71
|
klass.name == requested_type
|
59
72
|
end
|
60
73
|
if !@payment_method_type
|
61
|
-
flash[:error] = Spree.t(:
|
74
|
+
flash[:error] = Spree.t(:invalid_payment_method_type)
|
62
75
|
redirect_to new_admin_payment_method_path
|
63
76
|
end
|
64
77
|
end
|