spree_backend 4.2.0.rc2 → 4.2.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/spree/backend.js +0 -1
  3. data/app/assets/javascripts/spree/backend/address_states.js +20 -9
  4. data/app/assets/javascripts/spree/backend/calculator.js +2 -0
  5. data/app/assets/javascripts/spree/backend/checkouts/edit.js +99 -71
  6. data/app/assets/javascripts/spree/backend/line_items_on_order_edit.js +1 -1
  7. data/app/assets/javascripts/spree/backend/option_type_autocomplete.js +31 -37
  8. data/app/assets/javascripts/spree/backend/option_value_picker.js +50 -23
  9. data/app/assets/javascripts/spree/backend/product_picker.js +35 -19
  10. data/app/assets/javascripts/spree/backend/promotions.js +32 -27
  11. data/app/assets/javascripts/spree/backend/shipments.js +28 -37
  12. data/app/assets/javascripts/spree/backend/spree-select2.js +33 -14
  13. data/app/assets/javascripts/spree/backend/stock_transfer.js +32 -13
  14. data/app/assets/javascripts/spree/backend/taxon_autocomplete.js +30 -43
  15. data/app/assets/javascripts/spree/backend/taxons.js +60 -47
  16. data/app/assets/javascripts/spree/backend/user_picker.js +16 -18
  17. data/app/assets/javascripts/spree/backend/variant_autocomplete.js +23 -22
  18. data/app/assets/stylesheets/spree/backend/components/_badges.scss +1 -1
  19. data/app/assets/stylesheets/spree/backend/components/_tables.scss +2 -2
  20. data/app/assets/stylesheets/spree/backend/global/_variables.scss +1 -1
  21. data/app/assets/stylesheets/spree/backend/plugins/_select2_custom.scss +11 -0
  22. data/app/assets/stylesheets/spree/backend/plugins/select2_bootstrap4.scss +622 -0
  23. data/app/assets/stylesheets/spree/backend/spree_admin.css.scss +2 -1
  24. data/app/controllers/spree/admin/orders_controller.rb +15 -2
  25. data/app/controllers/spree/admin/products_controller.rb +2 -2
  26. data/app/controllers/spree/admin/states_controller.rb +1 -1
  27. data/app/controllers/spree/admin/taxons_controller.rb +15 -5
  28. data/app/helpers/spree/admin/base_helper.rb +21 -5
  29. data/app/helpers/spree/admin/navigation_helper.rb +11 -1
  30. data/app/helpers/spree/admin/payments_helper.rb +3 -3
  31. data/app/helpers/spree/admin/stock_movements_helper.rb +2 -0
  32. data/app/views/spree/admin/countries/index.html.erb +6 -6
  33. data/app/views/spree/admin/customer_returns/_return_item_decision.html.erb +3 -1
  34. data/app/views/spree/admin/customer_returns/_return_item_selection.html.erb +3 -1
  35. data/app/views/spree/admin/customer_returns/index.html.erb +2 -2
  36. data/app/views/spree/admin/customer_returns/new.html.erb +1 -1
  37. data/app/views/spree/admin/general_settings/edit.html.erb +25 -2
  38. data/app/views/spree/admin/option_types/index.html.erb +1 -1
  39. data/app/views/spree/admin/orders/_add_line_item.html.erb +1 -1
  40. data/app/views/spree/admin/orders/_add_product.html.erb +1 -1
  41. data/app/views/spree/admin/orders/_channel_form.html.erb +18 -0
  42. data/app/views/spree/admin/orders/_shipment.html.erb +3 -1
  43. data/app/views/spree/admin/orders/channel.html.erb +7 -0
  44. data/app/views/spree/admin/orders/customer_details/_autocomplete.js.erb +35 -12
  45. data/app/views/spree/admin/orders/customer_details/_form.html.erb +2 -2
  46. data/app/views/spree/admin/orders/customer_details/edit.html.erb +1 -1
  47. data/app/views/spree/admin/orders/index.html.erb +10 -11
  48. data/app/views/spree/admin/payment_methods/_form.html.erb +65 -46
  49. data/app/views/spree/admin/payment_methods/index.html.erb +1 -1
  50. data/app/views/spree/admin/products/_form.html.erb +4 -4
  51. data/app/views/spree/admin/products/index.html.erb +2 -1
  52. data/app/views/spree/admin/products/new.html.erb +2 -2
  53. data/app/views/spree/admin/promotion_rules/create.js.erb +1 -1
  54. data/app/views/spree/admin/promotions/_form.html.erb +1 -1
  55. data/app/views/spree/admin/promotions/actions/_create_line_items.html.erb +1 -1
  56. data/app/views/spree/admin/promotions/rules/_option_value.html.erb +8 -7
  57. data/app/views/spree/admin/promotions/rules/_product.html.erb +1 -1
  58. data/app/views/spree/admin/promotions/rules/_taxon.html.erb +1 -1
  59. data/app/views/spree/admin/promotions/rules/_user.html.erb +1 -1
  60. data/app/views/spree/admin/refunds/new.html.erb +1 -1
  61. data/app/views/spree/admin/reimbursements/edit.html.erb +4 -2
  62. data/app/views/spree/admin/reimbursements/show.html.erb +3 -1
  63. data/app/views/spree/admin/return_authorizations/_form.html.erb +7 -5
  64. data/app/views/spree/admin/return_authorizations/index.html.erb +2 -2
  65. data/app/views/spree/admin/return_index/customer_returns.html.erb +2 -2
  66. data/app/views/spree/admin/return_index/return_authorizations.html.erb +2 -2
  67. data/app/views/spree/admin/shared/_account_nav.html.erb +1 -1
  68. data/app/views/spree/admin/shared/_address_form.html.erb +7 -7
  69. data/app/views/spree/admin/shared/_head.html.erb +4 -0
  70. data/app/views/spree/admin/shared/_order_summary.html.erb +25 -21
  71. data/app/views/spree/admin/shared/_order_tabs.html.erb +9 -0
  72. data/app/views/spree/admin/shared/_refunds.html.erb +1 -1
  73. data/app/views/spree/admin/shared/_translations.html.erb +1 -0
  74. data/app/views/spree/admin/shared/_update_order_state.js.erb +6 -2
  75. data/app/views/spree/admin/shared/named_types/_index.html.erb +1 -1
  76. data/app/views/spree/admin/shipping_methods/_form.html.erb +2 -2
  77. data/app/views/spree/admin/shipping_methods/index.html.erb +5 -1
  78. data/app/views/spree/admin/stock_locations/_form.html.erb +1 -1
  79. data/app/views/spree/admin/stock_locations/index.html.erb +2 -2
  80. data/app/views/spree/admin/stock_transfers/_stock_movements.html.erb +1 -1
  81. data/app/views/spree/admin/stock_transfers/index.html.erb +42 -37
  82. data/app/views/spree/admin/stock_transfers/new.html.erb +1 -1
  83. data/app/views/spree/admin/stores/_form.html.erb +64 -11
  84. data/app/views/spree/admin/stores/index.html.erb +11 -6
  85. data/app/views/spree/admin/tax_categories/index.html.erb +1 -1
  86. data/app/views/spree/admin/tax_rates/index.html.erb +2 -2
  87. data/app/views/spree/admin/taxons/_form.html.erb +39 -35
  88. data/app/views/spree/admin/taxons/index.html.erb +1 -1
  89. data/app/views/spree/admin/users/_addresses_form.html.erb +4 -6
  90. data/app/views/spree/admin/variants/_form.html.erb +2 -2
  91. data/app/views/spree/admin/zones/index.html.erb +1 -1
  92. data/config/routes.rb +7 -1
  93. data/spree_backend.gemspec +1 -1
  94. metadata +15 -14
  95. data/app/assets/javascripts/spree/backend/tag_picker.js +0 -52
  96. data/app/assets/stylesheets/spree/backend/plugins/_select2.scss +0 -190
  97. data/app/views/spree/admin/general_settings/_form.html.erb +0 -17
@@ -1,52 +0,0 @@
1
- $.fn.tagAutocomplete = function () {
2
- 'use strict'
3
-
4
- function formatTag (tag) {
5
- return Select2.util.escapeMarkup(tag.name)
6
- }
7
-
8
- this.select2({
9
- placeholder: Spree.translations.tags_placeholder,
10
- minimumInputLength: 1,
11
- tokenSeparators: [','],
12
- multiple: true,
13
- tags: true,
14
- initSelection: function (element, callback) {
15
- var data = $(element.val().split(',')).map(function () {
16
- return { name: this, id: this }
17
- })
18
- callback(data)
19
- },
20
- ajax: {
21
- url: Spree.routes.tags_api,
22
- datatype: 'json',
23
- cache: true,
24
- data: function (term) {
25
- return {
26
- q: term,
27
- token: Spree.api_key
28
- }
29
- },
30
- results: function (data) {
31
- return {
32
- results: data.tags.map(function (tag) {
33
- return { name: tag.name, id: tag.name }
34
- })
35
- }
36
- }
37
- },
38
- createSearchChoice: function (term, data) {
39
- if ($(data).filter(function () {
40
- return this.name.localeCompare(term) === 0
41
- }).length === 0) {
42
- return { id: term, name: term }
43
- }
44
- },
45
- formatResult: formatTag,
46
- formatSelection: formatTag
47
- })
48
- }
49
-
50
- $(document).ready(function () {
51
- $('.tag_picker').tagAutocomplete()
52
- })
@@ -1,190 +0,0 @@
1
- div.select2-drop-mask {
2
- z-index: 999;
3
- }
4
- .select2-container {
5
- display: block;
6
-
7
- .select2-choice {
8
- height: $input-height;
9
- line-height: 2.2;
10
- border-color: $input-border-color;
11
- background-image: none;
12
- background-color: $input-bg;
13
- color: $gray-700;
14
-
15
- &,
16
- .select2-arrow {
17
- border-radius: $border-radius;
18
- }
19
-
20
- .select2-arrow {
21
- background-image: none;
22
- background-color: $input-bg;
23
- border:none;
24
- width: 30px;
25
-
26
- b {
27
- background-image: url(asset-path("backend-chevron-down.svg")) !important;
28
- overflow: hidden !important;
29
- vertical-align: middle !important;
30
- background-repeat: no-repeat !important;
31
- background-size: 1rem !important;
32
- background-position: 48% !important;
33
- }
34
- }
35
-
36
- .select2-chosen {
37
- vertical-align: middle;
38
- display: inline;
39
- }
40
-
41
- abbr {
42
- top: 12px;
43
- }
44
- }
45
- }
46
-
47
- .select2-container-multi .select2-choices .select2-search-field input {
48
- color: $gray-700;
49
- }
50
-
51
- .select2-search input {
52
- border-color: $input-border-color;
53
- border-radius: $border-radius;
54
- background-image: url(asset-path("backend-search.svg")) !important;
55
- overflow: hidden !important;
56
- vertical-align: middle !important;
57
- background-repeat: no-repeat !important;
58
- background-size: 1rem !important;
59
- background-position: 97% !important;
60
- }
61
-
62
- .select2-drop {
63
- z-index: $zindex-dropdown;
64
- &, &.select2-drop-above {
65
- border-radius: $border-radius;
66
- box-shadow: none;
67
- }
68
- }
69
-
70
- .select2-container-active {
71
- .select2-choice,
72
- .select2-choices {
73
- border-color: $input-focus-border-color;
74
- border-bottom: 1px solid $input-focus-border-color;
75
- }
76
- &, & a {
77
- box-shadow: none !important;
78
- }
79
- }
80
-
81
- .select2-dropdown-open.select2-drop-above .select2-choice,
82
- .select2-dropdown-open.select2-drop-above .select2-choices {
83
- background-image: none;
84
- }
85
-
86
-
87
- .select2-drop.select2-drop-active {
88
- border-color: $input-focus-border-color;
89
- border-top: 0;
90
- border-radius: 0 0 $border-radius $border-radius;
91
- margin-top: -6px;
92
- }
93
-
94
- .select2-drop.select2-drop-above.select2-drop-active {
95
- border-color: $input-focus-border-color;
96
- border-top: 1px solid $input-focus-border-color;
97
- border-radius: $border-radius $border-radius 0 0;
98
- margin-top: 6px;
99
- }
100
-
101
- .select2-container.select2-drop-above .select2-choice {
102
- border-color: $input-focus-border-color !important;
103
- border-radius: $border-radius;
104
- }
105
- .select2-result-label {
106
- color: $gray-900;
107
- }
108
-
109
- .select2-results .select2-highlighted {
110
- background-color: $primary;
111
- border-radius: $border-radius;
112
-
113
- .select2-result-label {
114
- color: white;
115
- }
116
- }
117
-
118
- .select2-container-multi {
119
- .select2-choices {
120
- min-height: $input-height;
121
- border-radius: $border-radius;
122
- line-height: 1;
123
- border-color: $input-border-color;
124
- background-image: none;
125
- background-color: $input-bg;
126
- display: flex;
127
- flex-wrap: wrap;
128
- align-items: center;
129
-
130
- .select2-search-choice {
131
- @extend .badge;
132
- @extend .badge-info;
133
- box-shadow: none;
134
- border: none;
135
- background-image: none;
136
- margin: 5px;
137
- padding: 7px;
138
-
139
- .select2-search-choice-close {
140
- background-image: url(asset-path("backend-cancel.svg")) !important ;
141
- position: absolute;
142
- left: 7px;
143
- top: 7px;
144
- background-position: 50% !important;
145
-
146
- }
147
-
148
- div {
149
- padding-left: 17px;
150
- }
151
- }
152
- }
153
-
154
- &.select2-container-active {
155
- .select2-choices {
156
- box-shadow: none;
157
- border-color: $input-focus-border-color;
158
- }
159
- }
160
- }
161
-
162
- .select2-search input,
163
- .select2-search-choice-close,
164
- .select2-container .select2-choice abbr,
165
- .select2-container .select2-choice .select2-arrow b {
166
- background-size: $select2-icon-size !important;
167
- }
168
-
169
- .select2-container.select2-allowclear .select2-choice abbr{
170
- background-image: url(asset-path("backend-cancel.svg")) !important ;
171
- overflow: hidden !important;
172
- vertical-align: middle !important;
173
- background-repeat: no-repeat !important;
174
- background-position: 50% !important;
175
- right:30px;
176
- background-size: $select2-icon-size !important;
177
- }
178
-
179
- .select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
180
- background-position: 50% !important;
181
- }
182
-
183
- // Bugfix for required elements
184
- select.select2[required="required"] {
185
- display: inline-block !important;
186
- width: 0;
187
- overflow: hidden;
188
- opacity:0;
189
- filter:alpha(opacity=0);
190
- }
@@ -1,17 +0,0 @@
1
- <div class="panel panel-default currencies">
2
- <div class="panel-heading">
3
- <%= Spree.t(:currencies) %>
4
- </div>
5
-
6
- <div class="panel-body">
7
- <div class="form-group">
8
- <div class="checkbox">
9
- <label>
10
- <%= check_box('', :show_store_currency_selector, { checked: Spree::Config.show_store_currency_selector }) %>
11
- <%= Spree.t('show_store_currency_selector.short') %>
12
- </label>
13
- <p class="help-block"><%= Spree.t('show_store_currency_selector.long') %></p>
14
- </div>
15
- </div>
16
- </div>
17
- </div>