spree_backend 2.3.3 → 2.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d2a0a8249ffdc4df0fd4419a9b2ec3b6871eaaf9
4
- data.tar.gz: d46f4f76c6804eb26c2c89443fccf1ba5acdf3a1
3
+ metadata.gz: 2247d6b1fd0f2c42d81b9e6fd359bc2ae51106af
4
+ data.tar.gz: f96494f83025962aac4de8de6064a8a7a12fa6bb
5
5
  SHA512:
6
- metadata.gz: c8e9301a71888f597eb431fc65118566b8c41f6794e60b2b47048516bb4f89b0d3de26014a1c8e87a96ea44ee5c7d6a1536db14517f023ef5d3e90fa0b631c28
7
- data.tar.gz: 052547c594d36134b8001ecdacea0bb7c4ef65b5bcf90afd8abfe8039a3a99a2344107b65cc19756602d476cd518fd0ad10c876c0263b0c77b1609aaa0037a8b
6
+ metadata.gz: d66f25f0a706af218074a17849edc034b005fcf759c768e94eceadb96663db6013ff48358ced784be59c265eeac8fe419b09fb1f496666d0d800a3c43856e28f
7
+ data.tar.gz: 141a997656ca4272428900e729cd8e7fb0a42daff8d73c566bbfb3acbc6f9a8bd08567d19dd247046405cb0e634ced2ac5987b6bf6e8aea24c3b977b154ffd38
@@ -127,15 +127,12 @@ $(document).ready(function(){
127
127
  handle_date_picker_fields();
128
128
  $(".observe_field").on('change', function() {
129
129
  target = $(this).data("update");
130
- ajax_indicator = $(this).data("ajax-indicator") || '#busy_indicator';
131
130
  $(target).hide();
132
- $(ajax_indicator).show();
133
131
  $.ajax({ dataType: 'html',
134
132
  url: $(this).data("base-url")+encodeURIComponent($(this).val()),
135
133
  type: 'get',
136
134
  success: function(data){
137
135
  $(target).html(data);
138
- $(ajax_indicator).hide();
139
136
  $(target).show();
140
137
  }
141
138
  });
@@ -47,7 +47,7 @@ $(document).ready(function () {
47
47
  });
48
48
 
49
49
  //handle delete click
50
- $('a.delete-item').click(function(){
50
+ $('a.delete-item').click(function(event){
51
51
  if (confirm(Spree.translations.are_you_sure_delete)) {
52
52
  var del = $(this);
53
53
  var shipment_number = del.data('shipment-number');
@@ -56,6 +56,7 @@ $(document).ready(function () {
56
56
  toggleItemEdit();
57
57
  adjustShipmentItems(shipment_number, variant_id, 0);
58
58
  }
59
+ return false;
59
60
  });
60
61
 
61
62
  // handle ship click
@@ -78,7 +79,9 @@ $(document).ready(function () {
78
79
  $('a.cancel-method').click(toggleMethodEdit);
79
80
 
80
81
  // handle shipping method save
81
- $('[data-hook=admin_shipment_form] a.save-method').on('click', function () {
82
+ $('[data-hook=admin_shipment_form] a.save-method').on('click', function (event) {
83
+ event.preventDefault();
84
+
82
85
  var link = $(this);
83
86
  var shipment_number = link.data('shipment-number');
84
87
  var selected_shipping_rate_id = link.parents('tbody').find("select#selected_shipping_rate_id[data-shipment-number='" + shipment_number + "']").val();
@@ -171,6 +174,8 @@ toggleMethodEdit = function(){
171
174
  var link = $(this);
172
175
  link.parents('tbody').find('tr.edit-method').toggle();
173
176
  link.parents('tbody').find('tr.show-method').toggle();
177
+
178
+ return false;
174
179
  }
175
180
 
176
181
  toggleItemEdit = function(){
@@ -292,7 +297,9 @@ cancelItemSplit = function(event) {
292
297
  prev_row.find('a.delete-item').toggle();
293
298
  }
294
299
 
295
- addVariantFromStockLocation = function() {
300
+ addVariantFromStockLocation = function(event) {
301
+ event.preventDefault();
302
+
296
303
  $('#stock_details').hide();
297
304
 
298
305
  var variant_id = $('input.variant_autocomplete').val();
@@ -124,6 +124,8 @@ $color-ste-inactive-bg: $color-notice !default;
124
124
  $color-ste-inactive-text: $color-1 !default;
125
125
  $color-ste-considered_risky-bg: $color-error !default;
126
126
  $color-ste-considered_risky-text:$color-1 !default;
127
+ $color-ste-considered_safe-bg: $color-success !default;
128
+ $color-ste-considered_safe-text: $color-1 !default;
127
129
  $color-ste-success-bg: $color-success !default;
128
130
  $color-ste-success-text: $color-1 !default;
129
131
  $color-ste-notice-bg: $color-notice !default;
@@ -133,19 +135,19 @@ $color-ste-error-text: $color-1 !default;
133
135
 
134
136
  // Available states
135
137
  $states: completed, complete, sold, pending, awaiting_return, returned, credit_owed, paid, shipped, balance_due, backorder, checkout, cart, address,
136
- delivery, payment, confirm, canceled, failed, ready, void, active, inactive, considered_risky, success, notice, error !default;
138
+ delivery, payment, confirm, canceled, failed, ready, void, active, inactive, considered_risky, considered_safe, success, notice, error !default;
137
139
 
138
140
  $states-bg-colors: $color-ste-completed-bg, $color-ste-complete-bg, $color-ste-sold-bg, $color-ste-pending-bg, $color-ste-awaiting_return-bg,
139
141
  $color-ste-returned-bg, $color-ste-credit_owed-bg, $color-ste-paid-bg, $color-ste-shipped-bg, $color-ste-balance_due-bg, $color-ste-backorder-bg,
140
142
  $color-ste-checkout-bg, $color-ste-cart-bg, $color-ste-address-bg, $color-ste-delivery-bg, $color-ste-payment-bg, $color-ste-confirm-bg,
141
143
  $color-ste-canceled-bg, $color-ste-failed-bg, $color-ste-ready-bg, $color-ste-void-bg, $color-ste-active-bg, $color-ste-inactive-bg, $color-ste-considered_risky-bg,
142
- $color-ste-success-bg, $color-ste-notice-bg, $color-ste-error-bg !default;
144
+ $color-ste-considered_safe-bg, $color-ste-success-bg, $color-ste-notice-bg, $color-ste-error-bg !default;
143
145
 
144
146
  $states-text-colors: $color-ste-completed-text, $color-ste-complete-text, $color-ste-sold-text, $color-ste-pending-text, $color-ste-awaiting_return-text,
145
147
  $color-ste-returned-text, $color-ste-credit_owed-text, $color-ste-paid-text, $color-ste-shipped-text, $color-ste-balance_due-text, $color-ste-backorder-text,
146
148
  $color-ste-checkout-text, $color-ste-cart-text, $color-ste-address-text, $color-ste-delivery-text, $color-ste-payment-text, $color-ste-confirm-text,
147
149
  $color-ste-canceled-text, $color-ste-failed-text, $color-ste-ready-text, $color-ste-void-text, $color-ste-active-text, $color-ste-inactive-text, $color-ste-considered_risky-text,
148
- $color-ste-success-text, $color-ste-notice-text, $color-ste-error-text !default;
150
+ $color-ste-considered_safe-text, $color-ste-success-text, $color-ste-notice-text, $color-ste-error-text !default;
149
151
 
150
152
  // Available actions
151
153
  $actions: edit, clone, remove, void, capture, save, cancel, mail !default;
@@ -10,25 +10,12 @@ module Spree
10
10
 
11
11
  skip_before_filter :load_resource, only: [:toggle_state, :edit, :update, :destroy]
12
12
 
13
- def destroy
14
- find_adjustment
15
- super
16
- end
17
-
18
- def edit
19
- find_adjustment
20
- super
21
- end
13
+ before_action :find_adjustment, only: [:destroy, :edit, :update]
22
14
 
23
15
  def index
24
16
  @adjustments = @order.all_adjustments.order("created_at ASC")
25
17
  end
26
18
 
27
- def update
28
- find_adjustment
29
- super
30
- end
31
-
32
19
  private
33
20
 
34
21
  def find_adjustment
@@ -99,7 +99,7 @@ module Spree
99
99
 
100
100
  params[:q][:s] ||= "name asc"
101
101
  @collection = super
102
- @collection = @collection.with_deleted if params[:q][:deleted_at_null] == '0'
102
+ @collection = @collection.with_deleted if params[:q].delete(:deleted_at_null) == '0'
103
103
  # @search needs to be defined as this is passed to search_form_for
104
104
  @search = @collection.ransack(params[:q])
105
105
  @collection = @search.result.
@@ -188,7 +188,7 @@ class Spree::Admin::ResourceController < Spree::Admin::BaseController
188
188
  if model_class.respond_to?(:accessible_by) && !current_ability.has_block?(params[:action], model_class)
189
189
  model_class.accessible_by(current_ability, action)
190
190
  else
191
- model_class.scoped
191
+ model_class.where(nil)
192
192
  end
193
193
  end
194
194
 
@@ -20,5 +20,3 @@
20
20
  <%= javascript_tag do -%>
21
21
  var order_number = '<%= @order.number %>';
22
22
  <% end -%>
23
-
24
- <%= button_link_to Spree.t(:continue), @order.cart? ? new_admin_order_payment_url(@order) : admin_orders_url, :icon => 'arrow-right' %>
@@ -1,3 +1,5 @@
1
+ <%= render :partial => 'spree/admin/shared/configuration_menu' %>
2
+
1
3
  <% content_for :page_title do %>
2
4
  <%= Spree.t(:new_country) %>
3
5
  <% end %>
@@ -10,31 +10,31 @@
10
10
  <fieldset class="general no-border-top">
11
11
 
12
12
  <%= fields_for :store do |f| %>
13
- <div class="field">
13
+ <div class="field" data-hook="admin_general_setting_input_name">
14
14
  <%= f.label :name %>
15
15
  <br />
16
16
  <%= f.text_field :name, class: 'fullwidth' %>
17
17
  </div>
18
18
 
19
- <div class="field">
19
+ <div class="field" data-hook="admin_general_setting_input_seo_title">
20
20
  <%= f.label :seo_title %>
21
21
  <br />
22
22
  <%= f.text_field :seo_title, class: 'fullwidth' %>
23
23
  </div>
24
24
 
25
- <div class="field">
25
+ <div class="field" data-hook="admin_general_setting_input_meta_keywords">
26
26
  <%= f.label :meta_keywords %>
27
27
  <br />
28
28
  <%= f.text_field :meta_keywords, class: 'fullwidth' %>
29
29
  </div>
30
30
 
31
- <div class="field">
31
+ <div class="field" data-hook="admin_general_setting_input_meta_description">
32
32
  <%= f.label :meta_description %>
33
33
  <br />
34
34
  <%= f.text_field :meta_description, class: 'fullwidth' %>
35
35
  </div>
36
36
 
37
- <div class="field">
37
+ <div class="field" data-hook="admin_general_setting_input_url">
38
38
  <%= f.label :url %>
39
39
  <br />
40
40
  <%= f.text_field :url, class: 'fullwidth' %>
@@ -3,23 +3,24 @@
3
3
  <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @line_item } %>
4
4
  <% end %>
5
5
 
6
- <% if Spree::Order.checkout_step_names.include?(:delivery) %>
6
+ <% if Spree::Order.checkout_step_names.include?(:delivery) && !%w(cart address).include?(@order.state) %>
7
7
  <%= render :partial => "spree/admin/orders/shipment", :collection => @order.shipments, :locals => { :order => order } %>
8
8
  <% else %>
9
9
  <%= render :partial => "spree/admin/orders/line_items", :locals => { :order => order } %>
10
10
  <% end %>
11
+
11
12
  <%= render :partial => "spree/admin/orders/adjustments", :locals => {
12
- :adjustments => @order.line_item_adjustments,
13
+ :adjustments => @order.line_item_adjustments,
13
14
  :order => order,
14
15
  :title => Spree.t(:line_item_adjustments)
15
16
  } %>
16
17
  <%= render :partial => "spree/admin/orders/adjustments", :locals => {
17
- :adjustments => @order.shipment_adjustments,
18
+ :adjustments => @order.shipment_adjustments,
18
19
  :order => order,
19
20
  :title => Spree.t(:shipment_adjustments)
20
21
  } %>
21
22
  <%= render :partial => "spree/admin/orders/adjustments", :locals => {
22
- :adjustments => @order.adjustments,
23
+ :adjustments => @order.adjustments,
23
24
  :order => order,
24
25
  :title => Spree.t(:order_adjustments)
25
26
  } %>
@@ -34,6 +34,10 @@
34
34
  <%= f.select :state_eq, Spree::Order.state_machines[:state].states.collect {|s| [Spree.t("order_state.#{s.name}"), s.value]}, {:include_blank => true}, :class => 'select2' %>
35
35
  </div>
36
36
 
37
+ <div class="field">
38
+ <%= label_tag nil, Spree.t(:promotion) %>
39
+ <%= f.select :promotions_id_in, Spree::Promotion.applied.pluck(:name, :id), {:include_blank => true}, :class => 'select2' %>
40
+ </div>
37
41
  </div>
38
42
 
39
43
  <div class="four columns">
@@ -64,10 +68,10 @@
64
68
  <%= f.check_box :completed_at_not_null, {:checked => @show_only_completed}, '1', '0' %>
65
69
  <%= Spree.t(:show_only_complete_orders) %>
66
70
  </label>
67
- </div>
68
- <div class="field">
69
- <%= label_tag nil, Spree.t(:promotion) %>
70
- <%= f.select :promotions_id_in, Spree::Promotion.applied.pluck(:name, :id), {:include_blank => true}, :class => 'select2' %>
71
+ <label>
72
+ <%= f.check_box :considered_risky_eq, {:checked => (params[:q][:considered_risky_eq] == '1')}, '1', '' %>
73
+ <%= Spree.t(:show_only_considered_risky) %>
74
+ </label>
71
75
  </div>
72
76
  </div>
73
77
 
@@ -101,18 +105,19 @@
101
105
  <thead>
102
106
  <tr data-hook="admin_orders_index_headers">
103
107
  <% if @show_only_completed %>
104
- <th><%= sort_link @search, :completed_at, I18n.t(:completed_at, :scope => 'activerecord.attributes.spree/order') %></th>
108
+ <th><%= sort_link @search, :completed_at, I18n.t(:completed_at, :scope => 'activerecord.attributes.spree/order') %></th>
105
109
  <% else %>
106
- <th><%= sort_link @search, :created_at, I18n.t(:created_at, :scope => 'activerecord.attributes.spree/order') %></th>
110
+ <th><%= sort_link @search, :created_at, I18n.t(:created_at, :scope => 'activerecord.attributes.spree/order') %></th>
107
111
  <% end %>
108
- <th><%= sort_link @search, :number, I18n.t(:number, :scope => 'activerecord.attributes.spree/order') %></th>
109
- <th><%= sort_link @search, :state, I18n.t(:state, :scope => 'activerecord.attributes.spree/order') %></th>
110
- <th><%= sort_link @search, :payment_state, I18n.t(:payment_state, :scope => 'activerecord.attributes.spree/order') %></th>
112
+ <th><%= sort_link @search, :number, I18n.t(:number, :scope => 'activerecord.attributes.spree/order') %></th>
113
+ <th><%= sort_link @search, :considered_risky, I18n.t(:considered_risky, :scope => 'activerecord.attributes.spree/order') %></th>
114
+ <th><%= sort_link @search, :state, I18n.t(:state, :scope => 'activerecord.attributes.spree/order') %></th>
115
+ <th><%= sort_link @search, :payment_state, I18n.t(:payment_state, :scope => 'activerecord.attributes.spree/order') %></th>
111
116
  <% if Spree::Order.checkout_step_names.include?(:delivery) %>
112
117
  <th><%= sort_link @search, :shipment_state, I18n.t(:shipment_state, :scope => 'activerecord.attributes.spree/order') %></th>
113
118
  <% end %>
114
- <th><%= sort_link @search, :email, I18n.t(:email, :scope => 'activerecord.attributes.spree/order') %></th>
115
- <th><%= sort_link @search, :total, I18n.t(:total, :scope => 'activerecord.attributes.spree/order') %></th>
119
+ <th><%= sort_link @search, :email, I18n.t(:email, :scope => 'activerecord.attributes.spree/order') %></th>
120
+ <th><%= sort_link @search, :total, I18n.t(:total, :scope => 'activerecord.attributes.spree/order') %></th>
116
121
  <th data-hook="admin_orders_index_header_actions" class="actions"></th>
117
122
  </tr>
118
123
  </thead>
@@ -121,6 +126,7 @@
121
126
  <tr data-hook="admin_orders_index_rows" class="state-<%= order.state.downcase %> <%= cycle('odd', 'even') %>">
122
127
  <td class="align-center"><%= l (@show_only_completed ? order.completed_at : order.created_at).to_date %></td>
123
128
  <td class="align-center"><%= link_to order.number, edit_admin_order_path(order) %></td>
129
+ <td class="align-center"><span class="state <%= order.considered_risky ? 'considered_risky' : 'considered_safe' %>"></span></td>
124
130
  <td class="align-center"><span class="state <%= order.state.downcase %>"><%= Spree.t("order_state.#{order.state.downcase}") %></span></td>
125
131
  <td class="align-center"><span class="state <%= order.payment_state %>"><%= link_to Spree.t("payment_states.#{order.payment_state}"), admin_order_payments_path(order) if order.payment_state %></span></td>
126
132
  <% if Spree::Order.checkout_step_names.include?(:delivery) %>
@@ -17,8 +17,6 @@
17
17
  </select>
18
18
  </div>
19
19
 
20
- <%= image_tag 'select2-spinner.gif', :plugin => 'spree', :style => 'display:none;', :id => 'busy_indicator' %>
21
-
22
20
  <div id="state-list" data-hook>
23
21
  <%= render :partial => 'state_list'%>
24
22
  </div>
@@ -12,18 +12,18 @@
12
12
  </div>
13
13
  <div class="omega four columns">
14
14
  <%= f.field_container :active do %>
15
- <label for="active"><%= Spree.t(:state) %></label>
15
+ <label for="active"><%= Spree.t(:status) %></label>
16
16
  <ul>
17
17
  <li>
18
18
  <%= f.label :active, Spree.t(:active) %>
19
19
  <%= f.check_box :active %>
20
20
  </li>
21
21
  <li>
22
- <%= f.label :active, Spree.t(:backorderable_default) %>
22
+ <%= f.label :backorderable_default, Spree.t(:backorderable_default) %>
23
23
  <%= f.check_box :backorderable_default %>
24
24
  </li>
25
25
  <li>
26
- <%= f.label :active, Spree.t(:propagate_all_variants) %>
26
+ <%= f.label :propagate_all_variants, Spree.t(:propagate_all_variants) %>
27
27
  <%= f.check_box :propagate_all_variants %>
28
28
  </li>
29
29
  </ul>
@@ -1,3 +1,5 @@
1
+ <%= render :partial => 'spree/admin/shared/configuration_menu' %>
2
+
1
3
  <% content_for :page_title do %>
2
4
  <%= Spree.t(:editing_stock_location) %> <i class="fa fa-arrow-right"></i>
3
5
  <%= @stock_location.name %>
@@ -1,3 +1,5 @@
1
+ <%= render :partial => 'spree/admin/shared/configuration_menu' %>
2
+
1
3
  <% content_for :page_title do %>
2
4
  <%= Spree.t(:new_stock_location) %>
3
5
  <% end %>
@@ -82,8 +82,7 @@
82
82
  </fieldset>
83
83
 
84
84
  <div class="alpha twelve columns no-objects-found">
85
- <%= Spree.t(:no_resource_found, resource: I18n.t(:other, scope: 'activerecord.models.spree/stock_transfer')) %>,
86
- <%= link_to Spree.t(:add_one), spree.new_admin_tax_rate_path %>!
85
+ <%= Spree.t(:no_resource_found, resource: I18n.t(:other, scope: 'activerecord.models.spree/variant')) %>.
87
86
  </div>
88
87
 
89
88
  <div id="transfer-variants-table" class="twelve columns alpha" style="display:none">
@@ -49,5 +49,6 @@
49
49
  </tr>
50
50
  {{/each}}
51
51
  </tbody>
52
+ </table>
52
53
  </fieldset>
53
54
  </script>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_backend
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.3
4
+ version: 2.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-19 00:00:00.000000000 Z
11
+ date: 2014-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_api
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.3.3
19
+ version: 2.3.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.3.3
26
+ version: 2.3.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: spree_core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 2.3.3
33
+ version: 2.3.4
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 2.3.3
40
+ version: 2.3.4
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: jquery-rails
43
43
  requirement: !ruby/object:Gem::Requirement