Subversion Repositories SmartDukaan

Rev

Rev 21555 | Rev 21627 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<html>
<head>
<title>ProfitMandi - FOFO Login</title>
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet" type="text/css">
<script src="https://apis.google.com/js/api:client.js"></script>
<script src="/profitmandi-fofo/resources/js/jquery-3.2.1.min.js"></script>
  <script>
  var googleUser = {};
  var startApp = function() {
    gapi.load('auth2', function(){
      // Retrieve the singleton for the GoogleAuth library and set up the client.
      auth2 = gapi.auth2.init({
        client_id: '968353813927-c7eb4mm2lmm451kb6plk9cdmtf47e3mk.apps.googleusercontent.com',
        cookiepolicy: 'single_host_origin',
        // Request scopes in addition to 'profile' and 'email'
        //scope: 'additional_scope'
      });
      attachSignin(document.getElementById('customBtn'));
    });
  };

  function attachSignin(element) {
    console.log(element.id);
    auth2.attachClickHandler(element, {},
        function(googleUser) {
                var profile = googleUser.getBasicProfile();
                submitUser(googleUser.getAuthResponse().id_token);
        }, function(error) {
          console.log(JSON.stringify(error, undefined, 2));
        });
  }
  
  function submitUser(token){
        jQuery.ajax({
        type : "POST",
        url : "/profitmandi-fofo/login/",
        data: {"token":token},
        success : function(response) {
                        console.log(response);
        }
    });  
}
  
  </script>
<style>
#welcome {
        width: 600px;
        margin:0 auto;
        padding-top:30px;
}
#login-box {
        position: relative;
    padding: 10px;
    margin:0 auto;
    width: 400px;
    height: 400px;
    border-radius: 3px;
    background: white;
    box-shadow: 0 1px 5px 0 rgba(0,0,0,0.26);
    overflow: hidden;
}
#login-logo {
    padding: 10px;
    margin:0 auto;
    width: 200px;
    height: 200px;
    border-radius: 3px;
    background: white;
    box-shadow: 0 1px 5px 0 rgba(0,0,0,0.26);
    overflow: hidden;
}
#customBtn{
        position: relative;
        margin:0 auto;
        top:5%;
        width:310px;
        height:50px;
        cursor:pointer;
}
h2{
        font-family: 'Lato', Helvetica, sans-serif;
        font-size:16px;
        color:gray;
        font-weight:800;
        text-align:center;
}
h1{
        font-family: 'Lato', Helvetica, sans-serif;
    font-size: 36px;
    font-weight: 300;
    color: #333333;
    -webkit-font-smoothing: subpixel-antialiased;
    text-align:center;
}
strong {
    font-weight: 500;
}
p{
        text-align:center;
        color:gray;
        font-size:16px;
        font-family: 'Lato', Helvetica, sans-serif;
}
</style>
</head>
<body style="background-color:rgb(246, 245, 241)">
</body>
<div id="welcome">
        <h1><strong>Welcome Partner</strong>, FOFO Login</h1>
</div>
<div id="login-box">
        <div id="login-logo">
                <img src="/profitmandi-fofo/resources/images/profitmandi-login-logo.jpg" />
        </div>
        <h2>Sign In with your google account</h2>
        <!--
        <div id="google-button">
                <img src="/profitmandi-fofo/resources/images/google.png" style="width:300px; height:45px;"/>
        </div>
        -->
        <div id="gSignInWrapper">
    <div id="customBtn" class="customGPlusSignIn">
                <img src="/profitmandi-fofo/resources/images/google.png" style="width:300px; height:45px;"/>    
    </div>
  </div>
  <div id="name"></div>
  <script>startApp();</script>
</div>
<p>All rights reserved. ©2017, Profitmandi</p>

</html>