From 4d2473dc9f1299130b990f9b0e5fdf29a923cdce Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 9 May 2014 16:28:20 +0300 Subject: [PATCH] Added goal tracking --- app/controllers/AccountController.php | 3 +- app/controllers/ReportController.php | 3 +- app/ninja/repositories/AccountRepository.php | 1 + app/views/accounts/nav_advanced.blade.php | 2 +- app/views/accounts/payments.blade.php | 2 +- app/views/header.blade.php | 9 +- app/views/invoices/edit.blade.php | 2 +- app/views/master.blade.php | 2 +- app/views/public/features.blade.php | 144 +++++++++--------- app/views/public/header.blade.php | 4 +- app/views/public/splash.blade.php | 2 +- public/built.js | 10 ++ .../{LaptopwIcon.jpg => laptopwicon.jpg} | Bin public/js/script.js | 10 ++ 14 files changed, 112 insertions(+), 82 deletions(-) rename public/images/{LaptopwIcon.jpg => laptopwicon.jpg} (100%) diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php index 22a8a1c004..5adac2baa1 100755 --- a/app/controllers/AccountController.php +++ b/app/controllers/AccountController.php @@ -184,7 +184,8 @@ class AccountController extends \BaseController { else if ($section == ACCOUNT_ADVANCED_SETTINGS) { $data = [ - 'account' => Auth::user()->account + 'account' => Auth::user()->account, + 'feature' => $subSection ]; return View::make("accounts.{$subSection}", $data); diff --git a/app/controllers/ReportController.php b/app/controllers/ReportController.php index b872251cb9..8404f839e6 100755 --- a/app/controllers/ReportController.php +++ b/app/controllers/ReportController.php @@ -96,7 +96,8 @@ class ReportController extends \BaseController { 'chartType' => $chartType, 'startDate' => $startDate->format(Session::get(SESSION_DATE_FORMAT)), 'endDate' => $endDate->modify('-1'.$padding)->format(Session::get(SESSION_DATE_FORMAT)), - 'groupBy' => $groupBy + 'groupBy' => $groupBy, + 'feature' => ACCOUNT_CHART_BUILDER, ]; return View::make('reports.report_builder', $params); diff --git a/app/ninja/repositories/AccountRepository.php b/app/ninja/repositories/AccountRepository.php index d6d5102fb0..63aeb24ec4 100755 --- a/app/ninja/repositories/AccountRepository.php +++ b/app/ninja/repositories/AccountRepository.php @@ -198,6 +198,7 @@ class AccountRepository $client = new Client; $client->public_id = Auth::user()->account_id; $client->user_id = $ninjaAccount->users()->first()->id; + $client->currency_id = 1; foreach (['name', 'address1', 'address2', 'city', 'state', 'postal_code', 'country_id', 'work_phone'] as $field) { $client->$field = Auth::user()->account->$field; diff --git a/app/views/accounts/nav_advanced.blade.php b/app/views/accounts/nav_advanced.blade.php index 63c5c32d42..538a14146a 100644 --- a/app/views/accounts/nav_advanced.blade.php +++ b/app/views/accounts/nav_advanced.blade.php @@ -8,7 +8,7 @@ @if (!Auth::user()->account->isPro())
-
{{ trans('texts.pro_plan_advanced_settings', ['link'=>''.trans('texts.pro_plan.remove_logo_link').'']) }}
+
{{ trans('texts.pro_plan_advanced_settings', ['link'=>''.trans('texts.pro_plan.remove_logo_link').'']) }}
 

 

diff --git a/app/views/accounts/payments.blade.php b/app/views/accounts/payments.blade.php index 47c92811f3..dad6767e36 100755 --- a/app/views/accounts/payments.blade.php +++ b/app/views/accounts/payments.blade.php @@ -95,7 +95,7 @@ var contents = $(this).parent().contents(); contents[contents.length - 1].nodeValue = ''; $(this).after('
'); - $(this).parent().children().last().after('Create an account'); + $(this).parent().children().last().after('Create an account'); }); diff --git a/app/views/header.blade.php b/app/views/header.blade.php index f9ff544111..76aa74764d 100755 --- a/app/views/header.blade.php +++ b/app/views/header.blade.php @@ -489,6 +489,7 @@ Want something changed? We're {{ link_to('https://github.com/hillelcoren/invoice '&new_last_name=' + encodeURIComponent($('form.signUpForm #new_last_name').val()) + '&go_pro=' + $('#go_pro').val(), success: function(result) { + trackUrl('/signed_up'); if (result) { localStorage.setItem('guest_key', ''); NINJA.isRegistered = true; @@ -526,15 +527,19 @@ Want something changed? We're {{ link_to('https://github.com/hillelcoren/invoice function showSignUp() { $('#signUpModal').modal('show'); + trackUrl('/view_sign_up'); } @if (Auth::check() && !Auth::user()->isPro()) - function showProPlan() { + var proPlanFeature = false; + function showProPlan(feature) { + proPlanFeature = feature; $('#proPlanModal').modal('show'); + trackUrl('/view_pro_plan/' + feature); } function submitProPlan() { - + trackUrl('/submit_pro_plan/' + proPlanFeature); if (NINJA.isRegistered) { $('#proPlanDiv, #proPlanFooter').hide(); $('#proPlanWorking').show(); diff --git a/app/views/invoices/edit.blade.php b/app/views/invoices/edit.blade.php index 7d5fcd1e08..2d5043fda4 100755 --- a/app/views/invoices/edit.blade.php +++ b/app/views/invoices/edit.blade.php @@ -276,7 +276,7 @@ @if (!Auth::user()->account->isPro())
- {{ trans('texts.pro_plan.remove_logo', ['link'=>''.trans('texts.pro_plan.remove_logo_link').'']) }} + {{ trans('texts.pro_plan.remove_logo', ['link'=>''.trans('texts.pro_plan.remove_logo_link').'']) }}
@endif diff --git a/app/views/master.blade.php b/app/views/master.blade.php index 04d8c7dad0..58ae3b71fc 100755 --- a/app/views/master.blade.php +++ b/app/views/master.blade.php @@ -51,7 +51,7 @@ - @if (App::environment() == ENV_PRODUCTION && isset($_ENV['ANALYTICS_KEY']) && $_ENV['ANALYTICS_KEY']) + @if (isset($_ENV['ANALYTICS_KEY']) && $_ENV['ANALYTICS_KEY'])