spree_dash 1.0.7 → 1.1.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@ module Spree
|
|
2
2
|
module AnalyticsHelper
|
3
3
|
|
4
4
|
def spree_analytics
|
5
|
-
render :partial => '
|
5
|
+
render :partial => 'analytics/header'
|
6
6
|
end
|
7
7
|
|
8
8
|
def analytics_tags
|
@@ -19,7 +19,7 @@ module Spree
|
|
19
19
|
{ :product => { :name => @product.name,
|
20
20
|
:price => @product.price,
|
21
21
|
:sku => @product.sku,
|
22
|
-
:categories => @product.taxons.map
|
22
|
+
:categories => @product.taxons.map { |t| t.permalink }
|
23
23
|
}
|
24
24
|
}
|
25
25
|
end
|
@@ -31,7 +31,7 @@ module Spree
|
|
31
31
|
|
32
32
|
def keywords_analytics_tags
|
33
33
|
return {} unless params[:keywords]
|
34
|
-
{ :search => { :keyword =>
|
34
|
+
{ :search => { :keyword => params[:keywords] } }
|
35
35
|
end
|
36
36
|
|
37
37
|
def cart_analytics_tags
|
@@ -56,12 +56,11 @@ module Spree
|
|
56
56
|
def products_for_order
|
57
57
|
@order.line_items.map do |line_item|
|
58
58
|
variant = line_item.variant
|
59
|
-
{
|
60
|
-
:name => variant.name,
|
59
|
+
{ :name => variant.name,
|
61
60
|
:qty => line_item.quantity,
|
62
61
|
:price => variant.price,
|
63
62
|
:sku => variant.sku,
|
64
|
-
:categories => variant.product.taxons.map
|
63
|
+
:categories => variant.product.taxons.map { |t| t.permalink }
|
65
64
|
}
|
66
65
|
end
|
67
66
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
Deface::Override.new(:virtual_path => "spree/layouts/spree_application",
|
2
2
|
:name => "add_analytics_header",
|
3
3
|
:insert_bottom => "[data-hook='inside_head']",
|
4
|
-
:partial => "spree/analytics/header"
|
5
|
-
:original => '6f23c8af6e863d0499835c00b3f2763cb98e1d75')
|
4
|
+
:partial => "spree/analytics/header")
|
data/config/locales/en.yml
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
en:
|
2
|
-
activate: Activate
|
3
2
|
agree_to_terms_of_service: Agree to Terms of Service
|
4
3
|
agree_to_privacy_policy: Agree to Privacy Policy
|
5
4
|
already_signed_up_for_analytics: You have already signed up for Spree Analytics
|
6
|
-
successfully_signed_up_for_analytics: Successfully signed up for Spree Analytics
|
5
|
+
successfully_signed_up_for_analytics: Successfully signed up for Spree Analytics
|
data/lib/spree/dash.rb
CHANGED
@@ -10,3 +10,13 @@ end
|
|
10
10
|
require 'spree/dash/engine'
|
11
11
|
require 'spree/dash/jirafe'
|
12
12
|
|
13
|
+
# add helper to all the base controllers
|
14
|
+
# Spree::BaseController includes Spree::Core::ControllerHelpers
|
15
|
+
require 'spree/core/controller_helpers'
|
16
|
+
class << Spree::Core::ControllerHelpers
|
17
|
+
def included_with_analytics(receiver)
|
18
|
+
included_without_analytics(receiver)
|
19
|
+
receiver.send :helper, 'spree/analytics'
|
20
|
+
end
|
21
|
+
alias_method_chain :included, :analytics
|
22
|
+
end
|
metadata
CHANGED
@@ -1,35 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_dash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
5
|
-
prerelease:
|
4
|
+
version: 1.1.0.rc1
|
5
|
+
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Brian Quinn
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-04-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: spree_core
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70262067599580 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - =
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.0.
|
21
|
+
version: 1.1.0.rc1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: *70262067599580
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: spree_auth
|
27
|
+
requirement: &70262067597400 !ruby/object:Gem::Requirement
|
25
28
|
none: false
|
26
29
|
requirements:
|
27
|
-
- -
|
30
|
+
- - =
|
28
31
|
- !ruby/object:Gem::Version
|
29
|
-
version: 1.0.
|
32
|
+
version: 1.1.0.rc1
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70262067597400
|
30
36
|
- !ruby/object:Gem::Dependency
|
31
37
|
name: httparty
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
38
|
+
requirement: &70262067610640 !ruby/object:Gem::Requirement
|
33
39
|
none: false
|
34
40
|
requirements:
|
35
41
|
- - ~>
|
@@ -37,12 +43,7 @@ dependencies:
|
|
37
43
|
version: 0.8.1
|
38
44
|
type: :runtime
|
39
45
|
prerelease: false
|
40
|
-
version_requirements:
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: 0.8.1
|
46
|
+
version_requirements: *70262067610640
|
46
47
|
description: Required dependency for Spree
|
47
48
|
email: brian@spreecommerce.com
|
48
49
|
executables: []
|
@@ -59,7 +60,6 @@ files:
|
|
59
60
|
- app/models/spree/dash_configuration.rb
|
60
61
|
- app/overrides/analytics_header.rb
|
61
62
|
- app/views/spree/admin/analytics/sign_up.html.erb
|
62
|
-
- app/views/spree/admin/overview/_form.html.erb
|
63
63
|
- app/views/spree/admin/overview/index.html.erb
|
64
64
|
- app/views/spree/analytics/_header.html.erb
|
65
65
|
- config/locales/en.yml
|
@@ -83,16 +83,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
83
83
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
84
|
none: false
|
85
85
|
requirements:
|
86
|
-
- - ! '
|
86
|
+
- - ! '>'
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version:
|
89
|
-
segments:
|
90
|
-
- 0
|
91
|
-
hash: 2482164716183180734
|
88
|
+
version: 1.3.1
|
92
89
|
requirements:
|
93
90
|
- none
|
94
91
|
rubyforge_project:
|
95
|
-
rubygems_version: 1.8.
|
92
|
+
rubygems_version: 1.8.10
|
96
93
|
signing_key:
|
97
94
|
specification_version: 3
|
98
95
|
summary: Overview dashboard for use with Spree.
|
@@ -1,23 +0,0 @@
|
|
1
|
-
<h2><%= t(:spree_analytics_token) %></h2>
|
2
|
-
|
3
|
-
<%= form_tag admin_dash_preferences_path, :method => :put do %>
|
4
|
-
<table data-hook="dash_preferences">
|
5
|
-
<tr data-hook="app_id">
|
6
|
-
<td><%= t(:analytics_app_id) %>:</td>
|
7
|
-
<td><%= text_field_tag :app_id, Spree::Dash::Config.app_id, :size => 50 %></td>
|
8
|
-
</tr>
|
9
|
-
<tr data-hook="site_id">
|
10
|
-
<td><%= t(:analytics_site_id) %>:</td>
|
11
|
-
<td><%= text_field_tag :site_id, Spree::Dash::Config.site_id, :size => 50 %></td>
|
12
|
-
</tr>
|
13
|
-
<tr data-hook="token">
|
14
|
-
<td><%= t(:analytics_token) %>:</td>
|
15
|
-
<td><%= text_field_tag :token, Spree::Dash::Config.token, :size => 50 %></td>
|
16
|
-
</tr>
|
17
|
-
</table>
|
18
|
-
|
19
|
-
<p class="form-buttons" data-hook="buttons">
|
20
|
-
<%= button t(:update) %> <%= link_to t(:cancel), admin_path %>
|
21
|
-
</p>
|
22
|
-
|
23
|
-
<% end %>
|