solidus_backend 1.1.0.pre1 → 1.1.0.pre2
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.
Potentially problematic release.
This version of solidus_backend might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/controllers/spree/admin/stock_transfers_controller.rb +15 -6
- data/app/controllers/spree/admin/users_controller.rb +5 -4
- data/app/helpers/spree/admin/base_helper.rb +0 -6
- data/app/views/spree/admin/log_entries/index.html.erb +3 -1
- data/app/views/spree/admin/orders/confirm/_payments.html.erb +1 -1
- data/app/views/spree/admin/payments/_list.html.erb +1 -1
- data/app/views/spree/admin/promotions/_form.html.erb +5 -0
- data/app/views/spree/admin/promotions/rules/_first_repeat_purchase_since.html.erb +7 -0
- data/app/views/spree/admin/stock_transfers/new.html.erb +1 -1
- data/app/views/spree/admin/trackers/_form.html.erb +0 -6
- data/app/views/spree/admin/trackers/index.html.erb +0 -2
- data/app/views/spree/admin/users/_form.html.erb +6 -1
- data/app/views/spree/admin/users/index.html.erb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f6d121e26b92751779de7aace0d4e77e75560dd
|
4
|
+
data.tar.gz: 6ae2f4576db3c13f393ffaa8b3a4da8a4b1e1e1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f21748bda471f57c7aba52f32f6bcfcbc852a4f88c97dea5d9569cc39a96a35593fc82322ce7bc66bfa7e1f00e7579ef4eb4505625c13945f2e96bd106c6a376
|
7
|
+
data.tar.gz: 0be3e5b0cd73bd5d382e6d2675ccadff7ba339e5b44e540c0186b77cb1391d87ff3b487de6f0253e0f85b66044eb30346e4addd66f122b7d5c812917cb540b15
|
@@ -7,8 +7,9 @@ module Spree
|
|
7
7
|
{ translation_key: :name, attr_name: :name }
|
8
8
|
]
|
9
9
|
|
10
|
-
before_filter :load_transferable_stock_locations, only:
|
10
|
+
before_filter :load_transferable_stock_locations, only: :index
|
11
11
|
before_filter :load_variant_display_attributes, only: [:receive, :edit, :show, :tracking_info]
|
12
|
+
before_filter :load_source_stock_locations, only: :new
|
12
13
|
before_filter :load_destination_stock_locations, only: :edit
|
13
14
|
before_filter :ensure_access_to_stock_location, only: :create
|
14
15
|
before_filter :ensure_receivable_stock_transfer, only: :receive
|
@@ -99,16 +100,16 @@ module Spree
|
|
99
100
|
authorize! :create, duplicate
|
100
101
|
end
|
101
102
|
|
102
|
-
def
|
103
|
-
|
103
|
+
def load_transferable_stock_locations
|
104
|
+
@stock_locations = accessible_source_stock_locations | accessible_destination_stock_locations
|
104
105
|
end
|
105
106
|
|
106
|
-
def
|
107
|
-
@
|
107
|
+
def load_source_stock_locations
|
108
|
+
@source_stock_locations = accessible_source_stock_locations
|
108
109
|
end
|
109
110
|
|
110
111
|
def load_destination_stock_locations
|
111
|
-
@destination_stock_locations =
|
112
|
+
@destination_stock_locations = accessible_destination_stock_locations.where.not(id: @stock_transfer.source_location_id)
|
112
113
|
end
|
113
114
|
|
114
115
|
def load_variant_display_attributes
|
@@ -141,6 +142,14 @@ module Spree
|
|
141
142
|
@stock_transfer.destination_location.move(transfer_item.variant, transfer_item.received_quantity, @stock_transfer)
|
142
143
|
end
|
143
144
|
end
|
145
|
+
|
146
|
+
def accessible_source_stock_locations
|
147
|
+
@source_locations ||= Spree::StockLocation.accessible_by(current_ability, :transfer_from)
|
148
|
+
end
|
149
|
+
|
150
|
+
def accessible_destination_stock_locations
|
151
|
+
@destination_locations ||= Spree::StockLocation.accessible_by(current_ability, :transfer_to)
|
152
|
+
end
|
144
153
|
end
|
145
154
|
end
|
146
155
|
end
|
@@ -109,10 +109,11 @@ module Spree
|
|
109
109
|
end
|
110
110
|
|
111
111
|
def user_params
|
112
|
-
attributes = permitted_user_attributes
|
113
|
-
|
114
|
-
|
115
|
-
|
112
|
+
attributes = permitted_user_attributes
|
113
|
+
|
114
|
+
if action_name == "create" || can?(:update_email, @user)
|
115
|
+
attributes |= [:email]
|
116
|
+
end
|
116
117
|
|
117
118
|
if can? :manage, Spree::Role
|
118
119
|
attributes += [{ spree_role_ids: [] }]
|
@@ -159,12 +159,6 @@ module Spree
|
|
159
159
|
dom_id(record, 'spree')
|
160
160
|
end
|
161
161
|
|
162
|
-
def rails_environments
|
163
|
-
@@rails_environments ||= Dir.glob("#{Rails.root}/config/environments/*.rb")
|
164
|
-
.map { |f| File.basename(f, ".rb") }
|
165
|
-
.sort
|
166
|
-
end
|
167
|
-
|
168
162
|
private
|
169
163
|
def attribute_name_for(field_name)
|
170
164
|
field_name.gsub(' ', '_').downcase
|
@@ -15,7 +15,7 @@
|
|
15
15
|
<% payments.each do |payment| %>
|
16
16
|
<tr>
|
17
17
|
<td>
|
18
|
-
<%= link_to payment.
|
18
|
+
<%= link_to payment.number, spree.admin_order_payment_path(@order, payment) %>
|
19
19
|
</td>
|
20
20
|
<td>
|
21
21
|
<%= pretty_time(payment.created_at) %>
|
@@ -13,7 +13,7 @@
|
|
13
13
|
<tbody>
|
14
14
|
<% payments.each do |payment| %>
|
15
15
|
<tr id="<%= dom_id(payment) %>" data-hook="payments_row" class="<%= cycle('odd', 'even', name: 'payment_table_cycle')%>">
|
16
|
-
<td><%= link_to payment.
|
16
|
+
<td><%= link_to payment.number, spree.admin_order_payment_path(@order, payment) %></td>
|
17
17
|
<td><%= pretty_time(payment.created_at) %></td>
|
18
18
|
<td class="align-center amount"><%= payment.display_amount.to_html %></td>
|
19
19
|
<td class="align-center"><%= payment_method_name(payment) %></td>
|
@@ -33,6 +33,11 @@
|
|
33
33
|
<%= f.check_box :advertise %>
|
34
34
|
<%= f.label :advertise %>
|
35
35
|
<% end %>
|
36
|
+
|
37
|
+
<%= f.field_container :apply_automatically do %>
|
38
|
+
<%= f.check_box :apply_automatically %>
|
39
|
+
<%= f.label :apply_automatically %>
|
40
|
+
<% end %>
|
36
41
|
</div>
|
37
42
|
|
38
43
|
<div class="omega nine columns">
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<div class="field alpha four columns">
|
2
|
+
<%= Spree.t(:form_text, scope: "promotion_rule_types.first_repeat_purchase_since") %>
|
3
|
+
</div>
|
4
|
+
|
5
|
+
<div class="field omega four columns">
|
6
|
+
<%= number_field_tag "#{param_prefix}[preferred_days_ago]", promotion_rule.preferred_days_ago, :class => 'fullwidth' %>
|
7
|
+
</div>
|
@@ -14,7 +14,7 @@
|
|
14
14
|
<fieldset class="no-border-top">
|
15
15
|
<%= f.field_container :source_location do %>
|
16
16
|
<%= f.label nil, Spree.t(:source_location) %>
|
17
|
-
<%= f.select :source_location_id, options_from_collection_for_select(@
|
17
|
+
<%= f.select :source_location_id, options_from_collection_for_select(@source_stock_locations, :id, :name), {include_blank: true}, {class: 'select2 fullwidth', "data-placeholder" => Spree.t(:select_a_stock_location)} %>
|
18
18
|
<%= f.error_message_on :source_location %>
|
19
19
|
<% end %>
|
20
20
|
<%= f.field_container :description do %>
|
@@ -5,12 +5,6 @@
|
|
5
5
|
<%= text_field :tracker, :analytics_id, :class => 'fullwidth' %>
|
6
6
|
</div>
|
7
7
|
</div>
|
8
|
-
<div class="four columns">
|
9
|
-
<div data-hook="environment" class="field">
|
10
|
-
<%= label_tag :tracker_environment, Spree.t(:environment) %>
|
11
|
-
<%= collection_select(:tracker, :environment, rails_environments, :to_s, :titleize, {}, {:id => 'tracker-env', :class => 'select2 fullwidth'}) %>
|
12
|
-
</div>
|
13
|
-
</div>
|
14
8
|
<div class="omega four columns">
|
15
9
|
<div data-hook="active" class="field">
|
16
10
|
<%= label_tag nil, Spree.t(:active) %>
|
@@ -23,7 +23,6 @@
|
|
23
23
|
<thead>
|
24
24
|
<tr data-hook="admin_trackers_index_headers">
|
25
25
|
<th><%= Spree.t(:google_analytics_id) %></th>
|
26
|
-
<th><%= Spree.t(:environment) %></th>
|
27
26
|
<th><%= Spree.t(:active) %></th>
|
28
27
|
<th class="actions"></th>
|
29
28
|
</tr>
|
@@ -32,7 +31,6 @@
|
|
32
31
|
<% @trackers.each do |tracker|%>
|
33
32
|
<tr id="<%= spree_dom_id tracker %>" data-hook="admin_trackers_index_rows" class="<%= cycle('odd', 'even')%>">
|
34
33
|
<td class="align-center"><%= tracker.analytics_id %></td>
|
35
|
-
<td class="align-center"><%= tracker.environment.to_s.titleize %></td>
|
36
34
|
<td class="align-center"><%= tracker.active ? Spree.t(:say_yes) : Spree.t(:say_no) %></td>
|
37
35
|
<td class="actions">
|
38
36
|
<% if can?(:update, tracker) %>
|
@@ -2,7 +2,12 @@
|
|
2
2
|
<div class="alpha six columns">
|
3
3
|
<%= f.field_container :email do %>
|
4
4
|
<%= f.label :email, Spree.t(:email) %>
|
5
|
-
|
5
|
+
<% if can?(:update_email, @user) %>
|
6
|
+
<%= f.email_field :email, :class => 'fullwidth' %>
|
7
|
+
<% else %>
|
8
|
+
<span title="<%= Spree.t(:cannot_update_email) %>" class="fa fa-question-circle icon_link no-text with-tip"></span>
|
9
|
+
<%= f.email_field :email, :class => 'fullwidth', disabled: true %>
|
10
|
+
<% end %>
|
6
11
|
<%= error_message_on :user, :email %>
|
7
12
|
<% end %>
|
8
13
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<% end %>
|
4
4
|
|
5
5
|
<% content_for :page_actions do %>
|
6
|
-
<% if can?(
|
6
|
+
<% if can?(:admin, Spree.user_class) && can?(:create, Spree.user_class) %>
|
7
7
|
<li>
|
8
8
|
<%= button_link_to Spree.t(:new_user), new_admin_user_url, :icon => 'plus', :id => 'admin_new_user_link' %>
|
9
9
|
</li>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_backend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.0.
|
4
|
+
version: 1.1.0.pre2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Solidus Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus_api
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.1.0.
|
19
|
+
version: 1.1.0.pre2
|
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: 1.1.0.
|
26
|
+
version: 1.1.0.pre2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: solidus_core
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.1.0.
|
33
|
+
version: 1.1.0.pre2
|
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: 1.1.0.
|
40
|
+
version: 1.1.0.pre2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bourbon
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -409,6 +409,7 @@ files:
|
|
409
409
|
- app/views/spree/admin/promotions/index.html.erb
|
410
410
|
- app/views/spree/admin/promotions/new.html.erb
|
411
411
|
- app/views/spree/admin/promotions/rules/_first_order.html.erb
|
412
|
+
- app/views/spree/admin/promotions/rules/_first_repeat_purchase_since.html.erb
|
412
413
|
- app/views/spree/admin/promotions/rules/_item_total.html.erb
|
413
414
|
- app/views/spree/admin/promotions/rules/_landing_page.html.erb
|
414
415
|
- app/views/spree/admin/promotions/rules/_nth_order.html.erb
|