spree_core 0.50.2 → 0.50.3
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/admin/base_controller.rb +31 -0
- data/app/models/app_configuration.rb +3 -0
- data/app/models/spree/alert.rb +13 -0
- data/app/views/admin/general_settings/edit.html.erb +8 -0
- data/app/views/admin/general_settings/show.html.erb +5 -1
- data/app/views/admin/shared/_alert.html.erb +6 -0
- data/app/views/layouts/admin.html.erb +1 -0
- data/config/locales/en.yml +2 -0
- data/config/routes.rb +5 -1
- data/lib/spree_core/version.rb +1 -1
- data/public/javascripts/admin.js +6 -0
- data/public/stylesheets/admin/admin.css +29 -0
- metadata +63 -63
@@ -1,11 +1,42 @@
|
|
1
1
|
class Admin::BaseController < Spree::BaseController
|
2
2
|
ssl_required
|
3
3
|
|
4
|
+
before_filter :check_alerts if Rails.env.production?
|
5
|
+
|
4
6
|
helper :search
|
5
7
|
helper 'admin/navigation'
|
6
8
|
layout 'admin'
|
7
9
|
|
8
10
|
protected
|
11
|
+
def check_alerts
|
12
|
+
return unless current_user and should_check_alerts?
|
13
|
+
|
14
|
+
unless session.has_key? :alerts
|
15
|
+
begin
|
16
|
+
session[:alerts] = Spree::Alert.current(request.host)
|
17
|
+
filter_dismissed_alerts
|
18
|
+
Spree::Config.set :last_check_for_spree_alerts => DateTime.now.to_s
|
19
|
+
rescue
|
20
|
+
session[:alerts] = nil
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def should_check_alerts?
|
26
|
+
return false if not Spree::Config[:check_for_spree_alerts]
|
27
|
+
|
28
|
+
last_check = Spree::Config[:last_check_for_spree_alerts]
|
29
|
+
return true if last_check.blank?
|
30
|
+
|
31
|
+
DateTime.parse(last_check) < 12.hours.ago
|
32
|
+
end
|
33
|
+
|
34
|
+
def filter_dismissed_alerts
|
35
|
+
return unless session[:alerts]
|
36
|
+
dismissed = (Spree::Config[:dismissed_spree_alerts] || '').split(',')
|
37
|
+
session[:alerts].reject! { |a| dismissed.include? a.id.to_s }
|
38
|
+
end
|
39
|
+
|
9
40
|
def render_js_for_destroy
|
10
41
|
render :partial => "/admin/shared/destroy"
|
11
42
|
flash.notice = nil
|
@@ -32,6 +32,9 @@ class AppConfiguration < Configuration
|
|
32
32
|
preference :cache_static_content, :boolean, :default => true
|
33
33
|
preference :use_content_controller, :boolean, :default => true
|
34
34
|
preference :allow_checkout_on_gateway_error, :boolean, :default => false
|
35
|
+
preference :check_for_spree_alerts, :boolean, :default => true
|
36
|
+
preference :dismissed_spree_alerts, :string, :default => ''
|
37
|
+
preference :last_check_for_spree_alerts, :string, :default => nil
|
35
38
|
|
36
39
|
validates :name, :presence => true, :uniqueness => true
|
37
40
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class Spree::Alert < ActiveResource::Base
|
2
|
+
self.site = "http://alerts.spreecommerce.com/"
|
3
|
+
self.format = :json
|
4
|
+
|
5
|
+
def self.current(host)
|
6
|
+
find(:all, :params => { :version => Spree.version,
|
7
|
+
:name => Spree::Config[:site_name],
|
8
|
+
:host => host,
|
9
|
+
:rails_env => Rails.env,
|
10
|
+
:rails_version => Rails.version })
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
@@ -28,6 +28,14 @@
|
|
28
28
|
</label>
|
29
29
|
</p>
|
30
30
|
|
31
|
+
<p>
|
32
|
+
<label>
|
33
|
+
<input name="preferences[check_for_spree_alerts]" type="hidden" value="0" />
|
34
|
+
<%= check_box_tag('preferences[check_for_spree_alerts]', "1", Spree::Config[:check_for_spree_alerts]) %>
|
35
|
+
<%= t('spree_alert_checking') %>
|
36
|
+
</label>
|
37
|
+
</p>
|
38
|
+
|
31
39
|
<p class="form-buttons">
|
32
40
|
<%= button t('update') %>
|
33
41
|
<%= t("or") %> <%= link_to t("cancel"), admin_general_settings_url %>
|
@@ -19,7 +19,11 @@
|
|
19
19
|
<tr>
|
20
20
|
<td colspan="2">
|
21
21
|
<%= (Spree::Config[:allow_ssl_in_development_and_test] ? t("ssl_will_be_used_in_development_and_test_modes") : t("ssl_will_not_be_used_in_development_and_test_modes")) %>
|
22
|
-
|
22
|
+
</td>
|
23
|
+
</tr>
|
24
|
+
<tr>
|
25
|
+
<td colspan="2">
|
26
|
+
<%= (Spree::Config[:check_for_spree_alerts] ? t("spree_alert_checking") : t("spree_alert_not_checking")) %>
|
23
27
|
</tr>
|
24
28
|
</table>
|
25
29
|
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<div class="alert <%= alert.severity.downcase %>">
|
2
|
+
<%= alert.message %> <%= link_to alert.url_name, alert.url if alert.url %>
|
3
|
+
<%= link_to 'X', dismiss_alert_admin_general_settings_path(:alert_id => alert.id),
|
4
|
+
:remote => true, :method => :post, :class => 'dismiss' %>
|
5
|
+
</div>
|
6
|
+
|
data/config/locales/en.yml
CHANGED
@@ -907,6 +907,8 @@ en:
|
|
907
907
|
ssl_will_be_used_in_production_mode: "SSL will be used in production mode"
|
908
908
|
ssl_will_not_be_used_in_development_and_test_modes: "SSL will not be used in development and test mode if necessary."
|
909
909
|
ssl_will_not_be_used_in_production_mode: "SSL will not be used in production mode"
|
910
|
+
spree_alert_checking: "Check for Spree security and release alerts"
|
911
|
+
spree_alert_not_checking: "Not checking for Spree security and release alerts"
|
910
912
|
start: Start
|
911
913
|
start_date: Valid from
|
912
914
|
state: State
|
data/config/routes.rb
CHANGED
data/lib/spree_core/version.rb
CHANGED
data/public/javascripts/admin.js
CHANGED
@@ -583,3 +583,32 @@ span.handle{
|
|
583
583
|
width:14px;
|
584
584
|
height:15px;
|
585
585
|
}
|
586
|
+
|
587
|
+
.alert {
|
588
|
+
-moz-border-radius: 5px;
|
589
|
+
-webkit-border-radius: 5px;
|
590
|
+
border-radius: 5px;
|
591
|
+
font-size: 1.3em;
|
592
|
+
margin-bottom: 1em;
|
593
|
+
padding: 0.8em;
|
594
|
+
}
|
595
|
+
.alert a.dismiss {
|
596
|
+
float:right;
|
597
|
+
font-size: 0.8em;
|
598
|
+
}
|
599
|
+
.alert.release {
|
600
|
+
background: #ccddff url(../images/shadow_top.png) 0px -50px repeat-x;
|
601
|
+
color: #556699;
|
602
|
+
border: 1px solid #99aacc;
|
603
|
+
}
|
604
|
+
.alert.security {
|
605
|
+
background: #f4b4b4 url(../images/shadow_top.png) 0px -50px repeat-x;
|
606
|
+
color: #000000;
|
607
|
+
border: 1px solid #e75b5b;
|
608
|
+
}
|
609
|
+
.alert.news {
|
610
|
+
background: #ccffd4 url(../images/shadow_top.png) 0px -50px repeat-x;
|
611
|
+
color: #000000;
|
612
|
+
border: 1px solid #66ff7e;
|
613
|
+
}
|
614
|
+
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 209
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 50
|
9
|
-
-
|
10
|
-
version: 0.50.
|
9
|
+
- 3
|
10
|
+
version: 0.50.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sean Schofield
|
@@ -15,13 +15,10 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
19
|
-
default_executable:
|
18
|
+
date: 2011-10-21 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
|
-
|
23
|
-
prerelease: false
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
21
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
25
22
|
none: false
|
26
23
|
requirements:
|
27
24
|
- - "="
|
@@ -32,12 +29,12 @@ dependencies:
|
|
32
29
|
- 1
|
33
30
|
- 2
|
34
31
|
version: 0.1.2
|
32
|
+
requirement: *id001
|
35
33
|
type: :runtime
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: nested_set
|
39
34
|
prerelease: false
|
40
|
-
|
35
|
+
name: acts_as_list
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
41
38
|
none: false
|
42
39
|
requirements:
|
43
40
|
- - "="
|
@@ -48,12 +45,12 @@ dependencies:
|
|
48
45
|
- 6
|
49
46
|
- 4
|
50
47
|
version: 1.6.4
|
48
|
+
requirement: *id002
|
51
49
|
type: :runtime
|
52
|
-
version_requirements: *id002
|
53
|
-
- !ruby/object:Gem::Dependency
|
54
|
-
name: rd_unobtrusive_date_picker
|
55
50
|
prerelease: false
|
56
|
-
|
51
|
+
name: nested_set
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
57
54
|
none: false
|
58
55
|
requirements:
|
59
56
|
- - "="
|
@@ -64,12 +61,12 @@ dependencies:
|
|
64
61
|
- 1
|
65
62
|
- 0
|
66
63
|
version: 0.1.0
|
64
|
+
requirement: *id003
|
67
65
|
type: :runtime
|
68
|
-
version_requirements: *id003
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: highline
|
71
66
|
prerelease: false
|
72
|
-
|
67
|
+
name: rd_unobtrusive_date_picker
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
73
70
|
none: false
|
74
71
|
requirements:
|
75
72
|
- - "="
|
@@ -80,12 +77,12 @@ dependencies:
|
|
80
77
|
- 5
|
81
78
|
- 1
|
82
79
|
version: 1.5.1
|
80
|
+
requirement: *id004
|
83
81
|
type: :runtime
|
84
|
-
version_requirements: *id004
|
85
|
-
- !ruby/object:Gem::Dependency
|
86
|
-
name: stringex
|
87
82
|
prerelease: false
|
88
|
-
|
83
|
+
name: highline
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
89
86
|
none: false
|
90
87
|
requirements:
|
91
88
|
- - "="
|
@@ -96,12 +93,12 @@ dependencies:
|
|
96
93
|
- 0
|
97
94
|
- 3
|
98
95
|
version: 1.0.3
|
96
|
+
requirement: *id005
|
99
97
|
type: :runtime
|
100
|
-
version_requirements: *id005
|
101
|
-
- !ruby/object:Gem::Dependency
|
102
|
-
name: state_machine
|
103
98
|
prerelease: false
|
104
|
-
|
99
|
+
name: stringex
|
100
|
+
- !ruby/object:Gem::Dependency
|
101
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
105
102
|
none: false
|
106
103
|
requirements:
|
107
104
|
- - "="
|
@@ -112,12 +109,12 @@ dependencies:
|
|
112
109
|
- 9
|
113
110
|
- 4
|
114
111
|
version: 0.9.4
|
112
|
+
requirement: *id006
|
115
113
|
type: :runtime
|
116
|
-
version_requirements: *id006
|
117
|
-
- !ruby/object:Gem::Dependency
|
118
|
-
name: faker
|
119
114
|
prerelease: false
|
120
|
-
|
115
|
+
name: state_machine
|
116
|
+
- !ruby/object:Gem::Dependency
|
117
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
121
118
|
none: false
|
122
119
|
requirements:
|
123
120
|
- - "="
|
@@ -128,12 +125,12 @@ dependencies:
|
|
128
125
|
- 9
|
129
126
|
- 5
|
130
127
|
version: 0.9.5
|
128
|
+
requirement: *id007
|
131
129
|
type: :runtime
|
132
|
-
version_requirements: *id007
|
133
|
-
- !ruby/object:Gem::Dependency
|
134
|
-
name: paperclip
|
135
130
|
prerelease: false
|
136
|
-
|
131
|
+
name: faker
|
132
|
+
- !ruby/object:Gem::Dependency
|
133
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
137
134
|
none: false
|
138
135
|
requirements:
|
139
136
|
- - "="
|
@@ -144,12 +141,12 @@ dependencies:
|
|
144
141
|
- 3
|
145
142
|
- 8
|
146
143
|
version: 2.3.8
|
144
|
+
requirement: *id008
|
147
145
|
type: :runtime
|
148
|
-
version_requirements: *id008
|
149
|
-
- !ruby/object:Gem::Dependency
|
150
|
-
name: rd_resource_controller
|
151
146
|
prerelease: false
|
152
|
-
|
147
|
+
name: paperclip
|
148
|
+
- !ruby/object:Gem::Dependency
|
149
|
+
version_requirements: &id009 !ruby/object:Gem::Requirement
|
153
150
|
none: false
|
154
151
|
requirements:
|
155
152
|
- - ">="
|
@@ -158,12 +155,12 @@ dependencies:
|
|
158
155
|
segments:
|
159
156
|
- 0
|
160
157
|
version: "0"
|
158
|
+
requirement: *id009
|
161
159
|
type: :runtime
|
162
|
-
version_requirements: *id009
|
163
|
-
- !ruby/object:Gem::Dependency
|
164
|
-
name: meta_search
|
165
160
|
prerelease: false
|
166
|
-
|
161
|
+
name: rd_resource_controller
|
162
|
+
- !ruby/object:Gem::Dependency
|
163
|
+
version_requirements: &id010 !ruby/object:Gem::Requirement
|
167
164
|
none: false
|
168
165
|
requirements:
|
169
166
|
- - "="
|
@@ -174,12 +171,12 @@ dependencies:
|
|
174
171
|
- 0
|
175
172
|
- 1
|
176
173
|
version: 1.0.1
|
174
|
+
requirement: *id010
|
177
175
|
type: :runtime
|
178
|
-
version_requirements: *id010
|
179
|
-
- !ruby/object:Gem::Dependency
|
180
|
-
name: activemerchant
|
181
176
|
prerelease: false
|
182
|
-
|
177
|
+
name: meta_search
|
178
|
+
- !ruby/object:Gem::Dependency
|
179
|
+
version_requirements: &id011 !ruby/object:Gem::Requirement
|
183
180
|
none: false
|
184
181
|
requirements:
|
185
182
|
- - "="
|
@@ -190,12 +187,12 @@ dependencies:
|
|
190
187
|
- 12
|
191
188
|
- 0
|
192
189
|
version: 1.12.0
|
190
|
+
requirement: *id011
|
193
191
|
type: :runtime
|
194
|
-
version_requirements: *id011
|
195
|
-
- !ruby/object:Gem::Dependency
|
196
|
-
name: will_paginate
|
197
192
|
prerelease: false
|
198
|
-
|
193
|
+
name: activemerchant
|
194
|
+
- !ruby/object:Gem::Dependency
|
195
|
+
version_requirements: &id012 !ruby/object:Gem::Requirement
|
199
196
|
none: false
|
200
197
|
requirements:
|
201
198
|
- - "="
|
@@ -207,12 +204,12 @@ dependencies:
|
|
207
204
|
- pre
|
208
205
|
- 2
|
209
206
|
version: 3.0.pre2
|
207
|
+
requirement: *id012
|
210
208
|
type: :runtime
|
211
|
-
version_requirements: *id012
|
212
|
-
- !ruby/object:Gem::Dependency
|
213
|
-
name: rails
|
214
209
|
prerelease: false
|
215
|
-
|
210
|
+
name: will_paginate
|
211
|
+
- !ruby/object:Gem::Dependency
|
212
|
+
version_requirements: &id013 !ruby/object:Gem::Requirement
|
216
213
|
none: false
|
217
214
|
requirements:
|
218
215
|
- - "="
|
@@ -223,12 +220,12 @@ dependencies:
|
|
223
220
|
- 0
|
224
221
|
- 7
|
225
222
|
version: 3.0.7
|
223
|
+
requirement: *id013
|
226
224
|
type: :runtime
|
227
|
-
version_requirements: *id013
|
228
|
-
- !ruby/object:Gem::Dependency
|
229
|
-
name: jquery-rails
|
230
225
|
prerelease: false
|
231
|
-
|
226
|
+
name: rails
|
227
|
+
- !ruby/object:Gem::Dependency
|
228
|
+
version_requirements: &id014 !ruby/object:Gem::Requirement
|
232
229
|
none: false
|
233
230
|
requirements:
|
234
231
|
- - "="
|
@@ -239,8 +236,10 @@ dependencies:
|
|
239
236
|
- 2
|
240
237
|
- 6
|
241
238
|
version: 0.2.6
|
239
|
+
requirement: *id014
|
242
240
|
type: :runtime
|
243
|
-
|
241
|
+
prerelease: false
|
242
|
+
name: jquery-rails
|
244
243
|
description: Required dependancy for Spree
|
245
244
|
email: sean@railsdog.com
|
246
245
|
executables: []
|
@@ -369,6 +368,7 @@ files:
|
|
369
368
|
- app/models/shipment.rb
|
370
369
|
- app/models/shipping_category.rb
|
371
370
|
- app/models/shipping_method.rb
|
371
|
+
- app/models/spree/alert.rb
|
372
372
|
- app/models/state.rb
|
373
373
|
- app/models/state_event.rb
|
374
374
|
- app/models/tax_category.rb
|
@@ -496,6 +496,7 @@ files:
|
|
496
496
|
- app/views/admin/shared/_additional_field.html.erb
|
497
497
|
- app/views/admin/shared/_address.html.erb
|
498
498
|
- app/views/admin/shared/_address_form.html.erb
|
499
|
+
- app/views/admin/shared/_alert.html.erb
|
499
500
|
- app/views/admin/shared/_calculator_fields.html.erb
|
500
501
|
- app/views/admin/shared/_configuration_menu.html.erb
|
501
502
|
- app/views/admin/shared/_destroy.js.erb
|
@@ -1094,7 +1095,6 @@ files:
|
|
1094
1095
|
- public/stylesheets/datepicker.css
|
1095
1096
|
- public/stylesheets/jquery.autocomplete.css
|
1096
1097
|
- public/stylesheets/screen.css
|
1097
|
-
has_rdoc: true
|
1098
1098
|
homepage: http://spreecommerce.com
|
1099
1099
|
licenses: []
|
1100
1100
|
|
@@ -1126,7 +1126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1126
1126
|
requirements:
|
1127
1127
|
- none
|
1128
1128
|
rubyforge_project: spree_core
|
1129
|
-
rubygems_version: 1.
|
1129
|
+
rubygems_version: 1.8.10
|
1130
1130
|
signing_key:
|
1131
1131
|
specification_version: 3
|
1132
1132
|
summary: Core e-commerce functionality for the Spree project.
|