solidus_backend 1.0.7 → 1.1.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 +3 -0
- data/app/assets/javascripts/spree/backend/admin.js.erb +17 -24
- data/app/assets/javascripts/spree/backend/checkouts/edit.js +3 -5
- data/app/assets/javascripts/spree/backend/flash.coffee +17 -0
- data/app/assets/javascripts/spree/backend/handlebars_extensions.coffee +9 -0
- data/app/assets/javascripts/spree/backend/option_type_autocomplete.js.erb +6 -6
- data/app/assets/javascripts/spree/backend/option_value_picker.js +43 -0
- data/app/assets/javascripts/spree/backend/product_picker.js +10 -8
- data/app/assets/javascripts/spree/backend/promotions.js.coffee +101 -0
- data/app/assets/javascripts/spree/backend/routes.js +2 -1
- data/app/assets/javascripts/spree/backend/shipments.js.erb +1 -1
- data/app/assets/javascripts/spree/backend/stock_management/index_add_forms.coffee +1 -1
- data/app/assets/javascripts/spree/backend/stock_movement.js.coffee +2 -2
- data/app/assets/javascripts/spree/backend/stock_transfers/variant_form.coffee +1 -1
- data/app/assets/javascripts/spree/backend/taxon_autocomplete.js.erb +6 -6
- data/app/assets/javascripts/spree/backend/taxons.js.coffee +6 -7
- data/app/assets/javascripts/spree/backend/templates/orders/customer_details/autocomplete.hbs +17 -0
- data/app/assets/javascripts/spree/backend/templates/products/sortable.hbs +5 -0
- data/app/assets/javascripts/spree/backend/templates/promotions/calculators/fields/tiered_flat_rate.hbs +17 -0
- data/app/assets/javascripts/spree/backend/templates/promotions/calculators/fields/tiered_percent.hbs +17 -0
- data/app/assets/javascripts/spree/backend/templates/promotions/rules/option_values.hbs +10 -0
- data/app/assets/javascripts/spree/backend/templates/promotions/rules/option_values_select.hbs +1 -0
- data/app/assets/javascripts/spree/backend/templates/stock_items/stock_location_stock_item.hbs +19 -0
- data/app/assets/javascripts/spree/backend/templates/stock_transfers/transfer_item.hbs.erb +52 -0
- data/app/assets/javascripts/spree/backend/templates/variants/autocomplete.hbs.erb +23 -0
- data/app/assets/javascripts/spree/backend/templates/variants/autocomplete_stock.hbs +51 -0
- data/app/assets/javascripts/spree/backend/templates/variants/line_items_autocomplete_stock.hbs +67 -0
- data/app/assets/javascripts/spree/backend/templates/variants/split.hbs +27 -0
- data/app/assets/javascripts/spree/backend/user_picker.js +8 -8
- data/app/assets/javascripts/spree/backend/variant_autocomplete.js.coffee.erb +6 -8
- data/app/assets/stylesheets/spree/backend/components/_messages.scss +6 -3
- data/app/assets/stylesheets/spree/backend/sections/_promotions.scss +16 -0
- data/app/controllers/spree/admin/base_controller.rb +1 -1
- data/app/controllers/spree/admin/option_types_controller.rb +1 -3
- data/app/controllers/spree/admin/orders/customer_details_controller.rb +1 -1
- data/app/controllers/spree/admin/orders_controller.rb +6 -11
- data/app/controllers/spree/admin/product_properties_controller.rb +9 -0
- data/app/controllers/spree/admin/products_controller.rb +20 -5
- data/app/controllers/spree/admin/promotions_controller.rb +2 -1
- data/app/controllers/spree/admin/reimbursements_controller.rb +20 -0
- data/app/controllers/spree/admin/resource_controller.rb +1 -1
- data/app/controllers/spree/admin/return_authorizations_controller.rb +5 -0
- data/app/controllers/spree/admin/root_controller.rb +1 -1
- data/app/controllers/spree/admin/search_controller.rb +2 -4
- data/app/controllers/spree/admin/states_controller.rb +1 -1
- data/app/controllers/spree/admin/stock_items_controller.rb +1 -1
- data/app/controllers/spree/admin/stock_transfers_controller.rb +3 -14
- data/app/controllers/spree/admin/users_controller.rb +2 -3
- data/app/controllers/spree/admin/variant_property_rule_values_controller.rb +7 -0
- data/app/controllers/spree/admin/variants_controller.rb +1 -1
- data/app/controllers/spree/admin/zones_controller.rb +1 -1
- data/app/helpers/spree/admin/adjustments_helper.rb +4 -9
- data/app/helpers/spree/admin/base_helper.rb +7 -6
- data/app/helpers/spree/admin/navigation_helper.rb +8 -2
- data/app/helpers/spree/admin/orders_helper.rb +1 -1
- data/app/helpers/spree/admin/products_helper.rb +2 -4
- data/app/helpers/spree/admin/stock_movements_helper.rb +3 -3
- data/app/views/spree/admin/adjustments/_adjustment.html.erb +1 -1
- data/app/views/spree/admin/orders/_add_line_item.html.erb +0 -5
- data/app/views/spree/admin/orders/_add_product.html.erb +0 -3
- data/app/views/spree/admin/orders/_carton.html.erb +0 -1
- data/app/views/spree/admin/orders/_shipment.html.erb +0 -1
- data/app/views/spree/admin/orders/confirm/_shipment.html.erb +0 -1
- data/app/views/spree/admin/orders/customer_details/_form.html.erb +1 -1
- data/app/views/spree/admin/orders/customer_details/edit.html.erb +0 -1
- data/app/views/spree/admin/orders/index.html.erb +1 -2
- data/app/views/spree/admin/payment_methods/_form.html.erb +0 -4
- data/app/views/spree/admin/payment_methods/index.html.erb +0 -2
- data/app/views/spree/admin/payments/source_views/_gateway.html.erb +3 -0
- data/app/views/spree/admin/product_properties/index.html.erb +52 -2
- data/app/views/spree/admin/promotions/_actions.html.erb +14 -10
- data/app/views/spree/admin/promotions/_promotion_action.html.erb +5 -3
- data/app/views/spree/admin/promotions/_promotion_rule.html.erb +5 -3
- data/app/views/spree/admin/promotions/_rules.html.erb +18 -14
- data/app/views/spree/admin/promotions/calculators/tiered_flat_rate/_fields.html.erb +5 -28
- data/app/views/spree/admin/promotions/calculators/tiered_percent/_fields.html.erb +5 -27
- data/app/views/spree/admin/promotions/edit.html.erb +6 -4
- data/app/views/spree/admin/promotions/index.html.erb +1 -1
- data/app/views/spree/admin/promotions/rules/_option_value.html.erb +13 -0
- data/app/views/spree/admin/refund_reasons/index.html.erb +2 -2
- data/app/views/spree/admin/reimbursements/edit.html.erb +1 -1
- data/app/views/spree/admin/return_authorizations/_form.html.erb +2 -2
- data/app/views/spree/admin/search/users.rabl +1 -1
- data/app/views/spree/admin/shared/_order_summary.html.erb +6 -0
- data/app/views/spree/admin/shared/_tabs.html.erb +2 -2
- data/app/views/spree/admin/shared/_translations.html.erb +16 -46
- data/app/views/spree/admin/shared/named_types/_index.html.erb +2 -2
- data/app/views/spree/admin/stock_items/_stock_management.html.erb +0 -2
- data/app/views/spree/admin/stock_movements/_form.html.erb +0 -2
- data/app/views/spree/admin/stock_transfers/edit.html.erb +0 -3
- data/app/views/spree/admin/stock_transfers/receive.html.erb +0 -2
- data/app/views/spree/admin/stock_transfers/show.html.erb +1 -1
- data/app/views/spree/admin/taxons/index.html.erb +0 -1
- data/app/views/spree/admin/users/_addresses_form.html.erb +4 -4
- data/app/views/spree/layouts/admin.html.erb +11 -9
- data/config/routes.rb +5 -0
- data/lib/spree/backend.rb +1 -2
- metadata +41 -139
- data/CHANGELOG.md +0 -1
- data/Gemfile +0 -6
- data/Rakefile +0 -15
- data/app/assets/javascripts/spree/backend/handlebar_extensions.js +0 -9
- data/app/assets/javascripts/spree/backend/promotions.js +0 -73
- data/app/assets/javascripts/spree/backend/stock_transfer.js.coffee +0 -196
- data/app/views/spree/admin/products/_autocomplete.js.erb +0 -14
- data/app/views/spree/admin/products/_sortable.html +0 -7
- data/app/views/spree/admin/stock_items/_stock_location_stock_item_template.html.erb +0 -21
- data/app/views/spree/admin/stock_transfers/_transfer_item_template.html.erb +0 -54
- data/app/views/spree/admin/variants/_autocomplete.js.erb +0 -25
- data/app/views/spree/admin/variants/_autocomplete_line_items_stock.js.erb +0 -69
- data/app/views/spree/admin/variants/_autocomplete_stock.js.erb +0 -53
- data/app/views/spree/admin/variants/_split.js.erb +0 -29
- data/script/rails +0 -9
- data/solidus_backend.gemspec +0 -30
- data/spec/controllers/spree/admin/base_controller_spec.rb +0 -24
- data/spec/controllers/spree/admin/cancellations_controller_spec.rb +0 -77
- data/spec/controllers/spree/admin/customer_returns_controller_spec.rb +0 -234
- data/spec/controllers/spree/admin/general_settings_controller_spec.rb +0 -41
- data/spec/controllers/spree/admin/missing_products_controller_spec.rb +0 -18
- data/spec/controllers/spree/admin/orders/customer_details_controller_spec.rb +0 -80
- data/spec/controllers/spree/admin/orders_controller_spec.rb +0 -472
- data/spec/controllers/spree/admin/payment_methods_controller_spec.rb +0 -49
- data/spec/controllers/spree/admin/payments_controller_spec.rb +0 -175
- data/spec/controllers/spree/admin/products_controller_spec.rb +0 -45
- data/spec/controllers/spree/admin/promotion_actions_controller_spec.rb +0 -21
- data/spec/controllers/spree/admin/promotion_codes_controller_spec.rb +0 -18
- data/spec/controllers/spree/admin/promotion_rules_controller_spec.rb +0 -21
- data/spec/controllers/spree/admin/promotions_controller_spec.rb +0 -122
- data/spec/controllers/spree/admin/refunds_controller_spec.rb +0 -32
- data/spec/controllers/spree/admin/reimbursements_controller_spec.rb +0 -75
- data/spec/controllers/spree/admin/reports_controller_spec.rb +0 -134
- data/spec/controllers/spree/admin/resource_controller_spec.rb +0 -166
- data/spec/controllers/spree/admin/return_authorizations_controller_spec.rb +0 -226
- data/spec/controllers/spree/admin/return_items_controller_spec.rb +0 -27
- data/spec/controllers/spree/admin/root_controller_spec.rb +0 -41
- data/spec/controllers/spree/admin/search_controller_spec.rb +0 -104
- data/spec/controllers/spree/admin/shipping_methods_controller_spec.rb +0 -14
- data/spec/controllers/spree/admin/stock_items_controller_spec.rb +0 -50
- data/spec/controllers/spree/admin/stock_locations_controller_spec.rb +0 -41
- data/spec/controllers/spree/admin/stock_transfers_controller_spec.rb +0 -331
- data/spec/controllers/spree/admin/store_credits_controller_spec.rb +0 -309
- data/spec/controllers/spree/admin/users_controller_spec.rb +0 -236
- data/spec/controllers/spree/admin/variants_controller_spec.rb +0 -32
- data/spec/features/admin/configuration/analytics_tracker_spec.rb +0 -54
- data/spec/features/admin/configuration/countries_spec.rb +0 -22
- data/spec/features/admin/configuration/general_settings_spec.rb +0 -45
- data/spec/features/admin/configuration/payment_methods_spec.rb +0 -125
- data/spec/features/admin/configuration/shipping_methods_spec.rb +0 -64
- data/spec/features/admin/configuration/states_spec.rb +0 -64
- data/spec/features/admin/configuration/stock_locations_spec.rb +0 -50
- data/spec/features/admin/configuration/tax_categories_spec.rb +0 -56
- data/spec/features/admin/configuration/tax_rates_spec.rb +0 -30
- data/spec/features/admin/configuration/taxonomies_spec.rb +0 -52
- data/spec/features/admin/configuration/zones_spec.rb +0 -39
- data/spec/features/admin/homepage_spec.rb +0 -78
- data/spec/features/admin/locale_spec.rb +0 -30
- data/spec/features/admin/orders/adjustments_promotions_spec.rb +0 -53
- data/spec/features/admin/orders/adjustments_spec.rb +0 -126
- data/spec/features/admin/orders/cancelling_and_resuming_spec.rb +0 -48
- data/spec/features/admin/orders/cancelling_inventory_spec.rb +0 -48
- data/spec/features/admin/orders/customer_details_spec.rb +0 -163
- data/spec/features/admin/orders/line_items_spec.rb +0 -50
- data/spec/features/admin/orders/listing_spec.rb +0 -130
- data/spec/features/admin/orders/log_entries_spec.rb +0 -55
- data/spec/features/admin/orders/new_order_spec.rb +0 -197
- data/spec/features/admin/orders/order_details_spec.rb +0 -533
- data/spec/features/admin/orders/payments_spec.rb +0 -228
- data/spec/features/admin/orders/risk_analysis_spec.rb +0 -47
- data/spec/features/admin/orders/shipments_spec.rb +0 -65
- data/spec/features/admin/payments/store_credits_spec.rb +0 -21
- data/spec/features/admin/products/edit/images_spec.rb +0 -87
- data/spec/features/admin/products/edit/products_spec.rb +0 -66
- data/spec/features/admin/products/edit/taxons_spec.rb +0 -56
- data/spec/features/admin/products/edit/variants_spec.rb +0 -61
- data/spec/features/admin/products/option_types_spec.rb +0 -114
- data/spec/features/admin/products/products_spec.rb +0 -392
- data/spec/features/admin/products/properties_spec.rb +0 -139
- data/spec/features/admin/products/prototypes_spec.rb +0 -110
- data/spec/features/admin/products/stock_management_spec.rb +0 -82
- data/spec/features/admin/products/variant_spec.rb +0 -51
- data/spec/features/admin/promotion_adjustments_spec.rb +0 -220
- data/spec/features/admin/promotions/tiered_calculator_spec.rb +0 -69
- data/spec/features/admin/promotions/user_rule_spec.rb +0 -25
- data/spec/features/admin/reports_spec.rb +0 -61
- data/spec/features/admin/stock_transfer_spec.rb +0 -86
- data/spec/features/admin/store_credits_spec.rb +0 -82
- data/spec/features/admin/taxons_spec.rb +0 -31
- data/spec/features/admin/users_spec.rb +0 -270
- data/spec/helpers/admin/base_helper_spec.rb +0 -24
- data/spec/helpers/admin/navigation_helper_spec.rb +0 -73
- data/spec/helpers/admin/reimbursements_helper_spec.rb +0 -34
- data/spec/helpers/admin/stock_movements_helper_spec.rb +0 -29
- data/spec/helpers/admin/store_credit_events_helper_spec.rb +0 -95
- data/spec/helpers/promotion_rules_helper_spec.rb +0 -12
- data/spec/spec_helper.rb +0 -108
- data/spec/support/appear_before_matcher.rb +0 -8
- data/spec/support/ror_ringer.jpeg +0 -0
- data/spec/test_views/spree/admin/widgets/edit.html.erb +0 -1
- data/spec/test_views/spree/admin/widgets/new.html.erb +0 -1
- data/vendor/assets/javascripts/handlebars.js +0 -2746
@@ -1,10 +1,6 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
3
|
var set_taxon_select = function(){
|
4
|
-
function formatTaxon(taxon) {
|
5
|
-
return Select2.util.escapeMarkup(taxon.pretty_name);
|
6
|
-
}
|
7
|
-
|
8
4
|
if ($('#product_taxon_ids').length > 0) {
|
9
5
|
$('#product_taxon_ids').select2({
|
10
6
|
placeholder: Spree.translations.taxon_placeholder,
|
@@ -41,8 +37,12 @@ var set_taxon_select = function(){
|
|
41
37
|
};
|
42
38
|
}
|
43
39
|
},
|
44
|
-
formatResult:
|
45
|
-
|
40
|
+
formatResult: function (taxon) {
|
41
|
+
return taxon.pretty_name;
|
42
|
+
},
|
43
|
+
formatSelection: function (taxon) {
|
44
|
+
return taxon.pretty_name;
|
45
|
+
}
|
46
46
|
});
|
47
47
|
}
|
48
48
|
}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
$
|
2
|
-
|
1
|
+
$ ->
|
2
|
+
productTemplate = HandlebarsTemplates['products/sortable']
|
3
3
|
|
4
4
|
productListTemplate = (products) ->
|
5
5
|
products.map(productTemplate).join('') ||
|
@@ -45,9 +45,6 @@ $(document).ready ->
|
|
45
45
|
sortable.trigger('sortupdate', item: draggable)
|
46
46
|
, 250
|
47
47
|
|
48
|
-
formatTaxon = (taxon) ->
|
49
|
-
Select2.util.escapeMarkup(taxon.pretty_name)
|
50
|
-
|
51
48
|
$('#taxon_id').select2
|
52
49
|
dropdownCssClass: "taxon_select_box",
|
53
50
|
placeholder: Spree.translations.find_a_taxon,
|
@@ -62,8 +59,10 @@ $(document).ready ->
|
|
62
59
|
results: (data) ->
|
63
60
|
results: data['taxons'],
|
64
61
|
more: data.current_page < data.pages
|
65
|
-
formatResult:
|
66
|
-
|
62
|
+
formatResult: (taxon) ->
|
63
|
+
taxon.pretty_name
|
64
|
+
formatSelection: (taxon) ->
|
65
|
+
taxon.pretty_name
|
67
66
|
|
68
67
|
$('#taxon_id').on "change", (e) ->
|
69
68
|
Spree.ajax
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<div class='customer-autocomplete-item'>
|
2
|
+
<div class='customer-details'>
|
3
|
+
<h5>{{customer.email}}</h5>
|
4
|
+
{{#if bill_address.firstname }}
|
5
|
+
<strong>{{t 'bill_address' }}</strong>
|
6
|
+
{{bill_address.firstname}} {{bill_address.lastname}}<br>
|
7
|
+
{{bill_address.address1}}, {{bill_address.address2}}<br>
|
8
|
+
{{bill_address.city}}<br>
|
9
|
+
{{#if bill_address.state_id }}
|
10
|
+
{{bill_address.state.name}}
|
11
|
+
{{else}}
|
12
|
+
{{bill_address.state_name}}
|
13
|
+
{{/if}}
|
14
|
+
{{bill_address.country.name}}
|
15
|
+
{{/if}}
|
16
|
+
</div>
|
17
|
+
</div>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<div class="fullwidth tier">
|
2
|
+
<a class="fa fa-trash remove js-remove-tier"></a>
|
3
|
+
<div class="two columns alpha omega">
|
4
|
+
<div class="input-group">
|
5
|
+
<span class="input-group-addon">$</span>
|
6
|
+
<input class="js-base-input form-control" type="text" value={{baseField.value}}>
|
7
|
+
</div>
|
8
|
+
</div>
|
9
|
+
<div class="two columns alpha omega right">
|
10
|
+
<div class="input-group">
|
11
|
+
<span class="input-group-addon">$</span>
|
12
|
+
<input class="js-value-input form-control"
|
13
|
+
name="{{valueField.name}}" type="text" value={{valueField.value}}>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
<div class="clear"></div>
|
17
|
+
</div>
|
data/app/assets/javascripts/spree/backend/templates/promotions/calculators/fields/tiered_percent.hbs
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
<div class="fullwidth tier">
|
2
|
+
<a class="fa fa-trash remove js-remove-tier"></a>
|
3
|
+
<div class="two columns alpha omega">
|
4
|
+
<div class="input-group">
|
5
|
+
<span class="input-group-addon">$</span>
|
6
|
+
<input class="js-base-input form-control" type="text" value={{baseField.value}}>
|
7
|
+
</div>
|
8
|
+
</div>
|
9
|
+
<div class="two columns alpha omega right">
|
10
|
+
<div class="input-group">
|
11
|
+
<input class="js-value-input form-control right-align"
|
12
|
+
name="{{valueField.name}}" type="text" value={{valueField.value}}>
|
13
|
+
<span class="input-group-addon">%</span>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
<div class="clear"></div>
|
17
|
+
</div>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<div class="fullwidth promo-rule-option-value">
|
2
|
+
<div class="four columns alpha">
|
3
|
+
<input class="js-promo-rule-option-value-product-select fullwidth" type="hidden" value="{{ productSelect.value }}">
|
4
|
+
</div>
|
5
|
+
<div class="three columns omega">
|
6
|
+
<input class="js-promo-rule-option-value-option-values-select fullwidth" name="{{ paramPrefix }}[preferred_eligible_values][{{ productSelect.value }}]" type="hidden" value={{optionValuesSelect.value}}>
|
7
|
+
</div>
|
8
|
+
<a class="fa fa-trash remove js-remove-promo-rule-option-value"></a>
|
9
|
+
<div class="clear"></div>
|
10
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
{{ param_prefix }}[preferred_eligible_values][{{product_id}}]
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<tr data-variant-id="{{variantId}}">
|
2
|
+
<td class="align-center location-name-cell">{{stockLocationName}}</td>
|
3
|
+
<td class="align-center">
|
4
|
+
{{#if backorderable}}
|
5
|
+
<input id="backorderable-{{id}}" name="backorderable" type="checkbox" value="backorderable" disabled="disabled" checked="checked">
|
6
|
+
{{else}}
|
7
|
+
<input id="backorderable-{{id}}" name="backorderable" type="checkbox" value="backorderable" disabled="disabled">
|
8
|
+
{{/if}}
|
9
|
+
</td>
|
10
|
+
<td class="align-center" id="number-update-{{id}}">
|
11
|
+
<span class="js-number-update-text">{{countOnHand}}</span>
|
12
|
+
<input class="fullwidth js-number-update-input" name="count_on_hand" type="number" value="">
|
13
|
+
</td>
|
14
|
+
<td class="actions">
|
15
|
+
<a class="fa fa-edit icon_link with-tip no-text" data-action="edit" data-id="{{id}}" href="#"></a>
|
16
|
+
<a class="fa fa-check icon_link with-tip no-text" data-action="green" data-id="{{id}}" data-location-id="{{stockLocationId}}" href="#"></a>
|
17
|
+
<a class="fa fa-void icon_link with-tip no-text" data-action="red" data-id="{{id}}" href="#"></a>
|
18
|
+
</td>
|
19
|
+
</tr>
|
@@ -0,0 +1,52 @@
|
|
1
|
+
<tr class='new-row' data-transfer-item-id="{{id}}">
|
2
|
+
<td class="align-center no-padding">
|
3
|
+
<div class='variant-container' data-variant-id="{{variantId}}">
|
4
|
+
<div class='variant-image'>
|
5
|
+
{{#if variantImageURL }}
|
6
|
+
<img alt="{{variantName}}" src="{{variantImageURL}}">
|
7
|
+
{{ else }}
|
8
|
+
<img alt='{{variant.name}}' src='<%= image_path("noimage/small.png") %>' />
|
9
|
+
{{/if}}
|
10
|
+
</div>
|
11
|
+
<div class='variant-details'>
|
12
|
+
<table class='stock-variant-field-table'>
|
13
|
+
<tbody>
|
14
|
+
{{#each variantDisplayAttributes}}
|
15
|
+
<tr>
|
16
|
+
<td>{{this.label}}</td>
|
17
|
+
<td class="fullwidth">{{this.value}}</td>
|
18
|
+
</tr>
|
19
|
+
{{/each}}
|
20
|
+
</tbody>
|
21
|
+
</table>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
</td>
|
25
|
+
<td class="align-center">
|
26
|
+
<table class='stock-variant-field-table'>
|
27
|
+
{{#each variantOptions}}
|
28
|
+
<tr>
|
29
|
+
<td>{{this.option_type}}</td>
|
30
|
+
<td>{{this.option_value}}</td>
|
31
|
+
</tr>
|
32
|
+
{{/each}}
|
33
|
+
</table>
|
34
|
+
</td>
|
35
|
+
<td class='align-center' id="number-update-{{id}}">
|
36
|
+
{{#if isReceiving }}
|
37
|
+
<span class='js-number-update-text'>{{receivedQuantity}}</span>
|
38
|
+
<input class="fullwidth js-number-update-input" name="received_quantity" type="number" value="">
|
39
|
+
{{ else }}
|
40
|
+
<span class='js-number-update-text'>{{expectedQuantity}}</span>
|
41
|
+
<input class="fullwidth js-number-update-input" name="expected_quantity" type="number" value="">
|
42
|
+
{{/if}}
|
43
|
+
</td>
|
44
|
+
<td class="actions">
|
45
|
+
<a class="fa fa-edit icon_link with-tip no-text" data-action="edit" data-id="{{id}}" href="#"></a>
|
46
|
+
<a class="fa fa-check icon_link with-tip no-text" data-action="green" data-id="{{id}}" href="#"></a>
|
47
|
+
<a class="fa fa-void icon_link with-tip no-text" data-action="red" data-id="{{id}}" href="#"></a>
|
48
|
+
{{#unless isReceiving }}
|
49
|
+
<a class="fa fa-trash icon_link with-tip no-text" data-action="remove" data-id="{{id}}" href="#"></a>
|
50
|
+
{{/unless}}
|
51
|
+
</td>
|
52
|
+
</tr>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<div class="variant-autocomplete-item media">
|
2
|
+
<div class="media-left">
|
3
|
+
{{#if variant.image }}
|
4
|
+
<img class="media-object" src='{{variant.image}}' />
|
5
|
+
{{ else }}
|
6
|
+
<img class="media-object" src='<%= image_path("noimage/mini.png") %>' />
|
7
|
+
{{/if}}
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="media-body">
|
11
|
+
<h6 class="media-heading">{{variant.name}}</h6>
|
12
|
+
<dl class="dl-collapse">
|
13
|
+
{{#if variant.option_values}}
|
14
|
+
{{#each variant.option_values}}
|
15
|
+
<dt>{{this.option_type_presentation}}:</dt>
|
16
|
+
<dd>{{this.presentation}}</dd>
|
17
|
+
{{/each}}
|
18
|
+
{{/if}}
|
19
|
+
<dt>{{ t "sku" }}</dt>
|
20
|
+
<dd>{{variant.sku}}</dd>
|
21
|
+
</dl>
|
22
|
+
</div>
|
23
|
+
</div>
|
@@ -0,0 +1,51 @@
|
|
1
|
+
<fieldset>
|
2
|
+
<legend align="center">{{ t "select_stock" }}</legend>
|
3
|
+
<table class="stock-levels" data-hook="stock-levels">
|
4
|
+
<colgroup>
|
5
|
+
<col style="width: 30%;" />
|
6
|
+
<col style="width: 40%;" />
|
7
|
+
<col style="width: 20%;" />
|
8
|
+
<col style="width: 10%;" />
|
9
|
+
</colgroup>
|
10
|
+
<thead>
|
11
|
+
<th>{{ t "location" }}</th>
|
12
|
+
<th>{{ t "count_on_hand" }}</th>
|
13
|
+
<th>{{ t "quantity" }}</th>
|
14
|
+
<th class="actions"></th>
|
15
|
+
</thead>
|
16
|
+
<tbody>
|
17
|
+
{{#each variant.stock_items}}
|
18
|
+
<tr>
|
19
|
+
<td>{{this.stock_location_name}}</td>
|
20
|
+
{{#unless ../variant.track_inventory}}
|
21
|
+
<td>
|
22
|
+
It doesn't track inventory
|
23
|
+
</td>
|
24
|
+
<td>
|
25
|
+
<input class="quantity" id="stock_item_quantity" data-stock-location-id="{{this.stock_location_id}}" type="number" min="1" value="1">
|
26
|
+
</td>
|
27
|
+
<td class="actions">
|
28
|
+
<button class="add_variant no-text fa fa-plus icon_link with-tip" data-stock-location-id="{{this.stock_location_id}}" title="{{ t "add" }}" data-action="add"></button>
|
29
|
+
</td>
|
30
|
+
{{else}}
|
31
|
+
{{#if this.available}}
|
32
|
+
<td>
|
33
|
+
{{this.count_on_hand}}
|
34
|
+
{{#if this.backorderable}} ({{ t "backorders_allowed" }}) {{/if}}
|
35
|
+
</td>
|
36
|
+
<td>
|
37
|
+
<input class="quantity" id="stock_item_quantity" data-stock-location-id="{{this.stock_location_id}}" type="number" min="1" value="1">
|
38
|
+
</td>
|
39
|
+
<td class="actions">
|
40
|
+
<button class="add_variant no-text fa fa-plus icon_link with-tip" data-stock-location-id="{{this.stock_location_id}}" title="{{ t "add" }}" data-action="add"></button>
|
41
|
+
</td>
|
42
|
+
{{else}}
|
43
|
+
<td>{{ t "out_of_stock" }}</td>
|
44
|
+
<td>0</td>
|
45
|
+
{{/if}}
|
46
|
+
{{/unless}}
|
47
|
+
</tr>
|
48
|
+
{{/each}}
|
49
|
+
</tbody>
|
50
|
+
</table>
|
51
|
+
</fieldset>
|
data/app/assets/javascripts/spree/backend/templates/variants/line_items_autocomplete_stock.hbs
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
<fieldset>
|
2
|
+
<legend align="center">{{ t "select_stock" }}</legend>
|
3
|
+
{{#if variant.track_inventory}}
|
4
|
+
<table class="stock-levels" data-hook="stock-levels">
|
5
|
+
<colgroup>
|
6
|
+
<col style="width: 30%;" />
|
7
|
+
<col style="width: 40%;" />
|
8
|
+
<col style="width: 30%;" />
|
9
|
+
</colgroup>
|
10
|
+
<thead>
|
11
|
+
<th>{{ t "name" }}</th>
|
12
|
+
<th>{{ t "location" }}</th>
|
13
|
+
<th>{{ t "count_on_hand" }}</th>
|
14
|
+
<th>{{ t "quantity" }}</th>
|
15
|
+
</thead>
|
16
|
+
<tbody>
|
17
|
+
{{#each variant.stock_items}}
|
18
|
+
<tr>
|
19
|
+
<td>{{#unless @index}}{{../../variant.name}}{{/unless}}</td>
|
20
|
+
<td>
|
21
|
+
{{stock_location_name}}
|
22
|
+
</td>
|
23
|
+
<td>
|
24
|
+
{{count_on_hand}}
|
25
|
+
</td>
|
26
|
+
<td>
|
27
|
+
<input class="quantity variant_quantity" id="quantity_{{@index}}" data-variant-id="{{../variant.id}}" data-stock-location-id="{{stock_location_id}}" type="number" min="0" value="0">
|
28
|
+
</td>
|
29
|
+
</tr>
|
30
|
+
{{/each}}
|
31
|
+
</tbody>
|
32
|
+
</table>
|
33
|
+
{{else}}
|
34
|
+
<table class="stock-levels untracked-inventory" data-hook="stock-levels">
|
35
|
+
<colgroup>
|
36
|
+
<col style="width: 30%;" />
|
37
|
+
<col style="width: 40%;" />
|
38
|
+
<col style="width: 30%;" />
|
39
|
+
</colgroup>
|
40
|
+
<thead>
|
41
|
+
<th>{{ t "name" }}</th>
|
42
|
+
<th>{{ t "count_on_hand" }}</th>
|
43
|
+
<th>{{ t "quantity" }}</th>
|
44
|
+
</thead>
|
45
|
+
<tbody>
|
46
|
+
<tr>
|
47
|
+
<td>
|
48
|
+
{{variant.name}}
|
49
|
+
</td>
|
50
|
+
<td>
|
51
|
+
No inventory necessary
|
52
|
+
</td>
|
53
|
+
<td>
|
54
|
+
<input class="quantity" id="variant_quantity" data-variant-id="{{variant.id}}" type="number" min="0" value="0">
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
</tbody>
|
58
|
+
</table>
|
59
|
+
{{/if}}
|
60
|
+
|
61
|
+
|
62
|
+
<fieldset class="no-border-bottom">
|
63
|
+
<legend align="center" class="stock-location">
|
64
|
+
<button class="add_variant no-text fa fa-plus icon_link" title="{{ t "add" }}" data-action="add">{{ t "add" }}</button>
|
65
|
+
</legend>
|
66
|
+
</fieldset>
|
67
|
+
</fieldset>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<tr class='stock-item-split' data-variant-id='{{variant.id}}'>
|
2
|
+
<td colspan='2'>
|
3
|
+
Move {{variant.name}} to
|
4
|
+
</td>
|
5
|
+
<td colspan='2'>
|
6
|
+
<select name="item_stock_location" id='item_stock_location' style='width:100%;'>
|
7
|
+
<option></option>
|
8
|
+
<optgroup label="{{ t "existing_shipments" }}">
|
9
|
+
{{#each shipments}}
|
10
|
+
<option data-shipment-number='{{this.number}}' value='{{this.stock_location_id}}'>{{this.stock_location.name}}({{this.number}})</option>
|
11
|
+
{{/each}}
|
12
|
+
</optgroup>
|
13
|
+
<optgroup label="{{ t "new_shipment_at_location" }}">
|
14
|
+
{{#each variant.stock_items}}
|
15
|
+
<option data-new-shipment='true' value='{{this.stock_location_id}}'>{{this.stock_location_name}} ({{this.count_on_hand}} on hand)</option>
|
16
|
+
{{/each}}
|
17
|
+
</optgroup>
|
18
|
+
</select>
|
19
|
+
</td>
|
20
|
+
<td>
|
21
|
+
<input class="quantity" id="item_quantity" type="number" min="1" value="1" max="{{max_quantity}}">
|
22
|
+
</td>
|
23
|
+
<td class='actions'>
|
24
|
+
<a href='#' class='save-split icon_link fa fa-ok no-text with-tip' title='Save'></a>
|
25
|
+
<a href='#' class='cancel-split icon_link fa fa-cancel no-text with-tip' title='Cancel'></a>
|
26
|
+
</td>
|
27
|
+
</tr>
|
@@ -1,10 +1,6 @@
|
|
1
1
|
$.fn.userAutocomplete = function () {
|
2
2
|
'use strict';
|
3
3
|
|
4
|
-
function formatUser(user) {
|
5
|
-
return Select2.util.escapeMarkup(user.email);
|
6
|
-
}
|
7
|
-
|
8
4
|
this.select2({
|
9
5
|
minimumInputLength: 1,
|
10
6
|
multiple: true,
|
@@ -12,7 +8,7 @@ $.fn.userAutocomplete = function () {
|
|
12
8
|
$.get(Spree.routes.user_search, {
|
13
9
|
ids: element.val()
|
14
10
|
}, function (data) {
|
15
|
-
callback(data
|
11
|
+
callback(data);
|
16
12
|
});
|
17
13
|
},
|
18
14
|
ajax: {
|
@@ -27,12 +23,16 @@ $.fn.userAutocomplete = function () {
|
|
27
23
|
},
|
28
24
|
results: function (data) {
|
29
25
|
return {
|
30
|
-
results: data
|
26
|
+
results: data
|
31
27
|
};
|
32
28
|
}
|
33
29
|
},
|
34
|
-
formatResult:
|
35
|
-
|
30
|
+
formatResult: function (user) {
|
31
|
+
return user.email;
|
32
|
+
},
|
33
|
+
formatSelection: function (user) {
|
34
|
+
return user.email;
|
35
|
+
}
|
36
36
|
});
|
37
37
|
};
|
38
38
|
|
@@ -1,10 +1,8 @@
|
|
1
1
|
# variant autocompletion
|
2
2
|
$(document).ready ->
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
window.variantLineItemTemplate = Handlebars.compile($("#variant_line_items_autocomplete_stock_template").text())
|
7
|
-
return
|
3
|
+
window.variantTemplate = HandlebarsTemplates["variants/autocomplete"]
|
4
|
+
window.variantStockTemplate = HandlebarsTemplates["variants/autocomplete_stock"]
|
5
|
+
window.variantLineItemTemplate = HandlebarsTemplates["variants/line_items_autocomplete_stock"]
|
8
6
|
|
9
7
|
formatVariantResult = (variant) ->
|
10
8
|
variant.image = variant.images[0].mini_url if variant["images"][0] isnt `undefined` and variant["images"][0].mini_url isnt `undefined`
|
@@ -35,8 +33,8 @@ $.fn.variantAutocomplete = (searchOptions = {}) ->
|
|
35
33
|
results: data["variants"]
|
36
34
|
|
37
35
|
formatResult: formatVariantResult
|
38
|
-
formatSelection: (variant
|
36
|
+
formatSelection: (variant) ->
|
39
37
|
if !!variant.options_text
|
40
|
-
|
38
|
+
variant.name + " (#{variant.options_text})"
|
41
39
|
else
|
42
|
-
|
40
|
+
variant.name
|