people analytics and bug fixes

James Peret 7 years ago
parent
commit
679ad3cfaa

+ 3 - 4
app/index.html

@@ -56,10 +56,6 @@
56 56
     <div class="footer" ng-controller="FooterCtrl" style="padding-top: 25px;">
57 57
       <div class="container">
58 58
         <div class="row">
59
-
60
-          <div class="col-md-4" style="text-align: center;">
61
-            <p style="text-align: center;"><i>Estrada José benedito dos Santos 4000<br>Guararema, SP - Brasil</i></p>
62
-          </div>
63 59
           <div class="col-md-4" style="text-align: center;">
64 60
             <p style="text-align: center;"><a href="mailto:oficina.itapeti@gmail.com">oficina.itapeti@gmail.com</a></p>
65 61
             <p style="text-align: center;">+55 11 4693-6161</p>
@@ -69,6 +65,9 @@
69 65
             <a href="http://youtube.com/higheffectsBR" target="_blank"><img src="images/logo-youtube.png" style="width: 50px;"></a>
70 66
             <a href="http://facebook.com/oficina.itapeti" target="_blank"><img src="images/logo-facebook.png" style="width: 50px;"></a>
71 67
           </div>
68
+          <div class="col-md-4" style="text-align: center;">
69
+            <p style="text-align: center;"><i>Estrada José Benedito dos Santos, 4000<br>Guararema, SP - Brasil</i></p>
70
+          </div>
72 71
         </div>
73 72
         <hr style="border-top: 1px solid #636363; margin-top: 5px; margin-bottom: 5px;">
74 73
         <p style="text-align: center; margin-bottom: 0px;">&copy; Oficina Itapeti {{date | date:'yyyy'}}</p>

+ 2 - 1
app/scripts/app.js

@@ -20,7 +20,8 @@ angular
20 20
     'ngTouch',
21 21
     'ui.router',
22 22
     'rzModule',
23
-    'bootstrapLightbox'
23
+    'bootstrapLightbox',
24
+    'ngCookies'
24 25
   ])
25 26
 
26 27
   .config(function (LightboxProvider) {

+ 19 - 4
app/scripts/controllers/main.js

@@ -8,12 +8,19 @@
8 8
  * Controller of the siteOficinaItapetiApp
9 9
  */
10 10
 angular.module('siteOficinaItapetiApp')
11
-  .controller('MainCtrl', [ '$window', '$scope', '$rootScope', '$http', 'Lightbox', '$state', function ($window, $scope, $rootScope, $http, Lightbox, $state) {
11
+  .controller('MainCtrl', [ '$window', '$scope', '$rootScope', '$http', 'Lightbox', '$state', '$cookies', function ($window, $scope, $rootScope, $http, Lightbox, $state, $cookies) {
12 12
       $window.scrollTo(0, 0);
13 13
 
14 14
       console.log("Current Page: " + $state.current.name);
15 15
 
16
-      mixpanel.track("Page Visit", {"Page": $state.current.name});
16
+      var user_email = $cookies.get("email");
17
+      if(user_email == "" || user_email == undefined){
18
+        mixpanel.track("Page Visit", {"Page": $state.current.name});
19
+      } else {
20
+        mixpanel.identify(user_mail);
21
+        mixpanel.track("Page Visit", {"Page": $state.current.name});
22
+      }
23
+
17 24
 
18 25
       $scope.Math = window.Math;
19 26
 
@@ -41,7 +48,8 @@ angular.module('siteOficinaItapetiApp')
41 48
       }
42 49
 
43 50
     $scope.sendMessage = function(msgData){
44
-      console.log("> Sending message from " + msgData.name);
51
+      console.log("> Sending message from " + msgData.first_name + " " + msgData.last_name);
52
+      var msg = "Nome: " + msgData.first_name + " " + msgData.last_name + "\nEmail: " msgData.email + "\n\n";
45 53
       var req = {
46 54
          method: 'POST',
47 55
          url: 'send_contact_mail.php',
@@ -49,13 +57,20 @@ angular.module('siteOficinaItapetiApp')
49 57
            to: "oficina.itapeti@gmail.com",
50 58
            from: msgData.email,
51 59
            subject: msgData.subject,
52
-           msg: msgData.message
60
+           msg: msg + msgData.message
53 61
          }
54 62
       }
55 63
 
56 64
       $http(req).then(function(data){
57 65
         console.log(data);
58 66
       });
67
+      mixpanel.people.set({
68
+        "$email": msgData.email,
69
+        "$first_name": msgData.first_name,
70
+        "$last_name": msgData.last_name
71
+      });
72
+      mixpanel.track("Message Sent", {"Page": $state.current.name});
73
+      $cookies.put("email", msgData.email);
59 74
     };
60 75
 
61 76
     $scope.images = [

+ 8 - 2
app/views/contato.html

@@ -25,10 +25,16 @@
25 25
         <br>
26 26
         <form>
27 27
           <div class="row">
28
-            <div class="col-md-6">
28
+            <div class="col-md-3">
29 29
               <div class="form-group">
30 30
                 <label for="exampleInputEmail1">Nome</label>
31
-                <input type="text" class="form-control" ng-model="msgData.name" id="userName" required placeholder="Nome">
31
+                <input type="text" class="form-control" ng-model="msgData.first_name" id="userFirstName" required placeholder="Nome">
32
+              </div>
33
+            </div>
34
+            <div class="col-md-3">
35
+              <div class="form-group">
36
+                <label for="exampleInputEmail1">Sobrenome</label>
37
+                <input type="text" class="form-control" ng-model="msgData.last_name" id="userLastName" required placeholder="Sobrenome">
32 38
               </div>
33 39
             </div>
34 40
               <div class="col-md-6">

+ 6 - 3
app/views/corte-laser.html

@@ -38,9 +38,12 @@
38 38
         </p>
39 39
       </div>
40 40
       <p style="text-align: center; margin-top: 45px;">
41
+        <a class="btn btn-success" ui-sref="contato" ng-click="service_contact_form_open()">Entrar em contato</a>
42
+        <!--
41 43
         <a class="btn btn-success" type="button" data-toggle="collapse" data-target="#collapseOrcamento" aria-expanded="true" aria-controls="collapseOrcamento" ng-hide="hidden" ng-click="hidden = true">Faça um orçamento</a>
44
+        -->
42 45
       </p>
43
-
46
+      <!--
44 47
       <div class="well orcamento collapse" id="collapseOrcamento">
45 48
         <h2>Orçamento Corte Laser</h2>
46 49
         <div class="row">
@@ -59,9 +62,9 @@
59 62
           </div>
60 63
         </div>
61 64
         <p style="text-align: center; margin-top: 15px;">
62
-          <a class="btn btn-success" ui-sref="contato">Entrar em contato</a>
65
+          <a class="btn btn-success" ui-sref="contato" ng-click="service_contact_form_open()">Entrar em contato</a>
63 66
         </p>
64
-
67
+        -->
65 68
       </div>
66 69
 
67 70
 

+ 1 - 1
app/views/corte-plasma.html

@@ -11,7 +11,7 @@
11 11
   <div class="row">
12 12
     <div class="col-md-12">
13 13
       <p style="text-align: center; margin-top: 15px;">
14
-        <a class="btn btn-success" ui-sref="contato">Entrar em contato</a>
14
+        <a class="btn btn-success" ui-sref="contato" ng-click="service_contact_form_open()">Entrar em contato</a>
15 15
       </p>
16 16
     </div>
17 17
   </div>

+ 1 - 1
app/views/eletronica.html

@@ -11,7 +11,7 @@
11 11
   <div class="row">
12 12
     <div class="col-md-12">
13 13
       <p style="text-align: center; margin-top: 15px;">
14
-        <a class="btn btn-success" ui-sref="contato">Entrar em contato</a>
14
+        <a class="btn btn-success" ui-sref="contato" ng-click="service_contact_form_open()">Entrar em contato</a>
15 15
       </p>
16 16
     </div>
17 17
   </div>

+ 1 - 1
app/views/impressao-3d.html

@@ -36,7 +36,7 @@
36 36
   <div class="row">
37 37
     <div class="col-md-12">
38 38
       <p style="text-align: center; margin-top: 15px;">
39
-        <a class="btn btn-success" ui-sref="contato">Entrar em contato</a>
39
+        <a class="btn btn-success" ui-sref="contato" ng-click="service_contact_form_open()">Entrar em contato</a>
40 40
       </p>
41 41
     </div>
42 42
   </div>

+ 1 - 1
app/views/projetos.html

@@ -12,7 +12,7 @@
12 12
   <div class="row">
13 13
     <div class="col-md-12">
14 14
       <p style="text-align: center; margin-top: 15px;">
15
-        <a class="btn btn-success" ui-sref="contato">Entrar em contato</a>
15
+        <a class="btn btn-success" ui-sref="contato" ng-click="service_contact_form_open()">Entrar em contato</a>
16 16
       </p>
17 17
     </div>
18 18
   </div>

+ 1 - 1
app/views/prototipagem.html

@@ -11,7 +11,7 @@
11 11
   <div class="row">
12 12
     <div class="col-md-12">
13 13
       <p style="text-align: center; margin-top: 15px;">
14
-        <a class="btn btn-success" ui-sref="contato">Entrar em contato</a>
14
+        <a class="btn btn-success" ui-sref="contato" ng-click="service_contact_form_open()">Entrar em contato</a>
15 15
       </p>
16 16
     </div>
17 17
   </div>

+ 1 - 1
bower.json

@@ -6,7 +6,7 @@
6 6
     "bootstrap": "^3.2.0",
7 7
     "angular-animate": "^1.4.0",
8 8
     "angular-aria": "^1.4.0",
9
-    "angular-cookies": "^1.4.0",
9
+    "angular-cookies": "^1.5.8",
10 10
     "angular-messages": "^1.4.0",
11 11
     "angular-resource": "^1.4.0",
12 12
     "angular-route": "^1.4.0",