Subversion Repositories SmartDukaan

Rev

Rev 21564 | Rev 21640 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 21564 Rev 21627
Line 1... Line 1...
1
<html>
1
<html>
2
<head>
2
<head>
3
<title>ProfitMandi - FOFO Login</title>
3
<title>ProfitMandi - FOFO Dashboard Login</title>
4
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet" type="text/css">
4
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet" type="text/css">
-
 
5
<link href="resources/css/login.css" rel="stylesheet" type="text/css">
5
<script src="https://apis.google.com/js/api:client.js"></script>
6
<script src="https://apis.google.com/js/api:client.js"></script>
6
<script src="/profitmandi-fofo/resources/js/jquery-3.2.1.min.js"></script>
7
<script src="resources/js/jquery-1.8.3.min.js"></script>
7
  <script>
-
 
8
  var googleUser = {};
-
 
9
  var startApp = function() {
-
 
10
    gapi.load('auth2', function(){
-
 
11
      // Retrieve the singleton for the GoogleAuth library and set up the client.
-
 
12
      auth2 = gapi.auth2.init({
-
 
13
        client_id: '968353813927-c7eb4mm2lmm451kb6plk9cdmtf47e3mk.apps.googleusercontent.com',
-
 
14
        cookiepolicy: 'single_host_origin',
8
<script src="resources/js/common.js"></script>
15
        // Request scopes in addition to 'profile' and 'email'
-
 
16
        //scope: 'additional_scope'
-
 
17
      });
-
 
18
      attachSignin(document.getElementById('customBtn'));
9
<script src="resources/js/events.js"></script>
19
    });
-
 
20
  };
-
 
21
 
10
 
22
  function attachSignin(element) {
-
 
23
    console.log(element.id);
-
 
24
    auth2.attachClickHandler(element, {},
-
 
25
        function(googleUser) {
-
 
26
        	var profile = googleUser.getBasicProfile();
-
 
27
        	submitUser(googleUser.getAuthResponse().id_token);
-
 
28
        }, function(error) {
-
 
29
          console.log(JSON.stringify(error, undefined, 2));
-
 
30
        });
-
 
31
  }
-
 
32
  
-
 
33
  function submitUser(token){
-
 
34
	jQuery.ajax({
-
 
35
        type : "POST",
-
 
36
        url : "/profitmandi-fofo/login/",
-
 
37
        data: {"token":token},
-
 
38
        success : function(response) {
-
 
39
			console.log(response);
-
 
40
        }
-
 
41
    });  
-
 
42
}
-
 
43
  
-
 
44
  </script>
-
 
45
<style>
-
 
46
#welcome {
-
 
47
	width: 600px;
-
 
48
	margin:0 auto;
-
 
49
	padding-top:30px;
-
 
50
}
-
 
51
#login-box {
-
 
52
	position: relative;
-
 
53
    padding: 10px;
-
 
54
    margin:0 auto;
-
 
55
    width: 400px;
-
 
56
    height: 400px;
-
 
57
    border-radius: 3px;
-
 
58
    background: white;
-
 
59
    box-shadow: 0 1px 5px 0 rgba(0,0,0,0.26);
-
 
60
    overflow: hidden;
-
 
61
}
-
 
62
#login-logo {
-
 
63
    padding: 10px;
-
 
64
    margin:0 auto;
-
 
65
    width: 200px;
-
 
66
    height: 200px;
-
 
67
    border-radius: 3px;
-
 
68
    background: white;
-
 
69
    box-shadow: 0 1px 5px 0 rgba(0,0,0,0.26);
-
 
70
    overflow: hidden;
-
 
71
}
-
 
72
#customBtn{
-
 
73
	position: relative;
-
 
74
	margin:0 auto;
-
 
75
	top:5%;
-
 
76
	width:310px;
-
 
77
	height:50px;
-
 
78
	cursor:pointer;
-
 
79
}
-
 
80
h2{
-
 
81
	font-family: 'Lato', Helvetica, sans-serif;
-
 
82
	font-size:16px;
-
 
83
	color:gray;
-
 
84
	font-weight:800;
-
 
85
	text-align:center;
-
 
86
}
-
 
87
h1{
-
 
88
	font-family: 'Lato', Helvetica, sans-serif;
-
 
89
    font-size: 36px;
-
 
90
    font-weight: 300;
-
 
91
    color: #333333;
-
 
92
    -webkit-font-smoothing: subpixel-antialiased;
-
 
93
    text-align:center;
-
 
94
}
-
 
95
strong {
-
 
96
    font-weight: 500;
-
 
97
}
-
 
98
p{
-
 
99
	text-align:center;
-
 
100
	color:gray;
-
 
101
	font-size:16px;
-
 
102
	font-family: 'Lato', Helvetica, sans-serif;
-
 
103
}
-
 
104
</style>
-
 
105
</head>
11
</head>
106
<body style="background-color:rgb(246, 245, 241)">
12
<body style="background-color:rgb(246, 245, 241)">
107
</body>
13
</body>
108
<div id="welcome">
14
<div id="welcome">
109
	<h1><strong>Welcome Partner</strong>, FOFO Login</h1>
15
	<h1><strong>Welcome Partner</strong>, FOFO Login</h1>
110
</div>
16
</div>
111
<div id="login-box">
17
<div id="login-box">
112
	<div id="login-logo">
18
	<div id="login-logo">
113
		<img src="/profitmandi-fofo/resources/images/profitmandi-login-logo.jpg" />
19
		<img src="resources/images/profitmandi-login-logo.jpg" />
114
	</div>
20
	</div>
115
	<h2>Sign In with your google account</h2>
21
	<h2>Sign In with your google account</h2>
116
	<!--
-
 
117
	<div id="google-button">
-
 
118
		<img src="/profitmandi-fofo/resources/images/google.png" style="width:300px; height:45px;"/>
-
 
119
	</div>
-
 
120
	-->
-
 
121
	<div id="gSignInWrapper">
22
	<div id="gSignInWrapper">
122
    <div id="customBtn" class="customGPlusSignIn">
23
    <div id="customBtn" class="customGPlusSignIn">
123
		<img src="/profitmandi-fofo/resources/images/google.png" style="width:300px; height:45px;"/>    
24
		<img src="resources/images/google.png" style="width:300px; height:45px;"/>    
124
    </div>
25
    </div>
125
  </div>
26
</div>
126
  <div id="name"></div>
27
<div id="name"></div>
127
  <script>startApp();</script>
28
  <script>startApp();</script>
128
</div>
29
</div>
129
<p>All rights reserved. ©2017, Profitmandi</p>
30
<p>All rights reserved. ©2017, Profitmandi</p>
130
 
-
 
131
</html>
31
</html>