spree_backend 3.0.4 → 3.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/spree/backend.js +35 -1
- data/app/assets/stylesheets/spree/backend/components/_labels.scss +4 -2
- data/app/controllers/spree/admin/base_controller.rb +42 -71
- data/app/controllers/spree/admin/general_settings_controller.rb +1 -10
- data/app/views/spree/admin/images/new.html.erb +2 -0
- data/app/views/spree/admin/products/_form.html.erb +6 -0
- data/app/views/spree/admin/return_authorizations/index.html.erb +1 -1
- data/app/views/spree/admin/taxons/_form.html.erb +1 -1
- data/app/views/spree/admin/variants/_autocomplete_line_items_stock.js.erb +1 -1
- data/app/views/spree/admin/variants/_autocomplete_stock.js.erb +5 -5
- data/app/views/spree/layouts/admin.html.erb +0 -1
- data/config/routes.rb +0 -1
- metadata +8 -22
- data/app/views/spree/admin/shared/_alert.html.erb +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cebe3e7299845641b73d9070be94f428951ab670
|
4
|
+
data.tar.gz: 4e5ec2d0d25cb341c0096b54273f5463ce1fa434
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8d848cf38a22b7ee82476b0fb552035439987a1219e3447850fdfb6d18ac2df147302e1cb6cad98b0d538620e98020136505dbe387ecc055159d74d2a0607b0
|
7
|
+
data.tar.gz: ccb8dd70ac73d53bef5a00e541581391d85f4fb5c9b0e9c1154e193f24cc7c0000605482e175467b13c1370793a38b02417e9f40766aa358c78b4d03f6cb5045
|
@@ -11,7 +11,41 @@
|
|
11
11
|
//= require velocity
|
12
12
|
//= require spree
|
13
13
|
//= require spree/backend/spree-select2
|
14
|
-
//=
|
14
|
+
//= require spree/backend/address_states
|
15
|
+
//= require spree/backend/adjustments
|
16
|
+
//= require spree/backend/admin
|
17
|
+
//= require spree/backend/calculator
|
18
|
+
//= require spree/backend/checkouts/edit
|
19
|
+
//= require spree/backend/gateway
|
20
|
+
//= require spree/backend/general_settings
|
21
|
+
//= require spree/backend/handlebar_extensions
|
22
|
+
//= require spree/backend/line_items
|
23
|
+
//= require spree/backend/line_items_on_order_edit
|
24
|
+
//= require spree/backend/nested-attribute
|
25
|
+
//= require spree/backend/option_type_autocomplete
|
26
|
+
//= require spree/backend/option_value_picker
|
27
|
+
//= require spree/backend/orders/edit
|
28
|
+
//= require spree/backend/orders/edit_form
|
29
|
+
//= require spree/backend/payments/edit
|
30
|
+
//= require spree/backend/payments/new
|
31
|
+
//= require spree/backend/product_picker
|
32
|
+
//= require spree/backend/progress
|
33
|
+
//= require spree/backend/promotions
|
34
|
+
//= require spree/backend/returns/expedited_exchanges_warning
|
35
|
+
//= require spree/backend/returns/return_item_selection
|
36
|
+
//= require spree/backend/shipments
|
37
|
+
//= require spree/backend/states
|
38
|
+
//= require spree/backend/stock_management
|
39
|
+
//= require spree/backend/stock_movement
|
40
|
+
//= require spree/backend/stock_transfer
|
41
|
+
//= require spree/backend/taxon_autocomplete
|
42
|
+
//= require spree/backend/taxon_tree_menu
|
43
|
+
//= require spree/backend/taxonomy
|
44
|
+
//= require spree/backend/taxons
|
45
|
+
//= require spree/backend/user_picker
|
46
|
+
//= require spree/backend/variant_autocomplete
|
47
|
+
//= require spree/backend/variant_management
|
48
|
+
//= require spree/backend/zone
|
15
49
|
|
16
50
|
Spree.routes.clear_cache = Spree.pathFor('admin/general_settings/clear_cache')
|
17
51
|
Spree.routes.checkouts_api = Spree.pathFor('api/checkouts')
|
@@ -7,7 +7,8 @@
|
|
7
7
|
.label-ready,
|
8
8
|
.label-active,
|
9
9
|
.label-success,
|
10
|
-
.label-sold
|
10
|
+
.label-sold,
|
11
|
+
.label-open
|
11
12
|
{
|
12
13
|
background-color: $brand-success;
|
13
14
|
|
@@ -20,7 +21,8 @@
|
|
20
21
|
.label-failed,
|
21
22
|
.label-considered_risky,
|
22
23
|
.label-error,
|
23
|
-
.label-invalid
|
24
|
+
.label-invalid,
|
25
|
+
.label-closed {
|
24
26
|
background-color: $brand-danger;
|
25
27
|
}
|
26
28
|
|
@@ -5,92 +5,63 @@ module Spree
|
|
5
5
|
helper 'spree/admin/tables'
|
6
6
|
layout '/spree/layouts/admin'
|
7
7
|
|
8
|
-
before_action :check_alerts
|
9
8
|
before_action :authorize_admin
|
9
|
+
before_action :generate_admin_api_key
|
10
10
|
|
11
11
|
protected
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
def authorize_admin
|
18
|
-
if respond_to?(:model_class, true) && model_class
|
19
|
-
record = model_class
|
20
|
-
else
|
21
|
-
record = controller_name.to_sym
|
22
|
-
end
|
23
|
-
authorize! :admin, record
|
24
|
-
authorize! action, record
|
25
|
-
end
|
26
|
-
|
27
|
-
# Need to generate an API key for a user due to some backend actions
|
28
|
-
# requiring authentication to the Spree API
|
29
|
-
def generate_admin_api_key
|
30
|
-
if (user = try_spree_current_user) && user.spree_api_key.blank?
|
31
|
-
user.generate_spree_api_key!
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def check_alerts
|
36
|
-
return unless should_check_alerts?
|
37
|
-
unless session.has_key? :alerts
|
38
|
-
session[:alerts] = Spree::Alert.current(request.host)
|
39
|
-
filter_dismissed_alerts
|
40
|
-
Spree::Config.set :last_check_for_spree_alerts => DateTime.now.to_s
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def should_check_alerts?
|
45
|
-
return false if !Rails.env.production? || !Spree::Config[:check_for_spree_alerts]
|
46
|
-
|
47
|
-
last_check = Spree::Config[:last_check_for_spree_alerts]
|
48
|
-
return true if last_check.blank?
|
13
|
+
def action
|
14
|
+
params[:action].to_sym
|
15
|
+
end
|
49
16
|
|
50
|
-
|
17
|
+
def authorize_admin
|
18
|
+
if respond_to?(:model_class, true) && model_class
|
19
|
+
record = model_class
|
20
|
+
else
|
21
|
+
record = controller_name.to_sym
|
51
22
|
end
|
23
|
+
authorize! :admin, record
|
24
|
+
authorize! action, record
|
25
|
+
end
|
52
26
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
27
|
+
# Need to generate an API key for a user due to some backend actions
|
28
|
+
# requiring authentication to the Spree API
|
29
|
+
def generate_admin_api_key
|
30
|
+
if (user = try_spree_current_user) && user.spree_api_key.blank?
|
31
|
+
user.generate_spree_api_key!
|
57
32
|
end
|
33
|
+
end
|
58
34
|
|
59
|
-
|
60
|
-
|
61
|
-
|
35
|
+
def flash_message_for(object, event_sym)
|
36
|
+
resource_desc = object.class.model_name.human
|
37
|
+
resource_desc += " \"#{object.name}\"" if object.respond_to?(:name) && object.name.present?
|
38
|
+
Spree.t(event_sym, resource: resource_desc)
|
39
|
+
end
|
62
40
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
return unless protect_against_forgery?
|
67
|
-
auth_token = params[request_forgery_protection_token]
|
68
|
-
unless (auth_token and form_authenticity_token == URI.unescape(auth_token))
|
69
|
-
raise(ActionController::InvalidAuthenticityToken)
|
70
|
-
end
|
71
|
-
end
|
41
|
+
def render_js_for_destroy
|
42
|
+
render partial: '/spree/admin/shared/destroy'
|
43
|
+
end
|
72
44
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
session[:alerts].reject! { |a| dismissed.include? a["id"].to_s }
|
81
|
-
end
|
45
|
+
# Index request for JSON needs to pass a CSRF token in order to prevent JSON Hijacking
|
46
|
+
def check_json_authenticity
|
47
|
+
return unless request.format.js? || request.format.json?
|
48
|
+
return unless protect_against_forgery?
|
49
|
+
auth_token = params[request_forgery_protection_token]
|
50
|
+
unless auth_token && form_authenticity_token == URI.unescape(auth_token)
|
51
|
+
raise(ActionController::InvalidAuthenticityToken)
|
82
52
|
end
|
53
|
+
end
|
83
54
|
|
84
|
-
|
85
|
-
|
86
|
-
|
55
|
+
def config_locale
|
56
|
+
Spree::Backend::Config[:locale]
|
57
|
+
end
|
87
58
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
end
|
59
|
+
def can_not_transition_without_customer_info
|
60
|
+
unless @order.billing_address.present?
|
61
|
+
flash[:notice] = Spree.t(:fill_in_customer_info)
|
62
|
+
redirect_to edit_admin_order_customer_url(@order)
|
93
63
|
end
|
64
|
+
end
|
94
65
|
end
|
95
66
|
end
|
96
67
|
end
|
@@ -6,7 +6,7 @@ module Spree
|
|
6
6
|
before_action :set_store
|
7
7
|
|
8
8
|
def edit
|
9
|
-
@preferences_security = [
|
9
|
+
@preferences_security = []
|
10
10
|
end
|
11
11
|
|
12
12
|
def update
|
@@ -21,15 +21,6 @@ module Spree
|
|
21
21
|
redirect_to edit_admin_general_settings_path
|
22
22
|
end
|
23
23
|
|
24
|
-
def dismiss_alert
|
25
|
-
if request.xhr? and params[:alert_id]
|
26
|
-
dismissed = Spree::Config[:dismissed_spree_alerts] || ''
|
27
|
-
Spree::Config.set dismissed_spree_alerts: dismissed.split(',').push(params[:alert_id]).join(',')
|
28
|
-
filter_dismissed_alerts
|
29
|
-
render nothing: true
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
24
|
def clear_cache
|
34
25
|
Rails.cache.clear
|
35
26
|
invoke_callbacks(:clear_cache, :after)
|
@@ -188,6 +188,12 @@
|
|
188
188
|
|
189
189
|
|
190
190
|
<div data-hook="admin_product_form_meta">
|
191
|
+
<div data-hook="admin_product_form_meta_title">
|
192
|
+
<%= f.field_container :meta_title, class: ['form-group'] do %>
|
193
|
+
<%= f.label :meta_title, Spree.t(:meta_title) %>
|
194
|
+
<%= f.text_field :meta_title, class: 'form-control' %>
|
195
|
+
<% end %>
|
196
|
+
</div>
|
191
197
|
|
192
198
|
<div data-hook="admin_product_form_meta_keywords">
|
193
199
|
<%= f.field_container :meta_keywords, class: ['form-group'] do %>
|
@@ -43,7 +43,7 @@
|
|
43
43
|
<%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::ReturnAuthorization)) %>
|
44
44
|
</div>
|
45
45
|
<% else %>
|
46
|
-
<div data-hook="
|
46
|
+
<div data-hook="rma_cannot_create" class="alert alert-info no-objects-found">
|
47
47
|
<%= Spree.t(:cannot_create_returns) %>
|
48
48
|
</div>
|
49
49
|
<% end %>
|
@@ -39,7 +39,7 @@
|
|
39
39
|
<%= f.text_field :meta_description, :class => 'form-control', :rows => 6 %>
|
40
40
|
<% end %>
|
41
41
|
|
42
|
-
<%= f.field_container :
|
42
|
+
<%= f.field_container :meta_keywords, class: ['form-group'] do %>
|
43
43
|
<%= f.label :meta_keywords, Spree.t(:meta_keywords) %>
|
44
44
|
<%= f.text_field :meta_keywords, :class => 'form-control', :rows => 6 %>
|
45
45
|
<% end %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<script type='text/template' id='variant_autocomplete_stock_template'>
|
2
|
-
|
2
|
+
|
3
3
|
<label><%= Spree.t(:select_stock) %></label>
|
4
4
|
<table class="table table-condensed table-bordered stock-levels no-marginb" data-hook="stock-levels">
|
5
5
|
<thead>
|
@@ -13,12 +13,12 @@
|
|
13
13
|
<tr>
|
14
14
|
<td>{{this.stock_location_name}}</td>
|
15
15
|
{{#unless ../variant.track_inventory}}
|
16
|
-
<td
|
16
|
+
<td><%= Spree.t(:doesnt_track_inventory) %></td>
|
17
17
|
<td>
|
18
18
|
<input class="quantity form-control input-sm" id="stock_item_quantity" data-stock-location-id="{{this.stock_location_id}}" type="number" min="1" value="1">
|
19
19
|
</td>
|
20
20
|
<td class="actions actions-1">
|
21
|
-
<button class="btn btn-sm btn-
|
21
|
+
<button class="btn btn-sm btn-success add_variant with-tip" data-stock-location-id="{{this.stock_location_id}}" title="<%= Spree.t(:add) %>" data-action="add">
|
22
22
|
<span class="icon icon-add"></span>
|
23
23
|
</button>
|
24
24
|
</td>
|
@@ -32,7 +32,7 @@
|
|
32
32
|
<input class="quantity form-control input-sm" id="stock_item_quantity" data-stock-location-id="{{this.stock_location_id}}" type="number" min="1" value="1">
|
33
33
|
</td>
|
34
34
|
<td class="actions actions-1">
|
35
|
-
<button class="btn btn-sm btn-
|
35
|
+
<button class="btn btn-sm btn-success add_variant with-tip" data-stock-location-id="{{this.stock_location_id}}" title="<%= Spree.t(:add) %>" data-action="add">
|
36
36
|
<span class="icon icon-add"></span>
|
37
37
|
</button>
|
38
38
|
</td>
|
@@ -44,5 +44,5 @@
|
|
44
44
|
</tr>
|
45
45
|
{{/each}}
|
46
46
|
</tbody>
|
47
|
-
</table>
|
47
|
+
</table>
|
48
48
|
</script>
|
@@ -49,7 +49,6 @@
|
|
49
49
|
<%# Alerts %>
|
50
50
|
<%#-------------------------------------------------%>
|
51
51
|
<%= flash_alert(flash) %>
|
52
|
-
<%= render partial: 'spree/admin/shared/alert', collection: session[:alerts] %>
|
53
52
|
|
54
53
|
<%#-------------------------------------------------%>
|
55
54
|
<%# Main content %>
|
data/config/routes.rb
CHANGED
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: 3.0.
|
4
|
+
version: 3.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-28 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: 3.0.
|
19
|
+
version: 3.0.5
|
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: 3.0.
|
26
|
+
version: 3.0.5
|
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: 3.0.
|
33
|
+
version: 3.0.5
|
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: 3.0.
|
40
|
+
version: 3.0.5
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bootstrap-sass
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,20 +94,6 @@ dependencies:
|
|
94
94
|
- - '='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 3.5.9.1
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: sprockets-rails
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '2.2'
|
104
|
-
type: :runtime
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '2.2'
|
111
97
|
description: Required dependency for Spree
|
112
98
|
email: sean@spreecommerce.com
|
113
99
|
executables: []
|
@@ -390,7 +376,6 @@ files:
|
|
390
376
|
- app/views/spree/admin/search/users.rabl
|
391
377
|
- app/views/spree/admin/shared/_address.html.erb
|
392
378
|
- app/views/spree/admin/shared/_address_form.html.erb
|
393
|
-
- app/views/spree/admin/shared/_alert.html.erb
|
394
379
|
- app/views/spree/admin/shared/_calculator_fields.html.erb
|
395
380
|
- app/views/spree/admin/shared/_content_header.html.erb
|
396
381
|
- app/views/spree/admin/shared/_destroy.js.erb
|
@@ -550,8 +535,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
550
535
|
requirements:
|
551
536
|
- none
|
552
537
|
rubyforge_project: spree_backend
|
553
|
-
rubygems_version: 2.4.
|
538
|
+
rubygems_version: 2.4.6
|
554
539
|
signing_key:
|
555
540
|
specification_version: 4
|
556
541
|
summary: backend e-commerce functionality for the Spree project.
|
557
542
|
test_files: []
|
543
|
+
has_rdoc:
|
@@ -1,8 +0,0 @@
|
|
1
|
-
<div class="col-md-12">
|
2
|
-
<div class="alert <%= alert['severity'].downcase %>">
|
3
|
-
<%= alert['message'] %> <%= link_to alert['url_name'], alert['url'] if alert['url'] %>
|
4
|
-
<%= link_to 'X', spree.dismiss_alert_admin_general_settings_path(:alert_id => alert['id']),
|
5
|
-
:remote => true, :method => :post, :class => 'dismiss' %>
|
6
|
-
</div>
|
7
|
-
|
8
|
-
</div>
|