adminpanel 2.2.3 → 2.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/adminpanel/google_analytics_chart.js.coffee +2 -2
- data/app/controllers/adminpanel/analytics_controller.rb +10 -3
- data/lib/adminpanel/version.rb +1 -1
- data/lib/generators/adminpanel/resource/templates/adminpanel_resource_template.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff642c29ef845dc25a183c0938386388fafc86ec
|
4
|
+
data.tar.gz: 37f3f7faaff4083b1d4c0d419f0169542bfbac5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3565fd437af3f63447c81ecc50634003fddd70ce04c62d2e0745adcba165006fa0348ccd00b572f2df0b95cab482a13cf8a4e82192336a4f19d1eb14d3ba0b61
|
7
|
+
data.tar.gz: e6cb9fd9a770e247a1764b3eb8ec9337b2238d9831305cfe90fa6427c00c41c4033398d316a3a1fab7a5326548332c8b604a4e12ea25b41bdcc4254f90b53303
|
@@ -4,6 +4,7 @@ module Adminpanel
|
|
4
4
|
include Adminpanel::Analytics::InstagramAnalytics
|
5
5
|
|
6
6
|
skip_before_filter :set_model
|
7
|
+
before_action :check_if_fb_account, only:[:fb]
|
7
8
|
|
8
9
|
API_VERSION = 'v3'
|
9
10
|
CACHED_API_FILE = "#{Rails.root}/tmp/cache/analytics-#{API_VERSION}.cache"
|
@@ -82,14 +83,12 @@ module Adminpanel
|
|
82
83
|
|
83
84
|
def fb
|
84
85
|
authorize! :read, Adminpanel::Analytic
|
85
|
-
auth = Adminpanel::Auth.find_by_key('facebook')
|
86
|
-
redirect_via_turbolinks_to analytics_path if !auth.nil? && auth.value != '' # not nil & not void
|
87
86
|
if params[:insight].present?
|
88
87
|
period = params[:insight]
|
89
88
|
else
|
90
89
|
period = 'day' #default period
|
91
90
|
end
|
92
|
-
page_graph = Koala::Facebook::API.new(auth.value)
|
91
|
+
page_graph = Koala::Facebook::API.new(@auth.value)
|
93
92
|
@impressions,
|
94
93
|
@impressions_unique,
|
95
94
|
|
@@ -153,5 +152,13 @@ module Adminpanel
|
|
153
152
|
@user = @instagram_client.user
|
154
153
|
end
|
155
154
|
end
|
155
|
+
|
156
|
+
private
|
157
|
+
def check_if_fb_account
|
158
|
+
@auth = Adminpanel::Auth.find_by_key('facebook')
|
159
|
+
if @auth.nil? || auth.value == ''
|
160
|
+
redirect_to analytics_path
|
161
|
+
end
|
162
|
+
end
|
156
163
|
end
|
157
164
|
end
|
data/lib/adminpanel/version.rb
CHANGED