diff --git a/plugins/box/dashboard/js/ganalytics.js b/plugins/box/dashboard/js/ganalytics.js index f08410e..26976eb 100644 --- a/plugins/box/dashboard/js/ganalytics.js +++ b/plugins/box/dashboard/js/ganalytics.js @@ -11,14 +11,14 @@ $.monstra.ganalytics = { authScopes: 'https://www.googleapis.com/auth/analytics.readonly' }, - _gaAreas: '#authOk,#authFail,#gaSettings,#gaLoading', + _gaAreas: '#authOk,#authFail,#gaSettings,#gaLoading,#reauthError,#gaHelpLink', _startDate: moment().subtract('days', 29), _endDate: moment(), init: function(data){ $.extend(this.conf, data); - $('#gaSettingsLink').click(function(){ - $.monstra.ganalytics.show('#gaSettings'); + $('.gaSettingsLink').click(function(){ + $.monstra.ganalytics.show('#gaSettings,#gaHelpLink'); }); }, @@ -94,7 +94,7 @@ $.monstra.ganalytics = { gaReportingResults: function(res){ if (typeof res.error != 'undefined' && typeof res.error.message != 'undefined') { - $.monstra.ganalytics.showError(res.error.message); + $.monstra.ganalytics.showError(res.error.message, res.error.code); return; } @@ -148,8 +148,14 @@ $.monstra.ganalytics = { $(selector).removeClass('hide').show(); }, - showError: function(msg){ + showError: function(msg, errCode){ + if (typeof errCode !== 'undefined' && errCode == 403) { + $.monstra.ganalytics.show('#reauthError,#gaHelpLink'); + } else { + $.monstra.ganalytics.show('#gaHelpLink'); + } $('#gaAlerts').html(msg); + $('#authOk').addClass('hide'); }, setVisits: function(val){ diff --git a/plugins/box/dashboard/views/backend/index.view.php b/plugins/box/dashboard/views/backend/index.view.php index 4879f10..9d04921 100644 --- a/plugins/box/dashboard/views/backend/index.view.php +++ b/plugins/box/dashboard/views/backend/index.view.php @@ -33,7 +33,10 @@
-

+
+

+
+
@@ -61,7 +64,6 @@
-
Settings

Today

Visits:
Visitors:
@@ -75,6 +77,12 @@
+
+
+ +
+
+
@@ -94,6 +102,12 @@
+ +