spree_zoned 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -0
- data/app/assets/stylesheets/store/spree_zoned.css +1 -1
- data/app/controllers/spree/admin/zoned_controller.rb +8 -18
- data/app/views/spree/admin/zoned/_prd_country.html.erb +1 -1
- data/lib/generators/spree_zoned/install/install_generator.rb +33 -29
- data/spree_zoned.gemspec +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
div#zoned-countryselect { text-align: right; }
|
2
|
-
div#zoned-countryselect label {
|
2
|
+
div#zoned-countryselect label { color: #a33; }
|
@@ -1,24 +1,14 @@
|
|
1
1
|
module Spree
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
def setcountry
|
10
|
-
respond_to do |format|
|
11
|
-
format.js do
|
12
|
-
@current_country = params[:id]
|
13
|
-
render :nothing => true
|
14
|
-
end
|
2
|
+
module Admin
|
3
|
+
class ZonedController < BaseController
|
4
|
+
def setcountry
|
5
|
+
respond_to do |format|
|
6
|
+
format.js do
|
7
|
+
@current_country = params[:id]
|
8
|
+
render :nothing => true
|
15
9
|
end
|
16
10
|
end
|
17
|
-
|
18
11
|
end
|
19
|
-
|
20
|
-
end
|
21
|
-
|
12
|
+
end
|
22
13
|
end
|
23
|
-
|
24
14
|
end
|
@@ -4,7 +4,7 @@
|
|
4
4
|
options_for_select( # common countries have negative id
|
5
5
|
[["Kein Land ausgewählt", 0]] +
|
6
6
|
Rails.application.config.commonCountriesForSelect,
|
7
|
-
0, # preselect item "No country selected"
|
7
|
+
@current_country || 0, # preselect item "No country selected"
|
8
8
|
),
|
9
9
|
:data => {
|
10
10
|
:remote => true,
|
@@ -1,44 +1,48 @@
|
|
1
|
-
module
|
2
|
-
module
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
source_root File.expand_path("../assets", __FILE__)
|
1
|
+
module SpreeZoned
|
2
|
+
module Generators
|
3
|
+
class InstallGenerator < Rails::Generators::Base
|
4
|
+
|
5
|
+
source_root File.expand_path("../assets", __FILE__)
|
7
6
|
|
8
|
-
|
7
|
+
def add_javascripts
|
8
|
+
res = ask 'Would you like to append spree_zoned to your js manifests now?\n(only answer no if you you\'ve already done it) [Y/n]'
|
9
|
+
if res == '' || res.downcase == 'y'
|
9
10
|
append_file 'app/assets/javascripts/store/all.js', "//= require store/spree_zoned\n"
|
10
11
|
append_file 'app/assets/javascripts/admin/all.js', "//= require admin/spree_zoned\n"
|
11
12
|
end
|
13
|
+
end
|
12
14
|
|
13
|
-
|
15
|
+
def add_stylesheets
|
16
|
+
res = ask 'Would you like to inject spree_zoned into your css manifests now?\n(only answer no if you you\'ve already done it) [Y/n]'
|
17
|
+
if res == '' || res.downcase == 'y'
|
14
18
|
inject_into_file 'app/assets/stylesheets/store/all.css', " *= require store/spree_zoned\n", :before => /\*\//, :verbose => true
|
15
19
|
inject_into_file 'app/assets/stylesheets/admin/all.css', " *= require admin/spree_zoned\n", :before => /\*\//, :verbose => true
|
16
20
|
end
|
21
|
+
end
|
17
22
|
|
18
|
-
|
19
|
-
|
20
|
-
|
23
|
+
def add_migrations
|
24
|
+
run 'bundle exec rake railties:install:migrations FROM=spree_zoned'
|
25
|
+
end
|
21
26
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
end
|
27
|
+
def run_migrations
|
28
|
+
res = ask 'Would you like to run the migrations now? [Y/n]'
|
29
|
+
if res == '' || res.downcase == 'y'
|
30
|
+
run 'bundle exec rake db:migrate'
|
31
|
+
else
|
32
|
+
puts 'Skipping rake db:migrate, don\'t forget to run it!'
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def copyasset(filename)
|
39
|
+
if copy_file "#{filename}", "app/assets/#{filename}"
|
40
|
+
puts "Copied #{filename} into app/assets/#{filename}\n"
|
41
|
+
else
|
42
|
+
puts "[Failed] File copying #{filename} into app/assets/#{filename}\n"
|
39
43
|
end
|
40
|
-
|
41
44
|
end
|
45
|
+
|
42
46
|
end
|
43
47
|
end
|
44
48
|
end
|
data/spree_zoned.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.platform = Gem::Platform::RUBY
|
4
4
|
s.name = 'spree_zoned'
|
5
|
-
s.version = '0.5.
|
5
|
+
s.version = '0.5.4'
|
6
6
|
s.summary = 'A Spree extension to make your store zoned'
|
7
7
|
s.description = "Everything you need for a zoned Spree store: zoned pricing, zoned products, zoned product ordering, zoned locales, ...\nProbalbly essential to you if you operate outside of the US."
|
8
8
|
s.required_ruby_version = '>= 1.9.2'
|