solidus_backend 3.1.5 → 3.2.0.alpha

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -6
  3. data/app/assets/javascripts/spree/backend/components/sortable_table.js +9 -1
  4. data/app/assets/javascripts/spree/backend/namespaces.js +1 -0
  5. data/app/assets/javascripts/spree/backend/products/index.js +7 -0
  6. data/app/assets/javascripts/spree/backend/shipments.js +1 -1
  7. data/app/assets/javascripts/spree/backend/variant_autocomplete.js +1 -3
  8. data/app/assets/javascripts/spree/backend/views/index.js +1 -0
  9. data/app/assets/javascripts/spree/backend/views/product/search.js +44 -0
  10. data/app/assets/javascripts/spree/backend.js +1 -0
  11. data/app/assets/stylesheets/spree/backend/components/_number_with_currency.scss +1 -0
  12. data/app/assets/stylesheets/spree/backend/shared/_forms.scss +9 -8
  13. data/app/assets/stylesheets/spree/backend/shared/_typography.scss +0 -32
  14. data/app/concerns/spree/admin/sets_user_language_locale_key.rb +9 -0
  15. data/app/controllers/spree/admin/base_controller.rb +2 -4
  16. data/app/controllers/spree/admin/cancellations_controller.rb +1 -1
  17. data/app/controllers/spree/admin/locale_controller.rb +2 -0
  18. data/app/controllers/spree/admin/orders/customer_details_controller.rb +1 -1
  19. data/app/controllers/spree/admin/orders_controller.rb +3 -3
  20. data/app/controllers/spree/admin/prices_controller.rb +1 -1
  21. data/app/controllers/spree/admin/reimbursements_controller.rb +2 -2
  22. data/app/controllers/spree/admin/stock_items_controller.rb +1 -1
  23. data/app/controllers/spree/admin/store_credits_controller.rb +6 -6
  24. data/app/controllers/spree/admin/tax_rates_controller.rb +11 -0
  25. data/app/controllers/spree/admin/users_controller.rb +3 -3
  26. data/app/helpers/spree/admin/products_helper.rb +4 -0
  27. data/app/helpers/spree/admin/stock_locations_helper.rb +1 -3
  28. data/app/views/spree/admin/adjustment_reasons/index.html.erb +8 -4
  29. data/app/views/spree/admin/adjustments/_adjustments_table.html.erb +2 -2
  30. data/app/views/spree/admin/adjustments/index.html.erb +1 -1
  31. data/app/views/spree/admin/orders/index.html.erb +6 -8
  32. data/app/views/spree/admin/payments/_list.html.erb +1 -1
  33. data/app/views/spree/admin/prices/_master_variant_table.html.erb +5 -6
  34. data/app/views/spree/admin/prices/_table.html.erb +5 -6
  35. data/app/views/spree/admin/products/edit.html.erb +2 -2
  36. data/app/views/spree/admin/products/index.html.erb +9 -3
  37. data/app/views/spree/admin/promotions/_rules.html.erb +9 -7
  38. data/app/views/spree/admin/promotions/index.html.erb +2 -2
  39. data/app/views/spree/admin/refunds/edit.html.erb +1 -1
  40. data/app/views/spree/admin/refunds/new.html.erb +6 -6
  41. data/app/views/spree/admin/shared/_head.html.erb +1 -1
  42. data/app/views/spree/admin/shared/_navigation.html.erb +5 -1
  43. data/app/views/spree/admin/shared/{_navigation_footer.html.erb → _navigation_footer_fallback.html.erb} +5 -5
  44. data/app/views/spree/admin/stock_items/_stock_management.html.erb +1 -1
  45. data/app/views/spree/admin/store_credit_reasons/index.html.erb +5 -3
  46. data/app/views/spree/admin/store_credits/index.html.erb +1 -1
  47. data/app/views/spree/admin/store_credits/show.html.erb +4 -3
  48. data/app/views/spree/admin/tax_rates/index.html.erb +31 -1
  49. data/app/views/spree/admin/users/_form.html.erb +1 -0
  50. data/app/views/spree/admin/users/edit.html.erb +1 -1
  51. data/app/views/spree/admin/users/index.html.erb +3 -3
  52. data/app/views/spree/admin/variants/_form.html.erb +7 -4
  53. data/app/views/spree/admin/variants/_table.html.erb +8 -7
  54. data/app/views/spree/admin/variants/_table_filter.html.erb +8 -9
  55. data/app/views/spree/admin/variants/index.html.erb +1 -1
  56. data/app/views/spree/admin/variants/new.html.erb +1 -0
  57. data/config/routes.rb +3 -3
  58. data/lib/spree/backend.rb +0 -1
  59. data/lib/spree/backend_configuration.rb +10 -0
  60. data/solidus_backend.gemspec +2 -1
  61. data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_en-CA.js +10 -0
  62. data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_lists.scss +35 -0
  63. metadata +13 -22
@@ -26,15 +26,21 @@
26
26
 
27
27
  <div class="col-4">
28
28
  <div class="field">
29
- <%= f.label :with_variant_sku_cont, Spree::Variant.human_attribute_name(:sku) %>
30
- <%= f.text_field :with_variant_sku_cont, size: 15 %>
29
+ <div class="js-kept-variant-sku-input">
30
+ <%= f.label :with_kept_variant_sku_cont, Spree::Variant.human_attribute_name(:sku) %>
31
+ <%= f.text_field :with_kept_variant_sku_cont, size: 15 %>
32
+ </div>
33
+ <div class="js-all-variant-sku-input">
34
+ <%= f.label :with_all_variant_sku_cont, Spree::Variant.human_attribute_name(:sku) %>
35
+ <%= f.text_field :with_all_variant_sku_cont, size: 15 %>
36
+ </div>
31
37
  </div>
32
38
  </div>
33
39
 
34
40
  <div class="col-2">
35
41
  <div class="field checkbox">
36
42
  <label>
37
- <%= f.check_box :with_discarded, { checked: params[:q][:with_discarded] == 'true' }, 'true', 'false' %>
43
+ <%= f.check_box :with_discarded, { checked: params[:q][:with_discarded] == 'true', class: 'js-with-discarded-input' }, 'true', 'false' %>
38
44
  <%= t('spree.show_deleted') %>
39
45
  </label>
40
46
  </div>
@@ -19,13 +19,15 @@
19
19
 
20
20
  <%= form_for @promotion, url: object_url, method: :put do |f| %>
21
21
  <fieldset class="no-border-top">
22
- <div id="promotion-policy-select" class="align-center row">
23
- <% Spree::Promotion::MATCH_POLICIES.each do |policy| %>
24
- <div class="col-6">
25
- <label><%= f.radio_button :match_policy, policy %> <%= t "spree.promotion_form.match_policies.#{policy}" %></label>
26
- </div>
27
- <% end %>
28
- </div>
22
+ <% if Spree::Config.allow_promotions_any_match_policy %>
23
+ <div id="promotion-policy-select" class="align-center row">
24
+ <% Spree::Promotion::MATCH_POLICIES.each do |policy| %>
25
+ <div class="col-6">
26
+ <label><%= f.radio_button :match_policy, policy %> <%= t "spree.promotion_form.match_policies.#{policy}" %></label>
27
+ </div>
28
+ <% end %>
29
+ </div>
30
+ <% end %>
29
31
 
30
32
  <div id="rules" class="filter_list">
31
33
  <% if @promotion.rules.any? %>
@@ -99,10 +99,10 @@
99
99
  <%= promotion.usage_count %>
100
100
  </td>
101
101
  <td>
102
- <%= promotion.starts_at.to_s(:long) if promotion.starts_at %>
102
+ <%= Spree::RailsCompatibility.to_fs(promotion.starts_at, :long) if promotion.starts_at %>
103
103
  </td>
104
104
  <td>
105
- <%= promotion.expires_at.to_s(:long) if promotion.expires_at %>
105
+ <%= Spree::RailsCompatibility.to_fs(promotion.expires_at, :long) if promotion.expires_at %>
106
106
  </td>
107
107
  <td class="actions">
108
108
  <% if can?(:edit, promotion) %>
@@ -10,7 +10,7 @@
10
10
  <div class="col-3">
11
11
  <div class="field">
12
12
  <%= f.label :amount %><br/>
13
- <%= @refund.amount %>
13
+ <%= @refund.display_amount %>
14
14
  </div>
15
15
  </div>
16
16
  <div class="col-3">
@@ -10,14 +10,14 @@
10
10
  <div data-hook="admin_refund_form_fields" class="row">
11
11
  <div class="col-3">
12
12
  <div class="field">
13
- <%= t('spree.payment_amount') %><br/>
14
- <%= @refund.payment.amount %>
13
+ <label><%= t('spree.payment_amount') %></label><br>
14
+ <%= Spree::Money.new(@refund.payment.amount) %>
15
15
  </div>
16
16
  </div>
17
17
  <div class="col-3">
18
18
  <div class="field">
19
- <%= t('spree.credit_allowed') %><br/>
20
- <%= @refund.payment.credit_allowed %>
19
+ <label><%= t('spree.credit_allowed') %></label><br/>
20
+ <%= Spree::Money.new(@refund.payment.credit_allowed) %>
21
21
  </div>
22
22
  </div>
23
23
  <div class="col-3">
@@ -29,13 +29,13 @@
29
29
  <div class="col-3">
30
30
  <div class="field">
31
31
  <%= f.label :refund_reason_id %><br/>
32
- <%= f.collection_select(:refund_reason_id, refund_reasons, :id, :name, {include_blank: true}, {class: 'custom-select fullwidth'}) %>
32
+ <%= f.collection_select(:refund_reason_id, refund_reasons, :id, :name, {prompt: t("spree.choose_reason")}, {class: 'custom-select fullwidth'}) %>
33
33
  </div>
34
34
  </div>
35
35
  </div>
36
36
 
37
37
  <div class="form-buttons filter-actions actions" data-hook="buttons">
38
- <%= f.submit Spree::Refund.model_name.human, class: 'btn btn-primary' %>
38
+ <%= f.submit t('spree.actions.refund'), class: 'btn btn-primary' %>
39
39
  <%= link_to t('spree.actions.cancel'), admin_order_payments_url(@refund.payment.order), class: 'btn btn-primary' %>
40
40
  </div>
41
41
  </fieldset>
@@ -41,7 +41,7 @@
41
41
  <%= render "spree/admin/shared/js_locale_data" %>
42
42
 
43
43
  <%= javascript_tag do -%>
44
- Spree.api_key = "<%= try_spree_current_user.try(:spree_api_key) %>";
44
+ Spree.api_key = "<%= spree_current_user.try(:spree_api_key) %>";
45
45
  Spree.env = "<%= Rails.env %>";
46
46
  <% end %>
47
47
 
@@ -7,7 +7,11 @@
7
7
  <span class="text"><%= t('spree.minimize_menu') %></span>
8
8
  <% end %>
9
9
  <%= render partial: 'spree/admin/shared/locale_selection' %>
10
- <%= render partial: 'spree/admin/shared/navigation_footer' %>
10
+ <% if lookup_context.exists?('spree/admin/shared/_navigation_footer') %>
11
+ <%= render partial: 'spree/admin/shared/navigation_footer' %>
12
+ <% else %>
13
+ <%= render partial: 'spree/admin/shared/navigation_footer_fallback' %>
14
+ <% end %>
11
15
  </div>
12
16
  </div>
13
17
  </div>
@@ -3,18 +3,18 @@
3
3
  any typical `rails generate spree:custom_user` auth, if you need something
4
4
  else you can override it like solidus_auth_devise does.
5
5
  -->
6
- <% if try_spree_current_user %>
6
+ <% if spree_current_user %>
7
7
  <ul id="login-nav" class="admin-login-nav">
8
8
  <li data-hook="user-account-link">
9
- <% if can?(:admin, try_spree_current_user) %>
10
- <%= link_to spree.edit_admin_user_path(try_spree_current_user) do %>
9
+ <% if can?(:admin, spree_current_user) %>
10
+ <%= link_to spree.edit_admin_user_path(spree_current_user) do %>
11
11
  <i class='fa fa-user'></i>
12
- <%= try_spree_current_user.email %>
12
+ <%= spree_current_user.email %>
13
13
  <% end %>
14
14
  <% else %>
15
15
  <a>
16
16
  <i class='fa fa-user'></i>
17
- <%= try_spree_current_user.email %>
17
+ <%= spree_current_user.email %>
18
18
  </a>
19
19
  <% end %>
20
20
  </li>
@@ -72,7 +72,7 @@
72
72
  </colgroup>
73
73
  <% variant.stock_items.each do |item| %>
74
74
  <% if @stock_item_stock_locations.include?(item.stock_location) %>
75
- <tr class="js-edit-stock-item stock-item-edit-row" data-variant-id="<%= variant.id %>" data-stock-item="<%= item.to_json %>" data-stock-location-name="<%= item.stock_location.name %>" data-track-inventory="<%= variant.should_track_inventory? %>" data-can-edit="<%= can?(:admin, Spree::StockItem) %>" data-variant-sku="<%= variant.sku %>">
75
+ <tr class="js-edit-stock-item stock-item-edit-row" data-variant-id="<%= variant.id %>" data-stock-item="<%= item.to_json %>" data-stock-location-name="<%= item.stock_location.name %>" data-track-inventory="<%= variant.should_track_inventory? %>" data-can-edit="<%= can?(:edit, Spree::StockItem) %>" data-variant-sku="<%= variant.sku %>">
76
76
  <%# This is rendered in JS %>
77
77
  </tr>
78
78
  <% end %>
@@ -6,9 +6,11 @@
6
6
 
7
7
  <% content_for :page_actions do %>
8
8
  <ul class='actions inline-menu'>
9
- <li>
10
- <%= link_to t('spree.new_store_credit_reason'), new_object_url, id: 'admin_new_named_type', class: 'btn btn-primary' %>
11
- </li>
9
+ <% if can?(:create, Spree::StoreCreditReason) %>
10
+ <li>
11
+ <%= link_to t('spree.new_store_credit_reason'), new_object_url, id: 'admin_new_named_type', class: 'btn btn-primary' %>
12
+ </li>
13
+ <% end %>
12
14
  </ul>
13
15
  <% end %>
14
16
 
@@ -70,6 +70,6 @@
70
70
  <div class="no-objects-found">
71
71
  <%= render 'spree/admin/shared/no_objects_found',
72
72
  resource: Spree::StoreCredit,
73
- new_resource_url: new_object_url %>
73
+ new_resource_url: spree.new_admin_user_store_credit_url %>
74
74
  </div>
75
75
  <% end %>
@@ -72,9 +72,10 @@
72
72
  <col style="width: 20%;" />
73
73
  <col style="width: 10%;" />
74
74
  <col style="width: 10%;" />
75
- <col style="width: 25%;" />
75
+ <col style="width: 20%;" />
76
+ <col style="width: 10%;" />
76
77
  <col style="width: 10%;" />
77
- <col style="width: 25%;" />
78
+ <col style="width: 20%;" />
78
79
  </colgroup>
79
80
  <thead>
80
81
  <tr>
@@ -84,7 +85,7 @@
84
85
  <th><%= t('spree.admin.store_credits.created_by') %></th>
85
86
  <th><%= Spree::StoreCreditEvent.human_attribute_name(:user_total_amount) %></th>
86
87
  <th><%= Spree::StoreCreditEvent.human_attribute_name(:amount_remaining) %></th>
87
- <th><%= Spree::StoreCreditReason.human_attribute_name(:name) %></th>
88
+ <th><%= t('spree.admin.store_credits.reason_for_updating') %></th>
88
89
  </tr>
89
90
  </thead>
90
91
  <tbody>
@@ -13,7 +13,35 @@
13
13
  <% end %>
14
14
  <% end %>
15
15
 
16
+ <% content_for :table_filter_title do %>
17
+ <%= t("spree.filter") %>
18
+ <% end %>
19
+
20
+ <% content_for :table_filter do %>
21
+ <%= search_form_for [:admin, @search], url: spree.admin_tax_rates_path do |f| %>
22
+ <div class= "row">
23
+ <div class="col-md-6">
24
+ <div class="field">
25
+ <%= f.label :zone_id_eq, Spree::Zone.model_name.human %>
26
+ <%= f.collection_select :zone_id_eq, @available_zones, :id, :name, { include_blank: t("spree.all") }, class: 'select2 fullwidth' %>
27
+ </div>
28
+ </div>
29
+ <div class="col-md-6">
30
+ <div class="field">
31
+ <%= f.label :tax_categories_id_eq, Spree::TaxCategory.model_name.human %>
32
+ <%= f.collection_select :tax_categories_id_eq, @available_categories, :id, :name, { include_blank: t("spree.all") }, class: 'select2 fullwidth' %>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ <div class="filter-actions">
37
+ <%= button_tag t("spree.filter_results"), class: "btn btn-primary" %>
38
+ </div>
39
+ <% end %>
40
+ <% end %>
41
+
16
42
  <% if @tax_rates.any? %>
43
+ <%= paginate @tax_rates, scope: spree, theme: "solidus_admin" %>
44
+
17
45
  <table class="index">
18
46
  <colgroup>
19
47
  <col style="width: 15%">
@@ -55,7 +83,7 @@
55
83
  <td><%=tax_rate.included_in_price? ? t('spree.say_yes') : t('spree.say_no') %></td>
56
84
  <td><%=tax_rate.show_rate_in_label? ? t('spree.say_yes') : t('spree.say_no') %></td>
57
85
  <td><%=tax_rate.expires_at.to_date.to_s(:short_date) if tax_rate.expires_at %></td>
58
- <td><%=tax_rate.calculator.to_s %></td>
86
+ <td><%=tax_rate.calculator && tax_rate.calculator.class.model_name.human %></td>
59
87
  <td class="actions">
60
88
  <% if can?(:update, tax_rate) %>
61
89
  <%= link_to_edit tax_rate, no_text: true %>
@@ -68,6 +96,8 @@
68
96
  <% end %>
69
97
  </tbody>
70
98
  </table>
99
+
100
+ <%= paginate @tax_rates, scope: spree, theme: "solidus_admin" %>
71
101
  <% else %>
72
102
  <div class="no-objects-found">
73
103
  <%= render 'spree/admin/shared/no_objects_found',
@@ -40,6 +40,7 @@
40
40
  <%= label_tag nil, plural_resource_name(Spree::StockLocation) %>
41
41
  <ul>
42
42
  <% if can?(:manage, Spree::UserStockLocation) %>
43
+ <%= hidden_field_tag('user[stock_location_ids][]', nil) %>
43
44
  <% @stock_locations.each do |stock_location| %>
44
45
  <li>
45
46
  <label>
@@ -32,7 +32,7 @@
32
32
  <% if @user.spree_api_key.present? %>
33
33
  <div id="current-api-key">
34
34
  <strong><%= t('.key') %>: </strong>
35
- <% if @user == try_spree_current_user %>
35
+ <% if @user == spree_current_user %>
36
36
  <%= @user.spree_api_key %>
37
37
  <% else %>
38
38
  <i>(<%= t('spree.hidden') %>)</i>
@@ -87,10 +87,10 @@
87
87
  <td class="align-center"><%= l user.created_at.to_date %></td>
88
88
  <td data-hook="admin_users_index_row_actions" class="actions">
89
89
  <% if can?(:edit, user) %>
90
- <%= link_to_edit user, no_text: true %>
90
+ <%= link_to_edit user, no_text: true, url: spree.admin_user_path(user) %>
91
91
  <% end %>
92
- <% if can?(:destroy, user) && user.orders.count.zero? %>
93
- <%= link_to_delete user, no_text: true %>
92
+ <% if can?(:destroy, user) && user.can_be_deleted? %>
93
+ <%= link_to_delete user, no_text: true, url: spree.admin_user_path(user) %>
94
94
  <% end %>
95
95
  </td>
96
96
  </tr>
@@ -17,7 +17,8 @@
17
17
  </div>
18
18
  </div>
19
19
  </fieldset>
20
- <fieldset class="no-border-top no-border-bottom">
20
+ <fieldset class="no-border-bottom">
21
+ <legend><%= t(".options") %></legend>
21
22
  <div class="row">
22
23
  <% @product.option_types.each_with_index do |option_type, index| %>
23
24
  <div class="col-3">
@@ -41,7 +42,8 @@
41
42
  </div>
42
43
 
43
44
  <div data-hook="admin_variant_form_additional_fields">
44
- <fieldset class="no-border-top no-border-bottom">
45
+ <fieldset class="no-border-bottom">
46
+ <legend><%= t(".properties") %></legend>
45
47
  <div class="row">
46
48
  <% [:weight, :height, :width, :depth].each_with_index do |field, index| %>
47
49
  <div class="col-3">
@@ -58,8 +60,9 @@
58
60
  </div>
59
61
 
60
62
  <div data-hook="admin_variant_form_fields">
61
- <fieldset class="no-border-top no-border-bottom">
62
- <p> <%== t('.pricing_hint') %> </p>
63
+ <fieldset class="no-border-bottom">
64
+ <legend><%= t(".pricing") %></legend>
65
+ <div class="alert alert-info"><%= t('.pricing_hint') %></div>
63
66
 
64
67
  <div class="row">
65
68
  <div class="col-3">
@@ -3,10 +3,9 @@
3
3
  <table class="index sortable" data-sortable-link="<%= update_positions_admin_product_variants_path(@product) %>">
4
4
  <colgroup>
5
5
  <col style="width: 5%" />
6
- <col style="width: 25%" />
7
- <col style="width: 20%" />
6
+ <col style="width: 35%" />
8
7
  <col style="width: 20%" />
9
- <col style="width: 15%" />
8
+ <col style="width: 25%" />
10
9
  <col style="width: 15%" />
11
10
  </colgroup>
12
11
  <thead data-hook="variants_header">
@@ -27,7 +26,7 @@
27
26
  <% end %>
28
27
  </td>
29
28
  <td><%= variant.options_text %></td>
30
- <td><%= variant.display_price.to_html %></td>
29
+ <td><%= variant.display_price&.to_html %></td>
31
30
  <td><%= variant.sku %></td>
32
31
  <td class="actions">
33
32
  <% if can?(:update, variant) %>
@@ -40,9 +39,11 @@
40
39
  </td>
41
40
  </tr>
42
41
  <% end %>
43
- <% if variants.empty? %>
44
- <tr><td colspan="4"><%= t('spree.none') %></td></tr>
45
- <% end %>
46
42
  </tbody>
47
43
  </table>
44
+ <% if variants.empty? %>
45
+ <div class="alert alert-warning">
46
+ <%= t('.no_variants_found', term: params[:variant_search_term]) %>
47
+ </div>
48
+ <% end %>
48
49
  <%= paginate variants, theme: "solidus_admin" %>
@@ -4,14 +4,13 @@
4
4
 
5
5
  <% content_for :table_filter do %>
6
6
  <%= form_for :variant_search, url: spree.admin_product_variants_path(product), method: :get do |f| %>
7
- <div class="col-10">
8
- <div data-hook="admin_variants_index_search" class="field">
9
- <%= f.label :variant_search_term, t('spree.variant_search_placeholder') %>
10
- <%= text_field_tag :variant_search_term, params[:variant_search_term], class: "fullwidth", placeholder: t('spree.variant_search_placeholder') %>
7
+ <div class="row">
8
+ <div class="col-10">
9
+ <div data-hook="admin_variants_index_search" class="field">
10
+ <%= f.label :variant_search_term, t('spree.variant_search_placeholder') %>
11
+ <%= text_field_tag :variant_search_term, params[:variant_search_term], class: "fullwidth", placeholder: t('spree.variant_search_placeholder') %>
12
+ </div>
11
13
  </div>
12
- </div>
13
-
14
- <% if product.variants.with_discarded.discarded.any? %>
15
14
  <div class="col-2">
16
15
  <div class="field checkbox">
17
16
  <label>
@@ -20,10 +19,10 @@
20
19
  </label>
21
20
  </div>
22
21
  </div>
23
- <% end %>
22
+ </div>
24
23
 
25
24
  <div class="actions filter-actions">
26
- <%= f.button :search %>
25
+ <%= button_tag t('spree.filter_results'), class: 'btn btn-primary' %>
27
26
  </div>
28
27
  <% end %>
29
28
  <% end %>
@@ -14,7 +14,7 @@
14
14
  <% end %>
15
15
  <% end %>
16
16
 
17
- <% if @product.variants.with_discarded.any? %>
17
+ <% if @product.variants.with_discarded.any? || params[:variant_search_term].present? %>
18
18
  <%= render "table_filter", product: @product %>
19
19
  <%= render "table", variants: @variants %>
20
20
  <% else %>
@@ -6,6 +6,7 @@
6
6
 
7
7
  <%= form_for [:admin, @product, @variant] do |f| %>
8
8
  <fieldset class="no-border-top" data-hook="admin_variant_new_form">
9
+ <legend><%= t('.new_variant') %></legend>
9
10
  <%= render partial: 'form', locals: { f: f } %>
10
11
  <%= render partial: 'spree/admin/shared/new_resource_links' %>
11
12
  </fieldset>
data/config/routes.rb CHANGED
@@ -77,8 +77,8 @@ Spree::Core::Engine.routes.draw do
77
77
  get :confirm
78
78
  put :complete
79
79
  post :resend
80
- get "/adjustments/unfinalize", to: "orders#unfinalize_adjustments"
81
- get "/adjustments/finalize", to: "orders#finalize_adjustments"
80
+ put "/adjustments/unfinalize", to: "orders#unfinalize_adjustments"
81
+ put "/adjustments/finalize", to: "orders#finalize_adjustments"
82
82
  put :approve
83
83
  put :cancel
84
84
  put :resume
@@ -91,7 +91,7 @@ Spree::Core::Engine.routes.draw do
91
91
  end
92
92
  end
93
93
 
94
- resources :adjustments
94
+ resources :adjustments, except: [:show]
95
95
  resources :return_authorizations do
96
96
  member do
97
97
  put :fire
data/lib/spree/backend.rb CHANGED
@@ -4,7 +4,6 @@ require 'spree_core'
4
4
  require 'spree_api'
5
5
 
6
6
  require 'jquery-rails'
7
- require 'coffee-rails'
8
7
  require 'sassc-rails'
9
8
  require 'handlebars_assets'
10
9
  require 'font-awesome-rails'
@@ -6,6 +6,16 @@ module Spree
6
6
  class BackendConfiguration < Preferences::Configuration
7
7
  preference :locale, :string, default: I18n.default_locale
8
8
 
9
+ preference :frontend_product_path,
10
+ :proc,
11
+ default: proc {
12
+ ->(template_context, product) {
13
+ return unless template_context.spree.respond_to?(:product_path)
14
+
15
+ template_context.spree.product_path(product)
16
+ }
17
+ }
18
+
9
19
  ORDER_TABS ||= [:orders, :payments, :creditcard_payments,
10
20
  :shipments, :credit_cards, :return_authorizations,
11
21
  :customer_returns, :adjustments, :customer_details]
@@ -14,6 +14,8 @@ Gem::Specification.new do |s|
14
14
  s.homepage = 'http://solidus.io'
15
15
  s.license = 'BSD-3-Clause'
16
16
 
17
+ s.metadata['rubygems_mfa_required'] = 'true'
18
+
17
19
  s.files = `git ls-files -z`.split("\x0").reject do |f|
18
20
  f.match(%r{^(spec|script)/})
19
21
  end
@@ -24,7 +26,6 @@ Gem::Specification.new do |s|
24
26
  s.add_dependency 'solidus_api', s.version
25
27
  s.add_dependency 'solidus_core', s.version
26
28
 
27
- s.add_dependency 'coffee-rails'
28
29
  s.add_dependency 'font-awesome-rails', '~> 4.0'
29
30
  s.add_dependency 'jbuilder', '~> 2.8'
30
31
  s.add_dependency 'jquery-rails'
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Select2 English Canada translations
3
+ */
4
+ (function ($) {
5
+ "use strict";
6
+
7
+ $.fn.select2.locales['en-CA'] = {};
8
+
9
+ $.extend($.fn.select2.defaults, $.fn.select2.locales['en-CA']);
10
+ })(jQuery);
@@ -5,3 +5,38 @@
5
5
  padding-left: 0;
6
6
  list-style: none;
7
7
  }
8
+
9
+ dl {
10
+ display: flex;
11
+ flex-wrap: wrap;
12
+ justify-content: space-between;
13
+ width: 100%;
14
+ overflow: hidden;
15
+ margin: 5px 0;
16
+ color: lighten($body-color, 15);
17
+
18
+ dt,
19
+ dd {
20
+ min-width: 40%;
21
+ line-height: 16px;
22
+ padding: 5px;
23
+ }
24
+
25
+ dt {
26
+ font-weight: $font-weight-bold;
27
+ padding-left: 0;
28
+ }
29
+
30
+ dd {
31
+ text-align: right;
32
+ padding-right: 0;
33
+ margin-left: 0;
34
+ }
35
+ }
36
+
37
+ .dl-collapse {
38
+ dt,
39
+ dd {
40
+ width: auto;
41
+ }
42
+ }