spree_zoned 0.5.17 → 0.5.18

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,9 @@
1
+ require 'delocalize'
2
+
1
3
  Spree::Admin::ProductsController.class_eval do
2
4
 
5
+ before_filter :deloc_master_price
6
+
3
7
  def deletefc
4
8
  inorout(@product.method :delfrom)
5
9
  end
@@ -85,4 +89,11 @@ protected
85
89
  end
86
90
  end
87
91
 
92
+ def deloc_master_price
93
+ if params[:product] && params[:product][:price]
94
+ params[:product][:price] = Delocalize::LocalizedNumericParser.parse(
95
+ params[:product][:price])
96
+ end
97
+ end
98
+
88
99
  end
@@ -0,0 +1,6 @@
1
+ Deface::Override.new(
2
+ :name => "replace_admin_product_right",
3
+ :virtual_path => "spree/admin/products/_form",
4
+ :replace_contents => "[data-hook='admin_product_form_right']",
5
+ :partial => "spree/admin/zoned/productright",
6
+ )
@@ -0,0 +1,73 @@
1
+ <%= f.field_container :price do %>
2
+ <%= f.label :price, t(:master_price) %> <span class="required">*</span>
3
+ <br />(<%= t('country') + ": " -%>
4
+ <% country = session[:zoned] && session[:zoned][:prd_country].to_i %>
5
+ <% c = Rails.application.config.commonCountriesForSelect.select {|e| e[1]==country} %>
6
+ <%= c.length == 1 ? c[0][0] : t(:nocountrysel) -%>
7
+ )<br />
8
+ <%= f.text_field :price, :value => number_with_precision(
9
+ @product.price, precision: 2)%>
10
+ <%= f.error_message_on :price %>
11
+ <% end %>
12
+
13
+ <%= f.field_container :cost_price do %>
14
+ <%= f.label :cost_price, t(:cost_price) %><br />
15
+ <%= f.text_field :cost_price, :value => number_with_precision(
16
+ @product.cost_price, precision: 2) %>
17
+ <%= f.error_message_on :cost_price %>
18
+ <% end %>
19
+
20
+ <%= f.field_container :available_on do %>
21
+ <%= f.label :available_on, t(:available_on) %><br />
22
+ <%= f.error_message_on :available_on %>
23
+ <%= f.text_field :available_on, :class => 'datepicker' %>
24
+ <% end %>
25
+
26
+ <% unless @product.has_variants? %>
27
+ <%= f.field_container :sku do %>
28
+ <%= f.label :sku, t(:sku) %><br />
29
+ <%= f.text_field :sku, :size => 16 %>
30
+ <% end %>
31
+
32
+ <% if Spree::Config[:track_inventory_levels] %>
33
+ <%= f.field_container :on_hand do %>
34
+ <%= f.label :on_hand, t(:on_hand) %><br />
35
+ <%= f.number_field :on_hand, :min => 0 %>
36
+ <% end %>
37
+ <% end %>
38
+
39
+ <ul id="shipping_specs">
40
+ <li id="shipping_specs_weight_field">
41
+ <%= f.label :weight, t(:weight) %>
42
+ <%= f.text_field :weight, :size => 4, :value => number_with_precision(
43
+ @product.weight, precision: 1) %>
44
+ </li>
45
+ <li id="shipping_specs_height_field">
46
+ <%= f.label :height, t(:height) %>
47
+ <%= f.text_field :height, :size => 4, :value => number_with_precision(
48
+ @product.height, precision: 1) %>
49
+ </li>
50
+ <li id="shipping_specs_width_field">
51
+ <%= f.label :width, t(:width) %>
52
+ <%= f.text_field :width, :size => 4, :value => number_with_precision(
53
+ @product.width, precision: 1) %>
54
+ </li>
55
+ <li id="shipping_specs_depth_field">
56
+ <%= f.label :depth, t(:depth) %>
57
+ <%= f.text_field :depth, :size => 4, :value => number_with_precision(
58
+ @product.depth, precision: 1) %>
59
+ </li>
60
+ </ul>
61
+ <% end %>
62
+
63
+ <%= f.field_container :shipping_categories do %>
64
+ <%= f.label :shipping_category_id, t(:shipping_categories) %><br />
65
+ <%= f.collection_select(:shipping_category_id, @shipping_categories, :id, :name, { :include_blank => true }, { 'style' => 'width:200px' }) %>
66
+ <%= f.error_message_on :shipping_category %>
67
+ <% end %>
68
+
69
+ <%= f.field_container :tax_category do %>
70
+ <%= f.label :tax_category_id, t(:tax_category) %><br />
71
+ <%= f.collection_select(:tax_category_id, @tax_categories, :id, :name, { :include_blank => true }, { 'style' => 'width:200px' }) %>
72
+ <%= f.error_message_on :tax_category %>
73
+ <% 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.17'
5
+ s.version = '0.5.18'
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.17
4
+ version: 0.5.18
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-26 00:00:00.000000000 Z
12
+ date: 2012-06-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: spree_core
@@ -142,8 +142,10 @@ files:
142
142
  - app/overrides/add_delfc.rb
143
143
  - app/overrides/add_prd_country.rb
144
144
  - app/overrides/add_prd_handles.rb
145
+ - app/overrides/replace_admin_product_right.rb
145
146
  - app/views/spree/admin/zoned/_delfc.html.erb
146
147
  - app/views/spree/admin/zoned/_prd_country.html.erb
148
+ - app/views/spree/admin/zoned/_productright.html.erb
147
149
  - app/views/spree/admin/zoned/setcountry.js.erb
148
150
  - app/views/spree/zoned/_countryselect.html.erb
149
151
  - app/views/spree/zoned/setcountry.js.erb