spree_zoned 0.5.4 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,7 +4,8 @@ module Spree
4
4
  def setcountry
5
5
  respond_to do |format|
6
6
  format.js do
7
- @current_country = params[:id]
7
+ session[:zoned] ||= {}
8
+ session[:zoned][:prd_country] = params[:id]
8
9
  render :nothing => true
9
10
  end
10
11
  end
@@ -1,17 +1,13 @@
1
1
  module Spree
2
-
3
- module Zoned
4
-
5
- class ZonedController < BaseController
6
-
7
- def setcountry
8
- respond_to do |format|
9
- format.js { render :nothing => true }
2
+ class ZonedController < BaseController
3
+ def setcountry
4
+ respond_to do |format|
5
+ format.js do
6
+ session[:zoned] ||= {}
7
+ session[:zoned][:current_country] = params[:id]
8
+ render :nothing => true
10
9
  end
11
10
  end
12
-
13
11
  end
14
-
15
12
  end
16
-
17
13
  end
@@ -1,10 +1,10 @@
1
- <li id="zoned-prd-country"">
1
+ <li id="zoned-prd-country">
2
2
  <%= label_tag t('country') + ": " %>
3
3
  <%= select_tag 'id',
4
4
  options_for_select( # common countries have negative id
5
5
  [["Kein Land ausgewählt", 0]] +
6
6
  Rails.application.config.commonCountriesForSelect,
7
- @current_country || 0, # preselect item "No country selected"
7
+ (session[:zoned] && session[:zoned][:prd_country]) || 0, # preselect item "No country selected"
8
8
  ),
9
9
  :data => {
10
10
  :remote => true,
@@ -5,7 +5,7 @@
5
5
  Rails.application.config.commonCountriesForSelect +
6
6
  [["-----------------", 0]] +
7
7
  countrylist.map { |country| [country.name, country.id] },
8
- -214, # Unites States
8
+ (session[:zoned] && session[:zoned][:current_country]) || -214, # Unites States
9
9
  ),
10
10
  :data => {
11
11
  :remote => true,
@@ -5,7 +5,7 @@ module SpreeZoned
5
5
  source_root File.expand_path("../assets", __FILE__)
6
6
 
7
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]'
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
9
  if res == '' || res.downcase == 'y'
10
10
  append_file 'app/assets/javascripts/store/all.js', "//= require store/spree_zoned\n"
11
11
  append_file 'app/assets/javascripts/admin/all.js', "//= require admin/spree_zoned\n"
@@ -13,7 +13,7 @@ module SpreeZoned
13
13
  end
14
14
 
15
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]'
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
17
  if res == '' || res.downcase == 'y'
18
18
  inject_into_file 'app/assets/stylesheets/store/all.css', " *= require store/spree_zoned\n", :before => /\*\//, :verbose => true
19
19
  inject_into_file 'app/assets/stylesheets/admin/all.css', " *= require admin/spree_zoned\n", :before => /\*\//, :verbose => true
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.4'
5
+ s.version = '0.5.5'
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'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_zoned
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-12 00:00:00.000000000 Z
12
+ date: 2012-06-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: spree_core