spree_multi_domain 3.0.4 → 3.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ "0.30.x" => { :branch => "0-30-x" }
2
+ "0.40.x" => { :branch => "0-40-stable" }
3
+ "0.50.x" => { :branch => "0-40-stable" }
4
+ "0.60.x" => { :branch => "0-60-stable" }
5
+ "0.70.x" => { :branch => "master" }
@@ -1,7 +1,7 @@
1
1
  Admin::ProductsController.class_eval do
2
- update.before << :set_stores
2
+ update.before :set_stores
3
3
 
4
- create.before << :add_to_all_stores
4
+ create.before :add_to_all_stores
5
5
 
6
6
  private
7
7
  def set_stores
@@ -3,9 +3,10 @@ ProductsController.class_eval do
3
3
 
4
4
  private
5
5
  def can_show_product
6
- if @product.stores.empty? || @product.stores.include?(@site)
7
- render :file => "public/404.html", :status => 404
8
- end
6
+ @product ||= Product.find_by_permalink!(params[:id])
7
+ if @product.stores.empty? || @product.stores.include?(@site)
8
+ render :file => "public/404.html", :status => 404
9
+ end
9
10
  end
10
11
 
11
12
  end
@@ -1 +1 @@
1
- <th><%= order @search, :by => :store, :as => t("stores") %></th>
1
+ <th><%= t("stores") %></th>
@@ -1,62 +1,41 @@
1
1
  <% if tracker = current_tracker %>
2
2
 
3
3
  <script type="text/javascript">
4
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
5
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
6
- </script>
4
+ var _gaq = _gaq || [];
5
+ _gaq.push(['_setAccount', '<%= tracker.analytics_id -%>']);
6
+ _gaq.push(['_trackPageview']);
7
+
8
+ <%- if flash[:commerce_tracking] -%>
9
+
10
+ _gaq.push(['_addTrans',
11
+ '<%= "#{"QA-" if request.server_name =~ /^(dev.|localhost)/ }#{@order.number}" %>', // order ID - required
12
+ '<%= tracker.store.name -%>', // affiliation or store name
13
+ '<%= @order.total -%>', // total - required
14
+ '<%= @order.adjustments.tax.sum(:amount).to_s -%>', // tax
15
+ '<%= @order.adjustments.shipping.sum(:amount).to_s -%>', // shipping
16
+ '<%= @order.ship_address.city if @order.ship_address -%>', // city
17
+ '<%= @order.ship_address.state.name if @order.ship_address and @order.ship_address.state -%>', // state or province
18
+ '<%= @order.ship_address.country.name if @order.ship_address && @order.ship_address.country -%>' // country
19
+ ]);
7
20
 
8
- <script type="text/javascript">
9
- var pageTracker = _gat._getTracker("<%= tracker.analytics_id %>");
10
- pageTracker._initData();
11
- pageTracker._trackPageview();
21
+ <%- @order.line_items.each do |line_item| -%>
22
+ _gaq.push(['_addItem',
23
+ '<%= "#{"QA-" if request.server_name =~ /^(dev.|localhost)/ }#{@order.number}" %>', // order ID - required
24
+ '<%= line_item.variant.sku -%>', // SKU/code - required
25
+ '<%= line_item.variant.product.name -%>', // product name
26
+ '-', // category or variation
27
+ '<%= line_item.price -%>', // unit price - required
28
+ '<%= line_item.quantity -%>' // quantity - required
29
+ ]);
30
+ <%- end -%>
31
+ _gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
32
+
33
+ <%- end -%>
34
+
35
+ (function() {
36
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
37
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
38
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
39
+ })();
12
40
  </script>
13
-
14
- <% if @analytics_page %>
15
- <script type="text/javascript">document.strTrackPageView="<%= @analytics_page %>";</script>
16
- <% end %>
17
-
18
- <!-- Primary Tracking -->
19
- <script type="text/javascript" src="/javascripts/VKIga.js"></script>
20
-
21
- <% if flash[:commerce_tracking] %>
22
- <script type="text/javascript">
23
-
24
- try {
25
- // report e-commerce transaction information when applicable
26
- /*
27
- * transaction ID - prepend dev/QA sites with 'QA-'
28
- * affiliate - always empty string
29
- * total - order total including tax & shipping
30
- * tax
31
- * shipping
32
- * ship-to city
33
- * ship-to province
34
- * ship-to country
35
- */
36
- VKIPageTracker._addTrans(
37
- "<%= "#{"QA-" if request.server_name =~ /^(dev.|localhost)/ }#{@order.number}" %>",
38
- "",
39
- "<%= @order.total %>",
40
- "<%= @order.adjustments.tax.sum(:amount).to_s %>",
41
- "<%= @order.adjustments.shipping.sum(:amount).to_s %>",
42
- "<%= @order.ship_address.city if @order.ship_address %>",
43
- "<%= @order.ship_address.state.name if @order.ship_address && @order.ship_address.state %><%= @order.ship_address.state_name if @order.ship_address && @order.ship_address.state.nil? %>",
44
- "<%= @order.ship_address.country.name if @order.ship_address && @order.ship_address.country %>"
45
- );
46
- <% @order.line_items.each do |line_item| -%>
47
- VKIPageTracker._addItem(
48
- "<%= "#{"QA-" if request.server_name =~ /^(dev.|localhost)/ }#{@order.number}" %>",
49
- "<%= line_item.variant.sku %>",
50
- "<%= line_item.variant.product.name %>",
51
- "-",
52
- "<%= line_item.price %>",
53
- "<%= line_item.quantity %>"
54
- );
55
- <% end -%>
56
- VKIPageTracker._trackTrans();
57
- } catch (err) {
58
- }
59
-
60
- </script>
61
- <% end %>
62
41
  <% end %>
@@ -1,8 +1,9 @@
1
1
  en:
2
+ store: Store
2
3
  stores: Stores
3
4
  new_store: New Store
4
5
  domains: Domains
5
6
  stores_admin: "Stores & Domains"
6
7
  manage_stores: Configure multiple stores and associated domain names
7
8
  editing_store: Editing Store
8
- default: Default
9
+ default: Default
@@ -0,0 +1,9 @@
1
+ fr:
2
+ store: Boutique
3
+ stores: Boutiques
4
+ new_store: Nouvelle Boutique
5
+ domains: Domaines
6
+ stores_admin: "Boutiques & Domaines"
7
+ manage_stores: Configurer les boutiques et les domaines associés
8
+ editing_store: Modifier une boutique
9
+ default: Defaut
@@ -0,0 +1,9 @@
1
+ ru:
2
+ store: "Магазин"
3
+ stores: "Магазины"
4
+ new_store: "Новый магазин"
5
+ domains: "Домены"
6
+ stores_admin: "Магазины и домены"
7
+ manage_stores: "Управление магазинами и привязка доменов"
8
+ editing_store: "Редактирование магазина"
9
+ default: "По умолчанию"
@@ -1,19 +1,55 @@
1
- class SpreeMultiDomainHooks < Spree::ThemeSupport::HookListener
1
+ Deface::Override.new(
2
+ :virtual_path => "admin/products/index",
3
+ :name => "multi_domain_admin_products_index_headers",
4
+ :insert_before => "[data-hook='admin_products_index_header_actions']",
5
+ :partial => "admin/products/index_headers",
6
+ :disabled => false)
2
7
 
3
- insert_after :admin_products_index_headers, :partial => "admin/products/index_headers"
4
- insert_after :admin_products_index_rows, :partial => "admin/products/index_rows"
5
- insert_before :admin_products_index_search, :partial => "admin/products/index_search_fields"
8
+ Deface::Override.new(
9
+ :virtual_path => "admin/products/index",
10
+ :name => "multi_domain_admin_products_index_rows",
11
+ :insert_before => "[data-hook='admin_products_index_row_actions']",
12
+ :partial => "admin/products/index_rows",
13
+ :disabled => false)
14
+
15
+ Deface::Override.new(
16
+ :virtual_path => "admin/products/index",
17
+ :name => "multi_domain_admin_products_index_search",
18
+ :insert_top => "[data-hook='admin_products_index_search']",
19
+ :partial => "admin/products/index_search_fields",
20
+ :disabled => false)
6
21
 
7
- insert_after :admin_product_form_meta, :partial => "admin/products/stores"
22
+ Deface::Override.new(
23
+ :virtual_path => "admin/products/_form",
24
+ :name => "multi_domain_admin_product_form_meta",
25
+ :insert_bottom => "[data-hook='admin_product_form_meta']",
26
+ :partial => "admin/products/stores",
27
+ :disabled => false)
8
28
 
9
- insert_after :admin_trackers_index_headers do
10
- "<th>#{I18n.t(:store)}</th>"
11
- end
12
- insert_after :admin_trackers_index_rows, 'admin/trackers/index_rows'
13
- replace :additional_tracker_fields, 'admin/trackers/store'
29
+ Deface::Override.new(
30
+ :virtual_path => "admin/trackers/index",
31
+ :name => "multi_domain_admin_trackers_index_headers",
32
+ :insert_before => "[data-hook='admin_trackers_index_headers'] th:last",
33
+ :text => "<th><%= I18n.t(:store) %></th>",
34
+ :disabled => false)
14
35
 
15
- insert_after :admin_configurations_menu do
16
- "<%= configurations_menu_item(I18n.t('stores_admin'), admin_stores_url, I18n.t('manage_stores')) %>"
17
- end
36
+ Deface::Override.new(
37
+ :virtual_path => "admin/trackers/index",
38
+ :name => "multi_domain_admin_trackers_index_rows",
39
+ :insert_before => "[data-hook='admin_trackers_index_rows'] td:last",
40
+ :partial => "admin/trackers/index_rows",
41
+ :disabled => false)
18
42
 
19
- end
43
+ Deface::Override.new(
44
+ :virtual_path => "admin/trackers/_form",
45
+ :name => "multi_domain_additional_tracker_fields",
46
+ :replace => "[data-hook='additional_tracker_fields']",
47
+ :partial => "admin/trackers/store",
48
+ :disabled => false)
49
+
50
+ Deface::Override.new(
51
+ :virtual_path => "admin/configurations/index",
52
+ :name => "multi_domain_admin_configurations_menu",
53
+ :insert_bottom => "[data-hook='admin_configurations_menu']",
54
+ :text => "<%= configurations_menu_item(I18n.t('stores_admin'), admin_stores_url, I18n.t('manage_stores')) %>",
55
+ :disabled => false)
@@ -0,0 +1,19 @@
1
+ namespace :spree_multi_domain do
2
+ desc "Copies all migrations and assets (NOTE: This will be obsolete with Rails 3.1)"
3
+ task :install do
4
+ Rake::Task['spree_multi_domain:install:migrations'].invoke
5
+ end
6
+
7
+ namespace :install do
8
+ desc "Copies all migrations (NOTE: This will be obsolete with Rails 3.1)"
9
+ task :migrations do
10
+ source = File.join(File.dirname(__FILE__), '..', '..', 'db')
11
+ destination = File.join(Rails.root, 'db')
12
+ puts "INFO: Mirroring assets from #{source} to #{destination}"
13
+ Spree::FileUtilz.mirror_files(source, destination)
14
+ end
15
+
16
+ end
17
+
18
+ end
19
+
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.platform = Gem::Platform::RUBY
3
3
  s.name = 'spree_multi_domain'
4
- s.version = '3.0.4'
4
+ s.version = '3.0.5'
5
5
  s.summary = 'Adds multiple site support to Spree'
6
6
  s.description = 'Multiple Spree stores on different domains - single unified backed for processing orders.'
7
7
  s.required_ruby_version = '>= 1.8.7'
@@ -16,7 +16,5 @@ Gem::Specification.new do |s|
16
16
  s.require_path = 'lib'
17
17
  s.requirements << 'none'
18
18
 
19
- s.has_rdoc = false
20
-
21
- s.add_dependency('spree_core', '>= 0.40.0')
19
+ s.add_dependency('spree_core', '>= 0.60.0')
22
20
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 3
7
7
  - 0
8
- - 4
9
- version: 3.0.4
8
+ - 5
9
+ version: 3.0.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Brian Quinn
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-02-23 00:00:00 +03:00
19
+ date: 2011-05-29 00:00:00 +04:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -28,9 +28,9 @@ dependencies:
28
28
  - !ruby/object:Gem::Version
29
29
  segments:
30
30
  - 0
31
- - 40
31
+ - 60
32
32
  - 0
33
- version: 0.40.0
33
+ version: 0.60.0
34
34
  type: :runtime
35
35
  version_requirements: *id001
36
36
  description: Multiple Spree stores on different domains - single unified backed for processing orders.
@@ -45,6 +45,7 @@ files:
45
45
  - .gitignore
46
46
  - README.md
47
47
  - Rakefile
48
+ - Versionfile
48
49
  - app/controllers/admin/products_controller_decorator.rb
49
50
  - app/controllers/admin/stores_controller.rb
50
51
  - app/controllers/products_controller_decorator.rb
@@ -65,18 +66,20 @@ files:
65
66
  - app/views/admin/trackers/_store.html.erb
66
67
  - app/views/shared/_google_analytics.html.erb
67
68
  - config/locales/en.yml
69
+ - config/locales/fr.yml
70
+ - config/locales/ru.yml
68
71
  - config/routes.rb
69
- - lib/generators/spree_multi_domain/install_generator.rb
70
- - lib/generators/templates/db/migrate/20091202122944_create_stores.rb
71
- - lib/generators/templates/db/migrate/20091202123245_add_order_store.rb
72
- - lib/generators/templates/db/migrate/20100114020535_add_store_to_tracker.rb
73
- - lib/generators/templates/db/migrate/20100227175140_add_default_store.rb
74
- - lib/generators/templates/db/migrate/20100227180338_create_products_stores.rb
75
- - lib/generators/templates/db/migrate/20100616204303_store_id_for_taxonomies.rb
76
- - lib/generators/templates/db/migrate/20110223141800_add_email_to_stores.rb
72
+ - db/migrate/20091202122944_create_stores.rb
73
+ - db/migrate/20091202123245_add_order_store.rb
74
+ - db/migrate/20100114020535_add_store_to_tracker.rb
75
+ - db/migrate/20100227175140_add_default_store.rb
76
+ - db/migrate/20100227180338_create_products_stores.rb
77
+ - db/migrate/20100616204303_store_id_for_taxonomies.rb
78
+ - db/migrate/20110223141800_add_email_to_stores.rb
77
79
  - lib/spree/search/multi_domain.rb
78
80
  - lib/spree_multi_domain.rb
79
81
  - lib/spree_multi_domain_hooks.rb
82
+ - lib/tasks/install.rake
80
83
  - spree_multi_domain.gemspec
81
84
  has_rdoc: true
82
85
  homepage: http://spreecommerce.com
@@ -1,15 +0,0 @@
1
- module SpreeMultiDomain
2
- module Generators
3
- class InstallGenerator < Rails::Generators::Base
4
- source_root File.expand_path("../../templates", __FILE__)
5
-
6
- desc "Configures your Rails application for use with spree_multi_domain"
7
-
8
- def copy_migrations
9
- directory "db"
10
- end
11
-
12
- end
13
- end
14
- end
15
-